/**
 * Header Styles
 */

/*
 * Senza hero in cima: header in flusso (occupa spazio).
 * Con hero: overlay assoluto sopra l’immagine.
 */
.site-header {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #fff;
    padding: 1.25rem 0;
}

body.has-top-hero .site-header {
    position: absolute;
    top: 20px;
    background: transparent;
    padding: 2rem 0;
}

/* Menu fisso separato - sempre fixed, solo show/hide */
.site-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.4s;
    will-change: transform, opacity;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
}

.site-header-fixed.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.site-header-fixed.hiding {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Social header: destra, staccati dal bordo, colore come il menù */
.aq-social-icons--header {
    position: absolute;
    right: 1.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    z-index: 10002;
    pointer-events: auto;
}

.aq-social-icons__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    text-decoration: none;
    line-height: 0;
    transition: opacity 0.25s ease, color 0.25s ease;
}

.aq-social-icons__link:hover {
    opacity: 0.75;
}

.aq-social-icons__link svg {
    display: block;
    width: 22px;
    height: 22px;
}

.aq-social-icons--mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
}

.aq-social-icons--mobile .aq-social-icons__link {
    color: #000000;
}

body.has-top-hero:not(.logo-on-light) .site-header:not(.site-header-fixed) .aq-social-icons--header .aq-social-icons__link {
    color: #fff;
}

body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .aq-social-icons--header .aq-social-icons__link {
    color: #fff;
}

body.has-top-hero.logo-on-light .site-header:not(.site-header-fixed) .aq-social-icons--header .aq-social-icons__link,
body.no-top-hero .site-header:not(.site-header-fixed) .aq-social-icons--header .aq-social-icons__link,
.site-header-fixed .aq-social-icons--header .aq-social-icons__link {
    color: #000000;
}

@media (max-width: 900px) {
    .aq-social-icons--header {
        right: 0.85rem;
        gap: 0.55rem;
    }
    .aq-social-icons__link svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .aq-social-icons--header {
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        gap: 0.45rem;
    }
    .aq-social-icons__link svg {
        width: 18px;
        height: 18px;
    }
}

/* Padding laterale solo per il contenuto interno */
.main-navigation {
    padding: 0 2rem;
}

.main-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links-left {
    justify-content: flex-end;
}

.nav-links-right {
    justify-content: flex-start;
    align-items: center;
}

.nav-link {
    color: #000000;
    text-decoration: none;
    font-size: 1.55rem;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
    font-family: var(--font-title) !important;
}

/* Su hero scuro: link chiari (JS toglie logo-on-light) */
body.has-top-hero:not(.logo-on-light) .site-header:not(.site-header-fixed) .nav-link {
    color: #fff;
}

/* Menu fisso: link scuri */
.site-header-fixed .nav-link {
    color: #000000;
}

.nav-link:hover {
    opacity: 0.8;
}

/* Link speciale "ordina" */
.nav-link.ordina {
    border: 2px solid currentColor;
    border-radius: 25px;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
}

.nav-link.ordina:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.site-header-fixed .nav-link.ordina {
    border-color: #000000;
}

.site-header-fixed .nav-link.ordina:hover {
    background-color: rgba(29, 35, 39, 0.05);
}

/* Carrello WooCommerce in header (pill come «Ordina»; icona outline; colore link forzato vs blu :visited) */
.aq-header-cart {
    display: flex;
    align-items: center;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.aq-header-cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border: 2px solid #fff;
    border-radius: 25px;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    font-family: var(--font-sans) !important;
    line-height: 1;
}

#site-header .aq-header-cart-link {
    border-color: #000000;
}

#site-header .aq-header-cart-link:any-link {
    color: #000000 !important;
}

body.has-top-hero:not(.logo-on-light) #site-header .aq-header-cart-link {
    border-color: #fff;
}

body.has-top-hero:not(.logo-on-light) #site-header .aq-header-cart-link:any-link {
    color: #fff !important;
}

.site-header-fixed .aq-header-cart-link {
    border-color: #000000;
}

.site-header-fixed .aq-header-cart-link:any-link {
    color: #000000 !important;
}

.aq-header-cart-link:hover {
    opacity: 0.95;
    background-color: rgba(255, 255, 255, 0.1);
}

.site-header-fixed .aq-header-cart-link:hover {
    background-color: rgba(29, 35, 39, 0.06);
}

.aq-header-cart-icon {
    display: flex;
    align-items: center;
    line-height: 0;
    color: inherit;
}

/* SVG carrello (shopping_cart.svg: glyph a riempimento, currentColor = colore link) */
.aq-header-cart-icon svg {
    width: 32px;
    height: 32px;
    display: block;
    flex-shrink: 0;
    color: inherit;
}

.aq-header-cart-icon svg path {
    fill: currentColor !important;
}

.aq-header-cart-count {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.28rem;
    box-sizing: border-box;
    border-radius: 999px;
    background-color: #000000;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.aq-header-cart-count--empty {
    display: none;
}

/* Carrello nel menu mobile */
.mobile-menu-content .aq-header-cart {
    margin: 1rem 0 0;
    justify-content: center;
}

