/* =========================================================
   GOLDEN REAL ESTATE — NAVBAR STYLES (v2 FINAL)
   Namespaced with .gre-* to avoid conflicts.
   ========================================================= */

:root {
    --gre-gold: #BD9A68;
    --gre-gold-light: #d4af37;
    --gre-dark: #262424;
    --gre-black: #1a1818;
    --gre-topbar-h: 40px;
    --gre-navbar-h: 92px;
    --gre-mobile-bar-h: 64px;
    --gre-ease: cubic-bezier(.77, 0, .18, 1);
}

/* =========================================================
   OUTER WRAPPER
   ========================================================= */
.gre-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 999 !important;
    transform: translateY(0);
    transition: transform .35s var(--gre-ease);
    will-change: transform;
    background: transparent !important;
}

/* =========================================================
   1. DESKTOP TOP BAR
   ========================================================= */
.gre-topbar {
    background: var(--gre-dark);
    height: var(--gre-topbar-h);
    display: flex;
    align-items: center;
    transition:
        transform .35s var(--gre-ease),
        opacity .25s ease;
    will-change: transform, opacity;
    overflow: hidden;
}

.gre-topbar-social {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.gre-topbar-social li a {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(189, 154, 104, .35);
    color: var(--gre-gold);
    font-size: 12px;
    transition: all .3s ease;
}

.gre-topbar-social li a:hover {
    background: var(--gre-gold);
    color: #fff;
    border-color: var(--gre-gold);
}

.gre-topbar-contact {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.gre-topbar-contact li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9e9999;
    font-size: 13px;
    text-decoration: none;
    transition: color .3s ease;
}

.gre-topbar-contact li a i {
    color: var(--gre-gold);
    font-size: 13px;
}

.gre-topbar-contact li a:hover {
    color: var(--gre-gold);
}

/* =========================================================
   2. DESKTOP NAVBAR
   ========================================================= */
.gre-navbar {
    position: relative;
    top: 0;
    height: var(--gre-navbar-h);
    background: var(--gre-dark);
    transition:
        background-color .3s ease,
        box-shadow .3s ease,
        transform .35s cubic-bezier(.77, 0, .18, 1),
        opacity .3s ease;
    will-change: transform, opacity;
}

.gre-navbar.is-scrolled {
    background: var(--gre-dark);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.gre-navbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.gre-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1;
}

.gre-nav-left  { justify-content: flex-end; }
.gre-nav-right { justify-content: flex-start; }

.gre-nav-links li a {
    display: inline-block;
    padding: 10px 18px;
    color: #b5b1b1;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    position: relative;
    transition: color .3s ease;
}

.gre-nav-links li a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 2px;
    background: var(--gre-gold);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width .35s var(--gre-ease);
}

.gre-nav-links li a:hover,
.gre-nav-links li.active a {
    color: var(--gre-gold);
}

.gre-nav-links li a:hover::after,
.gre-nav-links li.active a::after {
    width: 22px;
}

.gre-nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 30px;
}

.gre-nav-logo img {
    max-height: 95px;
    width: auto;
    height: auto;
    display: block;
    transition: transform .3s ease;
}

.gre-nav-logo:hover img {
    transform: scale(1.06);
}

/* =========================================================
   DESKTOP-ONLY: hide on scroll down, show on scroll up
   ========================================================= */
@media (min-width: 992px) {
    .gre-header.is-hidden {
        transform: translateY(-100%) !important;
        opacity: 0;
        pointer-events: none;
    }
}

/* Hide mobile bar on desktop */
.gre-mobile-bar { display: none; }

/* =========================================================
   3. MOBILE BAR — BASE
   No background decisions here; page rules below handle it.
   ========================================================= */
@media (max-width: 991.98px) {

    .gre-topbar { display: none; }
    .gre-navbar { display: none; }

    .gre-mobile-bar {
        display: block;
        background: transparent;
        height: var(--gre-mobile-bar-h);
        transition:
            background-color .35s ease,
            box-shadow .35s ease,
            backdrop-filter .35s ease;
        -webkit-backdrop-filter: blur(0px);
        backdrop-filter: blur(0px);
    }

    .gre-mobile-bar-inner {
        height: 100%;
        padding: 0 18px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .gre-mobile-logo {
        display: inline-flex;
        align-items: center;
        height: 100%;
    }

    .gre-mobile-logo img {
        max-height: 90px;
        width: auto;
        display: block;
    }

    .gre-menu-toggle {
        width: 44px;
        height: 44px;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        z-index: 10;
    }

    .gre-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: #ffffff;
        border-radius: 2px;
        transition: transform .3s ease, opacity .3s ease, width .3s ease;
    }

    .gre-menu-toggle span:nth-child(2) { width: 16px; }

    .gre-menu-toggle:hover span { width: 22px; }

    .gre-drawer-open .gre-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .gre-drawer-open .gre-menu-toggle span:nth-child(2) {
        opacity: 0;
    }
    .gre-drawer-open .gre-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* =========================================================
   4. MOBILE DRAWER
   ========================================================= */
.gre-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
    z-index: 9998;
}

