/*=========================================================
    ELIMUKENYAHUB - NAVBAR
    Modern Responsive Navigation
=========================================================*/


/*=========================================================
    NAVBAR
=========================================================*/

.navbar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;

    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

    transition:
        background 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.35s ease;
}


/*=========================================================
    NAVBAR CONTAINER
=========================================================*/

.nav-wrapper {
    width: 100%;
    min-height: 80px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    transition: min-height 0.35s ease;
}


/*=========================================================
    LOGO
=========================================================*/

.logo {
    display: flex;
    align-items: center;

    gap: 12px;

    flex-shrink: 0;

    text-decoration: none;

    min-width: 0;
}


.logo img {
    width: 55px;
    height: 55px;

    object-fit: contain;

    flex-shrink: 0;

    transition:
        width 0.35s ease,
        height 0.35s ease,
        transform 0.35s ease;
}


.logo:hover img {
    transform: scale(1.04);
}


.logo-text {
    min-width: 0;
    white-space: nowrap;
}


.logo-text h2 {
    margin: 0;

    color: var(--primary);

    font-size: 24px;
    font-weight: 800;

    line-height: 1.15;

    letter-spacing: -0.4px;
}


.logo-text span {
    display: block;

    margin-top: 3px;

    color: var(--text-light);

    font-size: 11px;
    font-weight: 500;

    line-height: 1.2;
}


/*=========================================================
    DESKTOP NAVIGATION
=========================================================*/

.nav-menu {
    display: flex;
    align-items: center;

    gap: 30px;

    margin-left: auto;

    list-style: none;

    padding: 0;
    margin-top: 0;
    margin-bottom: 0;

    flex-shrink: 1;
}


.nav-menu li {
    position: relative;

    list-style: none;

    flex-shrink: 0;
}


.nav-menu a {
    position: relative;

    display: inline-flex;
    align-items: center;

    padding: 9px 0;

    color: var(--text);

    font-size: 15px;
    font-weight: 600;

    line-height: 1;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}


/*=========================================================
    NAVIGATION HOVER
=========================================================*/

.nav-menu a:hover {
    color: var(--primary);

    transform: translateY(-1px);
}


/*=========================================================
    NAVIGATION UNDERLINE
=========================================================*/

.nav-menu a::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 0;
    height: 3px;

    border-radius: 50px;

    background: var(--secondary);

    transition:
        width 0.3s ease,
        opacity 0.3s ease;
}


.nav-menu a:hover::after {
    width: 100%;
}


/*=========================================================
    ACTIVE NAVIGATION
=========================================================*/

.nav-menu a.active {
    color: var(--primary);
}


.nav-menu a.active::after {
    width: 100%;
}


/*=========================================================
    RIGHT SIDE
=========================================================*/

.nav-right {
    display: flex;
    align-items: center;

    gap: 12px;

    flex-shrink: 0;
}


/*=========================================================
    SEARCH BUTTON
=========================================================*/

.search-toggle {
    width: 44px;
    height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(10, 46, 109, 0.06);

    border-radius: 50%;

    background: #f5f7fb;

    color: var(--primary);

    cursor: pointer;

    flex-shrink: 0;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.search-toggle:hover {
    background: var(--primary);

    color: #fff;

    transform: translateY(-2px);

    box-shadow: 0 8px 20px rgba(10, 46, 109, 0.18);
}


.search-toggle:active {
    transform: translateY(0);
}


/*=========================================================
    NAV BUTTONS
=========================================================*/

.nav-right .btn {
    white-space: nowrap;

    flex-shrink: 0;
}


/*=========================================================
    HAMBURGER
=========================================================*/

.hamburger {
    display: none;

    width: 44px;
    height: 44px;

    padding: 0;

    border: none;

    background: transparent;

    cursor: pointer;

    flex-shrink: 0;

    border-radius: 10px;

    transition:
        background 0.3s ease,
        transform 0.3s ease;
}


.hamburger:hover {
    background: #f5f7fb;
}


.hamburger span {
    display: block;

    width: 25px;
    height: 3px;

    margin: 5px auto;

    background: var(--primary);

    border-radius: 20px;

    transition:
        transform 0.3s ease,
        opacity 0.25s ease,
        width 0.3s ease;
}


/*=========================================================
    HAMBURGER ACTIVE STATE
    Works if .active is added to hamburger
=========================================================*/

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}


