/* DEFAULT */

/* Style général du header */
.header {
    width: 100%;
    font-family: var(--font-primary);
    background-color: var(--white);
    position: relative;
    justify-content: center;

    z-index: 10;


}

.header-nav {
    /* position: relative; */
    /* important pour positionner .bubble */
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    justify-content: flex-end;
    min-height: var(--min-height-header);
    /* Hauteur minimum pour éviter un header trop petit */
}

/* icone burger menu et close menu */
#menuBurger {
    width: 1.68rem;
}

/* LOGO */
/* Centrage du logo */
.header-logo-link {
    position: absolute;
    /* Rend le logo indépendant des autres éléments */
    left: 50vw;
    transform: translateX(-50%);
    /* Centre le logo parfaitement */
    padding: var(--padding-xs);
    max-height: 65px;
}

.header-logo-link img {
    max-height: 70px;
    width: auto;
    max-width: 25vw;
}

/* END LOGO */

/* RECHERCHE */
.open-close-modal {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.open-close-modal svg {
    height: 23px;
    width: auto;
}

/* END RECHERCHE */

/* SUBMENU */
.nav-left,
.nav-right {
    display: none;
}

.nav-mobile {
    /* position */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 0;
    padding-bottom: 3.7rem;
    margin: 0;
    align-items: center;
    /* general     */
    list-style: none;
    background-color: var(--white);
    /* TEXT */
    text-align: center;
    /* HIDDEN PAR DEFAUT */
    visibility: hidden;
    transform: translateY(-50vh);
    /* Départ légèrement en haut */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 30;
}

/* Quand le menu est ouvert */
.nav-mobile.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    /* Animation descendante */
}

.nav-mobile>li {
    padding-top: var(--padding-sm);
    padding-bottom: var(--padding-sm);
}

/* .nav-mobile li a:not(.cta), */
.menu-name {
    color: var(--color-primary);
    text-transform: uppercase;
    font-weight: var(--font-weight-sm);
    /* text-decoration: none; */
    font-size: 2rem;
    line-height: 100%;
    padding: var(--spacing-xs) clamp(0rem, 0.5rem, 1rem);
    position: relative;
    display: block;
    width: 100%;
}

/* .nav-mobile li a:not(.cta):hover, */
.menu-name:hover {
    text-decoration: underline;
}

.header .header-menu-arrow {
    /* width: 13px; */
    /* margin-left: var(--spacing-md); */
    vertical-align: middle;
    display: inline-block;
    padding-bottom: var(--spacing-xs);

    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    /* ✅ centrage vertical parfait */
}

.header .submenu {
    margin: var(--spacing-md) var(--spacing-sm);
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    flex-direction: column;
    font-size: 1.25rem;
    box-sizing: border-box;
}

/* Quand le menu est activé par le toggle JS */
.header .submenu-active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.submenu-items {
    background: var(--color-tertiary);
    border-radius: 15px;
    list-style: none;
    align-items: center;
    padding-top: var(--padding-lg);
    padding-bottom: 0.75rem;
    padding-inline: 0;
    margin: 0;
    flex-wrap: wrap;
}

.submenu-item {
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.submenu-item a {
    text-transform: uppercase;
    color: var(--color-primary);
}

/* END SUBMENU */

/* BULLE */

.bubble {
    display: none;
}

/* END BULLE */

/* SLIDE CATEGORIE PRODUIT */
/* Container des cartes */
.header .submenu .card-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    /* Astuce magique : chaque ligne a la même hauteur */
    /* Mobile : 2 cartes par ligne */
    gap: var(--padding-md);
    padding: var(--padding-sm);
    padding-bottom: var(--padding-xl);
}

/* Style des cartes */
.header .submenu .card {
    overflow: hidden;
    text-align: center;
    padding-block: var(--padding-md);
    padding-inline: var(--padding-xs);
    /* height: auto; */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border-radius: 15px;
    height: 100%;
    box-sizing: border-box;
}

.header .submenu .card a,
.header .submenu .card a:hover {
    color: var(--color-primary);
}

.header .submenu .card:not(.ctaHeaderNavMobile) {
    background-color: var(--color-tertiary);
    color: var(--color-primary);
    ;
}

.ctaHeaderNavMobile {
    background-color: var(--blueMinusl);
    color: white;
}

.header .cta {
    font-size: clamp(0.875rem, 1.5vw, 1.5rem);
}

/* Forcer toutes les .card à la même hauteur */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.header .submenu .card:hover {
    text-decoration: underline;
}

/* Images */
.header .submenu .card img {
    max-width: 70%;
    height: auto;
    max-height: 6.25rem;
}

/* Texte */
.header .submenu .card p {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    /* font-size: var(--fs-small-text-deco); */
    color: var(--color-primary);
    text-transform: uppercase;
}

/* END SLIDE CATEGORIE PRODUIT */

