/* ============================================
   HEADER — Chobham Pharmacy
   Fixed nav with pill, logo, phone, mega menu
============================================ */

.header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 16px 24px 0;
    display: flex; align-items: flex-start; justify-content: space-between;
    pointer-events: none;
    transition: all 0.5s var(--ease);
}
.header > * { pointer-events: auto; }

.header__logo {
    position: absolute; left: 50%; transform: translateX(-50%);
    top: 16px;
    z-index: 2;
    display: flex; align-items: center; justify-content: center;
}
.header__logo img { height: 64px; width: auto; }

/* Phone — left side */
.header__phone {
    position: relative; z-index: 2;
    display: flex; align-items: center; gap: 8px;
    height: 60px; padding: 0 20px;
    color: var(--gray-700);
    text-decoration: none;
    background: var(--white);
    border-radius: 60px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
    border: 1px solid var(--gray-200);
    transition: all 0.3s var(--ease);
}
.header__phone:hover { color: var(--gold); }
.header__phone-icon {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.header__phone-number {
    font-size: 0.82rem; font-weight: 400;
    letter-spacing: 0.02em;
}

/* Nav pill — right side */
.header__pill { position: relative; z-index: 2; }

.header__bg {
    position: absolute; inset: 0;
    background: var(--white);
    border-radius: 60px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
    border: 1px solid var(--gray-200);
    transition: all 0.5s var(--ease);
}
.header--scrolled .header__bg {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.header--scrolled .header__logo,
.header--scrolled .header__phone {
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.header__nav {
    position: relative; z-index: 2;
    display: flex; align-items: center; height: 60px; padding: 0 28px;
}
.header__links { display: flex; align-items: center; gap: 32px; list-style: none; }

.header__link {
    font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em;
    color: var(--gray-700); position: relative; padding: 4px 0;
    transition: color 0.3s var(--ease);
}
.header__link:hover { color: var(--gold); }

/* ---- Mega menu ---- */
.mega-menu-parent { position: static; }

.mega-menu {
    position: absolute; top: 100%; left: 0;
    width: 100%; padding-top: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
    pointer-events: none;
}
.mega-menu.mega-menu--active {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.mega-menu__inner {
    background: var(--white); border-radius: 20px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.08);
    border: 1px solid var(--gray-200);
    padding: 16px; display: flex; flex-direction: column; gap: 2px;
}
.mega-menu__item {
    display: block; padding: 10px 16px;
    font-size: 0.78rem; font-weight: 500; color: var(--gray-700);
    border-radius: 10px; transition: all 0.25s var(--ease);
}
.mega-menu__item:hover { background: var(--green-light); color: var(--green); }
.mega-menu__item--all { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--gray-200); color: var(--gold); font-weight: 600; }
.mega-menu__item--all:hover { background: var(--green-light); color: var(--green); }

/* ---- Mobile toggle (hamburger) ---- */
.header__toggle {
    display: none; width: 48px; height: 48px;
    align-items: center; justify-content: center;
    flex-direction: column; gap: 6px; z-index: 1001;
    border-radius: 50%; transition: all 0.3s var(--ease);
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.header__toggle:hover { background: rgba(255,255,255,0.85); }
.header__toggle span {
    display: block; width: 22px; height: 1.5px;
    background: var(--gray-900); transition: all 0.4s var(--ease);
}
.header__toggle.active { position: fixed; top: 24px; right: 24px; left: auto; }
.header__toggle.active span { background: var(--green); }
.header__toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.header__toggle.active span:nth-child(2) { opacity: 0; }
.header__toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .header__pill { display: none; }
    .header__phone { display: none; }
    .header__toggle { display: flex; }
}