.hamburger.active span:nth-child(2) {
    opacity: 0;

    width: 0;
}


.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/*=========================================================
    TABLET - 1200PX
=========================================================*/

@media (max-width: 1200px) {

    .nav-menu {
        gap: 23px;
    }

    .nav-menu a {
        font-size: 14px;
    }

    .logo {
        gap: 10px;
    }

    .logo img {
        width: 50px;
        height: 50px;
    }

    .logo-text h2 {
        font-size: 21px;
    }

    .logo-text span {
        font-size: 10px;
    }

}


/*=========================================================
    TABLET - 1100PX
=========================================================*/

@media (max-width: 1100px) {

    .nav-wrapper {
        gap: 12px;
    }

    .nav-menu {
        gap: 18px;
    }

    .nav-menu a {
        font-size: 13px;
    }

    .nav-right {
        gap: 8px;
    }

    .search-toggle {
        width: 42px;
        height: 42px;
    }

}


/*=========================================================
    SMALL TABLET / MOBILE NAVIGATION
=========================================================*/

@media (max-width: 992px) {

    .navbar {
        box-shadow: 0 3px 18px rgba(0, 0, 0, 0.07);
    }

    .nav-wrapper {
        min-height: 72px;

        gap: 10px;
    }

    /* Hide desktop navigation */

    .nav-menu {
        display: none;
    }

    /* Hide desktop buttons */

    .nav-right .btn {
        display: none;
    }

    /* Show hamburger */

    .hamburger {
        display: block;
    }

    .logo img {
        width: 48px;
        height: 48px;
    }

    .logo-text h2 {
        font-size: 20px;
    }

    .logo-text span {
        font-size: 10px;
    }

}


/*=========================================================
    MOBILE - 768PX
=========================================================*/

@media (max-width: 768px) {

    .nav-wrapper {
        min-height: 68px;
    }

    .logo {
        gap: 9px;
    }

    .logo img {
        width: 45px;
        height: 45px;
    }

    .logo-text h2 {
        font-size: 19px;
    }

    .logo-text span {
        font-size: 9px;
    }

    .search-toggle {
        width: 42px;
        height: 42px;
    }

    .hamburger {
        width: 42px;
        height: 42px;
    }

}


/*=========================================================
    MOBILE - 576PX
=========================================================*/

@media (max-width: 576px) {

    .nav-wrapper {
        min-height: 64px;
    }

    .logo {
        gap: 8px;
    }

    .logo img {
        width: 42px;
        height: 42px;
    }

    .logo-text h2 {
        font-size: 17px;
    }

    .logo-text span {
        font-size: 8px;
    }

    .nav-right {
        gap: 5px;
    }

    .search-toggle,
    .hamburger {
        width: 40px;
        height: 40px;
    }

}


/*=========================================================
    VERY SMALL PHONES - 420PX
=========================================================*/

@media (max-width: 420px) {

    .nav-wrapper {
        min-height: 60px;
    }

    .logo {
        gap: 6px;
    }

    .logo img {
        width: 39px;
        height: 39px;
    }

    .logo-text h2 {
        font-size: 16px;

        letter-spacing: -0.5px;
    }

    .logo-text span {
        display: none;
    }

    .search-toggle,
    .hamburger {
        width: 38px;
        height: 38px;
    }

    .hamburger span {
        width: 22px;
        height: 3px;
    }

}


/*=========================================================
    EXTRA SMALL PHONES - 360PX
=========================================================*/

@media (max-width: 360px) {

    .nav-wrapper {
        gap: 5px;
    }

    .logo {
        gap: 5px;
    }

    .logo img {
        width: 36px;
        height: 36px;
    }

    .logo-text h2 {
        font-size: 14px;
    }

    .search-toggle,
    .hamburger {
        width: 36px;
        height: 36px;
    }

    .search-toggle {
        font-size: 13px;
    }

    .hamburger span {
        width: 20px;
    }

}


