/* =====================================================================
   CAS HERO SLIDER — Hero premium avec carousel multi-slides
   ===================================================================== */

.cas-hero, .cas-hero * { box-sizing: border-box; }

.cas-hero {
    --hero-height: 80vh;
    --hero-accent: #d91415;
    --hero-accent-light: #ff3b3c;
    --hero-text: #ffffff;

    position: relative;
    width: 100%;
    height: var(--hero-height);
    overflow: hidden;
    color: var(--hero-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    isolation: isolate;
}

/* Hauteurs preset */
.cas-hero--height-fullscreen { --hero-height: 100vh; }
.cas-hero--height-large      { --hero-height: 80vh; }
.cas-hero--height-medium     { --hero-height: 65vh; }
.cas-hero--height-small      { --hero-height: 50vh; }

/* Sur mobile : hauteur auto qui s'adapte au contenu */
@media (max-width: 768px) {
    .cas-hero {
        height: auto !important;
        min-height: 0 !important;
    }
    .cas-hero__viewport {
        height: auto;
        min-height: 0;
    }
    .cas-hero__track {
        height: auto;
    }
    .cas-hero__slide {
        position: relative;
        height: auto;
        min-height: 0;
    }
    /* En mode carousel, on remet position absolute pour empiler les slides */
    .cas-hero--carousel .cas-hero__slide {
        position: absolute;
    }
    .cas-hero--carousel .cas-hero__slide.is-active {
        position: relative;
    }
}

/* ============================================================
   VIEWPORT & TRACK
   ============================================================ */
.cas-hero__viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.cas-hero__track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ============================================================
   SLIDES
   ============================================================ */
.cas-hero__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 1;
    pointer-events: none;
}

/* === Transition FADE (par défaut) === */
.cas-hero-trans-fade .cas-hero__slide {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.cas-hero-trans-fade .cas-hero__slide.is-active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

/* === Transition SLIDE === */
.cas-hero-trans-slide .cas-hero__slide {
    transform: translateX(100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.cas-hero-trans-slide .cas-hero__slide.is-active {
    transform: translateX(0);
    z-index: 2;
    pointer-events: auto;
}
.cas-hero-trans-slide .cas-hero__slide.is-prev {
    transform: translateX(-100%);
}

/* === Transition ZOOM === */
.cas-hero-trans-zoom .cas-hero__slide {
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.cas-hero-trans-zoom .cas-hero__slide.is-active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
    pointer-events: auto;
}

/* Mode 1 slide (pas de carousel) */
.cas-hero:not(.cas-hero--carousel) .cas-hero__slide {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    z-index: 2;
}

/* ============================================================
   FOND DES SLIDES (image / vidéo / gradient)
   ============================================================ */
.cas-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.cas-hero__bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Léger zoom Ken Burns sur la slide active */
    transform: scale(1.05);
    transition: transform 12s linear;
    will-change: transform;
}
.cas-hero__slide.is-active .cas-hero__bg-image {
    transform: scale(1);
}
.cas-hero__bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
}
.cas-hero__bg-image--poster {
    /* Affiché en arrière-plan derrière la vidéo (mobile fallback) */
    z-index: -1;
}
.cas-hero__bg-gradient {
    position: absolute;
    inset: 0;
}
.cas-hero__bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ============================================================
   CONTAINER & CONTENU
   ============================================================ */
.cas-hero__container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 24px;
    display: flex;
    align-items: center;
}

.cas-hero__slide--pos-top    .cas-hero__container { align-items: flex-start; }
.cas-hero__slide--pos-middle .cas-hero__container { align-items: center; }
.cas-hero__slide--pos-bottom .cas-hero__container { align-items: flex-end; }

.cas-hero__content {
    width: 100%;
    max-width: 700px;
}

.cas-hero__slide--align-left   .cas-hero__content { margin-right: auto; text-align: left; }
.cas-hero__slide--align-center .cas-hero__content { margin-left: auto; margin-right: auto; text-align: center; }
.cas-hero__slide--align-right  .cas-hero__content { margin-left: auto; text-align: right; }

/* ============================================================
   EYEBROW
   ============================================================ */
