/* Navigation Bar */
.navbar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 73px;
    display: flex;
    justify-content: center;
    z-index: 99999 !important;
    background-color: #7DB8CC;
    border-bottom: 1px solid transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: translateZ(0);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease-in-out;
}

.navbar-wrapper.with-bg {
    background-color: #7DB8CC;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.navbar-wrapper.hidden {
    transform: translateY(-100%);
}

.navbar-container {
    width: 100%;
    max-width: 1400px;
    height: 72px;
    display: flex;
    align-items: flex-end;
    padding: 16px 32px;
    gap: 10px;
}

.nav-logo-link {
    margin-right: 16px;
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s, transform 0.2s;
}

.nav-logo-scrolled {
    display: none;
}

.navbar-wrapper.with-bg .nav-logo-default {
    display: none;
}

.navbar-wrapper.with-bg .nav-logo-scrolled {
    display: block;
}

.nav-logo:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.nav-link {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    background: transparent;
    padding: 0px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-spacer {
    display: block;
    flex-grow: 1;
    flex-shrink: 0;
    min-width: 48px;
}

/* Default (Hero Section) Buttons */
.nav-signin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 0 24px;
    border-radius: 8px;
    height: 44px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.nav-signin:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-signin-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 16px;
    border-radius: 6px;
    height: 40px;
    white-space: nowrap;
    transition: all 0.2s;
}

.nav-signin-secondary:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.2);
}

/* Scrolled (Homes Section & Beyond - .with-bg active) Buttons */
/* The glassy button looks good here too, so no heavy overrides are needed */

.navbar-wrapper.with-bg .nav-signin-secondary {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
}

.navbar-wrapper.with-bg .nav-signin-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Navbar Menu Open State */
.navbar-wrapper.menu-open {
    background-color: rgba(23, 25, 35, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-bar {
    width: 100%;
    height: 2.5px;
    background-color: #FFFFFF;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active .hamburger-bar:nth-child(1) {
    transform: translateY(8.75px) rotate(45deg);
}

.hamburger-btn.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-bar:nth-child(3) {
    transform: translateY(-8.75px) rotate(-45deg);
}

/* Mobile & Tablet Fullscreen Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: rgba(23, 25, 35, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-16px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 400px;
    padding: 73px 32px 32px 32px;
}

.mobile-nav-link {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    transition: color 0.2s, transform 0.2s;
    text-decoration: none;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    color: #FFFFFF;
    transform: scale(1.05);
}

.mobile-menu-divider {
    width: 60px;
    height: 1px;
    background: rgba(255, 255, 255, 0.16);
    margin: 8px 0;
}

.mobile-cta-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.mobile-cta-stack a,
.mobile-cta-stack button {
    width: 100%;
}

.mobile-cta-stack .nav-signin,
.mobile-cta-stack .nav-signin-secondary {
    height: 48px;
    font-size: 16px;
    width: 100%;
}

.mobile-cta-stack .nav-signin {
    background-color: #72A7B9;
    border: 1px solid #72A7B9
}

/* Responsive Nav (Tablet & Mobile) */
@media screen and (max-width: 1024px) {

    .navbar-container .nav-link,
    .navbar-container .nav-signin,
    .navbar-container .nav-signin-secondary {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    .nav-logo {
        height: 32px;
    }

    .navbar-container {
        padding: 16px 24px;
        gap: 8px;
    }
}