/**
 * ShopKart Reels Slider — Widget Styles
 */

.sksa-reels {
	width: 100%;
	margin: 0;
	padding: 0;
}

.sksa-reels .swiper-wrapper {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sksa-reels .swiper-slide {
	aspect-ratio: 9/16;
	background: #000;
	overflow: hidden;
	position: relative;
	height: auto;
	cursor: pointer;
}

/* Video — fills the slide, no crop concerns since reels are pre-sized */
.sksa-reel-media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: #000;
}

/* Loader — visible until video is ready to play */
.sksa-reel-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
	z-index: 1;
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.3s ease;
}
.sksa-reel-loader--hidden { opacity: 0; }
.sksa-reel-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(255,255,255,0.2);
	border-top-color: rgba(255,255,255,0.85);
	border-radius: 50%;
	animation: sksa-reel-spin 0.8s linear infinite;
}
@keyframes sksa-reel-spin {
	to { transform: rotate(360deg); }
}

/* Bottom gradient for overlay legibility */
.sksa-reel-gradient {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 55%;
	background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
	pointer-events: none;
	z-index: 2;
}

/* Share button — top right */
.sksa-reel-share {
	position: absolute;
	top: 8px;
	right: 8px;
	background: rgba(0,0,0,0.5);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border: none;
	color: #fff;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
	padding: 0;
	transition: transform 0.15s, background 0.15s;
	-webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
	.sksa-reel-share:hover { background: rgba(255,255,255,0.2); }
}
.sksa-reel-share:active { transform: scale(0.92); }
.sksa-reel-share svg { width: 14px; height: 14px; }

/* Mute toggle — bottom right */
.sksa-reel-mute {
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(0,0,0,0.5);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border: none;
	color: #fff;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
	padding: 0;
	-webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
	.sksa-reel-mute:hover { background: rgba(255,255,255,0.2); }
}
.sksa-reel-mute:active { transform: scale(0.92); }
.sksa-reel-mute svg { width: 13px; height: 13px; }

