/* =========================================================
   Bestselling Products – Tabbed Product Slider
   Every size and colour comes from CSS variables that the
   plugin prints per section, so desktop and mobile are
   fully controlled from the admin screen.
   ========================================================= */

.bsp-section {
	background: var(--bsp-bg, #fff);
	padding-top: var(--bsp-pt, 40px);
	padding-bottom: var(--bsp-pb, 40px);
	position: relative;
	box-sizing: border-box;
}
.bsp-section *,
.bsp-section *::before,
.bsp-section *::after {
	box-sizing: border-box;
}
.bsp-section.bsp-fullwidth {
	width: calc(100vw - var(--bsp-sbw, 0px));
	max-width: calc(100vw - var(--bsp-sbw, 0px));
	margin-left: calc(50% - 50vw + (var(--bsp-sbw, 0px) / 2));
	margin-right: calc(50% - 50vw + (var(--bsp-sbw, 0px) / 2));
}
.bsp-inner {
	width: 100%;
	max-width: var(--bsp-cw, 1400px);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--bsp-sp, 20px);
	padding-right: var(--bsp-sp, 20px);
}

/* ------------------------- Header ------------------------- */

.bsp-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 20px;
}
.bsp-tabs-left .bsp-head,
.bsp-tabs-below .bsp-head {
	display: block;
}
.bsp-tabs-left .bsp-head-text,
.bsp-tabs-below .bsp-head-text {
	margin-bottom: 16px;
}
.bsp-head-text {
	min-width: 0;
}
.bsp-section .bsp-title {
	margin: 0 0 4px;
	padding: 0;
	font-size: var(--bsp-h-size, 28px);
	font-weight: var(--bsp-h-weight, 700);
	line-height: 1.25;
	color: var(--bsp-h-color, #1b2452);
	letter-spacing: 0;
	text-transform: none;
}
.bsp-section .bsp-sub {
	margin: 0;
	font-size: var(--bsp-sub-size, 16px);
	line-height: 1.4;
	color: var(--bsp-sub-color, #4a5170);
}

/* -------------------------- Tabs -------------------------- */

.bsp-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bsp-tab-gap, 10px);
	justify-content: flex-end;
	flex: 0 0 auto;
	scrollbar-width: none;
}
.bsp-tabs::-webkit-scrollbar { display: none; }
.bsp-tabs-left .bsp-tabs { justify-content: flex-start; }
.bsp-tabs-below .bsp-tabs { justify-content: center; }

