/* /assets/css/layout/header.css */

.site-header {
    background-color: var(--color-primary-accent);
    /* Ajout de la couleur de fond */
    position: sticky;
    top: 0;
    z-index: var(--z-index-header);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* Optionnel: petite ombre pour détacher du contenu */
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

/* Site Branding (Logo + Text) */
.site-branding {
    /* On change flex-shrink: 0; par ceci pour qu'il puisse rétrécir si besoin */
    flex: 1;
    min-width: 0;
    /* Évite que le texte ne casse la mise en page flexbox */
    margin-right: 15px;
    /* Réduit un peu l'espace avec la droite sur mobile */
}

.site-logo-and-title-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    overflow: hidden;
    /* Empêche le débordement */
}

/* Style for the WordPress Custom Logo */
.custom-logo {
    max-height: 40px;
    max-width: 40px;
    /* On ajoute une largeur max pour être sûr qu'il reste petit ! */
    width: auto;
    height: auto;
    object-fit: contain;
    /* Garde les bonnes proportions */
    margin-right: 12px;
    flex-shrink: 0;
    /* Le logo ne doit pas rétrécir, c'est le texte qui rétrécira */
}

.site-title-text {
    font-family: var(--font-serif);
    color: var(--color-text-light);
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    /* NOUVEAU : Gestion du débordement */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Main Navigation */
.main-navigation ul.menu {
    list-style: none;
    margin: 0;
    /* Ensure no default margins interfere with alignment */
    padding: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    /* Reduced gap between menu items */
}

.main-navigation .menu-item a {
    font-family: var(--font-sans-serif);
    color: var(--color-text-light);
    font-size: 0.9rem;
    /* Reverted to slightly larger size */
    text-decoration: none;
    padding: 0 4px 5px 4px;
    /* Padding for border spacing */
    border-bottom: 2px solid transparent;
    /* Prevents layout shift */
    transition: border-color 0.3s ease;
    white-space: nowrap;
    /* Prevents wrapping */
}

/* Active / Current Menu Item State */
.main-navigation .current-menu-item a {
    border-bottom-color: var(--color-secondary-accent);
    /* Golden border */
}

.main-navigation .menu-item a:hover {
    border-bottom-color: var(--color-secondary-accent);
    /* Golden border on hover */
}


/* Mobile Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: var(--z-index-menu-toggle);
    /* Ensure it's on top */
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text-light);
    margin: 4px 0;
    transition: all 0.3s ease-in-out;
}


/* Responsive Styles */
@media (max-width: 1024px) {

    /* Breakpoint for tablet and mobile */
    .menu-toggle {
        display: block;
    }

    .main-navigation {
        position: absolute;
        top: 100%;
        /* Position below the header */
        left: 0;
        width: 100%;
        background-color: var(--color-primary-accent);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
        z-index: var(--z-index-menu);
        /* Below the toggle but above content */
    }

    .main-navigation.is-open {
        max-height: 100vh;
        /* Or a large enough value */
    }

    .main-navigation ul.menu {
        flex-direction: column;
        padding: 20px;
        align-items: center;
    }

    .main-navigation .menu-item a {
        padding: 1rem;
        font-size: 1.2rem;
        border-bottom: none;
        /* Remove bottom border for mobile */
    }

    .main-navigation .current-menu-item a {
        background-color: var(--color-violet-light);
        border-radius: 50px;
    }

    .site-title-text {
        font-size: 1.3rem;
    }
}

/* Header Cart Styling */
.header-cart {
    margin-left: 20px;
    flex-shrink: 0;
}

.cart-contents {
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    padding: 5px;
    transition: transform 0.2s ease;
}

.cart-contents:hover {
    transform: scale(1.1);
}

.cart-icon {
    font-size: 1.4rem;
    filter: brightness(0) invert(1);
    /* Makes emoji/icon white if needed, or use SVG */
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--color-secondary-accent);
    /* Gold */
    color: var(--color-primary-accent);
    font-size: 0.75rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1024px) {
    .header-cart {
        margin-left: auto;
        /* Push to right on mobile */
        margin-right: 15px;
    }
}