/**
 * Venue product-page countdown timer — visual port of the tiquetera-theme
 * `_checkout-timer.scss`. The theme's SCSS tokens ($c-primary-700,
 * $space-m, $fs-h4, …) all resolve to WordPress preset CSS custom
 * properties exposed globally by the theme's theme.json, so we reference
 * the exact same variables here for a 1:1 look without the theme's build.
 *
 * Fallback values are provided so the timer still reads correctly if a
 * theme without those presets ever loads the plugin.
 */

.checkout-timer {
	background: var(--wp--preset--color--primary-700, #0a2540);
	color: var(--wp--preset--color--neutral-0, #fff);
	padding: var(--wp--preset--spacing--m, 16px);
	border-radius: var(--wp--custom--border-radius--m, 10px);
	margin-bottom: var(--wp--preset--spacing--l, 24px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
	transition: all 0.3s ease;
}

.checkout-timer__container {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--wp--preset--spacing--s, 12px);
}
@media (min-width: 1024px) {
	.checkout-timer__container {
		flex-direction: row;
		text-align: left;
	}
}

.checkout-timer__icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	backdrop-filter: blur(10px);
}
.checkout-timer__icon svg {
	width: 20px;
	height: 20px;
	color: var(--wp--preset--color--neutral-0, #fff);
}
@media (min-width: 1024px) {
	.checkout-timer__icon {
		width: 48px;
		height: 48px;
	}
	.checkout-timer__icon svg {
		width: 24px;
		height: 24px;
	}
}

.checkout-timer__content {
	flex: 1;
}

.checkout-timer__label {
	margin: 0 0 var(--wp--preset--spacing--s, 12px) 0;
	font-size: var(--wp--preset--font-size--caption, 14px);
	font-weight: 600;
	font-family: var(--wp--preset--font-family--poppins, inherit);
	opacity: 0.95;
	letter-spacing: 0.3px;
}
@media (min-width: 1024px) {
	.checkout-timer__label {
		font-size: var(--wp--preset--font-size--body-small, 15px);
		margin-bottom: var(--wp--preset--spacing--xs, 8px);
	}
}

.checkout-timer__display {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--xs, 8px);
}

.checkout-timer__time {
	font-size: var(--wp--preset--font-size--h-4, clamp(22px, 3vw, 28px));
	font-weight: 700;
	font-family: var(--wp--preset--font-family--inter, inherit);
	letter-spacing: 2px;
	text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	line-height: 1;
}
@media (min-width: 1024px) {
	.checkout-timer__time {
		font-size: var(--wp--preset--font-size--h-2, clamp(32px, 5vw, 48px));
	}
}

.checkout-timer__minutes,
.checkout-timer__seconds {
	display: inline-block;
	min-width: 2.5ch;
	text-align: center;
}

.checkout-timer__warning {
	margin-top: var(--wp--preset--spacing--s, 12px);
	padding: var(--wp--preset--spacing--xs, 8px) var(--wp--preset--spacing--s, 12px);
	background-color: var(--wp--preset--color--warning-600, #d97706);
	border-radius: var(--wp--custom--border-radius--s, 6px);
	display: none;
}
.checkout-timer__warning p {
	margin: 0;
	font-size: var(--wp--preset--font-size--caption, 14px);
	font-weight: 500;
	color: var(--wp--preset--color--neutral-0, #fff);
}
@media (min-width: 1024px) {
	.checkout-timer__warning p {
		font-size: var(--wp--preset--font-size--body-small, 15px);
	}
}
.checkout-timer__warning.is-visible {
	display: block;
}

/* Warning state (2 minutes or less) */
.checkout-timer--warning {
	background: var(--wp--preset--color--primary-700, #0a2540);
}
.checkout-timer--warning .checkout-timer__icon {
	background: var(--wp--preset--color--warning-600, #d97706);
	animation: vmTimerWarningPulse 2s ease-in-out infinite;
}

/* Critical state (1 minute or less) */
.checkout-timer--critical {
	background: var(--wp--preset--color--primary-700, #0a2540);
}
.checkout-timer--critical .checkout-timer__time {
	color: var(--wp--preset--color--danger-600, #dc2626);
	animation: vmTimerBlink 1s ease-in-out infinite;
}
.checkout-timer--critical .checkout-timer__icon {
	background: var(--wp--preset--color--danger-600, #dc2626);
	animation: vmTimerCriticalPulse 1s ease-in-out infinite;
}

/* Expired state */
.checkout-timer--expired {
	background: var(--wp--preset--color--danger-500, #ef4444);
	opacity: 0.7;
}
.checkout-timer--expired .checkout-timer__time {
	color: var(--wp--preset--color--neutral-0, #fff);
}

/* Expiration notice */
.checkout-timer__expiration-notice {
	margin-bottom: var(--wp--preset--spacing--l, 24px);
	padding: var(--wp--preset--spacing--s, 12px);
	background: color-mix(in srgb, var(--wp--preset--color--danger-500, #ef4444) 10%, transparent);
	border: 1px solid var(--wp--preset--color--danger-500, #ef4444);
	border-radius: var(--wp--custom--border-radius--s, 6px);
	color: var(--wp--preset--color--danger-600, #dc2626);
	font-weight: 500;
	font-size: var(--wp--preset--font-size--body-small, 15px);
	animation: vmTimerSlideDown 0.3s ease-out;
}
@media (min-width: 1024px) {
	.checkout-timer__expiration-notice {
		padding: var(--wp--preset--spacing--s, 12px) var(--wp--preset--spacing--m, 16px);
		font-size: var(--wp--preset--font-size--body, 17px);
	}
}

/* Animations (prefixed to avoid clashing with the theme's keyframes). */
@keyframes vmTimerWarningPulse {
	0%, 100% { box-shadow: 0 10px 30px var(--wp--preset--color--warning-600, #d97706); }
	50%      { box-shadow: 0 10px 40px var(--wp--preset--color--warning-600, #d97706); }
}
@keyframes vmTimerCriticalPulse {
	0%, 100% { box-shadow: 0 10px 30px var(--wp--preset--color--danger-600, #dc2626); }
	50%      { box-shadow: 0 10px 50px var(--wp--preset--color--danger-600, #dc2626); }
}
@keyframes vmTimerBlink {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.7; }
}
@keyframes vmTimerSlideDown {
	from { opacity: 0; transform: translateY(-20px); }
	to   { opacity: 1; transform: translateY(0); }
}
