/* Common styles for all countdowns */
.availability-countdown {
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    background: rgba(247, 247, 247, 0.9);
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    z-index: 10;
}

/* NEW: Specific styles for product loop countdowns */
.availability-countdown.product-loop {
    margin: 8px 0;
    padding: 8px;
    background: #f8f8f8;
    font-size: 0.9em;
    position: relative; /* Remove absolute positioning */
    top: auto;
    left: auto;
    right: auto;
}

.countdown-label {
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.countdown-timer {
    font-size: 1.2em;
    font-weight: bold;
    color: #d23669;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.countdown-timer span {
    display: inline-block;
    min-width: 40px;
    text-align: center;
}

.countdown-timer small {
    display: block;
    font-size: 0.7em;
    opacity: 0.8;
    color: #666;
}

.availability-expired {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    color: #c62828;
    font-weight: bold;
}

/* Single product page */
.availability-countdown.product-countdown { /* Changed from -single to match PHP class */
    margin: 20px 0;
    background: #f7f7f7;
}

/* Product loops - top position (keep but adjust) */
.availability-countdown.loop-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    background: rgba(247, 247, 247, 0.85);
}

/* Product loops - middle position (keep but adjust) */
.availability-countdown.loop-after-title {
    margin: 10px 0;
    clear: both;
}

/* Product loops - bottom position (keep but adjust) */
.availability-countdown.loop-after-item {
    margin-top: 10px;
    clear: both;
}

/* Front page specific styles */
.home .availability-countdown.loop-top,
.front-page .availability-countdown.loop-top {
    position: relative;
    margin-bottom: 10px;
}

/* NEW: Better responsive layout for countdown numbers */
@media (max-width: 768px) {
    .countdown-timer {
        font-size: 1em;
        gap: 5px;
    }
    
    .countdown-timer span {
        min-width: 35px;
    }
    
    .availability-countdown {
        padding: 8px;
    }
    
    .availability-countdown.loop-top {
        position: relative;
    }
    
    /* NEW: Stack countdown elements on small screens */
    .countdown-timer {
        flex-direction: column;
        gap: 2px;
    }
    
    .countdown-timer span {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .countdown-timer small {
        display: inline;
        margin-left: 5px;
    }
}

/* NEW: Animation for countdown changes */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.countdown-timer span {
    transition: all 0.3s ease;
}

.countdown-timer span:hover {
    animation: pulse 0.5s ease;
}

/* NEW: Dark mode support */
@media (prefers-color-scheme: dark) {
    .availability-countdown {
        background: rgba(40, 40, 40, 0.9);
        border-color: #444;
    }
    
    .countdown-label {
        color: #eee;
    }
    
    .countdown-timer {
        color: #ff6b9d;
    }
    
    .availability-countdown.product-loop {
        background: rgba(50, 50, 50, 0.9);
    }
    
    .availability-expired {
        background: #3a1a1a;
        border-color: #5a2a2a;
        color: #ff6b6b;
    }
}