﻿/* ==========================================================
   Project   : MiddleWay
   File      : navigation.css
   Component : Navigation
   Purpose   : Premium Navigation System
   Version   : 2.0
========================================================== */


/* ==========================================================
   HEADER
========================================================== */

.mw-header {
    position: sticky;
    top: 0;
    z-index: var(--mw-z-navbar);
    padding-top: 16px;
}


/* ==========================================================
   NAVBAR
========================================================== */

.mw-navbar {
    width: 100%;
}

.mw-navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--mw-header-height);
    background: var(--mw-navbar-background);
    border-radius: var(--mw-radius-pill);
    padding-inline: 28px;
    backdrop-filter: blur(20px);
    box-shadow: var(--mw-shadow-md);
    transition: all var(--mw-transition-normal);
}


/* ==========================================================
   BRAND
========================================================== */

.mw-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.mw-logo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mw-color-primary);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mw-author {
    color: var(--mw-heading-color);
    font-size: 1.05rem;
    font-weight: 600;
    white-space: nowrap;
}


/* ==========================================================
   DESKTOP MENU
========================================================== */

.mw-menu {
    display: flex;
    align-items: center;
    gap: 34px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/*nav menu HEIGHT OFFSET fix*/
.mw-main {
    padding-top: var(--mw-navbar-height);
}

.mw-no-wrap {
    white-space: nowrap;
}

.mw-menu-item {
    position: relative;
    padding-bottom: 6px;
}

.mw-menu-item > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    text-decoration: none;
    color: var(--mw-navbar-text);
    font-weight: 500;
    padding: 12px 0;
    transition: color .25s ease;
}

.mw-menu-item > a:hover {
    color: var(--mw-navbar-hover);
}


/* ==========================================================
   PREMIUM UNDERLINE
========================================================== */

    .mw-menu-item > a.active::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 2px;
        width: 100%;
        height: 2px;
        background: var(--mw-color-primary);
        border-radius: 999px;
    }

    .mw-menu-item:hover > a::after {
        width: 100%;
    }


/* ==========================================================
   CARET
========================================================== */

.mw-caret {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform .25s ease;
}

.mw-menu-item:hover > .mw-submenu + .mw-caret,
.mw-menu-item:hover .mw-caret {
    transform: rotate(180deg);
}


/* ==========================================================
   SUBMENU
========================================================== */

.mw-submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 260px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.05);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(0,0,0,.05);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 50;
}

.mw-menu-item:hover > .mw-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.mw-submenu li {
    list-style: none;
}

.mw-submenu a {
    position: relative;
    overflow: hidden;
    display: block;
    padding: 12px 16px;
    color: var(--mw-text-color);
    text-decoration: none;
}

    .mw-submenu a:hover {
        color: var(--mw-color-primary);
    }


    .mw-submenu a::before {
        content: "";
        position: absolute;
        left: 0;
        top: 50%;
        width: 3px;
        height: 0;
        transform: translateY(-50%);
        background: var(--mw-color-primary);
        border-radius: 999px;
        transition: height .18s ease;
    }

    .mw-submenu a:hover::before {
        height: 70%;
    }

    .mw-submenu a.active {
        color: var(--mw-color-primary);
        font-weight: 600;
    }

/* ==========================================================.mw-mobile-link
   ACTIVE NAVIGATION
========================================================== */

.mw-menu a.active,
.mw-mobile-menu a.active {
    color: var(--mw-color-primary);
    font-weight: 600;
}

/* ==========================================================
   ACTIONS
========================================================== */

.mw-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.mw-search-button,
.mw-language-picker,
.mw-mobile-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.mw-search-button {
    font-size: 1.10rem;
}

.mw-language-picker {
    font-weight: 600;
}

.mw-mobile-toggle {
    display: none;
    font-size: 1.55rem;
}


/*part2*/

/* ==========================================================
   MOBILE OVERLAY
========================================================== */

.mw-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .35s ease, visibility .35s ease;
    z-index: 9999;
}

    .mw-mobile-overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }


/* ==========================================================
   MOBILE PANEL
========================================================== */

.mw-mobile-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 28px 26px 36px;
}


/* ==========================================================
   MOBILE HEADER
========================================================== */

.mw-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.mw-mobile-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mw-mobile-close {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.05);
    cursor: pointer;
    font-size: 1.35rem;
    transition: background .25s ease, transform .25s ease;
}

    .mw-mobile-close:hover {
        background: rgba(245,124,0,.12);
        color: var(--mw-color-primary);
        transform: rotate(90deg);
    }


/* ==========================================================
   MOBILE LANGUAGE PICKER
========================================================== */