/* Product overlay — bottom left */
.sksa-reel-product {
	position: absolute;
	left: 8px;
	right: 44px;
	bottom: 8px;
	z-index: 4;
}
.sksa-reel-product-row {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 6px;
}
.sksa-reel-product-thumb {
	width: 32px;
	height: 32px;
	border-radius: 7px;
	object-fit: cover;
	flex-shrink: 0;
	background: #333;
}
.sksa-reel-product-info {
	flex: 1;
	min-width: 0;
}
.sksa-reel-product-title {
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}
.sksa-reel-product-price {
	font-size: 11px;
	color: rgba( 255, 255, 255, 0.9 );
	line-height: 1.3;
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
/* WC's get_price_html() output — strip its padding, style for compact display */
.sksa-reel-product-price del {
	opacity: 0.55;
	text-decoration: line-through;
	margin-right: 4px;
	font-size: 10px;
}
.sksa-reel-product-price ins {
	text-decoration: none;
	font-weight: 700;
	background: transparent;
}
.sksa-reel-product-price .woocommerce-Price-amount,
.sksa-reel-product-price bdi {
	font-weight: 600;
}
.sksa-reel-product-cta {
	display: block;
	background: #fff;
	color: #000;
	padding: 6px 10px;
	border-radius: 100px;
	font-size: 11px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	transition: transform 0.15s;
	-webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
	.sksa-reel-product-cta:hover { color: #000; }
}
.sksa-reel-product-cta:active { transform: scale(0.96); }

/* Progress bar — bottom edge, above gradient */
.sksa-reel-progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: rgba(255,255,255,0.2);
	z-index: 3;
	pointer-events: none;
}
.sksa-reel-progress-bar {
	height: 100%;
	width: 100%;
	background: #fff;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.1s linear;
}


/* ============ Pure Chevron Arrows (clean minimal) ============
 * No background, no border — just chevron with subtle drop shadow
 * for visibility against any video content.
 */
.sksa-reels-prev,
.sksa-reels-next {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	background: transparent;
	border: none;
	color: #fff;
	width: 32px;
	height: 32px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	padding: 0;
	filter: drop-shadow( 0 1px 3px rgba( 0, 0, 0, 0.6 ) );
	transition: transform 0.18s ease, opacity 0.2s;
	-webkit-tap-highlight-color: transparent;
}
.sksa-reels-prev { left: 8px; }
.sksa-reels-next { right: 8px; }
.sksa-reels-prev svg,
.sksa-reels-next svg {
	width: 24px;
	height: 24px;
}
@media (hover: hover) {
	.sksa-reels-prev:hover,
	.sksa-reels-next:hover {
		transform: translateY( -50% ) scale( 1.15 );
	}
}
.sksa-reels-prev:active,
.sksa-reels-next:active {
	transform: translateY( -50% ) scale( 0.92 );
}
.sksa-reels-prev.swiper-button-disabled,
.sksa-reels-next.swiper-button-disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

/* ============ AGGRESSIVE TAP STATE FIX ============
 * Theme/Elementor often forces a brand color on button :focus after tap.
 * Force-reset all interactive button states on touch devices.
 */

/* Reset focus outlines and remove tap highlight on ALL reel buttons */
.sksa-reel-share,
.sksa-reel-mute,
.sksa-reel-product-cta,
.sksa-reels-prev,
.sksa-reels-next {
	-webkit-tap-highlight-color: transparent !important;
	outline: none !important;
}
.sksa-reel-share:focus,
.sksa-reel-mute:focus,
.sksa-reel-product-cta:focus,
.sksa-reels-prev:focus,
.sksa-reels-next:focus,
.sksa-reel-share:focus-visible,
.sksa-reel-mute:focus-visible,
.sksa-reel-product-cta:focus-visible,
.sksa-reels-prev:focus-visible,
.sksa-reels-next:focus-visible {
	outline: none !important;
	box-shadow: none !important;
}

/* Touch-only devices: explicitly lock background to base state */
@media (hover: none) {
	button.sksa-reels-prev,
	button.sksa-reels-prev:hover,
	button.sksa-reels-prev:focus,
	button.sksa-reels-prev:active,
	button.sksa-reels-next,
	button.sksa-reels-next:hover,
	button.sksa-reels-next:focus,
	button.sksa-reels-next:active {
		background: transparent !important;
		background-color: transparent !important;
		border: none !important;
	}

	button.sksa-reel-share,
	button.sksa-reel-share:hover,
	button.sksa-reel-share:focus,
	button.sksa-reel-mute,
	button.sksa-reel-mute:hover,
	button.sksa-reel-mute:focus {
		background: rgba( 0, 0, 0, 0.5 ) !important;
	}

	a.sksa-reel-product-cta,
	a.sksa-reel-product-cta:hover,
	a.sksa-reel-product-cta:focus {
		background: #fff !important;
		color: #000 !important;
	}
}

/* ============ CHROME FOCUS FIX (v1.6.5) ============
 * Chrome retains :focus on tap more aggressively than Firefox.
 * Higher-specificity selectors + pseudo-element reset to beat theme rules.
 */
.sksa-reels.swiper button.sksa-reels-prev,
.sksa-reels.swiper button.sksa-reels-next,
.sksa-reels.swiper button.sksa-reels-prev:hover,
.sksa-reels.swiper button.sksa-reels-next:hover,
.sksa-reels.swiper button.sksa-reels-prev:focus,
.sksa-reels.swiper button.sksa-reels-next:focus,
.sksa-reels.swiper button.sksa-reels-prev:focus-visible,
.sksa-reels.swiper button.sksa-reels-next:focus-visible,
.sksa-reels.swiper button.sksa-reels-prev:active,
.sksa-reels.swiper button.sksa-reels-next:active {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	border-color: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}
.sksa-reels.swiper button.sksa-reels-prev::before,
.sksa-reels.swiper button.sksa-reels-prev::after,
.sksa-reels.swiper button.sksa-reels-next::before,
.sksa-reels.swiper button.sksa-reels-next::after {
	display: none !important;
	content: none !important;
}

.sksa-reels.swiper button.sksa-reel-share,
.sksa-reels.swiper button.sksa-reel-share:hover,
.sksa-reels.swiper button.sksa-reel-share:focus,
.sksa-reels.swiper button.sksa-reel-share:focus-visible,
.sksa-reels.swiper button.sksa-reel-mute,
.sksa-reels.swiper button.sksa-reel-mute:hover,
.sksa-reels.swiper button.sksa-reel-mute:focus,
.sksa-reels.swiper button.sksa-reel-mute:focus-visible {
	background: rgba( 0, 0, 0, 0.5 ) !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.sksa-reels.swiper a.sksa-reel-product-cta,
.sksa-reels.swiper a.sksa-reel-product-cta:hover,
.sksa-reels.swiper a.sksa-reel-product-cta:focus,
.sksa-reels.swiper a.sksa-reel-product-cta:focus-visible {
	background: #fff !important;
	color: #000 !important;
	box-shadow: none !important;
	outline: none !important;
}

/* ============ Center Pause/Play Icon (Glass Blur Circle) ============
 * Shows ▶ triangle when user pauses (persistent), ⏸ bars on resume (brief flash).
 * Visual feedback for explicit user tap actions only — not auto-pause/play.
 */
.sksa-reel-center-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% ) scale( 0.7 );
	z-index: 5;
	/* Size scales with reel width — icon stays proportional regardless of
	 * how many reels per view (1 on mobile, 2-4 on desktop). Min/max clamps
	 * prevent it from getting too tiny or too large at extreme sizes. */
	width: 22%;
	aspect-ratio: 1 / 1;
	min-width: 28px;
	max-width: 72px;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.45 );
	-webkit-backdrop-filter: blur( 12px );
	backdrop-filter: blur( 12px );
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}
.sksa-reel-center-icon.show {
	opacity: 1;
	transform: translate( -50%, -50% ) scale( 1 );
}
.sksa-reel-center-icon.flash {
	animation: sksa-icon-flash 0.7s ease forwards;
}
@keyframes sksa-icon-flash {
	0% { opacity: 0; transform: translate( -50%, -50% ) scale( 0.7 ); }
	20% { opacity: 1; transform: translate( -50%, -50% ) scale( 1.1 ); }
	40% { opacity: 1; transform: translate( -50%, -50% ) scale( 1 ); }
	100% { opacity: 0; transform: translate( -50%, -50% ) scale( 1.2 ); }
}
.sksa-reel-center-icon svg {
	width: 45%;
	height: 45%;
}

/* ============================================================
 * Randomize: pre-init hide (same pattern as image slider)
 * ============================================================ */

.sksa-reels[data-sksa-randomize="1"]:not(.sksa-rand-ready) {
	opacity: 0;
}

.sksa-reels[data-sksa-randomize="1"].sksa-rand-ready {
	opacity: 1;
	transition: opacity 0.25s ease;
}
