/* Barre flottante Countdown avec nesting complet */
.ax-countdown-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 12px 1rem;
    font-weight: 400;
    line-height: 1.2;

    /* Style pour les countdowns prêts à être affichés (optimisé pour éviter le CLS) */
    &.ax-countdown-ready {
        visibility: visible;
        opacity: 1;
        /* Affichage immédiat sans transition pour éviter le CLS */
    }

    /* Style pour masquer avec animation (remplace l'ancienne classe .hidden) */
    &.ax-countdown-hidden {
        visibility: hidden;
        opacity: 0;
        transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out;

        &.ax-countdown-top {
            transform: translateY(-100%);
        }

        &.ax-countdown-bottom {
            transform: translateY(100%);
        }
    }

    &.ax-countdown-top {
        top: 0;
    }

    &.ax-countdown-bottom {
        bottom: 0;
    }

    /* Container à l'intérieur de la banner */
    .ax-countdown-container {
        .ax-countdown-content {
            display: flex;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .ax-countdown-message {
            font-size: 16px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .ax-countdown-timer {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 700;
        }

        .ax-countdown-time-unit {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .ax-countdown-number {
            font-size: 20px;
            font-weight: 700;
            line-height: 1;
            margin-bottom: 2px;
        }

        .ax-countdown-label {
            font-size: 10px;
            font-weight: 500;
            letter-spacing: 0.5px;
            opacity: 0.5;
        }

        .ax-countdown-separator {
            font-size: 18px;
            font-weight: 700;
            margin: 0 4px;
            line-height: 1;
        }

        .ax-countdown-button {
            display: inline-block;
            padding: 8px 20px;
            border: 2px solid;
            border-radius: 25px;
            text-decoration: none;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            background: white;
            color: black !important;
            text-transform: none;

            &:hover {
                background: rgba(255, 255, 255, 0.1);
                color: white !important;
            }
        }

        .ax-countdown-close {
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            font-size: 24px;
            font-weight: 300;
            cursor: pointer;
            padding: 5px 10px;
            line-height: 1;
            opacity: 0.8;
            z-index: 9999;

            &:hover {
                opacity: 1;
            }
        }
    }

    /* Styles spécifiques pour Swiper */
    &.ax-countdown-swiper {
        .ax-countdown-container {
            .ax-countdown-swiper-container {
                width: 100%;
                height: 100%;
                position: relative;
            }

            .swiper-wrapper {
                align-items: center;
            }
        }
    }

    /* Responsive Design */
    @media (max-width: 768px) {
        padding: 10px 15px;
        font-size: 12px;

        .ax-countdown-container {
            .ax-countdown-content {
                gap: 15px;
                text-align: center;
            }

            .ax-countdown-message {
                font-size: 14px;
                order: 1;
                width: 100%;
            }

            .ax-countdown-timer {
                order: 2;
                gap: 6px;
            }

            .ax-countdown-action {
                order: 3;
                margin-left: 0;
            }

            .ax-countdown-number {
                font-size: 14px;
            }

            .ax-countdown-button {
                padding: 6px 16px;
                font-size: 12px;
            }

            .ax-countdown-close {
                right: 5px;
                font-size: 20px;
                padding: 2px 8px;
            }
        }
    }
}

/* Styles pour le body - pas d'encapsulation nécessaire car ils affectent le body */
body.ax-countdown-bottom-active {
    padding-bottom: 60px;

    @media (max-width: 768px) {
        padding-bottom: 80px;
    }
}