/**
 * Back in Stock Spotlight — frontend styles.
 * Scoped under .bish-* so it never leaks into the theme.
 */

.bish-section {
	--bish-accent: #3ddc84;
	--bish-accent-soft: rgba(61, 220, 132, 0.16);
	--bish-accent-glow: rgba(61, 220, 132, 0.45);
	--bish-bg: #0b0d10;
	--bish-surface: rgba(255, 255, 255, 0.04);
	--bish-surface-hover: rgba(255, 255, 255, 0.07);
	--bish-border: rgba(255, 255, 255, 0.09);
	--bish-text: #f4f6f8;
	--bish-muted: rgba(244, 246, 248, 0.58);
	--bish-radius: 20px;
	--bish-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);

	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin: 0 0 3rem;
	padding: clamp(2.5rem, 5vw, 4.5rem) 0;
	background: var(--bish-bg);
	color: var(--bish-text);
	border-radius: clamp(0px, 2vw, 28px);
	font-synthesis: none;
	-webkit-font-smoothing: antialiased;
}

/* ---------- Light theme ---------- */

.bish-theme--light,
.bish-section.bish-theme--light {
	--bish-bg: #f6f7f9;
	--bish-surface: #ffffff;
	--bish-surface-hover: #ffffff;
	--bish-border: rgba(9, 12, 16, 0.08);
	--bish-text: #0d1117;
	--bish-muted: rgba(13, 17, 23, 0.56);
	--bish-shadow: 0 22px 50px -30px rgba(9, 12, 16, 0.45);
}

@media (prefers-color-scheme: light) {
	.bish-theme--auto {
		--bish-bg: #f6f7f9;
		--bish-surface: #ffffff;
		--bish-surface-hover: #ffffff;
		--bish-border: rgba(9, 12, 16, 0.08);
		--bish-text: #0d1117;
		--bish-muted: rgba(13, 17, 23, 0.56);
		--bish-shadow: 0 22px 50px -30px rgba(9, 12, 16, 0.45);
	}
}

/* ---------- Ambient glow ---------- */

.bish-aurora {
	position: absolute;
	inset: -40% -10% auto -10%;
	height: 70%;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(45% 60% at 18% 40%, var(--bish-accent-soft), transparent 70%),
		radial-gradient(40% 55% at 82% 20%, var(--bish-accent-soft), transparent 72%);
	filter: blur(18px);
	opacity: 0.9;
}

.bish-inner {
	position: relative;
	width: min(1240px, 100% - clamp(1.5rem, 5vw, 4rem));
	margin-inline: auto;
}

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

.bish-head {
	max-width: 46rem;
	margin: 0 0 clamp(1.75rem, 3vw, 2.75rem);
}

.bish-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	margin: 0 0 0.9rem;
	padding: 0.42em 0.95em 0.42em 0.75em;
	border: 1px solid var(--bish-border);
	border-radius: 999px;
	background: var(--bish-accent-soft);
	color: var(--bish-text);
	font-size: clamp(0.7rem, 1.4vw, 0.78rem);
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	line-height: 1;
}

.bish-title {
	margin: 0;
	font-size: clamp(1.8rem, 4.2vw, 3rem);
	font-weight: 700;
	line-height: 1.06;
	letter-spacing: -0.03em;
	color: var(--bish-text);
}

.bish-sub {
	margin: 0.75rem 0 0;
	max-width: 40rem;
	color: var(--bish-muted);
	font-size: clamp(0.95rem, 1.6vw, 1.06rem);
	line-height: 1.55;
}

/* ---------- Live dot ---------- */

.bish-dot {
	position: relative;
	flex: none;
	width: 0.5em;
	height: 0.5em;
	border-radius: 50%;
	background: var(--bish-accent);
	box-shadow: 0 0 0 0 var(--bish-accent-glow);
	animation: bish-pulse 2.4s ease-out infinite;
}

@keyframes bish-pulse {
	0% { box-shadow: 0 0 0 0 var(--bish-accent-glow); }
	70% { box-shadow: 0 0 0 0.55em rgba(0, 0, 0, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* ---------- Grid ---------- */

.bish-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: clamp(0.9rem, 1.8vw, 1.4rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.bish-layout--carousel .bish-grid {
	display: flex;
	grid-template-columns: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 0.25rem;
	padding-bottom: 0.75rem;
	scrollbar-width: thin;
	scrollbar-color: var(--bish-border) transparent;
}

.bish-layout--carousel .bish-card {
	flex: 0 0 clamp(220px, 26vw, 280px);
	scroll-snap-align: start;
}

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

.bish-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--bish-border);
	border-radius: var(--bish-radius);
	background: var(--bish-surface);
	backdrop-filter: blur(10px);
	box-shadow: var(--bish-shadow);
	transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1), border-color 0.35s ease, background 0.35s ease;
	animation: bish-rise 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
	animation-delay: calc(var(--bish-i, 0) * 60ms);
}

@keyframes bish-rise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}

