/**
 * Woo Timer Pro — Frontend styles
 *
 * @package WooTimerPro
 */

.wtp-timer {
	--wtp-radius: 8px;
	--wtp-font: 14px;
	--wtp-primary: #6d28d9;
	--wtp-text: #ffffff;
	--wtp-bg: #f3f4f6;
	--wtp-urgent: #dc2626;
	--wtp-border-width: 0px;
	--wtp-border-color: #e5e7eb;
	--wtp-label-color: #1f2937;
	--wtp-label-size: 14px;
	--wtp-numbers-color: #ffffff;
	--wtp-numbers-bg: #6d28d9;
	--wtp-numbers-size: 22px;
	--wtp-unit-label-color: #6b7280;
	--wtp-unit-label-size: 10px;
	--wtp-progress-color: #6d28d9;
	--wtp-progress-bg: #e5e7eb;
	--wtp-progress-height: 6px;
	--wtp-progress-radius: 999px;

	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: var(--wtp-font);
	background: var(--wtp-bg);
	color: var(--wtp-text);
	border-radius: var(--wtp-radius);
	border: var(--wtp-border-width) solid var(--wtp-border-color);
	padding: 12px 14px;
	margin: 12px 0;
	box-sizing: border-box;
	line-height: 1.4;
}

.wtp-timer * { box-sizing: border-box; }

.wtp-timer__label {
	font-weight: 600;
	margin-bottom: 8px;
	text-align: center;
	color: var(--wtp-label-color);
	font-size: var(--wtp-label-size);
	letter-spacing: .2px;
}

.wtp-timer__grid {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

.wtp-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 52px;
}

.wtp-unit__num {
	display: inline-block;
	font-weight: 700;
	font-size: var(--wtp-numbers-size);
	line-height: 1;
	background: var(--wtp-numbers-bg);
	color: var(--wtp-numbers-color);
	padding: 8px 10px;
	border-radius: calc(var(--wtp-radius) * 0.7);
	min-width: 46px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	transition: background .25s ease, transform .25s ease;
}

.wtp-unit__label {
	font-size: var(--wtp-unit-label-size);
	color: var(--wtp-unit-label-color);
	opacity: .9;
	margin-top: 5px;
	text-transform: uppercase;
	letter-spacing: .6px;
	font-weight: 500;
}

.wtp-timer__expired {
	text-align: center;
	font-weight: 600;
	padding: 6px 0 2px;
}

/* ---------- Progress bar ---------- */
.wtp-progress {
	margin-top: 12px;
	height: var(--wtp-progress-height);
	background: var(--wtp-progress-bg);
	border-radius: var(--wtp-progress-radius);
	overflow: hidden;
	position: relative;
}
.wtp-progress__bar {
	display: block;
	height: 100%;
	background: var(--wtp-progress-color);
	width: 100%;
	border-radius: var(--wtp-progress-radius);
	transition: width 1s linear;
	position: relative;
}

/* Animation: shimmer (default) */
.wtp-progress--anim-shimmer .wtp-progress__bar {
	transition: width 1s ease;
	overflow: hidden;
}
.wtp-progress--anim-shimmer .wtp-progress__bar::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 40%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
	animation: wtp-progress-shimmer 1.8s linear infinite;
}
@keyframes wtp-progress-shimmer {
	0% { transform: translateX(-160%); }
	100% { transform: translateX(320%); }
}

/* Animation: pulse */
.wtp-progress--anim-pulse .wtp-progress__bar {
	transition: width 1s ease;
	animation: wtp-progress-pulse 1.6s ease-in-out infinite;
}
@keyframes wtp-progress-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .55; }
}

/* Animation: none */
.wtp-progress--anim-none .wtp-progress__bar { transition: none; }

/* Urgency */
.wtp-timer.is-urgent .wtp-unit__num {
	background: var(--wtp-urgent);
	animation: wtp-pulse 1s ease-in-out infinite;
}
.wtp-timer.is-urgent .wtp-progress__bar { background: var(--wtp-urgent); }
@keyframes wtp-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.05); }
}

/* Expired */
.wtp-timer.is-expired .wtp-timer__grid,
.wtp-timer.is-expired .wtp-progress { display: none; }
.wtp-timer.is-expired .wtp-timer__expired { display: block !important; font-size: 1.05em; opacity: .85; }

/* ---------- Presets ---------- */

/* Classic */
.wtp-timer--classic .wtp-unit__num { box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }

