/**
 * Sunnah Shopping Product Videos — floating player + popup.
 * Uses brand tokens with fallbacks so the plugin works standalone.
 */

.sspv-root {
	--sspv-forest: var(--forest, #0B3D2E);
	--sspv-gold: var(--gold, #C9A84C);
	--sspv-cream: var(--cream, #F5F2ED);
	--sspv-r: var(--r-lg, .75rem);
	--sspv-sh: var(--sh, 0 2px 12px rgba(11, 61, 46, .07));
}

/* ------------------------------------------------------------------ */
/* Floating player                                                     */
/* ------------------------------------------------------------------ */

.sspv-float {
	position: fixed;
	right: 16px;
	bottom: 84px;
	z-index: 9998;
	width: 220px;
	height: 124px;
	border-radius: var(--sspv-r);
	overflow: hidden;
	background: #000;
	box-shadow: 0 8px 28px rgba(11, 61, 46, .22);
	border: 2px solid rgba(255, 255, 255, .9);
	cursor: pointer;
	opacity: 0;
	transform: translateY(14px) scale(.96);
	transition: opacity .45s ease, transform .45s cubic-bezier(.2, .8, .3, 1);
}

.sspv-float.is-in {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.sspv-float.is-hidden {
	display: none;
}

.sspv-float:focus-visible {
	outline: 3px solid var(--sspv-gold);
	outline-offset: 3px;
}

.sspv-float__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sspv-float__badge {
	position: absolute;
	left: 8px;
	bottom: 8px;
	padding: 3px 9px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--sspv-cream);
	background: rgba(11, 61, 46, .82);
	border-radius: 999px;
	pointer-events: none;
}

.sspv-float__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 26px;
	height: 26px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .5);
	cursor: pointer;
	transition: background .2s ease;
}

.sspv-float__close:hover {
	background: rgba(0, 0, 0, .75);
}

.sspv-float__close svg {
	width: 14px;
	height: 14px;
	stroke: #fff;
	stroke-width: 2.2;
	stroke-linecap: round;
	fill: none;
}

/* ------------------------------------------------------------------ */
/* Minimized pill                                                      */
/* ------------------------------------------------------------------ */

.sspv-pill {
	position: fixed;
	right: 16px;
	bottom: 84px;
	z-index: 9998;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sspv-forest);
	box-shadow: 0 6px 20px rgba(11, 61, 46, .3);
	cursor: pointer;
	animation: sspv-pop .35s cubic-bezier(.2, .8, .3, 1);
}

.sspv-pill svg {
	width: 20px;
	height: 20px;
	fill: var(--sspv-gold);
	margin-left: 2px;
}

@keyframes sspv-pop {
	from { opacity: 0; transform: scale(.7); }
	to   { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------------ */
/* Popup                                                               */
/* ------------------------------------------------------------------ */

.sspv-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 20px;
}

.sspv-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 24, 18, .88);
	backdrop-filter: blur(3px);
	animation: sspv-fade .25s ease;
}

@keyframes sspv-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.sspv-modal__inner {
	position: relative;
	z-index: 1;
	width: min(520px, 100%);
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	animation: sspv-rise .3s cubic-bezier(.2, .8, .3, 1);
}

@keyframes sspv-rise {
	from { opacity: 0; transform: translateY(18px); }
	to   { opacity: 1; transform: translateY(0); }
}

.sspv-modal__stage {
	width: 100%;
	border-radius: var(--r-xl, 1.125rem);
	overflow: hidden;
	background: #000;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.sspv-modal__stage {
	width: 100%;
}

.sspv-modal__title {
	margin: 0;
	color: var(--sspv-cream);
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
}

.sspv-modal__close {
	position: absolute;
	top: -46px;
	right: 0;
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	cursor: pointer;
	transition: background .2s ease;
}

.sspv-modal__close:hover {
	background: rgba(255, 255, 255, .26);
}

.sspv-modal__close svg {
	width: 18px;
	height: 18px;
	stroke: #fff;
	stroke-width: 2.2;
	stroke-linecap: round;
	fill: none;
}

body.sspv-modal-open {
	overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 1023px) {
	.sspv-float {
		width: 180px;
		height: 102px;
		right: 12px;
		bottom: 130px; /* Clear the bottom nav + floating cart bar. */
	}

	.sspv-pill {
		right: 12px;
		bottom: 130px;
	}

	.sspv-modal {
		padding: 16px;
	}

	.sspv-modal__close {
		top: -44px;
	}
}

/* ------------------------------------------------------------------ */
/* Adapter mount points (v1.2)                                         */
/* ------------------------------------------------------------------ */

