/**
 * SWAM Sales Extensions - Countdown styles.
 * Warm amber/red urgency palette with a cyclic pulse to drive FOMO.
 */

.swam-countdown {
    --swam-accent: #e0a528;
    --swam-accent-2: #c0392b;
    display: block;
    margin: 14px 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(224, 165, 40, 0.55);
    background: linear-gradient(135deg, rgba(50, 24, 12, 0.92), rgba(28, 14, 8, 0.92));
    box-shadow: 0 0 0 0 rgba(224, 165, 40, 0.45);
    animation: swam-glow 2.4s ease-in-out infinite;
    max-width: 420px;
}

@keyframes swam-glow {
    0%   { box-shadow: 0 0 0 0 rgba(224, 165, 40, 0.40); }
    50%  { box-shadow: 0 0 22px 4px rgba(224, 165, 40, 0.28); }
    100% { box-shadow: 0 0 0 0 rgba(224, 165, 40, 0.40); }
}

.swam-countdown-msg {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #f6d98a;
    margin-bottom: 10px;
    line-height: 1.35;
}

.swam-countdown-msg strong {
    color: #ffffff;
    white-space: nowrap;
}

.swam-countdown-fire {
    display: inline-block;
    margin-right: 4px;
    animation: swam-flicker 1.6s ease-in-out infinite;
}

@keyframes swam-flicker {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50%      { transform: scale(1.18) rotate(-4deg); opacity: 0.85; }
}

.swam-countdown-timer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.swam-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    padding: 8px 6px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(224, 165, 40, 0.16), rgba(224, 165, 40, 0.06));
    border: 1px solid rgba(224, 165, 40, 0.30);
}

.swam-cd-unit b {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: #ffd873;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.swam-cd-unit small {
    margin-top: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #d8b877;
}

.swam-cd-sep {
    color: rgba(224, 165, 40, 0.6);
    font-size: 22px;
    font-weight: 700;
    padding-bottom: 12px;
}

/* Per-second heartbeat on the seconds digit. */
.swam-cd-s.swam-cd-beat {
    animation: swam-beat 0.5s ease-out;
}

@keyframes swam-beat {
    0%   { transform: scale(1); color: #ffd873; }
    30%  { transform: scale(1.35); color: #ff6b52; }
    100% { transform: scale(1); color: #ffd873; }
}

/* Ended state. */
.swam-countdown-ended-msg {
    display: none;
    margin-top: 8px;
    font-weight: 700;
    color: #ff8f7a;
}

.swam-countdown.swam-countdown-ended {
    animation: none;
    border-color: rgba(192, 57, 43, 0.6);
}

.swam-countdown.swam-countdown-ended .swam-countdown-timer,
.swam-countdown.swam-countdown-ended .swam-countdown-msg {
    opacity: 0.5;
}

.swam-countdown.swam-countdown-ended .swam-countdown-ended-msg {
    display: block;
}

/* ---------------------------------------------------------------------------
 *  Sticky lite bar (slides in from the top once the main countdown scrolls off)
 * ------------------------------------------------------------------------- */

.swam-countdown-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99990;
    transform: translateY(-100%);
    transition: transform 0.35s ease;
    background: linear-gradient(135deg, rgba(46, 22, 11, 0.98), rgba(24, 12, 7, 0.98));
    border-bottom: 1px solid rgba(224, 165, 40, 0.55);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
}

.swam-countdown-sticky.is-visible {
    transform: translateY(0);
}

.swam-sticky-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 14px;
}

.swam-sticky-label {
    font-size: 14px;
    font-weight: 700;
    color: #f6d98a;
    letter-spacing: 0.2px;
}

.swam-sticky-timer {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    color: #ffd873;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.swam-sticky-timer b {
    font-size: 18px;
    font-weight: 800;
    min-width: 26px;
    text-align: center;
    display: inline-block;
}

.swam-sticky-timer i {
    font-style: normal;
    font-size: 11px;
    color: #d8b877;
    margin: 0 6px 0 1px;
}

.swam-countdown-sticky .swam-countdown-fire {
    font-size: 18px;
}

/* Keep the sticky bar below the WordPress admin bar for logged-in users. */
body.admin-bar .swam-countdown-sticky { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .swam-countdown-sticky { top: 46px; }
}

/* ---------------------------------------------------------------------------
 *  Mobile: full width, centered content
 * ------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .swam-countdown {
        max-width: 100%;
        width: 100%;
        text-align: center;
    }
    .swam-countdown-msg {
        text-align: center;
    }
    .swam-countdown-timer {
        justify-content: center;
    }
    .swam-cd-unit {
        flex: 1 1 0;
        min-width: 0;
    }
    .swam-cd-unit b { font-size: 24px; }

    .swam-sticky-label { font-size: 12.5px; }
    .swam-sticky-timer b { font-size: 16px; min-width: 22px; }
    .swam-sticky-timer i { margin: 0 4px 0 1px; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
    .swam-countdown,
    .swam-countdown-fire,
    .swam-cd-s.swam-cd-beat {
        animation: none !important;
    }
    .swam-countdown-sticky { transition: none; }
}