/*=========================================================
    MOBILE MENU / OFF-CANVAS DRAWER
=========================================================*/

.mobile-menu {
    position: fixed;

    top: 0;
    right: -360px;

    width: 340px;
    max-width: 88vw;

    height: 100dvh;

    padding: 28px;

    box-sizing: border-box;

    background: rgba(255, 255, 255, 0.98);

    border-left: 1px solid rgba(0, 0, 0, 0.05);

    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);

    z-index: 2000;

    overflow-y: auto;

    overscroll-behavior: contain;

    transition:
        right 0.4s cubic-bezier(.77, 0, .18, 1),
        box-shadow 0.4s ease;
}


.mobile-menu.active {
    right: 0;

    box-shadow: -18px 0 50px rgba(0, 0, 0, 0.18);
}


/*=========================================================
    MOBILE MENU HEADER
=========================================================*/

.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 35px;

    padding-bottom: 18px;

    border-bottom: 1px solid #eef1f5;
}


.mobile-header h3 {
    margin: 0;

    color: var(--primary);

    font-size: 21px;
    font-weight: 800;
}


/*=========================================================
    CLOSE BUTTON
=========================================================*/

.close-menu {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;

    border-radius: 50%;

    background: #f5f7fb;

    color: var(--primary);

    font-size: 22px;

    cursor: pointer;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}


.close-menu:hover {
    background: var(--primary);

    color: #fff;

    transform: rotate(90deg);
}


/*=========================================================
    MOBILE MENU LIST
=========================================================*/

.mobile-menu ul {
    display: flex;

    flex-direction: column;

    gap: 7px;

    margin: 0;
    padding: 0;

    list-style: none;
}


.mobile-menu li {
    list-style: none;
}


.mobile-menu a {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 48px;

    padding: 10px 14px;

    border-radius: 10px;

    color: var(--text);

    font-size: 17px;
    font-weight: 600;

    text-decoration: none;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        padding-left 0.25s ease;
}


.mobile-menu a:hover {
    background: #f4f7fb;

    color: var(--primary);

    padding-left: 20px;
}


/*=========================================================
    MOBILE ACTIVE LINK
=========================================================*/

.mobile-menu a.active {
    background: rgba(10, 46, 109, 0.07);

    color: var(--primary);
}


.mobile-menu a.active::before {
    content: "";

    position: absolute;

    left: 0;
    top: 50%;

    width: 4px;
    height: 24px;

    border-radius: 10px;

    background: var(--secondary);

    transform: translateY(-50%);
}


/*=========================================================
    MOBILE BUTTONS
=========================================================*/

.mobile-buttons {
    display: flex;

    flex-direction: column;

    gap: 12px;

    margin-top: 35px;

    padding-top: 25px;

    border-top: 1px solid #eef1f5;
}


.mobile-buttons .btn {
    width: 100%;

    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;
}


/*=========================================================
    MOBILE MENU OVERLAY
=========================================================*/

.menu-overlay {
    position: fixed;

    inset: 0;

    background: rgba(5, 15, 35, 0.55);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    opacity: 0;

    visibility: hidden;

    z-index: 1500;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}


.menu-overlay.active {
    opacity: 1;

    visibility: visible;
}


/*=========================================================
    PREVENT BODY SCROLL WHEN MENU IS OPEN
    Works if JS adds .menu-open to body
=========================================================*/

body.menu-open {
    overflow: hidden;
}


/*=========================================================
    SCROLLED NAVBAR
=========================================================*/

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.09);
}


.navbar.scrolled .nav-wrapper {
    min-height: 70px;
}


.navbar.scrolled .logo img {
    width: 48px;
    height: 48px;
}


/*=========================================================
    SEARCH MODAL
=========================================================*/

.search-modal {
    position: fixed;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    box-sizing: border-box;

    background: rgba(3, 12, 30, 0.78);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    opacity: 0;

    visibility: hidden;

    z-index: 3000;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}


.search-modal.active {
    opacity: 1;

    visibility: visible;
}


/*=========================================================
    SEARCH BOX
=========================================================*/