.cas-hero__eyebrow {
    display: inline-block;
    color: var(--hero-accent-light);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0 0 18px 0;
    padding: 8px 18px;
    background: rgba(217, 20, 21, 0.15);
    border: 1px solid rgba(217, 20, 21, 0.4);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ============================================================
   TITRE
   ============================================================ */
.cas-hero__title {
    color: var(--hero-text) !important;
    font-size: clamp(32px, 5vw, 60px) !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    letter-spacing: -1px !important;
    margin: 0 0 22px 0 !important;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.cas-hero__title-highlight {
    color: var(--hero-accent);
    background: linear-gradient(135deg, var(--hero-accent) 0%, var(--hero-accent-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}

/* ============================================================
   SOUS-TITRE
   ============================================================ */
.cas-hero__subtitle {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: clamp(15px, 1.3vw, 18px) !important;
    line-height: 1.6 !important;
    margin: 0 0 32px 0 !important;
    max-width: 620px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.cas-hero__slide--align-center .cas-hero__subtitle { margin-left: auto; margin-right: auto; }
.cas-hero__slide--align-right .cas-hero__subtitle { margin-left: auto; }

/* ============================================================
   BOUTONS
   ============================================================ */
.cas-hero__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}
.cas-hero__slide--align-center .cas-hero__buttons { justify-content: center; }
.cas-hero__slide--align-right  .cas-hero__buttons { justify-content: flex-end; }

.cas-hero__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s, color 0.3s, border-color 0.3s;
    overflow: hidden;
    isolation: isolate;
    border: 2px solid transparent;
    line-height: 1.2;
}
.cas-hero__btn-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}
.cas-hero__btn-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s;
}
.cas-hero__btn-icon svg, .cas-hero__btn-icon i {
    width: 14px;
    height: 14px;
    font-size: 14px;
}

/* Shine effect */
.cas-hero__btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}
.cas-hero__btn:hover .cas-hero__btn-shine {
    left: 200%;
}
.cas-hero__btn:hover {
    transform: translateY(-3px);
}
.cas-hero__btn:hover .cas-hero__btn-icon {
    transform: translateX(3px);
}

/* PRIMARY (rouge plein gradient) */
.cas-hero__btn--primary {
    background: linear-gradient(135deg, #d91415, #a30c0d);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(217, 20, 21, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.cas-hero__btn--primary:hover {
    box-shadow: 0 14px 32px rgba(217, 20, 21, 0.55),
                0 0 30px rgba(217, 20, 21, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* SECONDARY (verre dépoli) */
.cas-hero__btn--secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.cas-hero__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

/* OUTLINE */
.cas-hero__btn--outline {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}
.cas-hero__btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
    color: #ffffff;
}

/* ============================================================
   ANIMATIONS DU CONTENU (apparition)
   ============================================================ */
.cas-hero--animate .cas-hero__slide:not(.is-active) .cas-hero__eyebrow,
.cas-hero--animate .cas-hero__slide:not(.is-active) .cas-hero__title,
.cas-hero--animate .cas-hero__slide:not(.is-active) .cas-hero__subtitle,
.cas-hero--animate .cas-hero__slide:not(.is-active) .cas-hero__buttons {
    opacity: 0;
    transform: translateY(20px);
}
.cas-hero--animate .cas-hero__slide.is-active .cas-hero__eyebrow {
    animation: casHeroFadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}
.cas-hero--animate .cas-hero__slide.is-active .cas-hero__title {
    animation: casHeroFadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.35s both;
}
.cas-hero--animate .cas-hero__slide.is-active .cas-hero__subtitle {
    animation: casHeroFadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}
.cas-hero--animate .cas-hero__slide.is-active .cas-hero__buttons {
    animation: casHeroFadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.65s both;
}
@keyframes casHeroFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FLÈCHES NAVIGATION
   ============================================================ */
.cas-hero__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(20, 8, 8, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 0;
}
.cas-hero__arrow svg {
    width: 22px;
    height: 22px;
    color: #ffffff;
    stroke: #ffffff;
    fill: none;
}
.cas-hero__arrow--prev { left: 24px; }
.cas-hero__arrow--next { right: 24px; }

.cas-hero__arrow:hover {
    background: var(--hero-accent);
    border-color: var(--hero-accent);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 12px 30px rgba(217, 20, 21, 0.5);
}

/* ============================================================
   DOTS
   ============================================================ */
.cas-hero__dots {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    align-items: center;
}
.cas-hero__dot {
    width: 36px;
    height: 4px;
    border: none;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0;
    transition: all 0.35s;
}
.cas-hero__dot:hover {
    background: rgba(255, 255, 255, 0.55);
}
.cas-hero__dot.is-active {
    width: 60px;
    background: var(--hero-accent);
    box-shadow: 0 0 12px rgba(217, 20, 21, 0.6);
}

/* ============================================================
   PROGRESS BAR (autoplay)
   ============================================================ */
.cas-hero__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10;
}
.cas-hero__progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--hero-accent), var(--hero-accent-light));
    transition: width linear;
    box-shadow: 0 0 10px rgba(217, 20, 21, 0.5);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .cas-hero__container { padding: 60px 20px; }
    .cas-hero__arrow { width: 48px; height: 48px; }
    .cas-hero__arrow svg { width: 18px; height: 18px; }
    .cas-hero__arrow--prev { left: 16px; }
    .cas-hero__arrow--next { right: 16px; }
}

