/* DW Shop Sidebar v1.0.0 */

:root {
	--dw-ssb-accent: #2c7be5;
}

/* ---------- Shared ---------- */
.dw-ssb-btn {
	display: inline-block;
	background: var(--dw-ssb-accent);
	color: #fff !important;
	border: 1px solid var(--dw-ssb-accent);
	border-radius: 4px;
	padding: 8px 16px;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	transition: opacity .15s ease;
}
.dw-ssb-btn:hover { opacity: .85; }
.dw-ssb-btn-outline {
	background: transparent;
	color: var(--dw-ssb-accent) !important;
}

/* ---------- Price Filter ---------- */
.dw-ssb-price-filter { margin: 0; }
.dw-ssb-slider {
	position: relative;
	height: 24px;
	margin: 10px 8px 4px;
}
.dw-ssb-slider-track,
.dw-ssb-slider-range {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	height: 4px;
	border-radius: 2px;
}
.dw-ssb-slider-track {
	left: 0; right: 0;
	background: #e2e5ea;
}
.dw-ssb-slider-range {
	background: var(--dw-ssb-accent);
}
.dw-ssb-range {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 24px;
	margin: 0; padding: 0;
	background: transparent;
	pointer-events: none;
}
.dw-ssb-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	pointer-events: auto;
	width: 16px; height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--dw-ssb-accent);
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.dw-ssb-range::-moz-range-thumb {
	pointer-events: auto;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--dw-ssb-accent);
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.dw-ssb-price-readout {
	display: flex;
	justify-content: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	margin: 6px 0 10px;
}
.dw-ssb-price-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}
.dw-ssb-reset {
	font-size: 13px;
	opacity: .7;
}

/* ---------- Top Selling ---------- */
.dw-ssb-top-selling {
	list-style: none;
	margin: 0; padding: 0;
}
.dw-ssb-ts-item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 10px 0;
	border-bottom: 1px solid #eee;
}
.dw-ssb-ts-item:last-child { border-bottom: 0; }
.dw-ssb-ts-thumb {
	position: relative;
	flex: 0 0 56px;
	display: block;
}
.dw-ssb-ts-thumb img {
	width: 56px; height: 56px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}
.dw-ssb-ts-rank {
	position: absolute;
	top: -6px; left: -6px;
	background: var(--dw-ssb-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	padding: 3px 5px;
	border-radius: 10px;
}
.dw-ssb-ts-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.dw-ssb-ts-name {
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
}
.dw-ssb-ts-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--dw-ssb-accent);
}
.dw-ssb-ts-rating .star-rating { font-size: 11px; }

/* ---------- Cart ---------- */
.dw-ssb-hide-when-empty:has(.dw-ssb-cart-empty) { display: none !important; }
/* Fallback for browsers without :has() — JS adds this class */
.dw-ssb-cart-widget.dw-ssb-is-hidden { display: none !important; }

.dw-ssb-cart-items {
	list-style: none;
	margin: 0; padding: 0;
}
.dw-ssb-cart-item {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}
.dw-ssb-cart-thumb { flex: 0 0 44px; }
.dw-ssb-cart-thumb img {
	width: 44px; height: 44px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}
.dw-ssb-cart-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.dw-ssb-cart-name {
	font-size: 13px;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.dw-ssb-cart-qty {
	font-size: 12px;
	opacity: .75;
}
.dw-ssb-cart-remove {
	flex: 0 0 auto;
	font-size: 16px;
	line-height: 1;
	opacity: .5;
	text-decoration: none !important;
}
.dw-ssb-cart-remove:hover { opacity: 1; color: #d63638; }
.dw-ssb-cart-total {
	display: flex;
	justify-content: space-between;
	padding: 12px 0 10px;
	font-size: 14px;
}
.dw-ssb-cart-buttons {
	display: flex;
	gap: 8px;
}
.dw-ssb-cart-buttons .dw-ssb-btn {
	flex: 1;
	text-align: center;
	padding: 8px 6px;
	font-size: 13px;
}
.dw-ssb-cart-empty-msg {
	margin: 0;
	font-size: 13px;
	opacity: .7;
}

/* ---------- Gallery ---------- */
.dw-ssb-gallery {
	display: grid;
	gap: 8px;
}
.dw-ssb-cols-2 { grid-template-columns: repeat(2, 1fr); }
.dw-ssb-cols-3 { grid-template-columns: repeat(3, 1fr); }
.dw-ssb-cols-4 { grid-template-columns: repeat(4, 1fr); }
.dw-ssb-gallery-item {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 4px;
	aspect-ratio: 1 / 1;
}
.dw-ssb-gallery-item img {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .25s ease;
}
.dw-ssb-gallery-item:hover img { transform: scale(1.06); }
.dw-ssb-gallery-overlay {
	position: absolute;
	inset: auto 0 0 0;
	background: linear-gradient(transparent, rgba(0,0,0,.65));
	color: #fff;
	font-size: 11px;
	line-height: 1.3;
	padding: 14px 6px 5px;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}
.dw-ssb-gallery-item:hover .dw-ssb-gallery-overlay { opacity: 1; }
.dw-ssb-gallery-name {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Lightbox ---------- */
.dw-ssb-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0,0,0,.85);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.dw-ssb-lb-inner {
	max-width: 90vw;
	max-height: 90vh;
	text-align: center;
}
.dw-ssb-lb-inner img {
	max-width: 100%;
	max-height: 72vh;
	border-radius: 6px;
	display: block;
	margin: 0 auto;
}
.dw-ssb-lb-caption {
	color: #fff;
	margin-top: 12px;
	font-size: 15px;
}
.dw-ssb-lb-caption a {
	color: #fff;
	text-decoration: underline;
	font-weight: 600;
}
.dw-ssb-lb-price {
	display: block;
	font-size: 13px;
	opacity: .85;
	margin-top: 2px;
}
.dw-ssb-lb-close {
	position: absolute;
	top: 14px; right: 20px;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	background: none;
	border: none;
	opacity: .8;
}
.dw-ssb-lb-close:hover { opacity: 1; }