.mw-mobile-language {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 6px;
    margin-bottom: 34px;
    background: rgba(0,0,0,.04);
    border-radius: 9999px;
}

    .mw-mobile-language button {
        flex: 1;
        border: none;
        background: transparent;
        padding: 10px 0;
        border-radius: 9999px;
        cursor: pointer;
        font-weight: 600;
        transition: background .25s ease, color .25s ease;
    }

        .mw-mobile-language button:hover {
            background: var(--mw-color-primary);
            color: #ffffff;
        }


/* ==========================================================
   MOBILE NAVIGATION
========================================================== */

.mw-mobile-navigation {
    flex: 1;
}

.mw-mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mw-mobile-item {
    border-bottom: 1px solid rgba(0,0,0,.06);
}

    .mw-mobile-link {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border: none;
    background: transparent;
    text-decoration: none;
    color: var(--mw-heading-color);
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: color .25s ease;
}

    .mw-mobile-link.active {
        color: var(--mw-color-primary);
        font-weight: 600;
    }

    .mw-mobile-link.active::before {
            content: "";
            position: absolute;
            left: -16px;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 22px;
            border-radius: 999px;
            background: var(--mw-color-primary);
        }
    .mw-mobile-link:hover {
        color: var(--mw-color-primary);
    }


/* ==========================================================
   MOBILE CARET
========================================================== */

.mw-mobile-caret {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform .30s ease;
}

.mw-mobile-item.is-expanded
.mw-mobile-caret {
    transform: rotate(180deg);
}


/* ==========================================================
   MOBILE SUBMENU
========================================================== */

.mw-mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 18px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .35s ease, opacity .25s ease;
}

.mw-mobile-item.is-expanded
.mw-mobile-submenu {
    max-height: 500px;
    opacity: 1;
}

.mw-mobile-sublink {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    color: var(--mw-text-color);
    transition: color .25s ease;
}

    .mw-mobile-sublink:hover {
        color: var(--mw-color-primary);
    }


/* ==========================================================
   MOBILE FOOTER
========================================================== */

.mw-mobile-footer {
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,.08);
}

    .mw-mobile-footer .mw-search-button {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 14px;
        border-radius: 9999px;
        background: rgba(0,0,0,.05);
        transition: background .25s ease, color .25s ease;
    }

        .mw-mobile-footer .mw-search-button:hover {
            background: var(--mw-color-primary);
            color: #ffffff;
        }


/* ==========================================================
   ACCESSIBILITY
========================================================== */

.mw-menu a:focus-visible,
.mw-submenu a:focus-visible,
.mw-mobile-link:focus-visible,
.mw-mobile-sublink:focus-visible,
.mw-search-button:focus-visible,
.mw-language-picker:focus-visible,
.mw-mobile-toggle:focus-visible,
.mw-mobile-close:focus-visible,
.mw-mobile-language button:focus-visible {
    outline: 2px solid var(--mw-color-primary);
    outline-offset: 4px;
    border-radius: 8px;
}


/* ==========================================================
   ANIMATIONS
========================================================== */

@keyframes mwFadeIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes mwFadeUp {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mw-mobile-overlay.is-open {
    animation: mwFadeIn .30s ease;
}

.mw-submenu {
    animation: mwFadeUp .25s ease;
}


/* ==========================================================
   RESPONSIVE
========================================================== */


/* ----------------------------------------------------------
   Mobile
---------------------------------------------------------- */

@media (max-width: 767px) {

    .mw-navbar-container {
        padding-inline: 18px;
    }

    .mw-author {
        display: block;
    }

    .mw-menu {
        display: none;
    }

    .mw-search-button {
        display: none;
    }

    .mw-language-picker {
        display: none;
    }

    .mw-mobile-toggle {
        display: block;
    }
}


/* ----------------------------------------------------------
   Tablet
---------------------------------------------------------- */

@media (min-width:768px) and (max-width:991px) {

    .mw-navbar-container {
        padding-inline: 22px;
    }

    .mw-author {
        display: none;
    }


    .mw-menu {
        gap: 20px;
    }

    .mw-menu-item > a {
        font-size: .92rem;
    }
}


/* ----------------------------------------------------------
   Laptop
---------------------------------------------------------- */

@media (min-width:992px) and (max-width:1199px) {

    .mw-author {
        display: none;
    }

    .mw-menu {
        gap: 24px;
    }
}


/* ----------------------------------------------------------
   Desktop
---------------------------------------------------------- */

@media (min-width:1200px) and (max-width:1599px) {

    .mw-author {
        display: none;
    }

    .mw-menu {
        gap: 30px;
    }
}


/* ----------------------------------------------------------
   Large Desktop
---------------------------------------------------------- */

@media (min-width:1600px) {

    .mw-navbar-container {
        max-width: 1600px;
    }
}


/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}