/* =========================================================
   KRISHNA SOLAR ENERGY - HEADER
   Clean Premium Navigation
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;

    width: 100%;

    background: #ffffff;

    border-bottom: 1px solid #e5e7eb;

    box-shadow: 0 2px 12px rgba(7, 26, 43, 0.05);
}


/* =========================================================
   NAVBAR
   ========================================================= */

.navbar {
    position: relative;

    min-height: 76px;

    display: flex;
    align-items: center;

    gap: 28px;
}


/* =========================================================
   LOGO
   ========================================================= */

.navbar-brand {
    display: inline-flex;
    align-items: center;

    flex: 0 0 auto;

    width: 190px;
    height: 60px;

    text-decoration: none;

    line-height: 0;
}

.navbar-brand img {
    display: block;

    width: 190px;
    height: 60px;

    max-width: 100%;

    object-fit: contain;
    object-position: left center;
}


/* =========================================================
   DESKTOP NAVIGATION
   ========================================================= */

.navbar-menu {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1;

    margin: 0;
    padding: 0;

    gap: 23px;

    list-style: none;
}

.navbar-menu li {
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    position: relative;

    display: inline-flex;
    align-items: center;

    min-height: 44px;

    padding: 0;

    color: #17212b;

    font-size: 14px;
    font-weight: 600;

    line-height: 1.2;

    text-decoration: none;

    white-space: nowrap;

    transition: color 180ms ease;
}

.navbar-menu a::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 4px;

    width: 0;
    height: 2px;

    border-radius: 10px;

    background: #0868c9;

    transition: width 180ms ease;
}

.navbar-menu a:hover,
.navbar-menu a:focus-visible {
    color: #0868c9;
}

.navbar-menu a:hover::after,
.navbar-menu a:focus-visible::after {
    width: 100%;
}


/* =========================================================
   CTA
   ========================================================= */

.navbar-cta {
    display: flex;
    align-items: center;

    flex: 0 0 auto;
}

.navbar-cta .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 0 21px;

    border-radius: 7px;

    background: #0868c9;
    border: 1px solid #0868c9;

    color: #ffffff;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    white-space: nowrap;

    box-shadow: 0 7px 18px rgba(8, 104, 201, 0.15);

    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease;
}

.navbar-cta .btn:hover {
    background: #07539f;
    border-color: #07539f;

    transform: translateY(-1px);
}


/* =========================================================
   MOBILE TOGGLE
   ========================================================= */

.navbar-toggle {
    display: none;

    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    padding: 0;
    margin: 0;

    border: 1px solid #dce3e9;
    border-radius: 8px;

    background: #ffffff;

    cursor: pointer;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 5px;

    -webkit-tap-highlight-color: transparent;

    position: relative;
    z-index: 10001;
}

.navbar-toggle span {
    display: block;

    width: 19px;
    height: 2px;

    border-radius: 5px;

    background: #071a2b;

    transition:
        transform 180ms ease,
        opacity 180ms ease;
}

.navbar-toggle:hover {
    border-color: #0868c9;
    background: #f7fbff;
}

.navbar-toggle:focus-visible {
    outline: 3px solid rgba(8, 104, 201, 0.2);
    outline-offset: 2px;
}


/* =========================================================
   MOBILE TOGGLE ACTIVE
   ========================================================= */

.navbar-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* =========================================================
   CURRENT MOBILE MENU SYSTEM
   Compatible with main.js
   ========================================================= */

.mobile-navigation,
.mobile-navigation-backdrop {
    display: none;
}


