/* ====================================================================
   FILE CSS COMPLETO - VERSIONE >> (CONTRASTI E PALLINO CARRELLO)
   ==================================================================== */

:root {
    --chc-ocra: #997500; /* Ocra più scuro e marcato per contrasto elevato */
    --chc-ocra-hover: #664d00;
    --chc-text: #222222;
    --chc-bg-mobile: #ffffff;
    --chc-optical-shift: 3px; 
}

/* 1. ANNULLAMENTO HEADER NATIVO */
.wp-block-template-part header,
body header.wp-block-template-part,
.site-header,
header.header {
    display: none !important;
}

/* 2. STRUTTURA CONTENITORE NUOVO HEADER */
.custom-optimized-header {
    display: block !important;
    width: 100%;
    background: transparent;
}

.chc-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center !important;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
}

/* 3. BRAND */
.chc-brand {
    display: flex;
    align-items: center !important; 
    gap: 15px;
}

.wp-block-site-logo {
    display: inline-flex;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
}

.chc-title * {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: var(--chc-text) !important;
    text-decoration: none !important;
    margin: 0 !important;
}

/* 4. MENU DESKTOP - PUNTO 1 (Contrasto in Hover migliorato) */
.chc-nav-desktop {
    display: flex;
    gap: 25px;
    margin-left: 40px;
    margin-right: auto;
    align-items: center !important;
    transform: translateY(var(--chc-optical-shift));
}

.chc-nav-desktop a {
    text-decoration: none;
    color: var(--chc-text);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 0; 
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.chc-nav-desktop a:hover {
    color: var(--chc-ocra-hover);
    border-bottom-color: var(--chc-ocra);
    font-weight: 600;
}

/* 5. AZIONI E PALLINO CARRELLO - PUNTO 2 */
.chc-actions {
    display: flex;
    align-items: center !important;
    gap: 20px;
    transform: translateY(var(--chc-optical-shift));
}

.chc-cart-icon {
    position: relative;
    color: var(--chc-text);
    display: inline-flex;
    align-items: center;
}

/* Badge quantità flessibile per evitare troncamenti a più cifre */
.chc-cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    /* background: var(--chc-ocra); */
    background: #d9534f !important; /* Rosso esplicito ben visibile */
    color: #fff;
    font-size: 0.70rem;
    font-weight: 700;
    /* min-width: 18px; */
    min-width: 20px;
    height: 18px;
    padding: 0 4px;
    /* border-radius: 9px; */
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;

    line-height: 1;
}

/* 6. HAMBURGER */
.chc-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.chc-hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--chc-text);
    border-radius: 3px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.chc-hamburger.is-active span:nth-child(1) { transform: translateY(9px) rotate(45deg); background-color: var(--chc-ocra); }
.chc-hamburger.is-active span:nth-child(2) { opacity: 0; }
.chc-hamburger.is-active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background-color: var(--chc-ocra); }

/* 7. TENDINA MOBILE OFF-CANVAS (Larghezza parziale controllata) */
.chc-mobile-dropdown {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;          /* Occupazione parziale dello schermo (modificabile a piacimento) */
    max-width: 320px;    /* Limite massimo di larghezza */
    height: 100vh;
    background: var(--chc-bg-mobile);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: block !important;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding-top: 80px;
    box-sizing: border-box;
}

.chc-mobile-dropdown.is-open {
    transform: translateX(0);
}

/* Voci menu mobile - PUNTO 1 (Contrasto e interazione chiara) */
.chc-mobile-dropdown a {
    display: block;
    padding: 16px 24px;
    color: var(--chc-text);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    border-bottom: 1px solid #eeeeee;
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.chc-mobile-dropdown a:hover,
.chc-mobile-dropdown a:active {
    background-color: var(--chc-ocra) !important;
    color: #ffffff !important;
    padding-left: 28px; /* Micro-feedback visivo in hover/active */
}

body.chc-scroll-locked {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

@media (max-width: 768px) {
    .chc-nav-desktop { display: none; }
    .chc-hamburger { display: flex; }
    .chc-actions { transform: none; }
}