.gre-drawer-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.gre-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(88vw, 360px);
    height: 100dvh;
    max-height: 100dvh;
    background: var(--gre-black);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .45s var(--gre-ease);
    will-change: transform;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.gre-drawer-open .gre-mobile-drawer {
    transform: translateX(0);
}

.gre-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(189, 154, 104, .12);
    flex-shrink: 0;
}

.gre-drawer-logo img {
    max-height: 90px;
    width: auto;
    display: block;
}

.gre-drawer-close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(189, 154, 104, .3);
    border-radius: 50%;
    color: var(--gre-gold);
    font-size: 16px;
    cursor: pointer;
    transition: all .3s ease;
    -webkit-tap-highlight-color: transparent;
}

.gre-drawer-close:hover {
    background: var(--gre-gold);
    color: #fff;
    border-color: var(--gre-gold);
    transform: rotate(90deg);
}

.gre-drawer-nav {
    padding: 12px 0;
    flex-shrink: 0;
}

.gre-drawer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gre-drawer-nav li a {
    display: block;
    padding: 14px 26px;
    color: #e8e0d8;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .3s ease;
}

.gre-drawer-nav li a:hover,
.gre-drawer-nav li a:focus {
    color: var(--gre-gold);
    border-left-color: var(--gre-gold);
    background: rgba(189, 154, 104, .05);
}

.gre-drawer-contact {
    padding: 14px 26px 22px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.gre-drawer-divider {
    width: 40px;
    height: 2px;
    background: var(--gre-gold);
    border-radius: 2px;
    opacity: .4;
    margin-bottom: 6px;
}

.gre-drawer-contact a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #b5b1b1;
    font-size: 13px;
    text-decoration: none;
    word-break: break-all;
    transition: color .3s ease;
}

.gre-drawer-contact a i {
    color: var(--gre-gold);
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.gre-drawer-contact a:hover {
    color: var(--gre-gold);
}

.gre-drawer-social {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 18px 26px 26px;
    border-top: 1px solid rgba(189, 154, 104, .12);
    flex-shrink: 0;
}

.gre-drawer-social a {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(189, 154, 104, .3);
    color: var(--gre-gold);
    font-size: 14px;
    text-decoration: none;
    transition: all .3s ease;
}

.gre-drawer-social a:hover {
    background: var(--gre-gold);
    color: #fff;
    border-color: var(--gre-gold);
    transform: translateY(-3px);
}

body.gre-drawer-open {
    overflow: hidden;
}

@media (min-width: 992px) {
    .gre-mobile-drawer,
    .gre-drawer-backdrop {
        display: none !important;
    }
}

/* =========================================================
   5. MOBILE — HOME PAGE (LAUNCH STATE)
   Transparent + larger logo at top. Collapses to the shared
   scrolled state (see section 6) once user scrolls.
   ========================================================= */
@media (max-width: 991.98px) {

    body.home-page .gre-mobile-bar:not(.is-scrolled) {
        height: auto;
        padding-top: 30px;
        padding-bottom: 20px;
        background: transparent;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    body.home-page .gre-mobile-bar:not(.is-scrolled) .gre-mobile-bar-inner {
        flex-direction: row;
        align-items: center;
        gap: 18px;
        padding: 0 35px;
        height: auto;
        transition: all .4s cubic-bezier(.77, 0, .18, 1);
    }

    body.home-page .gre-mobile-bar:not(.is-scrolled) .gre-mobile-logo img {
        max-height: 110px;
        transition: max-height .4s cubic-bezier(.77, 0, .18, 1);
    }

    body.home-page .gre-mobile-bar:not(.is-scrolled) .gre-menu-toggle {
        width: 48px;
        height: 48px;
    }
}

/* =========================================================
   6. MOBILE — SCROLLED STATE (SHARED)
   Applies to:
     • Home page AFTER scroll (mobileBar.is-scrolled)
     • Every non-home page (always, from the top)
   Guarantees pixel-identical appearance everywhere.
   ========================================================= */
@media (max-width: 991.98px) {

    body.home-page .gre-mobile-bar.is-scrolled,
    body:not(.home-page) .gre-mobile-bar {
        /* --- Vertical padding around logo + burger --- */
        height: auto;

        background: var(--gre-dark);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .35);

        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }

    body.home-page .gre-mobile-bar.is-scrolled .gre-mobile-bar-inner,
    body:not(.home-page) .gre-mobile-bar .gre-mobile-bar-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        padding: 0 18px;
        height: auto;
    }

    body.home-page .gre-mobile-bar.is-scrolled .gre-mobile-logo img,
    body:not(.home-page) .gre-mobile-bar .gre-mobile-logo img {
        max-height: 90px;
    }
}

/* =========================================================
   MOBILE DRAWER — ACTIVE PAGE
   Gold left border + gold text + subtle gold tint background
   ========================================================= */
.gre-drawer-nav li.active a {
    color: var(--gre-gold);
    border-left-color: var(--gre-gold);
    background: rgba(189, 154, 104, .08);
    font-weight: 600;
}


