/**
 * IPTV Product Options — product display.
 *
 * Statistics, highlights and bundle offers.
 * Extends the .iptvpo-fe contract established in frontend.css; nothing here is
 * redefined, only added. Logical properties keep RTL working.
 */

.iptvpo-display {
	--iptvpo-fe-accent: var(--iptvpo-accent, #5b6cff);
	--iptvpo-fe-accent-rgb: var(--iptvpo-accent-rgb, 91, 108, 255);
	--iptvpo-fe-radius: 18px;
	--iptvpo-fe-line: rgba(125, 125, 145, 0.18);
	--iptvpo-fe-surface: rgba(255, 255, 255, 0.55);
	--iptvpo-fe-shadow: 0 2px 8px rgba(20, 22, 45, 0.05), 0 12px 30px rgba(20, 22, 45, 0.06);
	--iptvpo-fe-ease: cubic-bezier(0.22, 1, 0.36, 1);

	display: grid;
	gap: 1.4em;
	margin-block: 1.8em;
	clear: both;
}

.iptvpo-display *,
.iptvpo-display *::before,
.iptvpo-display *::after {
	box-sizing: border-box;
}

.iptvpo-display__section {
	margin: 0;
}

.iptvpo-display .iptvpo-fe__title {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: 0 0 0.85em;
	font-size: 1.02em;
	font-weight: 650;
	letter-spacing: -0.01em;
	line-height: 1.3;
	color: inherit;
}

.iptvpo-fe__title-icon {
	display: grid;
	place-items: center;
	inline-size: 1.9em;
	block-size: 1.9em;
	flex: none;
	border-radius: 0.6em;
	color: var(--iptvpo-fe-accent);
	background: rgba(var(--iptvpo-fe-accent-rgb), 0.1);
}

/* -------------------------------------------------------------------------
 * Statistics
 * ---------------------------------------------------------------------- */

.iptvpo-fe-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.iptvpo-stat-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 16px 12px;
	text-align: center;
	list-style: none;
	border: 1px solid var(--iptvpo-fe-line);
	border-radius: var(--iptvpo-fe-radius);
	background: var(--iptvpo-fe-surface);
	backdrop-filter: blur(16px) saturate(170%);
	-webkit-backdrop-filter: blur(16px) saturate(170%);
	box-shadow: var(--iptvpo-fe-shadow);
	transition: transform 0.3s var(--iptvpo-fe-ease), box-shadow 0.3s var(--iptvpo-fe-ease);
}

.iptvpo-stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(20, 22, 45, 0.08), 0 20px 44px rgba(20, 22, 45, 0.09);
}

.iptvpo-stat-card__icon {
	display: grid;
	place-items: center;
	inline-size: 40px;
	block-size: 40px;
	margin-block-end: 4px;
	border-radius: 12px;
	color: var(--iptvpo-fe-accent);
	background: rgba(var(--iptvpo-fe-accent-rgb), 0.1);
}

.iptvpo-stat-card__value {
	font-size: 1.28em;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.iptvpo-stat-card__label {
	font-size: 0.76em;
	font-weight: 550;
	line-height: 1.35;
	opacity: 0.68;
}

.iptvpo-stat-card.is-adult .iptvpo-stat-card__icon {
	color: #d4557a;
	background: rgba(212, 85, 122, 0.12);
}

/* Highlights ----------------------------------------------------------- */

.iptvpo-highlights {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.iptvpo-highlight {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 6px 13px;
	list-style: none;
	font-size: 0.78em;
	font-weight: 570;
	border-radius: 999px;
	border: 1px solid var(--iptvpo-fe-line);
	background: var(--iptvpo-fe-surface);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.iptvpo-highlight svg {
	flex: none;
	color: var(--iptvpo-fe-accent);
}

/* -------------------------------------------------------------------------
 * Bundle offers
 * ---------------------------------------------------------------------- */

.iptvpo-bundle-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(262px, 1fr));
	gap: 12px;
}

.iptvpo-offer {
	--iptvpo-offer-color: var(--iptvpo-fe-accent);

	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 18px;
	overflow: hidden;
	border: 1px solid color-mix(in srgb, var(--iptvpo-offer-color) 26%, transparent);
	border-radius: calc(var(--iptvpo-fe-radius) + 4px);
	background:
		linear-gradient(140deg,
			color-mix(in srgb, var(--iptvpo-offer-color) 12%, transparent),
			color-mix(in srgb, var(--iptvpo-offer-color) 3%, transparent)),
		var(--iptvpo-fe-surface);
	backdrop-filter: blur(18px) saturate(175%);
	-webkit-backdrop-filter: blur(18px) saturate(175%);
	box-shadow: var(--iptvpo-fe-shadow);
	transition: transform 0.3s var(--iptvpo-fe-ease), box-shadow 0.3s var(--iptvpo-fe-ease);
}

/* Fallback for browsers without color-mix(). */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.iptvpo-offer {
		border-color: var(--iptvpo-fe-line);
		background: var(--iptvpo-fe-surface);
	}
}

