/* QT Woo Sales Countdown Timer — frontend styles */

:root {
    --qt-primary: #e74c3c;
    --qt-text: #ffffff;
    --qt-bg: #2c3e50;
}

/* ---------- Wrapper ---------- */
.qt-countdown-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    background: var(--qt-bg);
    color: var(--qt-text);
    margin: 16px 0;
    font-family: inherit;
    box-sizing: border-box;
}

.qt-urgency-label {
    font-weight: 700;
    font-size: 0.9em;
    width: 100%;
    margin-bottom: 8px;
}

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

.qt-expired-msg {
    color: #999;
    font-style: italic;
    padding: 8px 0;
}

.qt-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qt-label {
    font-size: 0.7em;
    text-align: center;
    margin-top: 6px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Flip style ---------- */
.qt-style-flip .qt-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qt-flip-card {
    width: 50px;
    height: 60px;
    background: var(--qt-primary);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.qt-flip-top,
.qt-flip-bottom {
    position: absolute;
    width: 100%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.qt-flip-bottom {
    bottom: 0;
}

/* Each half shows half of the number, so the digits are clipped to the card's centre line. */
.qt-flip-top span,
.qt-flip-bottom span {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--qt-text);
    line-height: 60px;
}

.qt-flip-top span {
    align-self: flex-start;
    transform: translateY(0);
}

.qt-flip-bottom span {
    align-self: flex-end;
    transform: translateY(0);
}

.qt-flip-card.flipping .qt-flip-bottom {
    animation: qt-flip-anim 0.3s ease-in-out;
}

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

/* ---------- Minimal style ---------- */
.qt-style-minimal .qt-number {
    font-size: 2em;
    font-weight: 700;
    color: var(--qt-primary);
    line-height: 1;
}

.qt-style-minimal .qt-label {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* ---------- Digital style ---------- */
.qt-style-digital {
    background: #1a1a1a;
}

.qt-style-digital .qt-number {
    font-family: 'Courier New', monospace;
    font-size: 2.2em;
    color: #00ff41;
    text-shadow: 0 0 8px #00ff41, 0 0 20px rgba(0, 255, 65, 0.4);
    line-height: 1;
}

.qt-style-digital .qt-label {
    color: #00ff41;
    opacity: 0.6;
}

/* ---------- Circular style ---------- */
.qt-circle-unit {
    position: relative;
    width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.qt-circle-svg {
    width: 90px;
    height: 90px;
    transform: rotate(-90deg);
    display: block;
    margin: 0 auto;
}

.qt-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 6;
}

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

/* Centre the number over the ring (the ring is 90px tall; the label sits below it). */
.qt-circle-value {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3em;
    font-weight: 700;
}

.qt-circle-label {
    font-size: 0.65em;
    margin-top: 4px;
    opacity: 0.8;
}

/* ---------- Progress bar style ---------- */
.qt-style-bar {
    flex-direction: column;
    align-items: stretch;
}

.qt-style-bar .qt-countdown {
    display: block;
}

.qt-bar-wrapper {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    height: 12px;
    overflow: hidden;
    margin: 8px 0;
}

.qt-bar-fill {
    height: 100%;
    background: var(--qt-primary);
    border-radius: 5px;
    transition: width 1s linear;
    min-width: 2px;
}

.qt-bar-text {
    font-size: 0.85em;
    opacity: 0.85;
    text-align: right;
}

/* ---------- Urgency ---------- */
.qt-countdown-wrapper.qt-urgency {
    --qt-primary: #ff1744;
    animation: qt-pulse 1s ease-in-out infinite;
}

@keyframes qt-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.015); }
}

/* ---------- Stock warning ---------- */
.qt-stock-warning {
    background: #ff5722;
    color: #fff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85em;
    margin-top: 8px;
    display: inline-block;
}

/* ---------- Shortcode grid ---------- */
.qt-countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 16px 0;
}

.qt-countdown-grid-item .qt-grid-title {
    margin: 0 0 6px;
    font-size: 1em;
}

.qt-countdown-grid-item .qt-countdown-wrapper {
    margin: 0;
}

/* ---------- Flash sale banner ---------- */
.qt-flash-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--qt-primary);
    color: #fff;
    padding: 10px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.qt-flash-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

.qt-fc-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qt-fc-val {
    font-size: 1.5em;
    font-weight: 700;
    min-width: 2ch;
    text-align: center;
    line-height: 1.1;
}

.qt-fc-sep {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 2px;
}

.qt-fc-unit small {
    font-size: 0.55em;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qt-flash-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 14px;
    margin-left: 8px;
    flex-shrink: 0;
}

.qt-flash-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Cart / checkout timer ---------- */
.qt-cart-timer-wrapper,
.qt-checkout-timer-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff8e1;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 12px 0;
    font-size: 1em;
    color: #333;
}

.qt-cart-icon {
    font-size: 1.5em;
}

.qt-cc-val {
    font-family: 'Courier New', monospace;
    font-size: 1.8em;
    font-weight: 700;
    color: #e65100;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .qt-countdown-wrapper {
        gap: 8px;
        padding: 12px;
        font-size: 0.9em;
    }

    .qt-flip-card {
        width: 42px;
        height: 52px;
    }

    .qt-flip-top span,
    .qt-flip-bottom span {
        font-size: 1.5em;
        line-height: 52px;
    }

    .qt-style-minimal .qt-number {
        font-size: 1.6em;
    }

    .qt-style-digital .qt-number {
        font-size: 1.7em;
    }

    .qt-circle-unit,
    .qt-circle-svg {
        width: 70px;
    }

    .qt-circle-svg {
        height: 70px;
    }

    .qt-circle-value {
        top: 35px;
        font-size: 1.05em;
    }

    .qt-flash-inner {
        gap: 8px;
    }

    .qt-fc-val,
    .qt-fc-sep {
        font-size: 1.2em;
    }

    .qt-cc-val {
        font-size: 1.5em;
    }
}
