/* ==========================================
   HEADER
========================================== */

.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    z-index: var(--z-header);
}

/* ==========================================
   LOGO
========================================== */

.custom-logo-link,
.site-logo {
    display: inline-flex;
    align-items: center;
}

.site-header .custom-logo {
    height: auto;
    width: auto;
    max-height: var(--navbar-logo-height);
    max-width: 320px;
}

.site-logo--text {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
}

/* ==========================================
   NAVBAR
========================================== */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: var(--navbar-height);
}

/* ==========================================
   LEFT
========================================== */

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

/* ==========================================
   MENU
========================================== */

.navbar__menu ul {
    display: flex;
    align-items: center;
    gap: var(--navbar-gap);
}

.navbar__menu a {
    color: var(--color-heading);
    font-size: var(--navbar-font-size);
    font-weight: var(--navbar-font-weight);
    line-height: 1;
    transition: color .25s ease;
}

.navbar__menu a:hover {
    color: var(--color-primary);
}

/* ==========================================
   ICON BUTTONS (account, cart, wishlist)
========================================== */

.navbar-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--color-heading);
    transition: .25s;
}

.navbar-icon:hover {
    color: var(--color-primary);
    background: rgba(37, 99, 235, .08);
}

.navbar-cart__count {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-black);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

/* ==========================================
   CENTER
========================================== */

.navbar__center {
    flex: 1;

    display: flex;
    justify-content: center;

    padding-inline: 2rem;
    margin-left: 3rem;
}

/* ==========================================
   RIGHT
========================================== */

.navbar__right {
    display: flex;
    align-items: center;
    gap: .25rem;
}

/* ==========================================
   RESPONSIVE HEADER
   Mobile 0–767 · Tablet 768–1023 · Desktop 1024+
========================================== */

/* Prevent any element from pushing the page wider than the viewport. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Hamburger — hidden on tablet/desktop, shown < 768px. */
.navbar__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.navbar__toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-heading);
    transition: transform .25s ease, opacity .25s ease;
}

/* Tablet: keep the nav links, drop the wide inline search, tighten spacing. */
@media (max-width: 1023px) {
    .navbar__center {
        display: none;
    }
    .navbar__left {
        gap: 1.5rem;
    }
    .navbar__menu ul {
        gap: 1.5rem;
    }
    .site-header .custom-logo {
        max-height: 56px;
    }
}

/* Mobile: hamburger + logo + account/cart only; desktop nav hidden. */
@media (max-width: 767px) {
    .navbar {
        min-height: 64px;
    }
    .navbar__toggle {
        display: inline-flex;
    }
    .navbar__menu {
        display: none;
    }
    .navbar__left {
        gap: .75rem;
    }
    .site-header .custom-logo {
        max-height: 40px;
        max-width: 180px; /* wide wordmark would otherwise run off the navbar */
    }
    .site-logo--text {
        font-size: var(--font-size-lg);
    }
}

/* ==========================================
   MOBILE DRAWER
========================================== */

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-header) + 10);
    visibility: hidden;
    pointer-events: none;
}

.mobile-menu.is-open {
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity .3s ease;
}

.mobile-menu.is-open .mobile-menu__overlay {
    opacity: 1;
}

.mobile-menu__panel {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: min(86vw, 340px);
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    box-shadow: 0 0 40px rgba(0, 0, 0, .18);
    transform: translateX(-100%);
    transition: transform .3s ease;
}

.mobile-menu.is-open .mobile-menu__panel {
    transform: translateX(0);
}

.mobile-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu__logo {
    display: inline-flex;
    align-items: center;
}

/* Small logo image in the drawer header. */
.mobile-menu__logo .custom-logo {
    height: auto;
    width: auto;
    max-height: 36px;
    max-width: 160px;
}

.mobile-menu__logo .site-logo--text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
}

.mobile-menu__close {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--color-heading);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.mobile-menu__list {
    list-style: none;
    margin: 0;
    padding: var(--space-2) 0;
}

.mobile-menu__list li {
    border-bottom: 1px solid var(--color-border-light);
}

.mobile-menu__list a {
    display: block;
    padding: var(--space-4) var(--space-5);
    color: var(--color-heading);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

.mobile-menu__list a:hover {
    color: var(--color-primary);
    background: var(--color-background-light);
}

.mobile-menu__search {
    margin-top: auto;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
}

/* Lock background scroll while the drawer is open. */
body.phl-menu-open {
    overflow: hidden;
}

/* ==========================================
   TOP CONSULTATION BAR — responsive
========================================== */

@media (max-width: 767px) {
    .top-bar__inner {
        gap: var(--space-2);
    }
    .top-bar__text {
        font-size: 12px;
        line-height: 1.3;
    }
    .top-bar__close {
        flex: 0 0 auto;
    }
}
