/* =========================================================
   FurniLove – badge „BESTSELLER" (lewy górny róg zdjęcia)
   Listing: li.furni-bestseller  ·  Karta produktu: body.furni-bestseller-product
   ========================================================= */

/* kontener zdjęcia musi mieć position:relative dla badge */
li.furni-bestseller .wc-block-components-product-image,
li.furni-bestseller .wc-block-grid__product-image,
.furni-bestseller-product .custom-stacked-product-gallery .stacked-gallery-item:first-child,
.furni-bestseller-product .woocommerce-product-gallery__wrapper > *:first-child {
	position: relative;
}

/* sam badge (::before) */
li.furni-bestseller .wc-block-components-product-image::before,
.furni-bestseller-product .custom-stacked-product-gallery .stacked-gallery-item:first-child::before,
.furni-bestseller-product .woocommerce-product-gallery__wrapper > *:first-child::before {
	content: "★ Bestseller";
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 5;
	display: inline-block;
	background: linear-gradient(135deg, #a17c44, #c9a96a);
	color: #fff;
	font-family: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	font-size: .66rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .08em;
	text-transform: uppercase;
	padding: 6px 11px;
	border-radius: 999px;
	box-shadow: 0 3px 10px rgba(27, 27, 27, .20);
	pointer-events: none;
	white-space: nowrap;
}

/* na karcie produktu odrobinę większy i nieco dalej od krawędzi */
.furni-bestseller-product .custom-stacked-product-gallery .stacked-gallery-item:first-child::before,
.furni-bestseller-product .woocommerce-product-gallery__wrapper > *:first-child::before {
	top: 16px;
	left: 16px;
	font-size: .72rem;
	padding: 7px 13px;
}

/* mniejsze ekrany — mniejszy badge na listingu */
@media (max-width: 600px) {
	li.furni-bestseller .wc-block-components-product-image::before {
		top: 9px;
		left: 9px;
		font-size: .6rem;
		padding: 5px 9px;
		letter-spacing: .06em;
	}
}

/* =========================================================
   PASEK (KARUZELA) BESTSELLERÓW — .fl-bsrail
   Wyświetlany przed główną listą na stronie sklepu.
   ========================================================= */
.fl-bsrail {
	--g: #a17c44; --g-l: #c9a96a; --cream: #fbfaf3; --ink: #1b1b1b;
	--muted: #6a6a6a; --line: #ece7db;
	box-sizing: border-box;
	max-width: var(--wp--style--global--wide-size, 1340px);
	margin: 6px auto 40px;
	padding: 13px 22px 22px;
	background: var(--cream);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: 0 1px 3px rgba(27, 27, 27, .04);
	font-family: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.fl-bsrail * { box-sizing: border-box; }

/* nagłówek */
.fl-bsrail__head { margin: 0 4px 14px; }
.fl-bsrail__eyebrow {
	display: block;
	text-transform: uppercase; letter-spacing: .2em; font-size: .68rem; font-weight: 600;
	color: var(--g); margin: 0 0 4px; line-height: 1.1;
}
.fl-bsrail__title {
	font-family: "Playfair Display", Georgia, serif; font-weight: 700;
	font-size: clamp(1.4rem, 2.4vw, 1.85rem); line-height: 1.1; margin: 0; color: var(--ink);
}

/* obszar przewijania + strzałki */
.fl-bsrail__wrap { position: relative; }

.fl-bsrail__track {
	display: flex; gap: 16px;
	overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scroll-padding-left: 2px;
	padding: 4px 2px 8px;
	-ms-overflow-style: none; scrollbar-width: none;
}
.fl-bsrail__track::-webkit-scrollbar { display: none; }

/* karta produktu */
.fl-bsrail__card {
	flex: 0 0 auto;
	width: 210px;
	scroll-snap-align: start;
	display: flex; flex-direction: column;
	background: #fff; border: 1px solid var(--line); border-radius: 14px;
	overflow: hidden; text-decoration: none; color: var(--ink);
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.fl-bsrail__card:hover,
.fl-bsrail__card:focus-visible {
	text-decoration: none; outline: none;
	border-color: var(--g-l);
	transform: translateY(-3px);
	box-shadow: 0 12px 26px rgba(27, 27, 27, .10);
}

.fl-bsrail__media {
	display: block; position: relative;
	aspect-ratio: 4 / 3; background: #fff;
}
.fl-bsrail__media img,
.fl-bsrail__media a,
.fl-bsrail__media .attachment-woocommerce_thumbnail {
	width: 100%; height: 100%; object-fit: contain; display: block;
}

.fl-bsrail__name {
	padding: 12px 13px 2px; font-size: .92rem; font-weight: 600; line-height: 1.3;
	color: var(--ink);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	min-height: 2.6em;
}
.fl-bsrail__price {
	padding: 0 13px 13px; margin-top: auto;
	font-size: .95rem; font-weight: 700; color: var(--g);
}
.fl-bsrail__price .woocommerce-Price-amount { color: var(--g); }
.fl-bsrail__price del { color: var(--muted); font-weight: 500; margin-right: 6px; }
.fl-bsrail__price ins { text-decoration: none; }

/* strzałki nawigacji (desktop) */
.fl-bsrail__nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 42px; height: 42px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: #fff; color: var(--g); border: 1px solid var(--line);
	box-shadow: 0 4px 14px rgba(27, 27, 27, .12);
	cursor: pointer; z-index: 4;
	transition: opacity .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.fl-bsrail__nav:hover { background: var(--g); color: #fff; }
.fl-bsrail__nav--prev { left: -10px; }
.fl-bsrail__nav--next { right: -10px; }

/* chowanie strzałek na krańcach / gdy nie ma czego przewijać */
.fl-bsrail.is-start .fl-bsrail__nav--prev,
.fl-bsrail.is-end .fl-bsrail__nav--next { opacity: 0; pointer-events: none; }
.fl-bsrail.is-static .fl-bsrail__nav { display: none; }

/* ---- MOBILE: bez strzałek, swipe + podgląd kolejnej karty ---- */
@media (max-width: 768px) {
	.fl-bsrail { padding: 12px 14px 16px; border-radius: 14px; margin-bottom: 28px; }
	.fl-bsrail__head { margin-bottom: 12px; }
	.fl-bsrail__nav { display: none; }
	.fl-bsrail__track {
		gap: 12px;
		scroll-padding-left: 14px;
		padding-left: 14px; padding-right: 14px;
		margin-left: -14px; margin-right: -14px;
	}
	.fl-bsrail__card { width: 46%; }
}
@media (max-width: 420px) {
	.fl-bsrail__card { width: 60%; }
}