.sspv-float__mount,
.sspv-modal__mount {
	position: absolute;
	inset: 0;
}

.sspv-modal__mount {
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 16;
	max-height: 74vh;
	background: #000;
}

.sspv-float__mount > *,
.sspv-modal__mount > * {
	width: 100%;
	height: 100%;
	display: block;
	border: 0;
}

.sspv-float__mount video,
.sspv-modal__mount video {
	object-fit: cover;
	background: #000;
}

.sspv-modal__mount video {
	object-fit: contain;
}

.sspv-float__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.sspv-float__poster[hidden] {
	display: none;
}

/* iframes cannot be styled from outside, so give them a stable box. */
.sspv-embed {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* ------------------------------------------------------------------ */
/* Gallery chrome (v1.1)                                               */
/* ------------------------------------------------------------------ */

.sspv-float__count {
	position: absolute;
	top: 6px;
	left: 6px;
	padding: 2px 7px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .03em;
	color: var(--sspv-cream);
	background: rgba(11, 61, 46, .82);
	border-radius: 999px;
	pointer-events: none;
}

.sspv-modal__stage {
	position: relative;
}

.sspv-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	cursor: pointer;
	transition: background .2s ease;
}

.sspv-nav:hover {
	background: rgba(0, 0, 0, .7);
}

.sspv-nav--prev { left: 10px; }
.sspv-nav--next { right: 10px; }

.sspv-nav svg {
	width: 20px;
	height: 20px;
	stroke: #fff;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
}

.sspv-modal__caption {
	margin: 0;
	color: var(--sspv-cream);
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
}

.sspv-dots {
	display: flex;
	gap: 8px;
	justify-content: center;
}

.sspv-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .35);
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}

.sspv-dot.is-active {
	background: var(--sspv-gold);
	transform: scale(1.25);
}

@media (max-width: 1023px) {
	.sspv-nav {
		width: 34px;
		height: 34px;
	}
	.sspv-nav--prev { left: 6px; }
	.sspv-nav--next { right: 6px; }
}

/* ------------------------------------------------------------------ */
/* Multi-provider: facade + embeds (v1.2)                              */
/* ------------------------------------------------------------------ */

.sspv-float__facade {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sspv-float__facade[hidden] {
	display: none;
}

.sspv-float__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(11, 61, 46, .78);
	pointer-events: none;
}

.sspv-float__play[hidden] {
	display: none;
}

.sspv-float__play svg {
	width: 18px;
	height: 18px;
	fill: var(--sspv-gold);
	margin-left: 2px;
}

.sspv-embed {
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 16;
	max-height: 74vh;
	background: #000;
}

.sspv-embed[hidden] {
	display: none;
}

.sspv-embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.sspv-modal__stage video[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.sspv-float,
	.sspv-pill,
	.sspv-modal__overlay,
	.sspv-modal__inner,
	.sspv-dot {
		animation: none !important;
		transition: none !important;
	}
}

/* ------------------------------------------------------------------ */
/* Video commerce (v1.3)                                               */
/* ------------------------------------------------------------------ */

.sspv-spots {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 3;
}

.sspv-spot-marker {
	position: absolute;
	transform: translate(-50%, -50%);
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 8px;
}

.sspv-spot-marker[hidden] {
	display: none;
}

.sspv-spot-marker__dot {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	border-radius: 50%;
	background: var(--sspv-gold);
	box-shadow: 0 0 0 4px rgba(201, 168, 76, .3);
	animation: sspv-pulse 2s ease-out infinite;
}

@keyframes sspv-pulse {
	0%   { box-shadow: 0 0 0 3px rgba(201, 168, 76, .45); }
	70%  { box-shadow: 0 0 0 12px rgba(201, 168, 76, 0); }
	100% { box-shadow: 0 0 0 3px rgba(201, 168, 76, 0); }
}

.sspv-spot-marker.is-added .sspv-spot-marker__dot {
	background: #4A8C6A;
	animation: none;
}

.sspv-spot-marker__card {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 190px;
	padding: 6px 10px 6px 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .95);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity .2s ease, transform .2s ease;
	pointer-events: none;
}

.sspv-spot-marker:hover .sspv-spot-marker__card,
.sspv-spot-marker:focus-visible .sspv-spot-marker__card {
	opacity: 1;
	transform: translateX(0);
}

.sspv-spot-marker__card img {
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	object-fit: cover;
	border-radius: 50%;
}

.sspv-spot-marker__meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
	text-align: left;
}

