/* ==========================================================================
   Site header — two tiers on desktop, one bar + drawer on mobile.

   Markup: inc/cms.php cms_render_header(). The .navbar / .nav-menu /
   .hamburger classes stay because script.js and blog.js bind to them.
   navigation.css, styles.css and js/navigation-fix.js (inline styles) all
   style the old one-row bar, so rules here are scoped to .site-header and
   use !important where they must win over those.
   ========================================================================== */

.site-header {
    --sh-wine: #5c1a33;
    --sh-wine-dark: #3d1122;
    --sh-red: #8B0000;
    --sh-gold: #c9a962;
    --sh-text: #2a2226;
    --sh-muted: #7d726c;
    --sh-line: #efe8df;
    --sh-row1: 56px;
    --sh-row2: 42px;
    --sh-bar: 64px;
}

html body .navbar.site-header {
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.97) !important;
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    backdrop-filter: saturate(160%) blur(10px);
    box-shadow: 0 1px 0 var(--sh-line) !important;
    transition: box-shadow 0.25s ease !important;
}

html body .navbar.site-header.is-scrolled {
    box-shadow: 0 1px 0 var(--sh-line), 0 10px 30px -18px rgba(40, 15, 25, 0.35) !important;
}

html body .navbar.site-header .nav-container {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "logo meta actions"
        "menu menu menu";
    align-items: center !important;
    justify-content: stretch !important;
    column-gap: 28px;
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
}

/* ---- Brand ---------------------------------------------------------------- */

html body .navbar.site-header .nav-logo {
    grid-area: logo;
    display: flex;
    align-items: center;
    height: var(--sh-row1);
}

.site-header .site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

html body .navbar.site-header .nav-logo img {
    height: 44px !important;
    width: 44px !important;
    object-fit: cover;
    border-radius: 50% !important;
    box-shadow: 0 0 0 1px var(--sh-line), 0 4px 12px -6px rgba(60, 20, 30, 0.35) !important;
    transform: none !important;
}

.site-header .site-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

html body .site-header .site-brand__name {
    color: var(--sh-wine-dark);
    font-size: 1rem !important;
    font-weight: 700;
    white-space: nowrap;
}

html body .site-header .site-brand__tag {
    margin-top: 2px;
    color: var(--sh-muted);
    font-size: 0.74rem !important;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ---- Contact meta --------------------------------------------------------- */

.site-header .site-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    min-width: 0;
}

html body .site-header .site-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--sh-muted) !important;
    font-size: 0.82rem !important;
    text-decoration: none !important;
    white-space: nowrap;
}

html body .site-header a.site-meta__item:hover {
    color: var(--sh-wine) !important;
}

.site-header .site-meta__item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--sh-gold);
}

/* ---- Actions: languages + shop -------------------------------------------- */

.site-header .site-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 14px;
}

.site-header .site-lang {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--sh-line);
    border-radius: 999px;
    background: #fff;
}

.site-header .site-lang__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 26px;
    border-radius: 999px;
    transition: background 0.15s ease;
}

.site-header .site-lang__link:hover {
    background: #f6f1ea;
}

.site-header .site-lang__link.is-active {
    background: #f1e7da;
}

html body .navbar.site-header .site-lang .flag {
    width: 20px !important;
    height: 14px !important;
    opacity: 0.75 !important;
    border-radius: 2px !important;
}

html body .navbar.site-header .site-lang__link.is-active .flag,
html body .navbar.site-header .site-lang__link:hover .flag {
    opacity: 1 !important;
}