@media (min-width: 1024px) {

    .header {
        position: fixed;
        top: 0;
    }

    .header-nav {
        /* Alignement horizontal */
        flex-direction: row;
        justify-content: space-between;
        /* Menu gauche / Logo / Menu droit */
        align-items: center;
        padding-inline: var(--spacing-xs);
        padding-block: .5rem;
        min-height: var(--min-height-header-desktop);
    }

    /* Centrage du logo */
    .header-logo-link {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        padding: var(--padding-xs);
        min-height: var(--min-height-header-desktop);
        top: 10%;
    }

    .header-logo-link img {
        height: 100%;
        max-height: 80px;
    }

    /* FIN GESTION LOGO */

    /* RECHERCHE */
    .open-close-modal {
        display: flex;
        justify-self: center;
    }

    .open-close-modal svg {
        height: 27px;
    }

    /* RECHERCHE */

    /* LINKS ET NAVIGATION */
    .nav-mobile {
        display: none;
    }

    .nav-left,
    .nav-right {
        flex-direction: row;
        /* le menu s’aligne horizontalement */
    }

    .nav-left li,
    .nav-right li {
        margin-inline: clamp(0.25rem, 1vw, 0.5rem);
        /* espace horizontal entre items */
    }

    .nav-left,
    .nav-right {
        display: flex;
        flex-direction: row;
        list-style: none;
        margin: 0;
        padding: 0;
        align-items: center;
    }

    .menu-name {
        position: unset;
        font-size: clamp(0.875rem, 1.5vw, 1.5rem);
        display: inline;
        width: unset;
    }

    .nav-left li a:not(.cta):hover,
    .nav-right li a:not(.cta):hover {
        text-decoration: underline;
    }

    .header .header-menu-arrow {
        width: 0.5rem;
        margin-left: 0.75rem;
        vertical-align: middle;
        display: inline-block;
        padding-bottom: var(--spacing-xs);

        position: unset;
        right: unset;
        top: unset;
        transform: unset;
    }

    /* LINKS ET NAVIGATION */

    /* SOUS-MENU */

    .header .submenu {
        position: absolute;
        top: 100%;
        /* Juste sous le header */
        left: 0;
        /* Pour qu’il commence à gauche de l’écran */
        width: 100%;
        /* Fait 100% de la largeur de l’écran */
        background: var(--color-tertiary);
        padding-inline: var(--padding-md);
        padding-top: 1.5rem;
        padding-bottom: 0.5rem;
        /* Element centré */
        display: flex;
        justify-content: center;
        /* Centre horizontalement */
        align-items: center;
        /* Centre verticalement */
        /* Cache le sous-menu par défaut */
        /* display: none; */
        /* quand display: none; est utilisé, les transitions ne s’appliquent pas */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        margin: 0;
        border-radius: 0px;
        font-size: clamp(0.875rem, 1.5vw, 1.5rem);
    }

    .submenu-content {
        max-width: 1440px;
        margin-inline: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        flex-direction: column;
    }

    .submenu-items {
        list-style: none;
        display: flex;
        /* Permet d’aligner les <li> horizontalement */
        gap: 20px;
        /* Espacement entre les éléments */
        padding-block: 0;
        margin: 0;
    }

    /* Afficher le sous-menu au survol de l'élément parent */
    .header .submenu.submenu-active {
        opacity: 1;
        visibility: visible;
        transition: visibility 0s, opacity 0s linear;
    }

    .header .submenu .card p {
        margin-top: var(--spacing-xl);
        margin-bottom: var(--spacing-md);
    }

    /* END SOUS-MENU */

    /* LA BULLE DU HEADER */
    .header-logo-link,
    .nav-left,
    .nav-right {
        z-index: 30;
    }

    .bubble {
        display: block;
        position: absolute;
        top: 99%;
        /* Ajustement pour un centrage parfait */
        transform: translateX(50%);
        right: 50%;
        /* width: 19rem; */

        /* Animation fluide sur la position / la taille */
        opacity: 1;
        transition: all 0.3s ease;
        z-index: 25;
    }

    .bubble img {
        max-width: 100%;
        /* Ne dépasse jamais le parent */
        /* height: auto; */
        /* display: block; */
        /* Évite les espaces indésirables */
    }

    .header .submenu .card-container {
        /* grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); */
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        align-items: flex-end;
        justify-content: center;
        padding: var(--padding-sm);
        gap: unset;
    }

    .header .submenu .card-container .card {
        flex: 1 1 0;
        min-width: 0;
    }

    .header .submenu .card img {
        max-width: 100%;
        max-height: 10.5rem;
    }
}

@media (min-width: 1366px) {
    .header-nav {
        max-width: 1440px;
        margin-inline: auto;
    }
}

@media (min-width: 1680px) {
    .header-logo-link img {
        height: 95px;
    }
}