.iptvpo-offer:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(20, 22, 45, 0.1), 0 24px 50px rgba(20, 22, 45, 0.11);
}

.iptvpo-offer.is-expired {
	opacity: 0.55;
	filter: grayscale(0.6);
}

.iptvpo-offer__badge {
	position: absolute;
	inset-block-start: 14px;
	inset-inline-end: 14px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.66em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	background: var(--iptvpo-offer-color);
	box-shadow: 0 3px 10px color-mix(in srgb, var(--iptvpo-offer-color) 45%, transparent);
	animation: iptvpo-badge-pulse 2.6s var(--iptvpo-fe-ease) infinite;
}

@keyframes iptvpo-badge-pulse {
	0%, 100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.055);
	}
}

.iptvpo-offer__icon {
	display: grid;
	place-items: center;
	inline-size: 46px;
	block-size: 46px;
	flex: none;
	border-radius: 14px;
	color: #fff;
	background: var(--iptvpo-offer-color);
	box-shadow: 0 6px 18px color-mix(in srgb, var(--iptvpo-offer-color) 42%, transparent);
	animation: iptvpo-float 4.5s var(--iptvpo-fe-ease) infinite;
}

@keyframes iptvpo-float {
	0%, 100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(-4px);
	}
}

.iptvpo-offer__body {
	inline-size: 100%;
}

.iptvpo-offer__title {
	margin: 0;
	font-size: 1.02em;
	font-weight: 680;
	letter-spacing: -0.015em;
	line-height: 1.25;
	color: inherit;
}

.iptvpo-offer__subtitle {
	margin: 3px 0 0;
	font-size: 0.84em;
	line-height: 1.45;
	opacity: 0.72;
}

.iptvpo-offer__expired {
	margin: 8px 0 0;
	font-size: 0.78em;
	font-weight: 600;
	opacity: 0.7;
}

/* Countdown ------------------------------------------------------------ */

.iptvpo-countdown {
	display: flex;
	gap: 6px;
	margin-block-start: 12px;
}

.iptvpo-countdown__part {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	min-inline-size: 44px;
	padding: 6px 4px;
	border-radius: 11px;
	background: rgba(255, 255, 255, 0.62);
	border: 1px solid var(--iptvpo-fe-line);
}

.iptvpo-countdown__num {
	font-size: 0.98em;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	color: var(--iptvpo-offer-color);
}

.iptvpo-countdown__label {
	font-size: 0.6em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.6;
}

/* Offer button --------------------------------------------------------- */

.iptvpo-offer__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	inline-size: 100%;
	margin-block-start: 4px;
	padding: 11px 18px;
	border: 0;
	border-radius: 999px;
	font-size: 0.86em;
	font-weight: 640;
	font-family: inherit;
	line-height: 1.2;
	color: #fff;
	background: var(--iptvpo-offer-color);
	cursor: pointer;
	box-shadow: 0 5px 16px color-mix(in srgb, var(--iptvpo-offer-color) 40%, transparent);
	transition: transform 0.2s var(--iptvpo-fe-ease), box-shadow 0.2s var(--iptvpo-fe-ease), filter 0.2s var(--iptvpo-fe-ease);
}

