/* ===========================
   Header & Navigation
   Rapid Property Transfers — Modern Design
   =========================== */

/* ===========================
   Top Bar
   =========================== */

.header-topbar {
    background-color: var(--color-navy);
    color: #fff;
    font-size: 0.8125rem;
    line-height: 1;
}

.topbar-inner {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-trust {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a.topbar-trust:hover {
    opacity: 0.85;
}

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

.topbar-phone,
.topbar-email {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    text-decoration: none;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.topbar-phone:hover,
.topbar-email:hover {
    opacity: 0.8;
}

/* Dividers between topbar items */
.topbar-right .topbar-phone + .topbar-email::before,
.topbar-right .topbar-email + .topbar-cta::before,
.topbar-right .topbar-phone + .topbar-cta::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    margin-right: 20px;
}

.topbar-cta {
    color: var(--color-gold);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s ease;
}

.topbar-cta:hover {
    color: var(--color-gold-hover);
}

/* ===========================
   Main Header
   =========================== */

.site-header {
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 500;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.site-header.is-scrolled {
    box-shadow: 0 4px 24px rgba(12, 30, 74, 0.08);
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

.header-inner {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 40px;
}

/* ===========================
   Logo
   =========================== */

.site-logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-logo img {
    height: 64px;
    width: auto;
    display: block;
}

.site-name {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-navy);
    letter-spacing: -0.01em;
    line-height: 1.2;
    max-width: 240px;
}

/* ===========================
   Desktop Navigation
   =========================== */

.nav-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 7px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #4B5563;
    text-decoration: none;
    border-radius: 8px;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
    color: var(--color-navy);
    background-color: rgba(12, 30, 74, 0.05);
}


/* Dropdown chevron indicator */
.nav-menu > li.menu-item-has-children > a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-menu > li.menu-item-has-children > a::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease, background-image 0.2s ease;
    margin-top: 1px;
}

/* Rotate up on hover (dropdown open) */
.nav-menu > li.menu-item-has-children:hover > a::after {
    transform: rotate(-180deg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230c1e4a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Rotate up when currently inside this section (sub-page active) */
.nav-menu > li.current-menu-ancestor > a::after {
    transform: rotate(-180deg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230c1e4a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Dropdown submenu */
.nav-menu .menu-item-has-children {
    position: relative;
}

.nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 8px 32px rgba(12, 30, 74, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 6px 6px 6px;
    list-style: none;
    margin: 0;
    z-index: 100;
}

.nav-menu .menu-item-has-children:hover > .sub-menu {
    display: block;
}

.nav-menu .sub-menu li {
    position: relative;
}

.nav-menu .sub-menu a {
    display: block;
    padding: 9px 14px;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    color: #374151;
    text-decoration: none;
    border-radius: 9px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-menu .sub-menu a:hover {
    background-color: rgba(12, 30, 74, 0.05);
    color: var(--color-navy);
}

/* Active sub-menu item — currently viewed page */
.nav-menu .sub-menu .current-menu-item > a {
    background-color: var(--color-navy);
    color: #ffffff;
    font-weight: 600;
}

.nav-menu .sub-menu .current-menu-item > a:hover {
    background-color: var(--color-navy);
    color: #ffffff;
}

/* ===========================
   Header Actions
   =========================== */

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

.header-phone {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-navy);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.header-phone:hover {
    color: var(--color-gold);
}

/* Header CTA — Gold pill */
.header-actions .header-cta {
    border-radius: 50px;
    padding: 10px 24px;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    font-weight: 600;
    background-color: var(--color-gold);
    color: var(--color-navy);
    border: 2px solid var(--color-gold);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.header-actions .header-cta:hover {
    background-color: var(--color-gold-hover);
    border-color: var(--color-gold-hover);
    color: var(--color-navy);
    box-shadow: 0 4px 16px rgba(184, 150, 62, 0.35);
    transform: translateY(-1px);
}

/* ===========================
   Hamburger Toggle
   =========================== */

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: 1.5px solid rgba(12, 30, 74, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.menu-toggle:hover {
    border-color: var(--color-navy);
    background-color: rgba(12, 30, 74, 0.04);
}

.menu-toggle span {
    display: block;
    height: 1.5px;
    background-color: var(--color-navy);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease, width 0.25s ease;
}

.menu-toggle span:nth-child(1) { width: 18px; }
.menu-toggle span:nth-child(2) { width: 12px; }
.menu-toggle span:nth-child(3) { width: 18px; }

body.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
    width: 18px;
}

body.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

body.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
    width: 18px;
}

/* ===========================
   Mobile Menu Drawer
   =========================== */

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 360px;
    max-width: 92vw;
    height: 100vh;
    background: #fff;
    z-index: 600;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(12, 30, 74, 0.1);
}

.mobile-menu.is-open {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.mobile-menu-logo img {
    height: 45px;
    width: auto;
}

.mobile-menu-site-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-navy);
    letter-spacing: -0.01em;
}

.menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--color-off-white);
    border: none;
    border-radius: 9px;
    color: var(--color-navy);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.menu-close:hover {
    background-color: rgba(12, 30, 74, 0.1);
}

.mobile-nav {
    flex: 1;
    padding: 10px 12px;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu > li {
    margin-bottom: 2px;
}

.mobile-nav-menu > li > a {
    display: block;
    padding: 11px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #374151;
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.mobile-nav-menu > li > a:hover,
.mobile-nav-menu .current-menu-item > a {
    color: var(--color-navy);
    background-color: rgba(12, 30, 74, 0.05);
}

/* Mobile submenu accordion */
.mobile-nav-menu .menu-item-has-children {
    position: relative;
}

.submenu-toggle {
    position: absolute;
    right: 12px;
    top: 6px;
    width: 32px;
    height: 32px;
    background: var(--color-off-white);
    border: none;
    border-radius: 8px;
    color: var(--color-navy);
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.25s ease;
}

.submenu-toggle:hover {
    background-color: rgba(12, 30, 74, 0.1);
}

.mobile-nav-menu .menu-item-has-children.is-open > .submenu-toggle {
    transform: rotate(180deg);
}

.mobile-nav-menu .sub-menu {
    display: none;
    list-style: none;
    margin: 0 0 4px;
    padding: 0 0 0 12px;
}

.mobile-nav-menu .menu-item-has-children.is-open > .sub-menu {
    display: block;
}

.mobile-nav-menu .sub-menu a {
    display: block;
    padding: 9px 14px;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    color: #6B7280;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 1px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.mobile-nav-menu .sub-menu a:hover {
    color: var(--color-navy);
    background-color: rgba(12, 30, 74, 0.05);
}

/* Mobile drawer footer */
.mobile-menu-footer {
    padding: 16px 20px 24px;
    margin-bottom: 50px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.mobile-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
    border-radius: 50px;
}

.mobile-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: 1.5px solid rgba(12, 30, 74, 0.12);
    border-radius: 50px;
    background: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-navy);
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.mobile-phone:hover {
    border-color: var(--color-navy);
    background-color: rgba(12, 30, 74, 0.03);
    color: var(--color-navy);
}

.mobile-email {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-email:hover {
    color: var(--color-navy);
}

/* ===========================
   Overlay
   =========================== */

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 20, 50, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 590;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open {
    overflow: hidden;
}

/* ===========================
   Responsive — Tablet (≤1024px)
   =========================== */

@media (max-width: 1024px) {
    .nav-primary {
        display: none;
    }

    .header-phone {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .topbar-email {
        display: none;
    }

    .header-actions {
        margin-left: auto;
    }
}

/* ===========================
   Responsive — Mobile (≤768px)
   =========================== */

@media (max-width: 768px) {
    .topbar-inner {
        padding: 7px 20px;
    }

    .topbar-left {
        display: none;
    }

    .topbar-right {
        width: 100%;
        justify-content: center;
        gap: 20px;
    }

    .header-inner {
        padding: 0 20px;
        height: 64px;
        gap: 12px;
    }

    .site-logo img {
        height: 45px;
    }

    .header-actions .header-cta {
        display: none;
    }
}

/* ===========================
   Responsive — Small Mobile (≤480px)
   =========================== */

@media (max-width: 480px) {
    .header-topbar {
        display: none;
    }
}
