/* =========================================================
   Aestheticz Shop by Video — public styles
   Namespaced entirely with `az-sbv` to avoid colliding with the
   homepage's own CSS. Reuses the site's --dlx-* variables where they're
   already defined (header.php / the homepage load them before this
   plugin's CSS does), but every rule also carries a fallback value so
   the component stays fully functional even if those variables are
   ever renamed or removed (Section 86).
   ========================================================= */

.az-sbv, .az-sbv *, .az-sbv *::before, .az-sbv *::after,
.az-sbv__modal-overlay, .az-sbv__modal-overlay *, .az-sbv__modal-overlay *::before, .az-sbv__modal-overlay *::after {
	box-sizing: border-box;
}

.az-sbv {
	padding: 3rem 6vw;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Poppins, sans-serif;
}

.az-sbv__header {
	text-align: center;
	max-width: 640px;
	margin: 0 auto 1.8rem;
}
.az-sbv__title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 600;
	font-size: clamp(2rem, 3.2vw, 3rem);
	color: var(--dlx-text, #2E2434);
	margin: 0;
}

.az-sbv__empty {
	text-align: center;
	color: var(--dlx-text-soft, #6E6178);
	padding: 2rem 0;
}
.az-sbv__loading {
	text-align: center;
	color: var(--dlx-text-soft, #6E6178);
	padding: 2rem 0;
	width: 100%;
}

/* Grid / carousel */
.az-sbv__grid--grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.4rem;
	max-width: 1360px;
	margin: 0 auto;
}
.az-sbv__grid--carousel {
	display: flex;
	gap: 1.2rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: .5rem;
	scrollbar-width: none;
	max-width: 1360px;
	margin: 0 auto;
}
.az-sbv__grid--carousel::-webkit-scrollbar { display: none; }
.az-sbv__grid--carousel .az-sbv__card {
	flex: 0 0 auto;
	width: 240px;
	scroll-snap-align: start;
}

@media (max-width: 1150px) {
	.az-sbv__grid--grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
	.az-sbv { padding: 2.4rem 6vw; }
	.az-sbv__grid--grid { grid-template-columns: repeat(2, 1fr); gap: .9rem; }
	.az-sbv__grid--carousel .az-sbv__card { width: 46vw; }
}

/* Card */
.az-sbv__card {
	display: flex;
	flex-direction: column;
	background: var(--dlx-card, #FFFFFF);
	border: none;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: var(--dlx-shadow, 0 10px 30px -12px rgba(124,92,255,0.25));
	cursor: pointer;
	padding: 0;
	text-align: left;
	transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s cubic-bezier(.22,1,.36,1);
	font-family: inherit;
}
.az-sbv__card:hover,
.az-sbv__card:focus-visible {
	transform: translateY(-6px);
	box-shadow: var(--dlx-shadow-lift, 0 20px 44px -16px rgba(124,92,255,0.35));
}
.az-sbv__thumbnail-wrap {
	position: relative;
	aspect-ratio: 9 / 14;
	background: var(--dlx-pink-soft, #FFE6F1);
	overflow: hidden;
}
.az-sbv__thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}
.az-sbv__card:hover .az-sbv__thumbnail { transform: scale(1.04); }
.az-sbv__thumbnail--placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--dlx-pink-soft, #FFE6F1), var(--dlx-lilac-soft, #EAD9FF));
}
.az-sbv__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: hsla(0,0%,100%,.85);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--dlx-accent, #7C5CFF);
	box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.az-sbv__play svg { width: 22px; height: 22px; margin-left: 2px; }
.az-sbv__card-meta {
	padding: .8rem .9rem 1rem;
	display: flex;
	flex-direction: column;
	gap: .2rem;
}
.az-sbv__card-influencer {
	font-size: .78rem;
	font-weight: 600;
	color: var(--dlx-accent, #7C5CFF);
}
.az-sbv__card-product {
	font-size: .85rem;
	color: var(--dlx-text, #2E2434);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* =================== HOMEPAGE REEL-EMBED CARDS =================== */
/* Distinct from .az-sbv__card (the shortcode/dedicated-page thumbnail
   button) — these render the actual self-hosted video, so the outer
   element is a plain div (never a <button>, since a <video> element
   needs its own click/tap handling for play controls), with an
   explicit "Shop This" button as the only click target that opens the modal. */
.az-sbv__reel-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--dlx-card, #FFFFFF);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: var(--dlx-shadow, 0 10px 30px -12px rgba(124,92,255,0.25));
}
.az-sbv__reel-embed-wrap {
	position: relative;
	aspect-ratio: 9 / 16;
	background: #000;
	overflow: hidden;
}
/* The self-hosted <video> fills this box completely. Sits underneath
   the placeholder in the DOM (both are absolutely/flex positioned to
   overlap); the placeholder is removed once the video's first frame
   has actually loaded (see activateAndPlay() in the JS), so there's
   never a flash of black before the poster/thumbnail shows. */
.az-sbv__reel-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* The lightweight placeholder shown before the card scrolls into view
   (before the video actually starts loading) — same visual language as
   the thumbnail card so there's no jarring swap. */
.az-sbv__reel-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--dlx-pink-soft, #FFE6F1);
}
.az-sbv__reel-placeholder img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.az-sbv__reel-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: hsla(0,0%,100%,.85);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--dlx-accent, #7C5CFF);
	box-shadow: 0 4px 14px rgba(0,0,0,.2);
	pointer-events: none;
}
.az-sbv__reel-play svg { width: 22px; height: 22px; margin-left: 2px; }
/* Shown only if the video file genuinely fails to load (deleted from
   S3, AWS Settings misconfigured, network issue) — the placeholder
   stays visible with this note instead of an empty black box. */
.az-sbv__reel-fallback-note {
	position: absolute;
	bottom: .6rem;
	left: 50%;
	transform: translateX(-50%);
	background: hsla(0,0%,0%,.65);
	color: #fff;
	font-size: .72rem;
	padding: .3rem .7rem;
	border-radius: 999px;
	white-space: nowrap;
}

.az-sbv__reel-meta {
	padding: .7rem .9rem .5rem;
	display: flex;
	flex-direction: column;
	gap: .15rem;
}
.az-sbv__reel-influencer { font-size: .78rem; font-weight: 600; color: var(--dlx-accent, #7C5CFF); }
.az-sbv__reel-product { font-size: .85rem; color: var(--dlx-text, #2E2434); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.az-sbv__reel-shop-btn {
	margin: .3rem .9rem .9rem;
	font-family: 'Outfit', sans-serif;
	font-weight: 600;
	font-size: .82rem;
	padding: .55rem 1rem;
	border-radius: 999px;
	border: none;
	background: linear-gradient(135deg, var(--dlx-pink, #FF7DBA), var(--dlx-lilac, #B58BFF));
	color: #fff;
	cursor: pointer;
	transition: transform .25s ease;
}
.az-sbv__reel-shop-btn:hover { transform: translateY(-2px); }

.az-sbv__grid--carousel .az-sbv__reel-card {
	flex: 0 0 auto;
	width: 240px;
	scroll-snap-align: start;
}
@media (max-width: 640px) {
	.az-sbv__grid--carousel .az-sbv__reel-card { width: 62vw; }
}

/* Modal */
.az-sbv__modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 14, 26, .6);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 2rem;
	opacity: 0;
	transition: opacity .25s ease;
}
.az-sbv__modal-overlay.az-sbv-open {
	display: flex;
	opacity: 1;
}
.az-sbv__modal {
	position: relative;
	background: var(--dlx-bg, #FFF9FC);
	border-radius: 22px;
	max-width: 960px;
	width: 100%;
	max-height: 94vh;
	overflow-y: auto;
	box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.az-sbv__modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: hsla(0,0%,100%,.85);
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	color: var(--dlx-text, #2E2434);
}
.az-sbv__modal-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 300px;
}
.az-sbv__spinner {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--dlx-border, rgba(46,36,52,.1));
	border-top-color: var(--dlx-accent, #7C5CFF);
	animation: az-sbv-spin .8s linear infinite;
}
@keyframes az-sbv-spin { to { transform: rotate(360deg); } }

.az-sbv__modal-error {
	padding: 3rem 2rem;
	text-align: center;
	color: var(--dlx-text-soft, #6E6178);
}

.az-sbv__modal-body {
	display: grid;
	grid-template-columns: 0.85fr 1.15fr;
	align-items: start; /* Without this, CSS grid stretches both columns to match whichever is taller — so a long product list was pulling the video column tall too, and since .az-sbv__modal-reel centers its content, the video ended up floating in the middle of that extra height instead of staying put. */
}
@media (max-width: 780px) {
	.az-sbv__modal-body { grid-template-columns: 1fr; }
}

.az-sbv__modal-reel {
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	position: sticky;
	top: 0;
}
.az-sbv__embed-container {
	position: relative;
	width: 100%;
}
.az-sbv__embed-container video {
	width: 100%;
	height: 100%;
	aspect-ratio: 9 / 16; /* Matches the vertical/Reels-style format these videos are uploaded in. */
	max-height: 80vh;
	border: none;
	display: block;
	margin: 0 auto;
	background: #000;
}
.az-sbv__embed-fallback {
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: #fff;
}
.az-sbv__embed-fallback a {
	color: var(--dlx-lilac, #B58BFF);
}

.az-sbv__modal-products {
	padding: 1.6rem 1.6rem 2rem;
	display: flex;
	flex-direction: column;
	gap: 1.6rem;
	max-height: 80vh; /* Roughly matches the video's own capped height, so with 3+ products this column scrolls internally instead of growing the whole modal (and, via align-items:start above, instead of stretching/re-centering the video). */
	overflow-y: auto;
}
.az-sbv__sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}

.az-sbv__product { display: flex; flex-direction: column; gap: .6rem; }
.az-sbv__product + .az-sbv__product {
	border-top: 1px solid var(--dlx-border, rgba(46,36,52,.1));
	padding-top: 1.4rem;
}
.az-sbv__product-name {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 600;
	font-size: 1.4rem;
	color: var(--dlx-text, #2E2434);
	margin: 0;
}
.az-sbv__product-price { font-size: 1.15rem; font-weight: 700; color: var(--dlx-text, #2E2434); }
.az-sbv__product-price del { font-weight: 400; color: var(--dlx-text-soft, #6E6178); margin-left: .4rem; font-size: .95rem; }
.az-sbv__product-desc { font-size: .9rem; color: var(--dlx-text-soft, #6E6178); line-height: 1.6; }
.az-sbv__product-stock { font-size: .82rem; font-weight: 600; }
.az-sbv__product-stock--in { color: #3FA66E; }
.az-sbv__product-stock--out { color: #C0392B; }

.az-sbv__variation-group { display: flex; flex-direction: column; gap: .4rem; }
.az-sbv__variation-label { font-size: .82rem; font-weight: 600; color: var(--dlx-text, #2E2434); }
.az-sbv__variation-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.az-sbv__variation-option {
	font-size: .82rem;
	padding: .5rem 1rem;
	border-radius: 999px;
	border: 1.5px solid var(--dlx-border, rgba(46,36,52,.1));
	background: var(--dlx-card, #fff);
	color: var(--dlx-text, #2E2434);
	cursor: pointer;
}
.az-sbv__variation-option.az-sbv-selected {
	background: linear-gradient(135deg, var(--dlx-pink, #FF7DBA), var(--dlx-lilac, #B58BFF));
	color: #fff;
	border-color: transparent;
}
.az-sbv__variation-option:disabled { opacity: .35; cursor: not-allowed; }

.az-sbv__qty-row { display: flex; align-items: center; gap: .8rem; }
.az-sbv__qty-stepper { display: flex; align-items: center; border: 1.5px solid var(--dlx-border, rgba(46,36,52,.1)); border-radius: 999px; overflow: hidden; }
.az-sbv__qty-stepper button { width: 36px; height: 36px; border: none; background: none; font-size: 1rem; cursor: pointer; color: var(--dlx-text, #2E2434); }
.az-sbv__qty-stepper input { width: 40px; border: none; text-align: center; font-size: .95rem; -moz-appearance: textfield; }

.az-sbv__actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.az-sbv__btn {
	font-weight: 600;
	font-size: .9rem;
	padding: .85rem 1.6rem;
	border-radius: 999px;
	border: none;
	cursor: pointer;
	flex: 1 1 auto;
	text-align: center;
	transition: transform .25s ease, opacity .25s ease;
}
.az-sbv__btn:disabled { opacity: .5; cursor: not-allowed; }
.az-sbv__btn--primary {
	background: linear-gradient(135deg, var(--dlx-pink, #FF7DBA), var(--dlx-lilac, #B58BFF));
	color: #fff;
}
.az-sbv__btn--outline {
	background: transparent;
	border: 1.5px solid var(--dlx-text, #2E2434);
	color: var(--dlx-text, #2E2434);
}
.az-sbv__btn:hover:not(:disabled) { transform: translateY(-2px); }

.az-sbv__wishlist-btn {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	background: none;
	border: none;
	font-size: .85rem;
	color: var(--dlx-text-soft, #6E6178);
	cursor: pointer;
	padding: 0;
}
.az-sbv__wishlist-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.az-sbv__wishlist-btn.az-sbv-active { color: var(--dlx-pink, #FF7DBA); }
.az-sbv__wishlist-btn.az-sbv-active svg { fill: currentColor; }

.az-sbv__view-product { font-size: .85rem; font-weight: 600; color: var(--dlx-accent, #7C5CFF); text-decoration: underline; }

.az-sbv__also-shown {
	font-size: .82rem;
	color: var(--dlx-text-soft, #6E6178);
	margin: -.4rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
	.az-sbv *, .az-sbv__modal-overlay * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
