/* --- Base & Normalized Styles --- */

.site_header {
    display: flex;
    width: 100%;
    justify-content: center;
    position: fixed;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    background: #FFF;
    background-position: bottom center;
}

body.home:not(.is-scrolled) .site_header {
    background-image: url('/wp-content/themes/webstudios/assets/img/bg_header.svg');
}

.site_header_sized {
    display: flex;
    width: 100%;
    max-width: 1280px;
    justify-content: space-between;
    padding: 0 10px;
    box-sizing: border-box;
    align-items: center;
}

.site_header_logo_c {
    display: flex;
    width: 200px;
    height: 110px;
    max-height: 100%;
    overflow: visible;
}

.site_header_logo_c img {
    display: block;
    width: auto;
    height: 130%;
}

.site_header_menu_c {
    display: flex;
    align-items: center;
}

/* --- Navigation Menu CSS --- */

.site_header_menu_nav {
    display: flex;
    align-items: center;
}

.site_header_menu_item {
    position: relative;
    margin: 0 15px;
}

.site_header_menu_item_head {
    display: flex;
    align-items: center;
    gap: 5px;
}

.site_header_menu_item_head a {
    font: 400 20px/1 OS_ALT_Regular;
    color: #242424;
    text-decoration: none;
    padding: 10px 0;
    position: relative; /* Required to anchor the SVG underline */
    transition: color 0.3s ease;
}

/* --- Active Menu Item & Tilde SVG --- */
.site_header_menu_item.is-active > .site_header_menu_item_head > a {
    color: #3FB0E5; /* Makes the text blue */
}

.site_header_menu_item.is-active > .site_header_menu_item_head > a::after {
    content: '';
    position: absolute;
    bottom: 0px; /* Adjust this to move the tilde up or down */
    left: 0;
    width: 100%;
    height: 8px; /* Adjust based on the height of your SVG */
    background-image: url('/wp-content/themes/webstudios/assets/img/tilde_svg.svg'); /* VERIFY THIS PATH */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    pointer-events: none;
}

/* Optional: Add tilde on hover for desktop */
@media (min-width: 1025px) {
    .site_header_menu_item:not(.is-active) > .site_header_menu_item_head > a:hover {
        color: #3FB0E5;
    }
    .site_header_menu_item:not(.is-active) > .site_header_menu_item_head > a:hover::after {
        content: '';
        position: absolute;
        bottom: 0px;
        left: 0;
        width: 100%;
        height: 8px;
        background-image: url('/wp-content/themes/webstudios/assets/img/tilde_svg.svg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center top;
        pointer-events: none;
    }
}

/* Submenu Toggle Button (Arrow) */
.site_header_submenu_toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.site_header_submenu_toggle::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #242424;
    border-bottom: 2px solid #242424;
    transform: rotate(45deg);
    margin-top: -4px;
}

/* Desktop Dropdown Submenu */
.site_header_submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFFFF;
    padding: 15px;
    border-radius: 10px;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.site_header_menu_item:hover > .site_header_submenu,
.site_header_menu_item.is-open > .site_header_submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Submenu Items */
.site_header_submenu .site_header_menu_item {
    margin: 0 0 10px 0;
    width: 100%;
}

.site_header_submenu .site_header_menu_item:last-child {
    margin-bottom: 0;
}

/* Mobile Hamburger Button (Hidden on Desktop) */
.site_header_menu_toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.site_header_menu_toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #242424;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* --- Contact Button CSS --- */

.site_header_contact_c {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site_header_main_contact_btn {
    display: flex;
    align-items: center;
    text-decoration: none;
    background: #242424;
    border-radius: 30px;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
}

.site_header_main_contact_btn > span:nth-child(1) {
    display: flex;
    width: 50px;
    flex-shrink: 0;
}

.site_header_main_contact_btn > span:nth-child(1) > img {
    height: 40px;
    width: auto;
}

.site_header_main_contact_btn > span:nth-child(2) {
    display: flex;
    width: calc(100% - 50px);
    flex-direction: column;
    align-items: center;
    padding-right: 10px;
    box-sizing: border-box;
}

.site_header_main_contact_btn > span:nth-child(2) > span:nth-child(1) {
    font: 400 13px/1 OS_Regular;
    color: #FFFFFF;
}

.site_header_main_contact_btn > span:nth-child(2) > span:nth-child(2) {
    font: 400 16px/1 OS_Bold;
    color: #FFFFFF; 
    margin-top: 7px;
}

.site_header_cart_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #f8ca07;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.site_header_cart_btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.site_header_cart_btn > img {
    height: 40px;
    width: auto;
}

/* --- Responsive Partition --- */

/* Tablet & Mobile Devices */
@media (max-width: 1024px) {
    .site_header_sized {
        height: 80px;
    }

    /* Show Hamburger */
    .site_header_menu_toggle {
        display: flex;
    }

    /* Animate Hamburger to X when active */
    .site_header_menu_toggle.is-active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .site_header_menu_toggle.is-active span:nth-child(2) {
        opacity: 0;
    }
    .site_header_menu_toggle.is-active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Mobile Slide-in Menu */
    .site_header_menu_c {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        max-width: 350px;
        height: 100vh;
        background: #FFFFFF;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
        z-index: 999;
    }

    .site_header_menu_c.is-open {
        transform: translateX(0);
    }

    .site_header_menu_nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .site_header_menu_item {
        margin: 0 0 10px 0;
        width: 100%;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
    }

    .site_header_menu_item_head {
        justify-content: space-between;
        width: 100%;
    }

    /* Mobile Submenu (Accordion style) */
    .site_header_submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 10px 0 0 20px;
        background: transparent;
        min-width: 100%;
        display: none;
    }

    .site_header_menu_item.is-open > .site_header_submenu {
        display: block;
    }

    /* Hide Contact Button text on small screens */
    .site_header_main_contact_btn > span:nth-child(2) {
        display: none;
    }
    .site_header_main_contact_btn {
        background: transparent;
        padding: 0;
    }
    
    
    .site_header_cart_btn {
        width: 50px;
        height: 50px;
    }
    
    .site_header_main_contact_btn > span:nth-child(1) > img {
        width: 50px;
        height: 50px;
    }
    
    .site_header_logo_c {
        order: 1;
    }

    .site_header_menu_c {
        order: 2;
    }

    .site_header_contact_c {
        order: 3;
    }

    .site_header_menu_toggle {
        order: 4;
    }
}






/* --- Badge Compteur Panier --- */

/* Indispensable : permet de positionner le badge par rapport au bouton, et non par rapport à toute la page */
.site_header_cart_btn {
    position: relative; 
}

.cart-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #d93636; /* Rouge classique pour les notifications */
    color: #ffffff;
    font-size: 11px;
    font-family: 'OS_Bold', sans-serif; /* Utilise la police de votre site */
    font-weight: bold;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    border: 2px solid #FFF; /* Liseré blanc pour le détacher du fond jaune */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    transition: transform 0.2s ease;
}

/* Animation au survol du bouton panier */
.site_header_cart_btn:hover .cart-count-badge {
    transform: scale(1.1);
}

/* Masquer le badge si le panier est vide (géré par le PHP) */
.cart-count-badge.hidden {
    display: none;
}

/* --- Adaptation Mobile --- */
@media (max-width: 1024px) {
    .cart-count-badge {
        width: 18px;
        height: 18px;
        font-size: 10px;
        line-height: 18px;
        top: -3px;
        right: -3px;
    }
}