html body .site-header .site-shop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px 0 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sh-wine) 0%, var(--sh-red) 100%);
    color: #fff !important;
    font-size: 0.88rem !important;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 8px 18px -10px rgba(92, 26, 51, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html body .site-header .site-shop:hover,
html body .site-header .site-shop:focus-visible {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -10px rgba(92, 26, 51, 0.9);
}

.site-header .site-shop svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

/* ---- Menu row ------------------------------------------------------------- */

html body .navbar.site-header .nav-menu {
    grid-area: menu;
    display: flex !important;
    justify-content: center;
    align-items: stretch;
    gap: clamp(14px, 1.9vw, 30px) !important;
    height: var(--sh-row2);
    margin: 0 !important;
    padding: 0 !important;
    border-top: 1px solid var(--sh-line);
    list-style: none !important;
}

html body .navbar.site-header .nav-menu > li {
    display: flex;
    align-items: stretch;
    margin: 0 !important;
    padding: 0 !important;
}

html body .navbar.site-header .nav-menu > li > a {
    display: inline-flex;
    align-items: center;
    padding: 0 !important;
    color: var(--sh-text) !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
}

html body .navbar.site-header .nav-menu > li > a:hover,
html body .navbar.site-header .nav-menu > li > a.active {
    color: var(--sh-wine) !important;
}

html body .navbar.site-header .nav-menu > li > a::after {
    bottom: 0 !important;
    height: 2px !important;
    border-radius: 2px 2px 0 0;
    background-color: var(--sh-wine) !important;
}

/* Shop and languages live in the top row on desktop; the drawer shows them. */
html body .navbar.site-header .nav-menu > li.sp-nav-item,
html body .navbar.site-header .nav-menu > li.language-switcher {
    display: none !important;
}

html body .navbar.site-header .hamburger {
    display: none !important;
}

/* ---- Tablet & mobile: one bar + drawer ------------------------------------ */

@media (max-width: 1080px) {
    html body .navbar.site-header .nav-container {
        grid-template-columns: auto 1fr auto auto;
        grid-template-areas: "logo . actions burger";
        column-gap: 12px;
        height: var(--sh-bar);
        padding: 0 16px !important;
    }

    html body .navbar.site-header .nav-logo {
        height: var(--sh-bar);
    }

    .site-header .site-meta,
    .site-header .site-lang {
        display: none;
    }

    html body .navbar.site-header .hamburger {
        grid-area: burger;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        border: 1px solid var(--sh-line);
        background: #fff;
    }

    html body .navbar.site-header .hamburger span {
        width: 20px !important;
        height: 2px !important;
        margin: 2.5px 0 !important;
        border-radius: 2px;
        background: var(--sh-wine-dark) !important;
    }

    html body .navbar.site-header .nav-menu {
        position: fixed !important;
        top: var(--sh-bar) !important;
        left: -100% !important;
        right: auto !important;
        width: 100% !important;
        height: calc(100vh - var(--sh-bar)) !important;
        height: calc(100dvh - var(--sh-bar)) !important;
        flex-direction: column !important;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0 !important;
        padding: 8px 20px 28px !important;
        overflow-y: auto;
        background: #fff !important;
        border-top: 1px solid var(--sh-line);
        box-shadow: none !important;
        text-align: left !important;
        transition: left 0.28s ease !important;
    }

    html body .navbar.site-header .nav-menu.active {
        left: 0 !important;
    }

    html body .navbar.site-header .nav-menu > li {
        margin: 0 !important;
        border-bottom: 1px solid var(--sh-line);
    }

    html body .navbar.site-header .nav-menu > li > a {
        width: 100%;
        min-height: 52px;
        font-size: 1rem !important;
    }

    html body .navbar.site-header .nav-menu > li > a::after {
        display: none !important;
    }

    html body .navbar.site-header .nav-menu > li.language-switcher {
        display: flex !important;
        justify-content: center !important;
        margin: 18px 0 0 !important;
        border-bottom: 0;
    }

    html body .navbar.site-header .nav-menu .flag-btn {
        padding: 8px !important;
    }
}

@media (max-width: 600px) {
    .site-header .site-brand__tag {
        display: none;
    }

    html body .site-header .site-brand__name {
        font-size: 0.92rem !important;
    }

    html body .site-header .site-shop {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }

    .site-header .site-shop span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (max-width: 380px) {
    .site-header .site-brand__text {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body .navbar.site-header,
    html body .navbar.site-header .nav-menu,
    html body .site-header .site-shop {
        transition: none !important;
    }
}