.iptvpo-offer__btn:hover {
	filter: brightness(1.06);
	transform: translateY(-1px);
	box-shadow: 0 8px 22px color-mix(in srgb, var(--iptvpo-offer-color) 50%, transparent);
}

.iptvpo-offer__btn:active {
	transform: scale(0.98);
}

.iptvpo-offer__btn:focus-visible {
	outline: 2px solid var(--iptvpo-offer-color);
	outline-offset: 3px;
}

.iptvpo-offer.is-expired .iptvpo-offer__btn {
	pointer-events: none;
}

/* -------------------------------------------------------------------------
 * Responsive, dark mode & accessibility
 * ---------------------------------------------------------------------- */

@media screen and (max-width: 600px) {
	.iptvpo-fe-stats-grid {
		grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
		gap: 8px;
	}

	.iptvpo-stat-card {
		padding: 13px 8px;
	}

	.iptvpo-stat-card__icon {
		inline-size: 34px;
		block-size: 34px;
	}

	.iptvpo-bundle-grid {
		grid-template-columns: 1fr;
	}
}

/*
 * Dark styling is opt-in from the THEME, not from the visitor's operating
 * system. Keying off prefers-color-scheme painted white-on-white on light
 * storefronts whenever the visitor had their phone in dark mode.
 */
.iptvpo-fe-dark .iptvpo-display,
[data-theme="dark"] .iptvpo-display {
	--iptvpo-fe-line: rgba(255, 255, 255, 0.14);
	--iptvpo-fe-surface: rgba(255, 255, 255, 0.06);
	--iptvpo-fe-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 12px 30px rgba(0, 0, 0, 0.3);
}

.iptvpo-fe-dark .iptvpo-countdown__part,
[data-theme="dark"] .iptvpo-countdown__part {
	background: rgba(255, 255, 255, 0.08);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.iptvpo-stat-card,
	.iptvpo-offer,
	.iptvpo-highlight {
		background: rgba(255, 255, 255, 0.92);
	}
}

@media (prefers-reduced-motion: reduce) {
	.iptvpo-stat-card,
	.iptvpo-offer,
	.iptvpo-offer__btn {
		transition: none;
	}

	.iptvpo-stat-card:hover,
	.iptvpo-offer:hover,
	.iptvpo-offer__btn:hover {
		transform: none;
	}

	.iptvpo-offer__badge,
	.iptvpo-offer__icon {
		animation: none;
	}
}

/* -------------------------------------------------------------------------
 * Settings-driven surface variants (1.3.0)
 * ---------------------------------------------------------------------- */

/* Card gap is configurable from Settings → Frontend. */
.iptvpo-fe-stats-grid,
.iptvpo-bundle-grid {
	gap: var(--iptvpo-fe-gap, 10px);
}

/* Animation: none ------------------------------------------------------- */

.iptvpo-anim-none .iptvpo-stat-card,
.iptvpo-anim-none .iptvpo-offer,
.iptvpo-anim-none .iptvpo-offer__btn,
.iptvpo-anim-none .iptvpo-fe-platform,
.iptvpo-anim-none .iptvpo-fe-feature {
	transition: none;
}

.iptvpo-anim-none .iptvpo-stat-card:hover,
.iptvpo-anim-none .iptvpo-offer:hover,
.iptvpo-anim-none .iptvpo-fe-platform:hover,
.iptvpo-anim-none .iptvpo-fe-feature:hover {
	transform: none;
}

.iptvpo-anim-none .iptvpo-offer__badge,
.iptvpo-anim-none .iptvpo-offer__icon {
	animation: none;
}

/* Animation: fade ------------------------------------------------------- */

.iptvpo-anim-fade .iptvpo-stat-card:hover,
.iptvpo-anim-fade .iptvpo-offer:hover,
.iptvpo-anim-fade .iptvpo-fe-platform:hover,
.iptvpo-anim-fade .iptvpo-fe-feature:hover {
	transform: none;
	opacity: 0.86;
}

.iptvpo-anim-fade .iptvpo-offer__icon {
	animation: none;
}

