/* =========================================
   TECHNO MAK STANDARDIZED NAVBAR STYLES
   ========================================= */

/* Desktop Header & Navbar Layout */
header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: var(--header-bg, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar {
    width: min(90%, 1440px);
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 50%;
}

.logo h2 {
    font-size: 26px;
    font-weight: 800;
    display: flex;
    gap: 5px;
    align-items: baseline;
    line-height: 1;
    letter-spacing: -0.5px;
    transition: color 0.35s ease;
}

.logo .techno {
    color: var(--techno-green, #12b76a);
}

.logo .mak {
    color: var(--mak-red, #e53935);
}

/* Nav Links Styles */
.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--text, #222222);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary, #0077ff);
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--primary, #0077ff);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Dropdown Menu Styles (Desktop) */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 250px;
    padding: 10px 0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 12px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Virtual bridge to prevent mouse-out */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text, #222222);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    border-radius: 0;
}

.nav-dropdown-menu a::after {
    display: none;
}

.nav-dropdown-menu a:hover {
    background: rgba(0, 119, 255, 0.06);
    color: var(--primary, #0077ff);
    padding-left: 24px;
}

.nav-dropdown-menu a.active {
    background: rgba(0, 119, 255, 0.08);
    color: var(--primary, #0077ff);
    border-left: 3px solid var(--primary, #0077ff);
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1005;
}

.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text, #222222);
    border-radius: 3px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, background-color 0.3s ease;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Responsive Overrides (max-width: 991px) */
@media (max-width: 991px) {
    .navbar {
        width: 92%;
        padding: 14px 0;
    }

    .logo h2 {
        font-size: 24px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 80px; /* Adjust according to header height */
        right: -100%;
        width: 280px;
        height: calc(100vh - 80px);
        background: #ffffff;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
        padding: 40px 24px;
        gap: 20px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        align-items: flex-start;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        font-size: 17px;
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
    }

    .nav-links a::after {
        display: none;
    }

    /* Mobile Dropdown Styling */
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown>a {
        width: 100%;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
    }

    .nav-dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        width: 100% !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        padding: 0 !important;
        background: transparent !important;
        list-style: none !important;
        margin: 0 !important;
        border: none !important;
        border-left: 2px solid rgba(0, 119, 255, 0.2) !important;
        border-radius: 0 !important;
    }

    .nav-dropdown.mobile-open .nav-dropdown-menu {
        max-height: 300px;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

    .nav-dropdown-menu li {
        width: 100%;
    }

    .nav-dropdown-menu a {
        display: block !important;
        width: 100% !important;
        color: var(--text, #222222) !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        padding: 8px 0 8px 18px !important;
        background: rgba(0, 119, 255, 0.02) !important;
        border-radius: 0 6px 6px 0 !important;
        margin-bottom: 2px !important;
        transition: all 0.25s ease !important;
        border: none !important;
    }

    .nav-dropdown-menu a:hover,
    .nav-dropdown-menu a.active {
        background: rgba(0, 119, 255, 0.08) !important;
        color: var(--primary, #0077ff) !important;
        padding-left: 22px !important;
    }

    .nav-dropdown>a .fa-caret-down {
        transition: transform 0.3s ease;
        display: inline-block;
        margin-left: auto;
    }

    .nav-dropdown.mobile-open>a .fa-caret-down {
        transform: rotate(180deg);
    }
}

/* Mobile Small Overrides (max-width: 600px) */
@media (max-width: 600px) {
    .navbar {
        width: 90%;
        padding: 12px 0;
    }

    .logo img {
        width: 44px;
        height: 44px;
    }

    .logo h2 {
        font-size: 20px;
    }

    .nav-links {
        top: 70px;
        height: calc(100vh - 70px);
    }
}
