
/* =========================================
   NOOR NAVIGATION SYSTEM
========================================= */

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    width: 100%;
    background: var(--header-bg);
    border-bottom: 1px solid #00000033;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
     transition:
        transform .32s cubic-bezier(.22, 1, .36, 1),
        box-shadow .25s ease,
        background-color .25s ease;
    will-change: transform;
}

/* Header hides while scrolling down */
.site-header.header-hidden {
    transform: translateY(-105%);
    box-shadow: none;
    pointer-events: none;
}

/* Header visible when scrolling up */
.site-header.header-visible {
    transform: translateY(0);
    pointer-events: auto;
}

/* Add subtle shadow after leaving page top */
.site-header.header-scrolled {
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}

/* Dark theme */
html[data-theme="dark"] .site-header.header-scrolled {
    background-color: rgba(8, 14, 25, .96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

/* Light theme */
html[data-theme="light"] .site-header.header-scrolled {
    background-color: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .site-header {
        transition: none;
    }
}


.site-header.is-scrolled {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.noor-navbar {
    min-height: var(--header-height);
    padding: 10px 0;
}

.noor-navbar .container {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ---------- Brand ---------- */

.noor-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: var(--text-primary);
    text-decoration: none;
}

.noor-brand:hover {
    color: var(--text-primary);
}

.brand-logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 21px;
    border-radius: 14px;
    background: linear-gradient(
        145deg,
        var(--primary),
        var(--secondary)
    );
    box-shadow: 0 7px 18px rgba(8, 121, 185, 0.2);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 0.035em;
}

.brand-text > span {
    margin-top: 5px;
    color: var(--text-primary);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.09em;
    white-space: nowrap;
}

.brand-text b {
    color: var(--primary);
}


.noor-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.noor-header-logo {
    display: block;
    width: 190px;
    height: 65px;
    object-fit: contain;
    object-position: left center;
}
/* Header Logo */
.noor-header-logo {
    display: block;
    width: 190px;
    height: 65px;
    object-fit: contain;
    object-position: left center;
}

/* Light Theme */
html[data-theme="light"] .noor-header-logo.logo-light {
    display: block;
}

html[data-theme="light"] .noor-header-logo.logo-dark {
    display: none;
}

/* Dark Theme */
html[data-theme="dark"] .noor-header-logo.logo-light {
    display: none;
}

html[data-theme="dark"] .noor-header-logo.logo-dark {
    display: block;
}

@media (max-width: 576px) {
    .noor-header-logo {
        width: 155px;
        height: 55px;
    }
}

/* ---------- Desktop links ---------- */

.desktop-navigation {
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.desktop-nav-link {
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition:
        color var(--transition-fast),
        background var(--transition-fast);
}

.desktop-nav-link:hover,
.desktop-nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* ---------- Header actions ---------- */

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon-btn {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.nav-icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}

.nav-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
}

/* ---------- Mobile menu trigger ---------- */

.mobile-menu-btn {
    display: none;
}

/* ---------- Drawer backdrop ---------- */

.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(5, 20, 30, 0.55);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--transition-normal),
        visibility var(--transition-normal);
}

.nav-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ---------- Mobile side drawer ---------- */

.mobile-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;

    width: min(86vw, 350px);
    height: 100vh;
    height: 100dvh;

    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));

    background: var(--surface);
    color: var(--text-primary);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);

    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;

    transition:
        transform var(--transition-normal),
        visibility var(--transition-normal);
}

.mobile-nav.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-header .brand-logo {
    width: 39px;
    height: 39px;
    font-size: 18px;
    border-radius: 12px;
}

.mobile-nav-header .brand-text strong {
    font-size: 22px;
}

.mobile-nav-header .brand-text > span {
    font-size: 8px;
}

.mobile-nav-welcome {
    padding: 26px 0 20px;
}

