/* ── Base Reset & Typography ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fb;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ── Navbar Header ── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(234, 234, 234, 0.8);
    height: 72px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding-left: 5%;
    padding-right: 5%;
    gap: 2rem;
    transition: box-shadow 0.3s, background-color 0.3s;
}

    header.scrolled {
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
        background-color: rgba(255, 255, 255, 0.98);
    }

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 4rem;
    width: auto;
    object-fit: contain;
}

/* ── Centre main tabs ── */
.nav-main-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* ── Auth nav ── */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-self: end;
}

/* ── Primary nav tabs (Buy / Sell / Mortgage) ── */
.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.45rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

    .nav-tab:hover {
        color: #2563eb;
        background: rgba(37, 99, 235, 0.07);
    }

/* ── Mortgage Dropdown ── */
.nav-dropdown {
    position: relative;
}

.nav-tab--dropdown svg {
    transition: transform 0.2s;
}

.nav-tab--dropdown[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.nav-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 230px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 6px;
    list-style: none;
    z-index: 200;
    /* Entry animation */
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-dropdown__menu--open {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

    .nav-dropdown__item:hover {
        background: rgba(37, 99, 235, 0.07);
        color: #2563eb;
    }

    .nav-dropdown__item svg {
        flex-shrink: 0;
        color: #6b7280;
    }

    .nav-dropdown__item:hover svg {
        color: #2563eb;
    }

/* New nav-link styles (Favorites) */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

/* ── Sign In / Auth CTA ── */
.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.52rem 1.25rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-radius: 7px;
    font-size: 0.87rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
    transition: background 0.18s, box-shadow 0.18s, transform 0.14s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

    .nav-cta:hover {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
        transform: translateY(-1px);
    }

    .nav-cta:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    }

    .nav-cta svg {
        flex-shrink: 0;
    }

/* ── Footer ── */
footer {
    text-align: center;
    padding: 2rem 5%;
    border-top: 1px solid #eaeaea;
    color: #888;
    font-size: 0.9rem;
    background-color: #fff;
}

/* ── Responsive ── */

/* Tablets & small laptops */
@media (max-width: 768px) {
    header {
        display: flex !important;
        justify-content: space-between !important;
        height: 60px !important;
        padding-left: 3% !important;
        padding-right: 3% !important;
    }

    .nav-main-tabs {
        display: none;
    }

    .logo {
        font-size: 1.5rem;
        justify-content: flex-start;
    }

    .logo-img {
        height: 3rem;
    }

    .nav-cta {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Phones */
@media (max-width: 480px) {
    header {
        height: 52px !important;
        padding-left: 2.5% !important;
        padding-right: 2.5% !important;
    }

    .logo {
        font-size: 1.25rem;
        gap: 0;
    }

    .logo-img {
        height: 2.25rem;
    }

    .logo span {
        display: none;
    }

    .nav-cta {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
        box-shadow: 0 1px 8px rgba(37, 99, 235, 0.25);
    }
}