/* ============================================================================
   NAVBAR STYLING - From RFZ Digital
   ============================================================================ */

:root {
    --primary-color: #0a102f;
    --secondary-color: #ffffff;
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --border-light: #e0e0e0;
    --navbar-accent: #31d1ff;
}

/* Main Navigation Header */
.site-header {
    position: relative;
    z-index: 100;
}

.site-header--sticky {
    position: sticky;
    top: 0;
    z-index: 999;
}

.site-header--transparent {
    background-color: transparent;
}

.site-header > .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* Navbar Pill Layout */
.site-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.50rem 1.5rem;
    box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 23, 42, 0.05);
    gap: 1rem;
}

/* Brand Logo */
.brand-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 0;
}

.brand-logo a {
    display: inline-block;
    height: 40px;
    overflow: hidden;
}

.brand-logo img {
    height: 100%;
    width: auto;
    max-width: 150px;
    display: inline-block;
}

.brand-logo .logo-light,
.brand-logo .logo-dark {
    height: 100%;
    width: auto;
    transition: opacity 0.3s ease;
}

.brand-logo .logo-light {
    display: block;
}

.brand-logo .logo-dark {
    display: none;
}

/* Menu Block */
.menu-block-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1190;
}

.menu-overlay.active {
    width: 100%;
    opacity: 1;
    visibility: visible;
}

