/* ============ HEADER ============ */
.site-header {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 140px;
    background: var(--white);
    border-bottom: 1px solid var(--paper-line);
    position: relative;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    position: relative;
    flex-shrink: 0;
}

.brand-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: var(--ink-900);
}

.main-nav {
    display: flex;
    gap: 34px;
}

.main-nav a {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-900);
    letter-spacing: -0.005em;
    position: relative;
    padding: 6px 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-500);
    transition: width .25s ease;
}

.main-nav a:hover {
    color: var(--accent-600);
}

.main-nav a:hover::after {
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    width: 250px;
    height: 40px;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-radius: 100px;
    padding: 0 8px 0 18px;
    transition: border-color .2s ease, background .2s ease, width .2s ease;
}

.search-box:focus-within {
    border-color: var(--accent-500);
    background: var(--white);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13.5px;
    font-family: var(--font-body);
    color: var(--ink-900);
    width: 100%;
}

.search-box input::placeholder {
    color: #9AA3B4;
}

.search-box button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-body);
    flex-shrink: 0;
}

.search-box button:hover {
    background: var(--paper-line);
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ink-900);
    transition: background .25s ease;
    position: relative;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--paper);
}

.icon-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-500);
    border: 1.5px solid var(--white);
}

/* ---- Mobile search toggle (hidden on desktop) ---- */
.search-toggle {
    display: none;
}

/* ---- Hamburger / nav toggle (hidden on desktop) ---- */
.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ink-900);
    transition: background .25s ease;
    flex-shrink: 0;
    position: relative;
}

.nav-toggle:hover {
    background: var(--paper);
}

.nav-toggle svg {
    display: block;
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle.is-active .icon-menu {
    display: none;
}

.nav-toggle.is-active .icon-close {
    display: block;
}

/* ---- Overlay behind the mobile nav panel ---- */
.nav-overlay {

    position: fixed;

    top: 64px;

    left: 0;

    right: 0;

    bottom: 0;

    background: rgba(0, 0, 0, .45);

    opacity: 0;

    visibility: hidden;

    transition: .3s;

    z-index: 2;

}

.nav-overlay.is-active {

    opacity: 1;

    visibility: visible;

}

.nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

body.nav-open {
    overflow: hidden;
}

/* ---- Mobile search bar (drops down under header) ---- */
.mobile-search-bar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--paper-line);
    padding: 14px 20px;
    z-index: 25;
}

.mobile-search-bar.is-active {
    display: flex;
}

.mobile-search-bar .search-box {
    width: 100%;
}

/* ==========================================================
   Responsive breakpoints
   ========================================================== */

/* Small desktops / large tablets */
@media (max-width: 1200px) {
    .site-header {
        padding: 0 48px;
    }

    .main-nav {
        gap: 24px;
    }

    .search-box {
        width: 210px;
    }
}

/* Tablets */
@media (max-width: 991px) {
    .site-header {
        padding: 0 28px;
    }

    .main-nav {
        gap: 18px;
    }

    .search-box {
        width: 180px;
    }
}

/* Collapse the inline search box into a toggle icon */
@media (max-width: 860px) {
    .search-box {
        display: none;
    }

    .search-toggle {
        display: flex;
    }
}

/* Hamburger nav kicks in */
@media (max-width: 768px) {
    .site-header {
        padding: 0 20px;
        height: 64px;
    }

    .nav-toggle {
        display: flex;
        order: 3;
    }

    .header-right {
        gap: 4px;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(320px, 82vw);
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 88px 28px 28px;
        transform: translateX(100%);
        transition: transform .35s ease;
        z-index: 40;
        box-shadow: -12px 0 40px rgba(14, 23, 48, 0.14);
        overflow-y: auto;
    }

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

    .main-nav a {
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid var(--paper-line);
        font-size: 16px;
    }

    .main-nav a::after {
        display: none;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .site-header {
        padding: 0 16px;
    }

    .brand-name {
        font-size: 17px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .icon-btn,
    .nav-toggle,
    .search-toggle {
        width: 34px;
        height: 34px;
    }

    .icon-btn svg,
    .nav-toggle svg,
    .search-toggle svg {
        width: 17px;
        height: 17px;
    }

    .mobile-search-bar {
        padding: 12px 16px;
    }
}