.sspv-spot-marker__name {
	font-size: 12px;
	font-weight: 600;
	color: var(--sspv-forest);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sspv-spot-marker__price {
	font-size: 11px;
	color: #3A3A3C;
}

/* Buy bar */

.sspv-buy {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.sspv-buy__btn {
	flex: 1 1 auto;
	max-width: 320px;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--sspv-gold);
	color: var(--sspv-forest);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: filter .2s ease;
}

.sspv-buy__btn:hover:not(:disabled) {
	filter: brightness(1.06);
}

.sspv-buy__btn:disabled {
	opacity: .75;
	cursor: default;
}

.sspv-buy__cart {
	color: var(--sspv-cream);
	font-size: 13px;
	text-decoration: underline;
	white-space: nowrap;
}

.sspv-buy__cart[hidden] {
	display: none;
}

/* Offer bar */

.sspv-offerbar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	width: 100%;
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba(201, 168, 76, .16);
	border: 1px solid rgba(201, 168, 76, .5);
}

.sspv-offerbar[hidden] {
	display: none;
}

.sspv-offerbar__text {
	color: var(--sspv-gold-lt, #F0DFA0);
	font-size: 13px;
	font-weight: 600;
}

.sspv-offerbar__timer {
	font-variant-numeric: tabular-nums;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.sspv-offerbar__btn {
	padding: 5px 12px;
	border: 0;
	border-radius: 999px;
	background: var(--sspv-gold);
	color: var(--sspv-forest);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.sspv-offerbar__btn[hidden] {
	display: none;
}

/* Related strip */

.sspv-related[hidden] {
	display: none;
}

.sspv-related {
	width: 100%;
}

.sspv-related__title {
	margin: 0 0 8px;
	color: var(--sspv-cream);
	font-size: 13px;
	text-align: center;
	opacity: .85;
}

.sspv-related__strip {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 4px;
	scrollbar-width: thin;
}

.sspv-card {
	flex: 0 0 132px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px;
	border-radius: var(--sspv-r);
	background: rgba(255, 255, 255, .95);
}

.sspv-card img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

.sspv-card__name {
	font-size: 12px;
	font-weight: 600;
	color: var(--sspv-forest);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sspv-card__price {
	font-size: 12px;
	color: #3A3A3C;
}

.sspv-card__btn {
	margin-top: 2px;
	padding: 6px 8px;
	border: 0;
	border-radius: 999px;
	background: var(--sspv-forest);
	color: var(--sspv-cream);
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
}

@media (max-width: 1023px) {
	.sspv-spot-marker__card {
		max-width: 150px;
	}

	.sspv-buy__btn {
		font-size: 14px;
		padding: 11px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sspv-spot-marker__dot {
		animation: none !important;
	}
}

/* Native <video> created by the player adapter. */
.sspv-video {
	width: 100%;
	height: 100%;
	display: block;
	background: #000;
}

/* ------------------------------------------------------------------ */
/* Portrait 9:16 geometry (v1.5.2)                                     */
/*                                                                     */
/* Reels are shot vertical, so both players are portrait. Each box is  */
/* sized from ONE dimension plus aspect-ratio — never width AND height */
/* — so an earlier rule can't quietly break the ratio and letterbox    */
/* the video. This block is last, so it wins.                          */
/* ------------------------------------------------------------------ */

.sspv-float {
	width: 158px;
	height: auto;
	aspect-ratio: 9 / 16;
}

/* The popup is driven by HEIGHT: the tallest box that fits the viewport,
   with width derived from it. That keeps a true 9:16 frame on any screen
   and leaves room for the caption and buy button underneath. */
.sspv-modal__inner {
	width: auto;
	max-width: 100%;
}

.sspv-modal__stage {
	position: relative;
	width: auto;
	max-width: 100%;
	border-radius: var(--r-xl, 1.125rem);
	overflow: hidden;
	background: #000;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.sspv-modal__mount {
	position: relative;
	inset: auto;
	height: min(62vh, 620px);
	width: auto;
	max-width: 100%;
	max-height: none;
	aspect-ratio: 9 / 16;
	background: #000;
}

.sspv-modal__mount video,
.sspv-modal__mount .sspv-embed,
.sspv-modal__mount > * {
	width: 100%;
	height: 100%;
	display: block;
	border: 0;
}

/* Popup shows the whole frame — a landscape video letterboxes rather than
   being cropped. The floating teaser crops instead, to stay filled. */
.sspv-modal__mount video {
	object-fit: contain;
}

.sspv-float__mount video {
	object-fit: cover;
}

@media (max-width: 1023px) {
	.sspv-float {
		width: 120px;
		height: auto;
		aspect-ratio: 9 / 16;
	}

	.sspv-modal__mount {
		height: min(58vh, 540px);
	}
}