.bish-card::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(150deg, var(--bish-accent), transparent 42%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.bish-card:hover,
.bish-card:focus-within {
	transform: translateY(-6px);
	background: var(--bish-surface-hover);
	border-color: transparent;
}

.bish-card:hover::after,
.bish-card:focus-within::after {
	opacity: 1;
}

.bish-card__link {
	display: flex;
	flex-direction: column;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.bish-card__link:focus-visible {
	outline: 2px solid var(--bish-accent);
	outline-offset: -3px;
	border-radius: var(--bish-radius);
}

/* ---------- Media ---------- */

.bish-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: linear-gradient(160deg, var(--bish-accent-soft), transparent 60%);
}

.bish-card__media img,
.bish-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.bish-card:hover .bish-card__img {
	transform: scale(1.05);
}

.bish-sheen {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.28) 50%, transparent 62%);
	transform: translateX(-120%);
	transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.bish-card:hover .bish-sheen {
	transform: translateX(120%);
}

/* ---------- Badge ---------- */

.bish-badge {
	position: absolute;
	top: 0.7rem;
	left: 0.7rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.42em 0.8em;
	border-radius: 999px;
	background: rgba(10, 12, 15, 0.72);
	border: 1px solid var(--bish-accent-glow);
	backdrop-filter: blur(8px);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
	white-space: nowrap;
	box-shadow: 0 6px 20px -8px var(--bish-accent-glow);
}

/* Badge inside the theme's own product loop. */
.woocommerce ul.products li.product .bish-badge--loop,
.bish-badge--loop {
	position: absolute;
	top: 0.65rem;
	left: 0.65rem;
	z-index: 5;
	pointer-events: none;
}

.woocommerce ul.products li.product {
	position: relative;
}

/* ---------- Body ---------- */

.bish-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: 1.05rem 1.1rem 0.9rem;
}

.bish-card__cat {
	color: var(--bish-muted);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bish-card__title {
	color: var(--bish-text);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.01em;
	min-height: 2.7em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bish-card__price {
	margin-top: 0.15rem;
	color: var(--bish-text);
	font-size: 0.98rem;
	font-weight: 700;
}

.bish-card__price del {
	opacity: 0.5;
	font-weight: 500;
	margin-right: 0.35em;
}

.bish-card__price ins {
	text-decoration: none;
	color: var(--bish-accent);
}

/* ---------- Footer ---------- */

.bish-card__foot {
	display: flex;
	margin-top: auto;
	padding: 0.25rem 1.1rem 1.15rem;
}

.bish-countdown {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	color: var(--bish-muted);
	font-size: 0.76rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.bish-countdown::before {
	content: "";
	width: 0.45em;
	height: 0.45em;
	border-radius: 50%;
	background: var(--bish-accent);
	flex: none;
}

.bish-countdown.is-ending {
	color: var(--bish-accent);
}

.bish-cta {
	display: inline-flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.7em 1.2em;
	border: 1px solid var(--bish-border);
	border-radius: 999px;
	background: var(--bish-accent);
	color: #06120b;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 10px 24px -14px var(--bish-accent-glow);
}

.bish-cta:hover,
.bish-cta:focus-visible {
	transform: translateY(-1px);
	filter: brightness(1.06);
	color: #06120b;
	box-shadow: 0 14px 28px -12px var(--bish-accent-glow);
}

.bish-cta.loading {
	opacity: 0.7;
	pointer-events: none;
}

.bish-cta.added::after {
	content: "✓";
	margin-left: 0.4em;
}

/* WooCommerce injects a "View cart" link after AJAX adds. */
.bish-card__foot .added_to_cart {
	display: none;
}

/* ---------- Single product banner ---------- */

.bish-single-banner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0 0 1rem;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--bish-accent-glow);
	border-radius: 14px;
	background: var(--bish-accent-soft);
	--bish-muted: currentColor;
}

.bish-single-banner .bish-badge {
	position: static;
	top: auto;
	left: auto;
}

/* ---------- Empty state ---------- */

.bish-empty {
	margin: 0;
	padding: 1.5rem;
	text-align: center;
	color: var(--bish-muted);
}

/* ---------- Motion & small screens ---------- */

@media (max-width: 600px) {
	.bish-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.bish-card__foot {
		flex-direction: column;
		align-items: stretch;
		gap: 0.5rem;
	}

	.bish-cta {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bish-card,
	.bish-card__img,
	.bish-sheen,
	.bish-dot,
	.bish-cta {
		animation: none !important;
		transition: none !important;
	}

	.bish-card:hover {
		transform: none;
	}
}
