/* === SLIDER BANNIÈRE TOP === */
.ad-slider-container {
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 50; /* En dessous du header mais au-dessus du contenu */
    transition: all 0.3s ease;
}

/* Slider minimisé */
.ad-slider-container.minimized {
    margin: 0;
    padding: 0.5rem 1rem;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ad-slider-container.minimized .ad-label {
    display: none;
}

.ad-slider-container.minimized .ad-slider-wrapper {
    min-height: 60px !important;
}

@media (min-width: 768px) {
    .ad-slider-container.minimized .ad-slider-wrapper {
        min-height: 80px !important;
    }
}

.ad-slider-container.minimized .ad-slider-controls {
    margin-top: 0.5rem;
}

/* Bouton minimiser/agrandir */
.ad-slider-toggle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ad-slider-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.ad-slider-toggle:active {
    transform: scale(0.95);
}

.ad-slider-container.minimized .ad-slider-toggle {
    top: 0.25rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.ad-slider-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

/* ==================== SMALL MOBILE (320px - 449px) ==================== */
@media (min-width: 320px) and (max-width: 449px) {
    .ad-slider-wrapper {
        min-height: 100px;
        height: auto;
    }

    .ad-slider-container {
        padding: 0;
        margin: 0;
    }

    .ad-slide-mobile-img,
    .ad-slide-image.ad-slide-mobile-img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 200px !important;
        object-fit: contain !important;
    }
}

/* ==================== BREAKPOINT 2 - MOBILE LARGE (450px - 479px) ==================== */
@media (min-width: 450px) and (max-width: 479px) {
    .ad-slider-wrapper {
        min-height: 100px;
        height: auto;
    }

    .ad-slider-container {
        padding: 0;
        margin: 0;
    }

    .ad-slide-mobile {
        width: 100% !important;
    }

    .ad-slide-mobile-img,
    .ad-slide-image.ad-slide-mobile-img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 220px !important;
        object-fit: contain !important;
    }

    .ad-slide-image {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* ==================== BREAKPOINT 500px - MOBILE LARGE (500px - 599px) ==================== */
@media (min-width: 500px) and (max-width: 599px) {
    .ad-slider-wrapper {
        min-height: 100px;
        height: auto;
    }

    .ad-slider-container {
        padding: 0;
        margin: 0;
    }

    .ad-slide-mobile {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .ad-clickable-link,
    .ad-image-wrapper {
        width: 100% !important;
        display: block !important;
    }

    .ad-slide-mobile-img,
    .ad-slide-image.ad-slide-mobile-img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 230px !important;
        object-fit: contain !important;
    }
}

/* ==================== TABLETTES PORTRAIT (480px - 499px et 600px - 767px) ==================== */
@media (min-width: 480px) and (max-width: 499px),
       (min-width: 600px) and (max-width: 767px) {
    .ad-slider-wrapper {
        min-height: 100px;
        height: auto;
    }

    .ad-slider-container {
        padding: 0;
        margin: 0;
    }

    .ad-slide-mobile {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .ad-clickable-link,
    .ad-image-wrapper {
        width: 100% !important;
        display: block !important;
    }

    .ad-slide-mobile-img,
    .ad-slide-image.ad-slide-mobile-img,
    .ad-slide-mobile .ad-slide-image,
    .ad-slide-mobile img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 260px !important;
        object-fit: contain !important;
    }
}

/* ==================== TABLETTES (768px - 1023px) ==================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .ad-slider-wrapper {
        min-height: 180px !important;
        height: auto !important;
    }

    .ad-slide-desktop {
        width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .ad-clickable-link {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .ad-image-wrapper {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .ad-slide-desktop-img,
    .ad-slide-image.ad-slide-desktop-img,
    .ad-slide-desktop .ad-slide-image,
    .ad-slide-desktop img,
    .ad-image-wrapper img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 380px !important;
        min-height: unset !important;
        object-fit: contain !important;
        display: block !important;
    }
}

/* ==================== SMALL DESKTOP (1024px - 1439px) ==================== */
@media (min-width: 1024px) and (max-width: 1439px) {
    .ad-slider-wrapper {
        min-height: 200px !important;
        height: auto !important;
    }
}

/* ==================== LARGE DESKTOP (≥ 1440px) ==================== */
@media (min-width: 1440px) {
    .ad-slider-wrapper {
        min-height: 500px; /* Hauteur 1440x500 */
    }
}

/* ==================== ULTRA LARGE DESKTOP (≥ 1920px) ==================== */
@media (min-width: 1920px) {
    .ad-slider-wrapper {
        min-height: 500px; /* Hauteur 1440x500 */
    }
}

.ad-slider-slide {
    display: none;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
}

.ad-slider-slide.active {
    display: block;
    opacity: 1;
    animation: slideIn 0.5s ease-in-out;
    position: relative;
}

@keyframes slideIn {
    from { 
        transform: translateX(20px);
        opacity: 0;
    }
    to { 
        transform: translateX(0);
        opacity: 1;
    }
}

.ad-slide-desktop,
.ad-slide-mobile {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-slide-image {
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.3s;
    display: block;
    margin: 0 auto;
}

/* Forcer la largeur complète à partir du breakpoint 2 */
@media (min-width: 450px) {
    .ad-slide-mobile {
        width: 100% !important;
    }
    
    .ad-clickable-link {
        width: 100% !important;
        display: block !important;
    }
    
    .ad-image-wrapper {
        width: 100% !important;
        display: block !important;
    }
    
    .ad-slide-mobile-img,
    .ad-slide-image.ad-slide-mobile-img,
    .ad-slide-mobile .ad-slide-image,
    .ad-slide-mobile img {
        max-width: 100% !important;
        width: 100% !important;
    }
}

.ad-slide-image:hover {
    transform: scale(1.01);
}

/* Indicateur de clic pour les publicités avec URL */
.ad-clickable-link {
    display: block;
    position: relative;
    text-decoration: none;
}

.ad-image-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.ad-click-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(25, 118, 210, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.ad-clickable-link:hover .ad-click-indicator {
    opacity: 1;
    transform: translateY(0);
}

.ad-click-icon {
    font-size: 1rem;
}

.ad-click-text {
    white-space: nowrap;
}

@media (max-width: 767px) {
    .ad-click-indicator {
        bottom: 5px;
        right: 5px;
        padding: 0.375rem 0.75rem;
        font-size: 0.7rem;
    }
    
    .ad-click-text {
        display: none; /* Masquer le texte sur mobile, garder juste l'icône */
    }
    
    .ad-click-icon {
        font-size: 1.2rem;
    }
}

/* ==================== MOBILE FIRST (par défaut) ==================== */
/* Bannières mobiles : 330x150px - Mobile Banner standard */
.ad-slide-desktop {
    display: none; /* Cachées sur mobile */
}

.ad-slide-mobile {
    display: block; /* Affichées par défaut */
}

.ad-slide-mobile-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
}


/* ==================== BREAKPOINT 2 - MOBILE LARGE (450px - 479px) ==================== */
@media (min-width: 450px) and (max-width: 479px) {
    .ad-slide-mobile {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .ad-clickable-link,
    .ad-image-wrapper {
        width: 100% !important;
        display: block !important;
    }

    .ad-slide-mobile-img,
    .ad-slide-image.ad-slide-mobile-img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 220px !important;
        object-fit: contain !important;
    }
}

.ad-slide-desktop-img {
    display: none; /* N'affecte que sur mobile */
}

/* ==================== TABLETTES (768px - 1023px) ==================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .ad-slide-desktop {
        display: flex !important;
        width: 100% !important;
        height: auto !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .ad-slide-mobile {
        display: none;
    }

    .ad-clickable-link {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .ad-image-wrapper {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .ad-slide-desktop-img,
    .ad-slide-image.ad-slide-desktop-img,
    .ad-slide-desktop .ad-slide-image,
    .ad-slide-desktop img,
    .ad-image-wrapper img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 380px !important;
        min-height: unset !important;
        object-fit: contain !important;
    }

    .ad-slide-mobile-img {
        display: none;
    }
}

/* ==================== SMALL DESKTOP (1024px - 1439px) ==================== */
@media (min-width: 1024px) and (max-width: 1439px) {
    .ad-slider-wrapper {
        min-height: 200px !important;
        height: auto !important;
    }

    .ad-slide-desktop {
        display: flex !important;
        width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .ad-slide-mobile {
        display: none;
    }

    .ad-clickable-link {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .ad-image-wrapper {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .ad-slide-desktop-img,
    .ad-slide-image.ad-slide-desktop-img,
    .ad-slide-desktop .ad-slide-image,
    .ad-slide-desktop img,
    .ad-image-wrapper img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 500px !important;
        min-height: unset !important;
        object-fit: contain !important;
    }

    .ad-slide-mobile-img {
        display: none;
    }
}

/* ==================== LARGE DESKTOP (≥ 1440px) ==================== */
@media (min-width: 1440px) {
    .ad-slide-desktop {
        display: block; /* Afficher large desktop */
    }
    
    .ad-slide-mobile {
        display: none; /* Cacher mobile */
    }
    
    .ad-slide-desktop-img {
        display: block;
        width: 100%;
        max-width: 1440px; /* Largeur Large Desktop Leaderboard */
        height: 500px; /* Hauteur 1440x500 */
        object-fit: contain;
    }
    
    .ad-slide-mobile-img {
        display: none; /* Cacher mobile */
    }
}

/* ==================== ULTRA LARGE DESKTOP (≥ 1920px) ==================== */
@media (min-width: 1920px) {
    .ad-slide-desktop {
        display: block; /* Afficher ultra large desktop */
    }
    
    .ad-slide-mobile {
        display: none; /* Cacher mobile */
    }
    
    .ad-slide-desktop-img {
        display: block;
        width: 100%;
        max-width: 1920px; /* Largeur Ultra Large Desktop */
        height: 500px; /* Même hauteur cible que 1440×500 (image responsive) */
        object-fit: contain;
    }
    
    .ad-slide-mobile-img {
        display: none; /* Cacher mobile */
    }
}

/* ==================== LIGHTBOX PLEIN ÉCRAN ==================== */
.ad-lightbox-trigger {
    cursor: zoom-in;
    display: block;
    width: 100%;
}

.ad-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: lightboxFadeIn 0.2s ease;
}

.ad-lightbox.open {
    display: flex;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ad-lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
    user-select: none;
}

.ad-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1;
}

.ad-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 767px) {
    .ad-lightbox-img {
        max-width: 100vw;
        max-height: 85vh;
        border-radius: 0;
    }

    .ad-lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.4rem;
    }
}

/* ==================== FIN LIGHTBOX ==================== */

.ad-slider-controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.ad-slider-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.ad-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    display: inline-block;
}

.ad-dot.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.2);
}

.ad-dot:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: scale(1.1);
}

@media (max-width: 767px) {
    .ad-slider-container {
        padding: 0;
        margin: 0;
    }

    .ad-slider-controls {
        display: none;
    }
}

