/* SDL Widgets: Browser Slider */
.sdlw-bs {
	--sdlw-bs-max: 1000px;
	--sdlw-bs-bg: rgba(255, 255, 255, .03);
	--sdlw-bs-line: rgba(255, 255, 255, .16);
	--sdlw-bs-radius: 16px;
	--sdlw-bs-bar: 48px;
	--sdlw-bs-icon: #fff;
	--sdlw-bs-icon-size: 17px;
	--sdlw-bs-url-w: 46%;
	--sdlw-bs-ratio: 16 / 10;
	--sdlw-bs-fit: cover;
	--sdlw-bs-screen-radius: 8px;
	--sdlw-bs-speed: 700ms;
	--sdlw-bs-offset: 0px;
	position: relative;
	width: 100%;
}

/* Bottom offset: the window is pulled down by --sdlw-bs-offset.
   Crop = cut flat at the widget's bottom edge (side/top shadows kept).
   Overhang = hangs over whatever comes next. */
.sdlw-bs__clip { position: relative; display: flow-root; }
.sdlw-bs--crop .sdlw-bs__clip {
	-webkit-clip-path: inset(-200px -200px 0 -200px);
	clip-path: inset(-200px -200px 0 -200px);
}
.sdlw-bs__clip > .sdlw-bs__window { margin-bottom: calc(var(--sdlw-bs-offset) * -1); }

/* Window */
.sdlw-bs__window {
	position: relative;
	width: 100%;
	max-width: var(--sdlw-bs-max);
	margin: 0 auto;
	overflow: hidden;
	background: var(--sdlw-bs-bg);
	border: 1px solid var(--sdlw-bs-line);
	border-radius: var(--sdlw-bs-radius);
}
.sdlw-bs--fade-bottom .sdlw-bs__window {
	-webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

/* Toolbar */
.sdlw-bs__bar {
	display: grid;
	grid-template-columns: 1fr minmax(0, var(--sdlw-bs-url-w)) 1fr;
	align-items: center;
	gap: 14px;
	height: var(--sdlw-bs-bar);
	padding: 0 16px;
	color: var(--sdlw-bs-icon);
	box-sizing: border-box;
}
/* Thin divider between the toolbar and the screen, edge to edge */
.sdlw-bs--bar-line .sdlw-bs__bar {
	border-bottom: var(--sdlw-bs-bar-line-w, 1px) solid var(--sdlw-bs-bar-line, rgba(255, 255, 255, .12));
}
.sdlw-bs__bar-left,
.sdlw-bs__bar-right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.sdlw-bs__bar-right { justify-content: flex-end; }
.sdlw-bs__dots { display: inline-flex; align-items: center; gap: var(--sdlw-bs-dot-gap, 7px); margin-right: 6px; }
.sdlw-bs__dots i { display: block; flex: 0 0 auto; width: var(--sdlw-bs-dot, 9px); height: var(--sdlw-bs-dot, 9px); border-radius: 50%; background: currentColor; }
.sdlw-bs--mac .sdlw-bs__dots i:nth-child(1) { background: #ff5f57; }
.sdlw-bs--mac .sdlw-bs__dots i:nth-child(2) { background: #febc2e; }
.sdlw-bs--mac .sdlw-bs__dots i:nth-child(3) { background: #28c840; }
.sdlw-bs__ico { display: inline-flex; flex: 0 0 auto; width: var(--sdlw-bs-icon-size); height: var(--sdlw-bs-icon-size); }
.sdlw-bs__ico svg,
.sdlw-bs__lock svg,
.sdlw-bs__reload svg { display: block; width: 100%; height: 100%; }
.sdlw-bs__ico--dim { opacity: .45; }

.sdlw-bs__url {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 0;
	height: calc(var(--sdlw-bs-bar) * .58);
	padding: 0 34px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 9px;
	background: rgba(255, 255, 255, .02);
	color: var(--sdlw-bs-icon);
}
.sdlw-bs__lock { display: inline-flex; flex: 0 0 auto; width: 11px; height: 11px; }
.sdlw-bs__url-text {
	overflow: hidden;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: .01em;
	white-space: nowrap;
	text-overflow: ellipsis;
	transition: opacity .25s ease;
}
.sdlw-bs__reload {
	position: absolute;
	top: 50%;
	right: 10px;
	display: inline-flex;
	width: 14px;
	height: 14px;
	transform: translateY(-50%);
	opacity: .9;
}

/* Screen */
.sdlw-bs__body { padding: 0 12px 12px; }
.sdlw-bs__screen {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--sdlw-bs-ratio);
	border-radius: var(--sdlw-bs-screen-radius);
	background: #fff;
	isolation: isolate;
}
.sdlw-bs__slide {
	position: absolute;
	inset: 0;
	visibility: hidden;
}
.sdlw-bs__slide.is-active,
.sdlw-bs__slide.is-leaving { visibility: visible; }
.sdlw-bs__slide.is-leaving { z-index: 1; }
.sdlw-bs__slide.is-active { z-index: 2; }
.sdlw-bs__slide img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border-radius: 0;
	object-fit: var(--sdlw-bs-fit);
	object-position: center top;
}

/* Dots below */
.sdlw-bs__pg { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.sdlw-bs__pg button {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .35);
	cursor: pointer;
	transition: width .3s ease, background-color .3s ease;
}
.sdlw-bs__pg button[aria-current="true"] { width: 24px; background: #fff; }
.sdlw-bs__pg button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Tablet */
@media (max-width: 1024px) {
	.sdlw-bs { --sdlw-bs-bar: 44px; --sdlw-bs-icon-size: 16px; }
	.sdlw-bs__bar-left, .sdlw-bs__bar-right { gap: 14px; }
}

/* Mobile: keep the dots, address bar and tabs icon only */
@media (max-width: 767px) {
	.sdlw-bs { --sdlw-bs-bar: 38px; --sdlw-bs-url-w: 62%; --sdlw-bs-radius: 12px; --sdlw-bs-icon-size: 14px; --sdlw-bs-screen-radius: 6px; }
	.sdlw-bs__bar { padding: 0 10px; gap: 8px; }
	.sdlw-bs__ico--opt { display: none; }
	.sdlw-bs { --sdlw-bs-dot: 7px; --sdlw-bs-dot-gap: 5px; }
	.sdlw-bs__dots { margin-right: 0; }
	.sdlw-bs__url { padding: 0 24px; border-radius: 7px; }
	.sdlw-bs__url-text { font-size: 11px; }
	.sdlw-bs__reload { right: 7px; width: 11px; height: 11px; }
	.sdlw-bs__body { padding: 0 7px 7px; }
}