/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 1023px) {

    .navbar {
        min-height: 72px;
        justify-content: space-between;
    }

    .navbar-brand {
        width: 175px;
        height: 56px;
    }

    .navbar-brand img {
        width: 175px;
        height: 56px;
    }

    .navbar-cta {
        display: none;
    }

    .navbar-toggle {
        display: inline-flex;
    }


    /* Existing navbar menu is not used as the mobile drawer */
    .navbar-menu {
        display: none;
    }


    /* ---------------------------------------------------------
       Mobile Navigation
       --------------------------------------------------------- */

    .mobile-navigation {
        position: fixed;

        top: 0;
        right: 0;
        bottom: 0;

        width: min(390px, 88vw);

        display: block;

        background: #ffffff;

        border-left: 1px solid #e2e8f0;

        box-shadow: -18px 0 45px rgba(7, 26, 43, 0.14);

        overflow-y: auto;
        overflow-x: hidden;

        overscroll-behavior: contain;

        transform: translateX(100%);

        visibility: hidden;
        pointer-events: none;

        transition:
            transform 260ms ease,
            visibility 260ms ease;

        z-index: 10000;

        -webkit-overflow-scrolling: touch;
    }

    .mobile-navigation.is-open {
        transform: translateX(0);

        visibility: visible;
        pointer-events: auto;
    }


    /* ---------------------------------------------------------
       Mobile Navigation Inner
       --------------------------------------------------------- */

    .mobile-navigation-inner {
        min-height: 100%;

        display: flex;
        flex-direction: column;

        padding:
            88px
            20px
            24px;
    }


    /* ---------------------------------------------------------
       Mobile Navigation Links
       --------------------------------------------------------- */

    .mobile-nav-menu {
        display: flex;
        flex-direction: column;

        width: 100%;

        gap: 4px;

        margin: 0;
        padding: 0;

        list-style: none;
    }

    .mobile-nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;

        width: 100%;

        min-height: 50px;

        padding: 13px 14px;

        border: 0;
        border-radius: 8px;

        background: transparent;

        color: #17212b;

        font-family: inherit;
        font-size: 15px;
        font-weight: 600;

        line-height: 1.35;

        text-align: left;
        text-decoration: none;

        cursor: pointer;

        transition:
            color 180ms ease,
            background-color 180ms ease;
    }

    .mobile-nav-link:hover,
    .mobile-nav-link:focus-visible {
        color: #0868c9;

        background: #f5f8fb;
    }

    .mobile-nav-link:focus-visible {
        outline: 2px solid rgba(8, 104, 201, 0.22);
        outline-offset: 1px;
    }


    /* ---------------------------------------------------------
       Mobile Solar Dropdown
       --------------------------------------------------------- */

    .mobile-nav-group {
        width: 100%;
    }

    .mobile-nav-dropdown-toggle svg {
        flex: 0 0 auto;

        transition: transform 180ms ease;
    }

    .mobile-nav-dropdown-toggle.is-open svg {
        transform: rotate(180deg);
    }

    .mobile-nav-submenu {
        display: grid;

        grid-template-rows: 0fr;

        width: 100%;

        overflow: hidden;

        opacity: 0;

        transition:
            grid-template-rows 220ms ease,
            opacity 180ms ease;
    }

    .mobile-nav-submenu::before {
        content: "";
        min-height: 0;
    }

    .mobile-nav-submenu.is-open {
        grid-template-rows: 1fr;

        opacity: 1;
    }

    .mobile-nav-submenu > * {
        min-height: 0;
    }

    .mobile-nav-sublink {
        display: flex;
        align-items: center;

        min-height: 46px;

        margin-left: 12px;
        padding: 10px 14px;

        border-left: 2px solid #dbe7f1;

        color: #526273;

        font-size: 14px;
        font-weight: 500;

        line-height: 1.35;

        text-decoration: none;

        transition:
            color 180ms ease,
            border-color 180ms ease,
            background-color 180ms ease;
    }

    .mobile-nav-sublink:hover,
    .mobile-nav-sublink:focus-visible {
        color: #0868c9;

        border-left-color: #0868c9;

        background: #f7fbff;
    }


    /* ---------------------------------------------------------
       Mobile Navigation CTA
       --------------------------------------------------------- */

    .mobile-navigation-actions {
        display: grid;

        grid-template-columns: 1fr;

        gap: 10px;

        width: 100%;

        margin-top: auto;
        padding-top: 24px;
    }

    .mobile-navigation-actions .btn {
        width: 100%;

        min-height: 48px;

        justify-content: center;
    }


    /* ---------------------------------------------------------
       Backdrop
       --------------------------------------------------------- */

    .mobile-navigation-backdrop {
        position: fixed;

        inset: 0;

        display: block;

        background: rgba(7, 26, 43, 0.38);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity 220ms ease,
            visibility 220ms ease;

        z-index: 9999;
    }

    .mobile-navigation-backdrop.is-visible {
        opacity: 1;

        visibility: visible;
        pointer-events: auto;
    }


    /* ---------------------------------------------------------
       Prevent Background Scroll
       --------------------------------------------------------- */

    body.mobile-menu-open {
        overflow: hidden;
        touch-action: none;
    }
}


/* =========================================================
   600px
   ========================================================= */

@media (max-width: 600px) {

    .navbar {
        min-height: 68px;

        gap: 12px;
    }

    .navbar-brand {
        width: 165px;
        height: 52px;
    }

    .navbar-brand img {
        width: 165px;
        height: 52px;
    }

    .navbar-toggle {
        width: 43px;
        height: 43px;

        flex-basis: 43px;
    }

    .mobile-navigation-inner {
        padding-left: 17px;
        padding-right: 17px;
    }
}


/* =========================================================
   450px
   ========================================================= */

@media (max-width: 450px) {

    .navbar {
        min-height: 64px;
    }

    .navbar-brand {
        width: 150px;
        height: 48px;
    }

    .navbar-brand img {
        width: 150px;
        height: 48px;
    }

    .navbar-toggle {
        width: 41px;
        height: 41px;

        flex-basis: 41px;
    }

    .mobile-navigation {
        width: min(360px, 91vw);
    }

    .mobile-navigation-inner {
        padding:
            80px
            14px
            20px;
    }

    .mobile-nav-link {
        min-height: 48px;

        padding: 12px 12px;

        font-size: 14px;
    }

    .mobile-nav-sublink {
        min-height: 44px;

        margin-left: 10px;

        padding: 9px 12px;

        font-size: 13.5px;
    }
}


/* =========================================================
   390px
   ========================================================= */

@media (max-width: 390px) {

    .navbar {
        gap: 8px;
    }

    .navbar-brand {
        width: 138px;
        height: 45px;
    }

    .navbar-brand img {
        width: 138px;
        height: 45px;
    }

    .navbar-toggle {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }

    .mobile-navigation {
        width: 92vw;
    }

    .mobile-navigation-inner {
        padding-left: 12px;
        padding-right: 12px;
    }
}


/* =========================================================
   359px
   ========================================================= */

@media (max-width: 359px) {

    .navbar-brand {
        width: 128px;
        height: 42px;
    }

    .navbar-brand img {
        width: 128px;
        height: 42px;
    }

    .navbar-toggle {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }

    .mobile-navigation-inner {
        padding-left: 10px;
        padding-right: 10px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .site-header *,
    .site-header *::before,
    .site-header *::after,
    .mobile-navigation,
    .mobile-navigation-backdrop {
        transition-duration: 0.01ms !important;
    }
}