.menu-block {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-head {
    display: none;
}

.site-menu-main {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
}

.site-menu-main .nav-item {
    position: relative;
}

.nav-link-item {
    display: inline-block;
    padding: 0.75rem 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.nav-link-item:hover,
.nav-link-item.active {
    background-color: rgba(10, 16, 47, 0.1);
    color: var(--primary-color);
}

.nav-dropdown-trigger {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown-trigger::after {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.55rem;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    content: "";
    vertical-align: middle;
}

.nav-item-dropdown > .nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1300;
    width: max-content;
    min-width: 230px;
    max-width: min(320px, 85vw);
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(10, 16, 47, 0.08);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
    list-style: none;
}

.nav-item-dropdown > .nav-submenu[hidden] {
    display: none;
}

.nav-submenu a {
    display: block;
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--primary-color);
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
    white-space: normal;
}

.nav-submenu a:hover,
.nav-submenu a:focus-visible {
    background: rgba(10, 16, 47, 0.08);
    color: var(--primary-color);
}

.nav-mega-menu {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 50% !important;
    z-index: 1300;
    width: min(860px, calc(100vw - 32px)) !important;
    max-width: none !important;
    padding: 24px !important;
    border: 1px solid #e1e1e1 !important;
    border-radius: 0 0 14px 14px !important;
    background: #fff !important;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16) !important;
    transform: translateX(-50%);
}

.site-menu-main .nav-item-dropdown--services {
    position: static;
}

.nav-item-dropdown--services:hover > .nav-mega-menu[hidden],
.nav-item-dropdown--services:focus-within > .nav-mega-menu[hidden] {
    display: block;
}

.nav-mega-menu__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.nav-mega-menu__heading h2 {
    margin: 0;
    color: #0a102f;
    font-size: 18px;
    font-weight: 650;
}

.nav-mega-menu__heading > span {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    margin: -8px -24px -24px 0;
    border-radius: 0 0 0 50%;
    background: #f8f8f8;
    color: #0a102f;
    font-size: 20px;
}

.nav-mega-menu__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.nav-mega-menu .nav-mega-menu__card {
    display: flex;
    min-height: 112px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 10px;
    border: 1px solid #d8d8d8;
    border-radius: 7px;
    color: #111;
    text-align: center;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.nav-mega-menu .nav-mega-menu__card:hover,
.nav-mega-menu .nav-mega-menu__card:focus-visible {
    border-color: #1d2cff;
    box-shadow: 0 6px 18px rgba(29, 44, 255, 0.1);
    color: #111;
    transform: translateY(-2px);
}

.nav-mega-menu__card svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: #1d2cff;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25;
}

.nav-mega-menu .nav-mega-menu__card span {
    padding: 0;
    color: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

/* CTA Button */
.header-cta-btn-wrapper {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-masco {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 2rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-masco--header {
    padding: 0.625rem 1.5rem;
}

.btn-fill--up {
    background: var(--navbar-accent);
    color: white;
}

.btn-fill--up:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(10, 16, 47, 0.25);
    color: white;
    text-decoration: none;
}

.rounded-pill {
    border-radius: 50rem;
}

/* Mobile Menu Trigger */
.mobile-menu-trigger {
    display: none;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 0.375rem;
    cursor: pointer;
    z-index: 1100;
}

.mobile-menu-trigger span {
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-trigger.active span:nth-child(1) {
    transform: rotate(45deg) translateY(10px);
}

.mobile-menu-trigger.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-trigger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-10px);
}

/* Sticky Reveal */
.site-header.reveal-header {
    background-color: transparent;
    box-shadow: none;
}

.site-header.reveal-header > .container > .site-navbar {
    padding: 0.50rem 1.5rem;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet & Small Desktop */
@media (max-width: 1099.98px) {
    .site-navbar {
        padding: 0.5rem 0.75rem;
        border-radius: 1rem;
    }

    .site-menu-main {
        gap: 0.25rem;
    }

    .nav-link-item {
        padding: 0.625rem 0.875rem;
        font-size: 14px;
    }

    .btn-masco--header {
        padding: 0.5rem 1rem;
        font-size: 13px;
    }
}

/* Tablet and mobile */
@media (max-width: 1099.98px) {
    .site-navbar {
        padding: 0.5rem 0.5rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    /* Show mobile menu trigger */
    .mobile-menu-trigger {
        display: flex;
    }

    /* Hide desktop menu */
    .menu-block {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 0;
        clip-path: inset(0 0 0 100%);
        transition: clip-path 0.3s ease;
        z-index: 1200;
        overflow-y: auto;
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    }

    .menu-block.active {
        clip-path: inset(0);
    }

    .menu-block:not(.active) {
        clip-path: inset(0 0 0 100%);
    }

    .menu-block .mobile-menu-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        border-bottom: 1px solid var(--border-light);
        background: #f8f9fa;
    }

    .menu-block .mobile-menu-head a {
        flex: 1;
    }

    .menu-block .mobile-menu-head img {
        height: 40px;
        width: auto;
    }

    .mobile-menu-close {
        font-size: 28px;
        cursor: pointer;
        color: var(--primary-color);
        font-weight: bold;
        margin-left: auto;
        background: none;
        border: none;
        padding: 0;
    }

    .site-menu-main {
        flex-direction: column;
        gap: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .site-menu-main .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-link-item {
        display: block;
        width: 100%;
        padding: 1rem;
        border-radius: 0;
        font-size: 15px;
    }

    .nav-item-dropdown > .nav-dropdown-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .nav-item-dropdown > .nav-submenu {
        position: static;
        width: 100%;
        max-width: none;
        padding: 0 12px 10px;
        border: 0;
        border-radius: 0;
        background: #f8f9fa;
        box-shadow: none;
    }

    .nav-mega-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        padding: 12px !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .nav-mega-menu__heading {
        margin-bottom: 12px;
    }

    .nav-mega-menu__heading > span {
        display: none;
    }

    .nav-mega-menu__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-mega-menu .nav-mega-menu__card {
        min-height: 92px;
        gap: 8px;
        padding: 10px 6px;
        border-radius: 7px;
    }

    .nav-mega-menu__card svg {
        width: 28px;
        height: 28px;
    }

    .nav-submenu a {
        padding: 10px 12px;
    }

    .nav-link-item:hover,
    .nav-link-item.active {
        background-color: rgba(10, 16, 47, 0.1);
    }

    /* Hide CTA button on very small screens */
    @media (max-width: 575px) {
        .header-cta-btn-wrapper {
            display: none;
        }
    }
}

/* Lower nav bar pill layout */
.site-header > .container > .site-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.50rem 1.5rem;
    box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

@media (min-width: 1100px) {
    .site-header > .container > .site-navbar {
        justify-content: space-between;
    }

    /* Keep pill padding when sticky reveal zeros navbar padding */
    .site-header.reveal-header > .container > .site-navbar {
        padding: 0.50rem 1.5rem;
    }
}

/* Sticky reveal: keep outer header chrome transparent */
.site-header.site-header--sticky.reveal-header,
.site-header.site-header--sticky.reveal-header.bg--primary {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Keep black logo on sticky reveal */
@media (min-width: 1100px) {
    .site-header.site-header--sticky.reveal-header .brand-logo .logo-light {
        display: block !important;
    }

    .site-header.site-header--sticky.reveal-header .brand-logo .logo-dark {
        display: none !important;
    }

    /* Keep nav links readable */
    .site-header.site-header--sticky.reveal-header.bg--primary .nav-link-item {
        color: #000 !important;
    }
}

.custom-navbar-white {
    color: #0a102f;
}

@media (min-width: 1100px) {
    .custom-navbar-white .nav-link-item {
        color: #0a102f !important;
    }
}

/* Logo handling for white navbar */
.custom-navbar-white .logo-light {
    display: none !important;
}

.custom-navbar-white .logo-dark {
    display: none !important;
}

.custom-navbar-white .logo-special {
    display: inline-block !important;
    filter: brightness(0);
}

@media (min-width: 1100px) {
    .site-header.site-header--sticky {
        position: absolute;
        top: 28px;
        left: 0;
        right: 0;
        width: 100%;
    }

    .site-header > .container {
        width: min(calc(100% - 48px), 1320px);
        max-width: 1320px;
        margin: 0 auto;
        padding-left: 0;
        padding-right: 0;
    }

    .site-header.site-header--sticky.reveal-header {
        position: fixed;
        top: 0;
    }

    .btn-masco--header {
        padding: 0.875rem 2rem;
        font-size: 16px;
    }
}
