/* =============================================================
   QT Woo Sales Countdown Timer – Frontend Styles
   Author: Quick Tips | https://www.youtube.com/@ParamFreelance
   ============================================================= */

/* ---- Base wrapper ---- */
.qt-countdown-wrapper {
	margin: 12px 0;
	font-family: inherit;
}

.qt-urgency-label {
	font-size: 13px;
	font-weight: 600;
	color: #555;
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: .05em;
}

.qt-countdown-wrapper.qt-urgency .qt-urgency-label {
	color: #c0392b;
	animation: qt-pulse-text 1s infinite;
}

@keyframes qt-pulse-text {
	0%, 100% { opacity: 1; }
	50% { opacity: .6; }
}

/* ---- Stock warning ---- */
.qt-stock-warning {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 700;
	color: #c0392b;
}

/* ======================================================
   STYLE: FLIP CLOCK
   ====================================================== */
.qt-style-flip .qt-countdown {
	display: flex;
	gap: 8px;
	align-items: center;
}

.qt-style-flip .qt-unit {
	text-align: center;
}

.qt-style-flip .qt-flip-card {
	position: relative;
	width: 52px;
	height: 60px;
	background: var(--qt-bg, #2c3e50);
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

.qt-style-flip .qt-flip-top,
.qt-style-flip .qt-flip-bottom {
	position: absolute;
	left: 0;
	right: 0;
	height: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qt-style-flip .qt-flip-top {
	top: 0;
	border-bottom: 1px solid rgba(255,255,255,.1);
}

.qt-style-flip .qt-flip-bottom {
	bottom: 0;
	align-items: flex-start;
}

.qt-style-flip .qt-flip-card span {
	font-size: 28px;
	font-weight: 800;
	color: var(--qt-text, #fff);
	line-height: 1;
}

.qt-style-flip .qt-label {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #888;
	margin-top: 4px;
}

.qt-style-flip .qt-unit-separator {
	font-size: 28px;
	font-weight: 800;
	color: var(--qt-bg, #2c3e50);
	margin-bottom: 16px;
}

/* Flip animation */
.qt-flip-card.flipping .qt-flip-top {
	animation: qt-flip-top .3s ease forwards;
}
.qt-flip-card.flipping .qt-flip-bottom {
	animation: qt-flip-bottom .3s ease .3s forwards;
}

@keyframes qt-flip-top {
	0% { transform: rotateX(0); }
	100% { transform: rotateX(-90deg); }
}

@keyframes qt-flip-bottom {
	0% { transform: rotateX(90deg); }
	100% { transform: rotateX(0); }
}

/* ======================================================
   STYLE: MINIMAL TEXT
   ====================================================== */
.qt-style-minimal .qt-countdown {
	display: flex;
	gap: 6px;
	align-items: center;
	flex-wrap: wrap;
}

.qt-style-minimal .qt-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: var(--qt-bg, #2c3e50);
	padding: 6px 10px;
	border-radius: 4px;
	min-width: 44px;
}

.qt-style-minimal .qt-number {
	font-size: 22px;
	font-weight: 700;
	color: var(--qt-text, #fff);
}

.qt-style-minimal .qt-label {
	font-size: 9px;
	text-transform: uppercase;
	color: rgba(255,255,255,.7);
	letter-spacing: .08em;
}

/* ======================================================
   STYLE: DIGITAL
   ====================================================== */
.qt-style-digital .qt-countdown {
	display: inline-flex;
	gap: 0;
	background: #111;
	padding: 8px 14px;
	border-radius: 6px;
	box-shadow: 0 0 0 2px rgba(0,255,0,.2), inset 0 0 20px rgba(0,0,0,.5);
}

.qt-style-digital .qt-unit {
	text-align: center;
	padding: 0 8px;
}

.qt-style-digital .qt-unit + .qt-unit {
	border-left: 1px solid #333;
}

.qt-style-digital .qt-number {
	font-family: 'Courier New', monospace;
	font-size: 30px;
	font-weight: 700;
	color: #0f0;
	text-shadow: 0 0 8px rgba(0,255,0,.6);
}

.qt-style-digital .qt-label {
	font-size: 9px;
	color: #0a0;
	text-transform: uppercase;
	letter-spacing: .1em;
}

/* ======================================================
   STYLE: PROGRESS BAR
   ====================================================== */
.qt-style-bar .qt-countdown {
	width: 100%;
}

.qt-bar-wrapper {
	width: 100%;
	height: 14px;
	background: #eee;
	border-radius: 7px;
	overflow: hidden;
	margin-bottom: 6px;
}

.qt-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--qt-bg, #2c3e50), var(--qt-primary, #e74c3c));
	border-radius: 7px;
	transition: width .5s linear;
}

.qt-bar-text {
	font-size: 13px;
	color: #555;
	font-weight: 600;
}

/* ======================================================
   STYLE: CIRCULAR
   ====================================================== */
.qt-style-circular .qt-countdown {
	display: flex;
	gap: 10px;
}

.qt-circle-unit {
	position: relative;
	text-align: center;
	width: 80px;
}

.qt-circle-svg {
	width: 80px;
	height: 80px;
	transform: rotate(-90deg);
}

.qt-circle-bg {
	fill: none;
	stroke: #eee;
	stroke-width: 6;
}

.qt-circle-prog {
	fill: none;
	stroke: var(--qt-primary, #e74c3c);
	stroke-width: 6;
	stroke-linecap: round;
	stroke-dasharray: 220;
	stroke-dashoffset: 220;
	transition: stroke-dashoffset .5s linear;
}

.qt-circle-value {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -60%);
	font-size: 20px;
	font-weight: 700;
	color: #333;
}

.qt-circle-label {
	font-size: 11px;
	color: #888;
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-top: 2px;
}

/* ======================================================
   CART TIMER
   ====================================================== */
.qt-cart-timer-wrapper,
.qt-checkout-timer-wrapper {
	background: #fff8e1;
	border: 1px solid #f39c12;
	border-left: 4px solid #f39c12;
	border-radius: 6px;
	padding: 12px 16px;
	margin-bottom: 20px;
}

.qt-cart-timer-inner,
.qt-checkout-timer-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.qt-cart-icon,
.qt-checkout-icon {
	font-size: 24px;
}

.qt-cart-timer-text strong {
	display: block;
	font-size: 14px;
	color: #333;
}

.qt-cart-timer-text p {
	margin: 2px 0 0;
	font-size: 13px;
	color: #555;
}

.qt-cart-countdown {
	margin-left: auto;
	font-size: 22px;
	font-weight: 700;
	color: #c0392b;
	font-variant-numeric: tabular-nums;
}

.qt-cc-val {
	font-size: 22px;
	font-weight: 800;
	color: #e74c3c;
}

/* ======================================================
   FLASH SALE BANNER
   ====================================================== */
.qt-flash-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99999;
	background: linear-gradient(135deg, #1a1a2e, #16213e);
	color: #fff;
	padding: 10px 16px;
	box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.qt-flash-banner-top {
	top: 0;
}

.qt-flash-banner-bottom {
	bottom: 0;
}

.qt-flash-banner-top ~ * {
	padding-top: 46px;
}

.qt-flash-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	max-width: 1200px;
	margin: 0 auto;
	flex-wrap: wrap;
}

.qt-flash-icon {
	font-size: 20px;
}

.qt-flash-text {
	font-weight: 600;
	font-size: 14px;
}

.qt-flash-countdown {
	display: flex;
	align-items: center;
	gap: 4px;
}

.qt-fc-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: rgba(255,255,255,.12);
	padding: 3px 8px;
	border-radius: 4px;
}

.qt-fc-val {
	font-size: 18px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.qt-fc-unit small {
	font-size: 8px;
	text-transform: uppercase;
	opacity: .7;
}

.qt-fc-sep {
	font-size: 18px;
	font-weight: 700;
	opacity: .5;
}

.qt-flash-close {
	background: none;
	border: none;
	color: rgba(255,255,255,.6);
	cursor: pointer;
	font-size: 16px;
	margin-left: auto;
	padding: 4px 8px;
	transition: color .2s;
}

.qt-flash-close:hover {
	color: #fff;
}

/* ======================================================
   LOOP / SHOP PAGE
   ====================================================== */
.qt-context-loop .qt-countdown {
	font-size: .9em;
}

.qt-context-loop .qt-style-flip .qt-flip-card {
	width: 36px;
	height: 42px;
}

.qt-context-loop .qt-style-flip .qt-flip-card span {
	font-size: 18px;
}

/* ======================================================
   CATEGORY SHORTCODE GRID
   ====================================================== */
.qt-category-countdown-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
}

.qt-category-item {
	border: 1px solid #eee;
	border-radius: 8px;
	overflow: hidden;
	padding: 12px;
	text-align: center;
}

.qt-category-item a {
	display: block;
	text-decoration: none;
	color: inherit;
	margin-bottom: 10px;
}

/* ======================================================
   URGENCY – red state
   ====================================================== */
.qt-urgency .qt-flip-card,
.qt-urgency .qt-unit {
	background: var(--qt-urgency-bg, #c0392b) !important;
}

.qt-urgency .qt-bar-fill {
	background: #c0392b;
}

.qt-urgency .qt-circle-prog {
	stroke: #c0392b;
}

.qt-urgency.qt-style-digital .qt-number {
	color: #f00;
	text-shadow: 0 0 8px rgba(255,0,0,.6);
}
