/* Header / Primary Navigation */

.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--paper);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    width: 100%;
    height: var(--header-h);
    gap: 50px;
    padding: 0 0 0 clamp(16px, 2vw, 28px);
    box-sizing: border-box;
}

.site-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    text-decoration: none;
    color: var(--navy);
    background: var(--paper);
    padding: 0;
    min-width: 0;
    width: auto;
    height: auto;
    flex-shrink: 0;
    align-self: flex-end;
    line-height: 0;
}

.site-brand img,
.site-brand img.custom-logo,
.site-brand__logo {
    display: block;
    width: auto;
    max-width: 118px;
    height: 90px;
    object-fit: contain;
    object-position: bottom center;
}

.site-brand__name {
    font-family: var(--display);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--navy);
    text-align: center;
    white-space: nowrap;
}

.nav-col {
    /* Start right after the logo and fill through to the screen's right edge */
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    width: auto;
    max-width: none;
    min-width: 0;
    height: 56px;
    margin-left: 0;
    padding: 0;
    align-self: flex-end;
    background: var(--nav-bg);
    border-radius: 14px 0 0 0;
    position: relative;
    z-index: 400;
}

.main-navigation > ul > li:first-child > a {
    padding-left: 14px;
}

.main-navigation {
    display: flex;
    align-items: stretch;
    flex: 1;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    position: relative;
    z-index: 400;
}

.main-navigation > ul {
    display: flex;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
}

#primary-menu {
    flex: 0 1 auto;
    min-width: 0;
    justify-content: flex-start;
}

.main-navigation > ul.nav-buttons,
.nav-buttons {
    margin-left: auto;
    flex-shrink: 0;
}

.main-navigation > ul > li {
    position: relative;
    display: flex;
    align-items: stretch;
}

.main-navigation > ul > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 11px;
    color: #fff;
    text-decoration: none;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    border-bottom: 3px solid transparent;
    position: relative;
}

.main-navigation > ul > li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.7;
    margin-left: 2px;
}

.main-navigation > ul > li.current-menu-item > a,
.main-navigation > ul > li.current-menu-ancestor > a,
.main-navigation > ul > li > a:hover {
    border-bottom-color: var(--wine);
}

.main-navigation > ul > li > a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.main-navigation > ul > li.menu-item-has-children > a::before {
    display: none;
}

.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    list-style: none;
    margin: 0;
    padding: 16px 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

.main-navigation ul ul li {
    display: block;
}

.main-navigation ul ul a {
    display: block;
    padding: 9px 24px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.main-navigation ul ul a:hover {
    color: var(--wine);
    background: #fafafa;
}

.main-navigation ul li:hover > ul,
.main-navigation ul li:focus-within > ul {
    display: block;
}

.nav-buttons {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0 14px 0 8px;
    gap: 6px;
    flex-shrink: 0;
}

.nav-buttons .lang-switcher {
    display: flex;
    align-items: center;
    padding: 0;
}

.lang-switcher__list {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 200px;
    background: rgba(255, 255, 255, 0.08);
}

.lang-switcher__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 26px;
    padding: 0 10px;
    border-radius: 200px;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.lang-switcher__btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.lang-switcher__btn.is-active {
    background: #fff;
    color: var(--navy);
}

.nav-btn-text {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s;
}

.nav-btn-text:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
    text-decoration: none;
    position: relative;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(23, 61, 107, 0.28);
    border-radius: 8px;
    color: var(--navy);
    cursor: pointer;
    font-size: 0;
    line-height: 1;
}

.menu-toggle::before {
    content: '☰';
    font-size: 22px;
    line-height: 1;
}

.menu-toggle[aria-expanded='true']::before {
    content: '✕';
    font-size: 20px;
}

.site-search-wrap {
    background: var(--navy-deep);
    padding: 14px 0;
}

.site-search-wrap[hidden] {
    display: none;
}

.site-search-wrap.is-open {
    display: block;
}