.nav-section-label {
    display: block;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.mobile-nav-welcome h3 {
    margin: 9px 0 5px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.mobile-nav-welcome p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ---------- Drawer links ---------- */

.mobile-nav-links {
    display: grid;
    gap: 7px;
}

.mobile-nav-link {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 13px;

    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;

    transition:
        background var(--transition-fast),
        color var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.drawer-link-icon {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    flex-shrink: 0;

    border-radius: 11px;
    background: var(--surface-secondary);
    color: var(--primary);
    font-size: 15px;
}

.mobile-nav-link.active .drawer-link-icon {
    background: var(--primary);
    color: #ffffff;
}

.drawer-chevron {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 10px;
}

/* ---------- Drawer footer ---------- */

.mobile-nav-footer {
    margin-top: auto;
    padding-top: 23px;
}

.drawer-call-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface-secondary);
    color: var(--text-primary);
}

.drawer-call-btn > i:first-child {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
}

.drawer-call-btn small,
.drawer-call-btn strong {
    display: block;
}

.drawer-call-btn small {
    color: var(--text-muted);
    font-size: 10px;
}

.drawer-call-btn strong {
    font-size: 13px;
}

.drawer-call-btn > i:last-child {
    color: var(--primary);
    font-size: 12px;
}

.drawer-location-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 11px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Mobile bottom navigation ---------- */

.mobile-bottom-nav {
    display: none;
}

/* ---------- Dark mode adjustments ---------- */

html[data-theme="dark"] .mobile-nav {
    background: var(--surface);
    border-color: var(--border-color);
}

html[data-theme="dark"] .drawer-link-icon {
    background: var(--surface-secondary);
}

html[data-theme="dark"] .mobile-nav-link.active .drawer-link-icon {
    background: var(--primary);
    color: #ffffff;
}

html[data-theme="dark"] .drawer-call-btn {
    background: var(--surface-secondary);
    border-color: var(--border-color);
}

/* ---------- Tablet and mobile ---------- */

@media (max-width: 991.98px) {

    .noor-navbar {
        min-height: 66px;
        padding: 8px 0;
    }

    .noor-navbar .container {
        gap: 9px;
    }

    .mobile-menu-btn {
        display: inline-grid;
        width: 39px;
        height: 39px;
        order: 0;
    }

    .noor-navbar > .container > .noor-brand {
        order: 1;
    }

    .nav-actions {
        order: 2;
        margin-left: auto;
    }

    .brand-logo {
        width: 39px;
        height: 39px;
        border-radius: 12px;
        font-size: 18px;
    }

    .brand-text strong {
        font-size: 22px;
    }

    .brand-text > span {
        font-size: 8px;
    }

    /* Fixed bottom app navigation */

    .mobile-bottom-nav {
        position: fixed;
        z-index: 1050;
        right: 0;
        bottom: 0;
        left: 0;

        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        gap: 0;

        padding: 8px 5px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));

        background: var(--surface);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -6px 24px rgba(9, 40, 62, 0.07);

        transition:
            background var(--transition-normal),
            border-color var(--transition-normal);
    }

    .bottom-nav-item {
        min-width: 0;
        min-height: 48px;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;

        padding: 3px 1px;
        border: 0;
        border-radius: 10px;
        background: transparent;

        color: var(--text-muted);
        font-family: var(--font-body);
        font-size: 10px;
        font-weight: 700;
        line-height: 1.2;
        text-decoration: none;
        cursor: pointer;
    }

    .bottom-nav-item > i {
        font-size: 18px;
        line-height: 1;
    }

    .bottom-nav-item.active,
    .bottom-nav-item:hover {
        color: var(--primary);
    }

    .bottom-nav-call {
        color: var(--primary);
    }

    .bottom-call-icon {
        width: 43px;
        height: 43px;
        display: grid;
        place-items: center;
        margin-top: -23px;

        border: 4px solid var(--body-bg);
        border-radius: 50%;
        background: var(--primary);
        color: #ffffff;

        box-shadow: 0 5px 14px rgba(8, 121, 185, 0.22);
    }

    .bottom-call-icon i {
        font-size: 16px;
    }

    /* Space for the fixed bottom navigation */

    body {
        padding-bottom: calc(
            72px + env(safe-area-inset-bottom)
        );
    }
}

/* ---------- Small phones ---------- */

@media (max-width: 380px) {

    .noor-navbar .container {
        gap: 6px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .mobile-menu-btn,
    .nav-actions .nav-icon-btn {
        width: 35px;
        height: 35px;
    }

    .noor-brand {
        gap: 6px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .brand-text strong {
        font-size: 19px;
    }

    .brand-text > span {
        font-size: 7px;
        letter-spacing: 0.05em;
    }

    .mobile-bottom-nav {
        padding-right: 2px;
        padding-left: 2px;
    }

    .bottom-nav-item {
        font-size: 9px;
    }
}
/* Mobile call icon: hidden on desktop */
.mobile-call-btn {
    display: none;
    color: var(--primary);
}

/* Mobile header actions */
@media (max-width: 991.98px) {

    .nav-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-call-btn {
        display: inline-grid;
        width: 39px;
        height: 39px;
        color: var(--primary);
        background: var(--primary-light);
        border-color: transparent;
    }

    .mobile-call-btn:hover {
        color: #fff;
        background: var(--primary);
    }

}

/* Small mobile screens */
@media (max-width: 380px) {

    .nav-actions {
        gap: 5px;
    }

    .mobile-call-btn,
    .nav-actions .theme-toggle {
        width: 35px;
        height: 35px;
    }

}