/* Animation: scale ------------------------------------------------------ */

.iptvpo-anim-scale .iptvpo-stat-card:hover,
.iptvpo-anim-scale .iptvpo-offer:hover,
.iptvpo-anim-scale .iptvpo-fe-platform:hover,
.iptvpo-anim-scale .iptvpo-fe-feature:hover {
	transform: scale(1.035);
}

.iptvpo-anim-scale .iptvpo-offer__icon {
	animation: none;
}

/* Animation: glass hover ------------------------------------------------ */

.iptvpo-anim-glass .iptvpo-stat-card:hover,
.iptvpo-anim-glass .iptvpo-offer:hover,
.iptvpo-anim-glass .iptvpo-fe-platform:hover,
.iptvpo-anim-glass .iptvpo-fe-feature:hover {
	transform: none;
	background: rgba(255, 255, 255, 0.88);
	border-color: rgba(var(--iptvpo-fe-accent-rgb), 0.4);
	box-shadow:
		0 8px 22px rgba(var(--iptvpo-fe-accent-rgb), 0.16),
		0 24px 54px rgba(20, 22, 45, 0.1);
}

.iptvpo-anim-glass .iptvpo-offer__icon {
	animation: none;
}

/* Glass effect disabled ------------------------------------------------- */

.iptvpo-no-glass .iptvpo-stat-card,
.iptvpo-no-glass .iptvpo-offer,
.iptvpo-no-glass .iptvpo-highlight,
.iptvpo-no-glass .iptvpo-fe-platform,
.iptvpo-no-glass .iptvpo-fe-feature {
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	background: #fff;
}

/* Responsive disabled --------------------------------------------------- */

.iptvpo-no-responsive .iptvpo-fe-stats-grid {
	grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.iptvpo-no-responsive .iptvpo-bundle-grid {
	grid-template-columns: repeat(auto-fit, minmax(262px, 1fr));
}

/* -------------------------------------------------------------------------
 * Accessibility
 * ---------------------------------------------------------------------- */

.iptvpo-display :focus-visible,
.iptvpo-fe :focus-visible {
	outline: 2px solid var(--iptvpo-fe-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

.iptvpo-sr-only {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

@media (forced-colors: active) {
	.iptvpo-stat-card,
	.iptvpo-offer,
	.iptvpo-fe-platform,
	.iptvpo-fe-feature {
		border: 1px solid CanvasText;
	}

	.iptvpo-offer__btn {
		border: 1px solid ButtonText;
	}
}

/* Tablet ---------------------------------------------------------------- */

@media screen and (min-width: 601px) and (max-width: 1024px) {
	.iptvpo-fe-stats-grid {
		grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
	}

	.iptvpo-bundle-grid {
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	}
}

/* Guarantee nothing overflows its container at any width. */
.iptvpo-display,
.iptvpo-display__section,
.iptvpo-fe-stats-grid,
.iptvpo-bundle-grid {
	max-inline-size: 100%;
	min-inline-size: 0;
}

.iptvpo-offer__title,
.iptvpo-offer__subtitle,
.iptvpo-stat-card__label {
	overflow-wrap: anywhere;
}

/* -------------------------------------------------------------------------
 * Content statistics note (1.6.1)
 * ---------------------------------------------------------------------- */

.iptvpo-stats-note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 12px 0 0;
	padding: 11px 14px;
	border: 1px solid var(--iptvpo-fe-line);
	border-radius: var(--iptvpo-fe-radius, 18px);
	background: rgba(var(--iptvpo-fe-accent-rgb), 0.05);
	font-size: 0.78em;
	line-height: 1.6;
	opacity: 0.82;
}

.iptvpo-stats-note svg {
	flex: none;
	margin-block-start: 2px;
	color: var(--iptvpo-fe-accent);
}

.iptvpo-stats-note span {
	min-inline-size: 0;
	overflow-wrap: anywhere;
}

@media screen and (max-width: 600px) {
	.iptvpo-stats-note {
		font-size: 0.74em;
		padding: 10px 12px;
	}
}