.site-search-wrap form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.site-search-wrap input {
    flex: 1;
    height: 42px;
    padding: 0 16px;
    border: none;
    border-radius: 200px;
    font-size: 15px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.site-search-wrap button {
    height: 42px;
    padding: 0 22px;
    background: var(--wine);
    color: #fff;
    border: none;
    border-radius: 200px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 860px) {
    body.menu-open {
        overflow: hidden;
    }

    .header-inner {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 72px;
        align-items: center;
        gap: 12px;
        padding: 8px 16px;
        box-sizing: border-box;
    }

    .site-brand {
        min-width: 72px;
        width: 72px;
        height: 56px;
        padding: 0;
        z-index: 2;
    }

    .site-brand img,
    .site-brand img.custom-logo,
    .site-brand__logo {
        width: 56px;
        height: 56px;
    }

    .site-brand__name {
        display: none;
    }

    .nav-col {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        align-self: center;
        height: auto;
        min-height: 56px;
        background: transparent;
        border-radius: 0;
        position: static;
        z-index: auto;
    }

    .menu-toggle {
        display: inline-flex;
        position: relative;
        z-index: 2;
        margin-left: auto;
        background: #fff;
        border-color: rgba(23, 61, 107, 0.22);
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 72px);
        margin: 0;
        padding: 8px 0 20px;
        overflow-x: hidden;
        overflow-y: auto;
        background: var(--nav-bg);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 0;
        box-shadow: 0 18px 40px rgba(16, 46, 84, 0.28);
        z-index: 500;
        -webkit-overflow-scrolling: touch;
    }

    .main-navigation.is-open {
        display: block;
    }

    .main-navigation > ul {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    #primary-menu {
        flex: none;
        justify-content: flex-start;
    }

    .main-navigation > ul.nav-buttons,
    .nav-buttons {
        margin-left: 0;
        margin-top: 8px;
        padding: 12px 16px 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.16);
        display: grid;
        grid-template-columns: 56px 1fr;
        gap: 10px;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }

    .main-navigation > ul > li {
        display: block;
        width: 100%;
        position: relative;
    }

    .main-navigation > ul > li > a {
        width: 100%;
        padding: 16px 20px;
        justify-content: space-between;
        border-bottom: 0;
        font-size: 17px;
        line-height: 1.35;
        white-space: normal;
        box-sizing: border-box;
    }

    .main-navigation > ul > li.menu-item-has-children > a::after {
        flex-shrink: 0;
        margin-left: 12px;
        transition: transform 0.18s ease;
    }

    .main-navigation > ul > li.menu-item-has-children.is-open > a::after {
        transform: rotate(180deg);
    }

    .main-navigation > ul > li.current-menu-item > a,
    .main-navigation > ul > li.current-menu-ancestor > a,
    .main-navigation > ul > li > a:hover {
        border-bottom-color: transparent;
        background: rgba(255, 255, 255, 0.08);
    }

    /* Disable desktop hover dropdowns on mobile */
    .main-navigation ul li:hover > ul,
    .main-navigation ul li:focus-within > ul {
        display: none;
    }

    .main-navigation ul li.is-open > ul {
        display: block;
    }

    .main-navigation ul ul {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 100%;
        min-width: 0;
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 0 0 8px;
        background: rgba(0, 0, 0, 0.18);
        display: none;
        border-radius: 0;
    }

    .main-navigation ul ul a {
        color: #fff;
        padding: 13px 20px 13px 34px;
        font-size: 15px;
        line-height: 1.4;
        white-space: normal;
    }

    .main-navigation ul ul a:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.08);
    }

    .nav-buttons {
        display: grid;
        grid-template-columns: 56px 1fr;
        gap: 10px;
        align-items: center;
        padding: 4px 0 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-buttons > li {
        display: block;
        width: 100%;
        position: relative;
    }

    .nav-buttons .nav-icon-btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.28);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        box-sizing: border-box;
    }

    .nav-buttons .lang-switcher {
        padding: 0;
    }

    .lang-switcher__list {
        width: 100%;
        height: 48px;
        padding: 4px;
        border-radius: 10px;
        box-sizing: border-box;
    }

    .lang-switcher__btn {
        flex: 1;
        height: 100%;
        min-width: 0;
        font-size: 14px;
        border-radius: 8px;
    }

    .site-search-wrap {
        position: relative;
        z-index: 501;
    }
}