@media (max-width: 768px) {
    /* Container avec PLUS d'air haut/bas */
    .cas-hero__container {
        padding: 60px 16px !important;
        align-items: flex-start !important;
        height: auto !important;
        min-height: 0 !important;
    }

    /* Forcer le contenu à respecter sa propre hauteur */
    .cas-hero__content {
        max-width: 100% !important;
    }

    /* Eyebrow plus compact */
    .cas-hero__eyebrow {
        font-size: 10px;
        letter-spacing: 2.5px;
        padding: 5px 12px;
        margin-bottom: 12px;
    }

    /* Titre - moins d'espace en bas */
    .cas-hero__title {
        margin-bottom: 12px !important;
        line-height: 1.15 !important;
    }

    /* Sous-titre - moins d'espace en bas */
    .cas-hero__subtitle {
        margin-bottom: 18px !important;
        line-height: 1.5 !important;
    }

    /* Boutons COTE A COTE (pas empilés) - taille réduite */
    .cas-hero__buttons {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        width: auto !important;
        gap: 8px;
        margin-bottom: 0;
    }
    .cas-hero__btn {
        width: auto !important;
        padding: 8px 14px;
        font-size: 11px;
        letter-spacing: 0.3px;
        border-radius: 9px;
    }
    .cas-hero__btn-content { gap: 7px; }
    .cas-hero__btn-icon svg, .cas-hero__btn-icon i {
        width: 11px;
        height: 11px;
        font-size: 11px;
    }

    /* Dots collés au bas du contenu */
    .cas-hero__dots {
        position: absolute;
        bottom: 16px;
        gap: 6px;
    }
    .cas-hero__dot { width: 24px; height: 3px; }
    .cas-hero__dot.is-active { width: 36px; }

    /* Flèches : cachées par défaut sur mobile */
    .cas-hero--no-arrows-mobile .cas-hero__arrow { display: none !important; }

    /* Padding-bottom suffisant pour les dots */
    .cas-hero--carousel .cas-hero__container {
        padding-bottom: 80px !important;
    }
}

@media (max-width: 480px) {
    /* Plus de marge h/b sur très petit écran */
    .cas-hero__container {
        padding: 50px 14px !important;
    }

    .cas-hero__eyebrow {
        font-size: 9px;
        letter-spacing: 2px;
        padding: 4px 10px;
        margin-bottom: 8px;
    }

    .cas-hero__title {
        margin-bottom: 8px !important;
    }

    .cas-hero__subtitle {
        margin-bottom: 14px !important;
        font-size: 13px !important;
    }

    /* Boutons côte à côte (PAS empilés) - taille réduite */
    .cas-hero__buttons {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        width: auto !important;
        gap: 6px;
    }
    .cas-hero__buttons .cas-hero__btn {
        width: auto !important;
        padding: 7px 12px;
        font-size: 10px;
        letter-spacing: 0.3px;
    }
    .cas-hero__buttons .cas-hero__btn-content { gap: 6px; }
    .cas-hero__buttons .cas-hero__btn-icon svg,
    .cas-hero__buttons .cas-hero__btn-icon i {
        width: 10px;
        height: 10px;
        font-size: 10px;
    }

    .cas-hero--carousel .cas-hero__container {
        padding-bottom: 70px !important;
    }
    .cas-hero__dots { bottom: 12px; }

    .cas-hero__progress { height: 2px; }
}

/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .cas-hero__slide,
    .cas-hero__bg-image,
    .cas-hero__btn-shine,
    .cas-hero__progress-bar,
    .cas-hero--animate .cas-hero__slide.is-active * {
        animation: none !important;
        transition: none !important;
    }
    .cas-hero__bg-video { display: none; }
}