.search-box-container {
    position: relative;

    width: min(700px, 100%);

    padding: 40px;

    box-sizing: border-box;

    background: #fff;

    border-radius: 24px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.25);

    transform: translateY(20px) scale(0.97);

    transition:
        transform 0.35s ease,
        opacity 0.35s ease;

    opacity: 0;
}


.search-modal.active .search-box-container {
    transform: translateY(0) scale(1);

    opacity: 1;
}


/*=========================================================
    SEARCH CLOSE BUTTON
=========================================================*/

.close-search {
    position: absolute;

    top: 20px;
    right: 20px;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;

    border-radius: 50%;

    background: #f5f7fb;

    color: var(--primary);

    font-size: 20px;

    cursor: pointer;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}


.close-search:hover {
    background: var(--primary);

    color: #fff;

    transform: rotate(90deg);
}


/*=========================================================
    SEARCH INPUT
=========================================================*/

.search-input {
    position: relative;

    margin: 30px 0;
}


.search-input i {
    position: absolute;

    left: 20px;
    top: 50%;

    color: #999;

    transform: translateY(-50%);

    pointer-events: none;
}


.search-input input {
    width: 100%;
    height: 60px;

    padding:
        0 20px 0 60px;

    box-sizing: border-box;

    border: 2px solid var(--border);

    border-radius: 15px;

    background: #fff;

    color: var(--text);

    font-size: 16px;

    outline: none;

    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}


.search-input input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(10, 46, 109, 0.08);
}


/*=========================================================
    SEARCH MODAL - TABLET
=========================================================*/

@media (max-width: 768px) {

    .search-box-container {
        padding: 35px 25px;

        border-radius: 20px;
    }

    .search-input input {
        height: 55px;
    }

}


/*=========================================================
    SEARCH MODAL - MOBILE
=========================================================*/

@media (max-width: 576px) {

    .search-modal {
        padding: 15px;
    }

    .search-box-container {
        padding: 30px 20px;

        border-radius: 18px;
    }

    .close-search {
        top: 15px;
        right: 15px;

        width: 36px;
        height: 36px;
    }

    .search-input {
        margin: 25px 0 10px;
    }

    .search-input input {
        height: 52px;

        font-size: 15px;
    }

}


/*=========================================================
    MOBILE DRAWER - SMALL PHONES
=========================================================*/

@media (max-width: 420px) {

    .mobile-menu {
        width: 310px;

        max-width: 90vw;

        padding: 22px;
    }

    .mobile-header {
        margin-bottom: 25px;
    }

    .mobile-header h3 {
        font-size: 19px;
    }

    .mobile-menu a {
        font-size: 16px;

        min-height: 46px;
    }

}


/*=========================================================
    TOUCH DEVICES
=========================================================*/

@media (hover: none) and (pointer: coarse) {

    .nav-menu a:hover {
        transform: none;
    }

    .search-toggle:hover {
        transform: none;

        box-shadow: none;
    }

    .mobile-menu a:hover {
        padding-left: 14px;
    }

}


/*=========================================================
    ACCESSIBILITY - KEYBOARD FOCUS
=========================================================*/

.nav-menu a:focus-visible,
.search-toggle:focus-visible,
.hamburger:focus-visible,
.close-menu:focus-visible,
.close-search:focus-visible,
.mobile-menu a:focus-visible,
.search-input input:focus-visible {
    outline: 3px solid rgba(76, 175, 40, 0.45);

    outline-offset: 3px;
}


/*=========================================================
    REDUCED MOTION
=========================================================*/

@media (prefers-reduced-motion: reduce) {

    .navbar,
    .nav-wrapper,
    .logo img,
    .nav-menu a,
    .nav-menu a::after,
    .search-toggle,
    .hamburger,
    .hamburger span,
    .mobile-menu,
    .mobile-menu a,
    .menu-overlay,
    .search-modal,
    .search-box-container,
    .close-menu,
    .close-search,
    .search-input input {
        transition: none !important;
    }

}


/*=========================================================
    EXTRA SAFETY
    Prevent accidental horizontal overflow
=========================================================*/

.navbar,
.mobile-menu,
.search-modal {
    max-width: 100%;
}