.mobile-menu-content .aq-header-cart-link {
    border-color: #000000;
}

.mobile-menu-content .aq-header-cart-link:any-link {
    color: #000000 !important;
}

.site-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 2rem;
    grid-column: 2;
    justify-self: center;
}

.site-branding .custom-logo {
    max-height: 180px;
    width: auto;
    transition: all 0.3s ease;
}

.site-header-fixed .site-branding .custom-logo {
    max-height: 56px;
    filter: none;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.site-header-fixed .site-title {
    color: #000000;
    font-size: 1.2rem;
}

/* Logo SVG e immagini — header trasparente (in alto): più grande e bianco */
.site-branding .custom-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.site-branding .custom-logo,
.site-branding img,
.site-branding svg {
    height: auto;
    width: auto;
    max-height: 180px;
    max-width: min(520px, 78vw);
    display: block;
}

.site-branding svg {
    width: auto;
    height: 180px;
    max-width: min(520px, 78vw);
    overflow: visible;
}

/*
 * Logo header classico:
 * - default / sfondo chiaro / no-hero → nero
 * - hero scuro (body.logo-on-dark) → bianco
 */
.site-header:not(.site-header-fixed) .site-branding img.custom-logo,
.site-header:not(.site-header-fixed) .site-branding .custom-logo-link > img {
    filter: brightness(0);
}

body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding img.custom-logo,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding .custom-logo-link > img {
    filter: brightness(0) invert(1);
}

.site-header:not(.site-header-fixed) .site-branding svg *,
.site-header:not(.site-header-fixed) .site-branding svg path,
.site-header:not(.site-header-fixed) .site-branding svg circle,
.site-header:not(.site-header-fixed) .site-branding svg rect,
.site-header:not(.site-header-fixed) .site-branding svg polygon,
.site-header:not(.site-header-fixed) .site-branding svg line,
.site-header:not(.site-header-fixed) .site-branding svg ellipse,
.site-header:not(.site-header-fixed) .site-branding svg polyline,
.site-header:not(.site-header-fixed) .site-branding svg text,
.site-header:not(.site-header-fixed) .site-branding svg tspan,
.site-header:not(.site-header-fixed) .site-branding svg g,
.site-header:not(.site-header-fixed) .site-branding svg use {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

.site-header:not(.site-header-fixed) .site-branding svg path[stroke]:not([fill]),
.site-header:not(.site-header-fixed) .site-branding svg circle[stroke]:not([fill]),
.site-header:not(.site-header-fixed) .site-branding svg rect[stroke]:not([fill]),
.site-header:not(.site-header-fixed) .site-branding svg polygon[stroke]:not([fill]),
.site-header:not(.site-header-fixed) .site-branding svg line,
.site-header:not(.site-header-fixed) .site-branding svg polyline {
    fill: none !important;
    stroke: #000000 !important;
}

body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg *,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg path,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg circle,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg rect,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg polygon,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg line,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg ellipse,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg polyline,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg text,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg tspan,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg g,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg use {
    fill: #ffffff !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
}

body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg path[stroke]:not([fill]),
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg circle[stroke]:not([fill]),
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg rect[stroke]:not([fill]),
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg polygon[stroke]:not([fill]),
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg line,
body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-branding svg polyline {
    fill: none !important;
    stroke: #ffffff !important;
}

.site-header:not(.site-header-fixed) .site-title {
    color: #000000;
}

body.has-top-hero.logo-on-dark .site-header:not(.site-header-fixed) .site-title {
    color: #ffffff;
}

.site-header-fixed .site-branding .custom-logo,
.site-header-fixed .site-branding img,
.site-header-fixed .site-branding svg {
    max-height: 56px;
}

.site-header-fixed .site-branding svg {
    height: 56px;
}

/* Colore SVG nel menu fisso - nero */
.site-header-fixed .site-branding svg * {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Poi specifica per ogni tipo di elemento SVG */
.site-header-fixed .site-branding svg path,
.site-header-fixed .site-branding svg circle,
.site-header-fixed .site-branding svg rect,
.site-header-fixed .site-branding svg polygon,
.site-header-fixed .site-branding svg line,
.site-header-fixed .site-branding svg ellipse,
.site-header-fixed .site-branding svg polyline,
.site-header-fixed .site-branding svg text,
.site-header-fixed .site-branding svg tspan,
.site-header-fixed .site-branding svg g,
.site-header-fixed .site-branding svg use,
.site-header-fixed .site-branding svg defs,
.site-header-fixed .site-branding svg clipPath,
.site-header-fixed .site-branding svg mask,
.site-header-fixed .site-branding svg pattern {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Elementi che hanno solo stroke (bordi senza riempimento) */
.site-header-fixed .site-branding svg path[stroke]:not([fill]),
.site-header-fixed .site-branding svg circle[stroke]:not([fill]),
.site-header-fixed .site-branding svg rect[stroke]:not([fill]),
.site-header-fixed .site-branding svg polygon[stroke]:not([fill]),
.site-header-fixed .site-branding svg line,
.site-header-fixed .site-branding svg polyline,
.site-header-fixed .site-branding svg ellipse[stroke]:not([fill]) {
    stroke: #000000 !important;
    fill: none !important;
}

/* Forza stroke anche se non presente nell'attributo */
.site-header-fixed .site-branding svg path[stroke],
.site-header-fixed .site-branding svg circle[stroke],
.site-header-fixed .site-branding svg rect[stroke],
.site-header-fixed .site-branding svg polygon[stroke],
.site-header-fixed .site-branding svg line,
.site-header-fixed .site-branding svg ellipse[stroke],
.site-header-fixed .site-branding svg polyline {
    stroke: #000000 !important;
}

/* Testo SVG nel menu fisso */
.site-header-fixed .site-branding svg text,
.site-header-fixed .site-branding svg tspan {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Responsive Desktop */
@media (min-width: 769px) {
    .main-navigation {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 2rem;
    }
    
    .nav-links {
        flex-shrink: 0;
    }
    
    .nav-links-left {
        grid-column: 1;
        justify-self: end;
    }
    
    .nav-links-right {
        grid-column: 3;
        justify-self: start;
    }
    
    .site-branding {
        grid-column: 2;
        justify-self: center;
        flex-shrink: 0;
    }
}

/* Responsive Tablet */
@media (max-width: 768px) {
    .site-header {
        padding: 1.5rem 0;
    }
    
    /* Menu fisso tablet - già gestito da .site-header-fixed */
    
    .header-container {
        padding: 0;
    }
    
    .main-navigation {
        padding: 0 1.5rem;
    }
    
    .main-navigation {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .nav-links-left {
        grid-column: 1;
        justify-self: end;
    }
    
    .nav-links-right {
        grid-column: 3;
        justify-self: start;
    }
    
    .site-branding {
        margin: 0 1rem;
        grid-column: 2;
        justify-self: center;
    }
    
    .site-branding .custom-logo,
    .site-branding img,
    .site-branding svg {
        max-height: 140px;
    }

    .site-branding svg {
        height: 140px;
    }
    
    .site-header-fixed .site-branding .custom-logo,
    .site-header-fixed .site-branding img,
    .site-header-fixed .site-branding svg {
        max-height: 48px;
    }

    .site-header-fixed .site-branding svg {
        height: 48px;
    }
    
    .nav-link {
        font-size: 1.25rem;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #000000;
    font-size: 1.4rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    font-family: var(--font-title);
    transition: opacity 0.3s ease;
}

.mobile-menu-toggle:hover {
    opacity: 0.8;
}

.site-header-fixed .mobile-menu-toggle {
    color: #000000;
}

body.has-top-hero:not(.logo-on-light) .site-header:not(.site-header-fixed) .mobile-menu-toggle {
    color: #fff;
}

/* Mobile Menu Overlay - si apre verso il basso */
.mobile-menu-overlay {
    display: none;
}

.mobile-menu-content {
    position: relative;
    width: 100%;
    background: #fff;
    padding: 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    z-index: 100000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
}

.mobile-menu-content.active {
    max-height: 70vh;
    overflow-y: auto;
}

/* Desktop: nascondi menu mobile */
@media (min-width: 481px) {
    .mobile-menu-content {
        display: none;
    }
}

/* Blocca scroll quando menu è aperto */
body.menu-open {
    overflow: hidden;
}

.mobile-nav-link {
    display: block;
    padding: 1rem 0;
    color: #000000;
    text-decoration: none;
    font-size: 1.55rem;
    font-weight: 500;
    font-family: var(--font-title) !important;
    transition: opacity 0.3s ease;
}

.mobile-nav-link:hover {
    opacity: 0.8;
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

/* Link "ordina" nel menu mobile */
.mobile-nav-link.ordina {
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin: 0.5rem 0;
    text-align: center;
    transition: all 0.3s ease;
}

.mobile-nav-link.ordina:hover {
    background-color: rgba(29, 35, 39, 0.05);
}

/* Responsive Mobile */
@media (max-width: 480px) {
    .site-header {
        padding: 1rem 0;
    }
    
    /* Menu fisso mobile - già gestito da .site-header-fixed */
    
    .header-container {
        padding: 0;
    }
    
    .main-navigation {
        padding: 0;
    }
    
    .main-navigation {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    /* Nascondi link desktop */
    .nav-links {
        display: none;
    }
    
    /* Wrapper logo e menu mobile */
    .site-branding-wrapper {
        position: relative;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        order: 0;
    }
    
    /* Logo centrato e più grande */
    .site-branding {
        margin: 0;
        text-align: center;
    }
    
    .site-branding .custom-logo,
    .site-branding img,
    .site-branding svg {
        max-height: 150px;
    }
    
    .site-branding svg {
        height: 150px;
    }
    
    .site-header-fixed .site-branding .custom-logo,
    .site-header-fixed .site-branding img,
    .site-header-fixed .site-branding svg {
        max-height: 52px;
    }
    
    .site-header-fixed .site-branding svg {
        height: 52px;
    }
    
    /* Menu toggle centrato sotto il logo - sempre visibile */
    .mobile-menu-toggle {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .mobile-menu-content {
        display: none;
        width: 100%;
    }
}