.bsp-section .bsp-tab-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: var(--bsp-tab-h, 44px);
	padding: 0 var(--bsp-tab-pad, 22px);
	margin: 0;
	border: var(--bsp-tab-bw, 1px) solid var(--bsp-tab-border, #dfe3ec);
	border-radius: var(--bsp-tab-radius, 8px);
	background: var(--bsp-tab-bg, #fff);
	color: var(--bsp-tab-color, #2b2f61);
	font-size: var(--bsp-tab-font, 15px);
	font-weight: var(--bsp-tab-weight, 700);
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background .18s ease, color .18s ease, border-color .18s ease;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
}
.bsp-section .bsp-tab-btn.is-active {
	background: var(--bsp-tab-abg, #2b2f61);
	color: var(--bsp-tab-acolor, #fff);
	border-color: var(--bsp-tab-aborder, #2b2f61);
}
.bsp-section .bsp-tab-btn:focus-visible {
	outline: 2px solid var(--bsp-prog-bar, #2b2f61);
	outline-offset: 2px;
}

/* ------------------------- Panels ------------------------- */

.bsp-panel[hidden] { display: none; }

.bsp-slider { position: relative; }

.bsp-track {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: var(--bsp-gap, 20px);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 2px;
	margin: -2px;
}
.bsp-track::-webkit-scrollbar { display: none; width: 0; height: 0; }
.bsp-track:focus-visible {
	outline: 2px solid var(--bsp-prog-bar, #2b2f61);
	outline-offset: 2px;
}
.bsp-track.bsp-grabbing { cursor: grabbing; scroll-snap-type: none; }

/* Themes often restyle buttons globally; keep ours predictable. */
.bsp-section button {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	min-height: 0;
	width: auto;
}

/* -------------------------- Card -------------------------- */

.bsp-section .bsp-card {
	flex: 0 0 auto;
	width: var(--bsp-card-w, 300px);
	display: flex;
	flex-direction: column;
	margin: 0;
	background: var(--bsp-card-bg, #fff);
	border: var(--bsp-card-bw, 1px) solid var(--bsp-card-border, #e6e8ef);
	border-radius: var(--bsp-card-radius, 8px);
	box-shadow: var(--bsp-card-shadow, none);
	scroll-snap-align: start;
	position: relative;
}

.bsp-card-media {
	position: relative;
	display: block;
	height: var(--bsp-img-h, 350px);
	overflow: hidden;
	background: #f4f4f6;
	border-radius: var(--bsp-card-radius, 8px) var(--bsp-card-radius, 8px) 0 0;
	text-decoration: none;
}
.bsp-section .bsp-card-media .bsp-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: var(--bsp-img-fit, cover);
	transition: transform .5s ease;
	border-radius: inherit;
}
.bsp-section .bsp-card:hover .bsp-img { transform: scale(1.04); }

.bsp-badge {
	position: absolute;
	top: var(--bsp-badge-top, 14px);
	left: var(--bsp-badge-left, 14px);
	z-index: 2;
	padding: 7px 12px;
	border-radius: var(--bsp-badge-radius, 6px);
	background: var(--bsp-badge-bg, #e0114f);
	color: var(--bsp-badge-color, #fff);
	font-size: var(--bsp-badge-size, 13px);
	font-weight: 700;
	line-height: 1.2;
}

.bsp-card-body {
	flex: 1 1 auto;
	padding: var(--bsp-card-pad, 14px);
	line-height: 1.4;
}

/* Rating */
.bsp-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
	margin-bottom: var(--bsp-row-gap, 10px);
	font-size: var(--bsp-rating-font, 14px);
	line-height: 1;
}
.bsp-stars {
	position: relative;
	display: inline-flex;
	line-height: 0;
	flex: 0 0 auto;
}
.bsp-stars-bg,
.bsp-stars-row { display: inline-flex; }
.bsp-stars-fg {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: var(--bsp-pct, 100%);
	overflow: hidden;
}
.bsp-star {
	flex: 0 0 auto;
	width: var(--bsp-star-size, 20px);
	height: var(--bsp-star-size, 20px);
	margin-right: 2px;
	border-radius: 2px;
	background: var(--bsp-star-empty, #dcdce6);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.bsp-stars-fg .bsp-star { background: var(--bsp-star, #00b67a); }
.bsp-star svg { width: 76%; height: 76%; fill: #fff; display: block; }
.bsp-sprite { display: none !important; }
.bsp-section a.bsp-rating-link { text-decoration: none; }
.bsp-section a.bsp-rating-link:hover .bsp-rating-val { text-decoration: underline; }
.bsp-rating-val { font-weight: 700; color: var(--bsp-rating-color, #1b2452); }
.bsp-rating-count { color: var(--bsp-count-color, #6c7183); }

/* Title */
.bsp-section .bsp-card-title {
	margin: 0 0 var(--bsp-row-gap, 10px);
	padding: 0;
	font-size: var(--bsp-title-size, 15px);
	font-weight: var(--bsp-title-weight, 700);
	line-height: var(--bsp-title-lh, 1.35);
	color: var(--bsp-title-color, #1b2452);
	display: -webkit-box;
	-webkit-line-clamp: var(--bsp-title-lines, 2);
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-transform: none;
	letter-spacing: 0;
}
.bsp-section .bsp-card-title a {
	color: inherit;
	text-decoration: none;
}
.bsp-section .bsp-card-title a:hover { text-decoration: underline; }

/* Swatches */
.bsp-colours { margin-bottom: var(--bsp-row-gap, 10px); }

/* Invisible placeholder that keeps cards the same height */
.bsp-ghost {
	visibility: hidden;
	pointer-events: none;
	user-select: none;
}
.bsp-colours-label {
	display: block;
	margin-bottom: 7px;
	font-size: var(--bsp-sw-label-size, 13px);
	color: var(--bsp-sw-label, #6c7183);
	line-height: 1.2;
}
.bsp-swatches {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	line-height: 1;
}
.bsp-section .bsp-swatch {
	flex: 0 0 auto !important;
	display: block;
	position: relative;
	box-sizing: border-box;
	width: var(--bsp-sw-size, 22px) !important;
	height: var(--bsp-sw-size, 22px) !important;
	min-width: var(--bsp-sw-size, 22px) !important;
	max-width: var(--bsp-sw-size, 22px) !important;
	min-height: var(--bsp-sw-size, 22px) !important;
	max-height: var(--bsp-sw-size, 22px) !important;
	aspect-ratio: 1 / 1;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid var(--bsp-sw-border, #e0e0e6) !important;
	border-radius: 50% !important;
	line-height: 1 !important;
	font-size: 0;
	box-shadow: none !important;
	appearance: none;
	-webkit-appearance: none;
	background-clip: padding-box;
	overflow: hidden;
	transform: none;
}
.bsp-section .bsp-swatch-btn {
	cursor: pointer;
	transition: transform .15s ease;
}
.bsp-section .bsp-swatch-btn:hover {
	transform: scale(1.12);
}
.bsp-section .bsp-swatch-btn:focus-visible {
	outline: 2px solid var(--bsp-prog-bar, #2b2f61);
	outline-offset: 2px;
}
.bsp-section .bsp-swatch.is-active {
	overflow: visible;
}
.bsp-section .bsp-swatch.is-active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px;
	height: 2px;
	border-radius: 2px;
	background: var(--bsp-sw-active, #1b2452);
}

/* Price */
.bsp-price-row {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 5px;
}
.bsp-price {
	font-size: var(--bsp-price-size, 22px);
	font-weight: 700;
	color: var(--bsp-price-color, #1b2452);
	line-height: 1.2;
}
.bsp-rrp {
	font-size: var(--bsp-rrp-size, 14px);
	color: var(--bsp-rrp-color, #6c7183);
}
.bsp-section .bsp-info {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	position: relative;
	box-sizing: border-box;
	width: 16px !important;
	height: 16px !important;
	min-width: 16px !important;
	max-width: 16px !important;
	min-height: 16px !important;
	max-height: 16px !important;
	aspect-ratio: 1 / 1;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid var(--bsp-rrp-color, #6c7183) !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: var(--bsp-rrp-color, #6c7183);
	font-size: 10px !important;
	font-style: normal;
	font-weight: 400;
	line-height: 1 !important;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	align-self: center;
	box-shadow: none !important;
	appearance: none;
	-webkit-appearance: none;
	transform: none;
}
.bsp-info::after {
	content: attr(data-tip);
	position: absolute;
	bottom: 150%;
	right: -6px;
	width: 210px;
	max-width: 60vw;
	padding: 9px 11px;
	border-radius: 6px;
	background: #1b2452;
	color: #fff;
	font-size: 12px;
	font-style: normal;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	opacity: 0;
	visibility: hidden;
	transition: opacity .15s ease;
	z-index: 6;
	pointer-events: none;
}
.bsp-info:hover::after,
.bsp-info:focus::after { opacity: 1; visibility: visible; }

.bsp-code {
	font-size: var(--bsp-code-size, 14px);
	color: var(--bsp-code-color, #e0114f);
	line-height: 1.4;
}
.bsp-code strong { font-weight: 700; }

/* Delivery */
.bsp-delivery {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
	padding: var(--bsp-del-pad, 11px) var(--bsp-card-pad, 14px);
	border-top: 1px solid var(--bsp-del-border, #e6e8ef);
	background: var(--bsp-del-bg, #fff);
	color: var(--bsp-del-color, #2b2f61);
	font-size: var(--bsp-del-size, 13px);
	line-height: 1.35;
	border-radius: 0 0 var(--bsp-card-radius, 8px) var(--bsp-card-radius, 8px);
}
.bsp-truck {
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
	color: var(--bsp-del-icon, #2b2f61);
}
.bsp-delivery-text strong { font-weight: 700; }

/* ------------------------- Arrows ------------------------- */

.bsp-section .bsp-nav {
	position: absolute;
	top: calc(var(--bsp-img-h, 350px) / 2);
	transform: translateY(-50%);
	z-index: 3;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bsp-arrow-bg, #fff);
	color: var(--bsp-arrow-color, #2b2f61);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
}
.bsp-has-arrows .bsp-nav { display: flex; }
.bsp-section .bsp-nav svg { width: 20px; height: 20px; }
.bsp-section .bsp-prev { left: -14px; }
.bsp-section .bsp-next { right: -14px; }
.bsp-section .bsp-nav[disabled] { opacity: .35; cursor: default; }

/* ------------------------ Scroll bar ---------------------- */

.bsp-progress {
	position: relative;
	width: var(--bsp-prog-w, 50%);
	height: 4px;
	margin: 24px auto 0;
	border-radius: 4px;
	background: var(--bsp-prog-track, #e3e3e6);
	cursor: pointer;
}
.bsp-progress-bar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 30%;
	border-radius: 4px;
	background: var(--bsp-prog-bar, #2b2f61);
	transition: left .08s linear;
}

.bsp-empty {
	padding: 14px 16px;
	border: 1px dashed #c9c9c9;
	border-radius: 6px;
	color: #666;
}

@media (max-width: 1024px) {
	.bsp-section .bsp-prev { left: 4px; }
	.bsp-section .bsp-next { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
	.bsp-section .bsp-img,
	.bsp-progress-bar,
	.bsp-section .bsp-tab-btn { transition: none; }
}
