/*
|--------------------------------------------------------------------------
| Sticky Header Update
|--------------------------------------------------------------------------
| Keeps the frontend header fixed at the top while scrolling.
*/

:root {
    --sticky-header-height: 76px;
}

.sticky-site-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    width: 100%;
    background: #ffffff;
    transition: box-shadow 0.22s ease, background-color 0.22s ease, backdrop-filter 0.22s ease;
}

.sticky-site-header .site-navbar {
    min-height: var(--sticky-header-height);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    transition: min-height 0.22s ease, box-shadow 0.22s ease;
}

.sticky-site-header.header-scrolled {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.10);
}

.sticky-site-header.header-scrolled .site-navbar {
    min-height: 66px;
}

.sticky-site-header .site-logo {
    max-height: 52px;
    transition: max-height 0.22s ease;
}

.sticky-site-header.header-scrolled .site-logo {
    max-height: 44px;
}

.sticky-site-header .navbar .nav-link,
.sticky-site-header .nav-link {
    font-weight: 700;
    color: #334155;
    border-radius: 12px;
    padding: 10px 12px;
}

.sticky-site-header .navbar .nav-link:hover,
.sticky-site-header .nav-link:hover,
.sticky-site-header .nav-link:focus {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.07);
}

.sticky-site-header .dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.sticky-site-header .dropdown-item {
    border-radius: 12px;
    padding: 9px 12px;
    font-weight: 600;
}

.sticky-site-header .dropdown-item:hover {
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

.sticky-site-header .navbar-toggler {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 10px;
}

.sticky-site-header .navbar-toggler:focus {
    box-shadow: 0 0 0 0.18rem rgba(13, 110, 253, 0.12);
}

.sticky-site-header .admin-login-btn {
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 800;
}

/* Anchor scroll offset so section titles are not hidden behind sticky header */
html {
    scroll-padding-top: calc(var(--sticky-header-height) + 18px);
}

@media (max-width: 991px) {
    .sticky-site-header {
        position: sticky;
        top: 0;
    }

    .sticky-site-header .site-navbar {
        min-height: 68px;
    }

    .sticky-site-header .navbar-collapse {
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        margin-top: 12px;
        padding: 12px 0;
        max-height: calc(100vh - 82px);
        overflow-y: auto;
    }

    .sticky-site-header .nav-link {
        margin-bottom: 4px;
    }

    .sticky-site-header .admin-login-btn {
        width: 100%;
        margin-top: 8px;
    }
}

@media (max-width: 575px) {
    :root {
        --sticky-header-height: 68px;
    }

    .sticky-site-header .site-logo {
        max-height: 42px;
        max-width: 150px;
    }

    .sticky-site-header.header-scrolled .site-logo {
        max-height: 38px;
    }
}