/* Modern */
.wtp-timer--modern {
	background: linear-gradient(135deg, rgba(109,40,217,.08), rgba(109,40,217,.02));
	backdrop-filter: blur(4px);
	border: 1px solid rgba(109,40,217,.15);
}
.wtp-timer--modern .wtp-unit__num {
	background: linear-gradient(135deg, var(--wtp-primary), #8b5cf6);
	border-radius: 12px;
	box-shadow: 0 4px 10px rgba(109,40,217,.25);
}
.wtp-timer--modern .wtp-timer__label { text-align: left; font-size: calc(var(--wtp-label-size) * 1.05); }
.wtp-timer--modern .wtp-timer__grid { justify-content: flex-start; }

/* Minimal */
.wtp-timer--minimal {
	background: transparent;
	border-left: 3px solid var(--wtp-primary);
	border-radius: 0;
	padding-left: 12px;
}
.wtp-timer--minimal .wtp-timer__grid { justify-content: flex-start; gap: 16px; }
.wtp-timer--minimal .wtp-unit__num {
	background: transparent;
	color: var(--wtp-primary);
	padding: 0;
	font-size: calc(var(--wtp-numbers-size) * 1.15);
	min-width: 0;
	box-shadow: none;
}
.wtp-timer--minimal .wtp-timer__label { text-align: left; }
.wtp-timer--minimal .wtp-unit__label { color: var(--wtp-unit-label-color); }

/* Boxed */
.wtp-timer--boxed {
	background: #fff;
	border: 2px solid var(--wtp-primary);
	padding: 14px 16px;
}
.wtp-timer--boxed .wtp-unit__num { border-radius: 6px; }
.wtp-timer--boxed .wtp-timer__label {
	color: var(--wtp-primary);
	font-weight: 700;
	text-transform: uppercase;
	font-size: calc(var(--wtp-label-size) * .8);
	letter-spacing: 1px;
}

/* Gradient */
.wtp-timer--gradient {
	background: linear-gradient(135deg, var(--wtp-primary) 0%, #8b5cf6 50%, #ec4899 100%);
	color: #fff;
	box-shadow: 0 10px 30px rgba(109, 40, 217, .25);
}
.wtp-timer--gradient .wtp-unit__num {
	background: rgba(255, 255, 255, .15);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 12px;
	color: #fff;
}
.wtp-timer--gradient .wtp-timer__label { color: rgba(255,255,255,.95); }
.wtp-timer--gradient .wtp-unit__label { color: rgba(255,255,255,.85); }
.wtp-timer--gradient .wtp-progress { background: rgba(255,255,255,.2); }
.wtp-timer--gradient .wtp-progress__bar { background: #fff; }

/* Position helpers */
.wtp-timer--pos-above_title { margin-top: 0; }

/* Responsive */
@media (max-width: 480px) {
	.wtp-timer { padding: 10px 12px; }
	.wtp-unit { min-width: 44px; }
	.wtp-unit__num {
		font-size: calc(var(--wtp-numbers-size) * .85);
		padding: 6px 8px;
		min-width: 38px;
	}
	.wtp-unit__label { font-size: max(8px, calc(var(--wtp-unit-label-size) * .9)); }
	.wtp-timer__grid { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.wtp-timer.is-urgent .wtp-unit__num { animation: none; }
	.wtp-progress__bar { transition: none; }
	.wtp-progress--anim-pulse .wtp-progress__bar { animation: none; }
	.wtp-progress--anim-shimmer .wtp-progress__bar::after { animation: none; }
}

/* =========================================================
 * Sticky floating bar
 * ========================================================= */

.wtp-sticky {
	container-type: inline-size;
	container-name: wtp-sticky-bar;

	position: fixed;
	z-index: 9999;
	background: var(--wtp-sticky-bg);
	color: var(--wtp-sticky-txt);
	width: var(--wtp-sticky-w, 300px);
	max-width: calc(100vw - 24px);
	padding: 14px;
	border-radius: var(--wtp-sticky-r, 14px);
	box-sizing: border-box;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
	justify-content: center;
}
.wtp-sticky[hidden] { display: none !important; }
.wtp-sticky.has-shadow { box-shadow: 0 20px 45px rgba(15, 23, 42, .18), 0 4px 12px rgba(15, 23, 42, .08); }

/* Sticky timer override */
.wtp-sticky .wtp-timer {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	font-size: var(--wtp-sticky-label-size, 14px);
}
.wtp-sticky .wtp-timer__label {
	font-size: var(--wtp-sticky-label-size, 14px);
	margin-bottom: 6px;
	text-align: center;
}
.wtp-sticky .wtp-unit {
	min-width: 0;
}
.wtp-sticky .wtp-unit__num {
	font-size: var(--wtp-sticky-numbers-size, 18px);
	padding: 5px 8px;
	min-width: 32px;
	border-radius: 8px;
}
.wtp-sticky .wtp-unit__label {
	font-size: var(--wtp-sticky-unit-size, 10px);
	margin-top: 3px;
}
.wtp-sticky .wtp-timer__grid {
	gap: 6px;
	justify-content: center;
}
.wtp-sticky .wtp-progress {
	margin-top: 8px;
}

/* Auto-scaling via container queries (uses cqw units). */
@supports (font-size: 1cqw) {
	.wtp-sticky .wtp-timer__label { font-size: var(--wtp-sticky-label-cq, var(--wtp-sticky-label-size, 14px)); }
	.wtp-sticky .wtp-unit__num    { font-size: var(--wtp-sticky-numbers-cq, var(--wtp-sticky-numbers-size, 18px)); }
	.wtp-sticky .wtp-unit__label  { font-size: var(--wtp-sticky-unit-cq, var(--wtp-sticky-unit-size, 10px)); }
	.wtp-sticky__btn              { font-size: var(--wtp-sticky-btn-cq, var(--wtp-sticky-btn-size, 13px)); }
	.wtp-sticky .wtp-unit__num    { padding: 0.35em 0.55em; min-width: 2.6em; }
}

/* Position */
.wtp-sticky--left-bottom {
	left: var(--wtp-sticky-x, 20px);
	bottom: var(--wtp-sticky-y, 20px);
	max-height: var(--wtp-sticky-h, 200px);
	overflow: auto;
}
.wtp-sticky--right-bottom {
	right: var(--wtp-sticky-x, 20px);
	bottom: var(--wtp-sticky-y, 20px);
	max-height: var(--wtp-sticky-h, 200px);
	overflow: auto;
}
.wtp-sticky--center-bottom {
	left: 50%;
	bottom: var(--wtp-sticky-y, 20px);
	transform: translateX(-50%);
	max-height: var(--wtp-sticky-h, 200px);
	overflow: auto;
}

/* Close */
.wtp-sticky__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(15, 23, 42, .08);
	color: inherit;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease;
	padding: 0;
	line-height: 1;
	z-index: 1;
}
.wtp-sticky__close:hover { background: rgba(15, 23, 42, .16); }

/* Button */
.wtp-sticky__actions { display: flex; }

.wtp-sticky__btn,
.wtp-sticky__btn:link,
.wtp-sticky__btn:visited,
.wtp-sticky__btn:hover,
.wtp-sticky__btn:focus,
.wtp-sticky__btn:active {
	color: var(--wtp-sticky-btn-txt, #ffffff);
	text-decoration: none;
	background: var(--wtp-sticky-btn-bg, #6d28d9);
}

.wtp-sticky__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 10px 14px;
	border-radius: calc(var(--wtp-sticky-r, 14px) * .7);
	font-weight: 600;
	font-size: var(--wtp-sticky-btn-size, 13px);
	transition: transform .12s ease, filter .12s ease;
}
.wtp-sticky__btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.wtp-sticky__btn:active { transform: translateY(0); }

/* Animations */
.wtp-sticky--anim-slide.wtp-sticky--left-bottom {
	transform: translateX(-120%);
	opacity: 0;
	transition: transform .35s ease, opacity .35s ease;
}
.wtp-sticky--anim-slide.wtp-sticky--right-bottom {
	transform: translateX(120%);
	opacity: 0;
	transition: transform .35s ease, opacity .35s ease;
}
.wtp-sticky--anim-slide.wtp-sticky--center-bottom {
	transform: translate(-50%, 120%);
	opacity: 0;
	transition: transform .35s ease, opacity .35s ease;
}
.wtp-sticky.is-visible.wtp-sticky--anim-slide.wtp-sticky--left-bottom { transform: translateX(0); opacity: 1; }
.wtp-sticky.is-visible.wtp-sticky--anim-slide.wtp-sticky--right-bottom { transform: translateX(0); opacity: 1; }
.wtp-sticky.is-visible.wtp-sticky--anim-slide.wtp-sticky--center-bottom { transform: translate(-50%, 0); opacity: 1; }

.wtp-sticky--anim-fade { opacity: 0; transition: opacity .3s ease; }
.wtp-sticky--anim-fade.is-visible { opacity: 1; }

.wtp-sticky--anim-zoom { transform: scale(.85); opacity: 0; transition: transform .3s ease, opacity .3s ease; }
.wtp-sticky--anim-zoom.is-visible { transform: scale(1); opacity: 1; }

.wtp-sticky--anim-zoom.wtp-sticky--center-bottom { transform: translate(-50%, 0) scale(.85); }
.wtp-sticky--anim-zoom.wtp-sticky--center-bottom.is-visible { transform: translate(-50%, 0) scale(1); }

/* Mobile */
@media (max-width: 640px) {
	.wtp-sticky { width: calc(100vw - 24px); }
	.wtp-sticky--hide-mobile { display: none !important; }
	.wtp-sticky--left-bottom,
	.wtp-sticky--right-bottom,
	.wtp-sticky--center-bottom {
		left: 12px;
		right: 12px;
		bottom: 12px;
		max-height: none;
		overflow: visible;
	}
	.wtp-sticky--center-bottom { left: 12px; transform: none; }
	.wtp-sticky--anim-slide.wtp-sticky--center-bottom { transform: translateY(120%); }
	.wtp-sticky.is-visible.wtp-sticky--anim-slide.wtp-sticky--center-bottom { transform: translateY(0); }
}