/* =========================================================
   VISOTECH ENGINEERING
   HEADER.CSS
   FINAL CLEAN VERSION
   ========================================================= */


/* =========================================================
   1. TOP BAR
   ========================================================= */

.top-bar {
    width: 100%;
    background: #f1f5f9;
    color: #334155;
    border-bottom: 1px solid #dbe3ee;
    font-size: 12px;
    line-height: 1.3;
}

.top-bar .container {
    width: min(1200px, calc(100% - 40px));
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-bar-wrapper {
    min-height: 36px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;

    gap: 16px;
}

.top-bar-item {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    white-space: nowrap;

    color: #334155;

    text-decoration: none;

    font-size: 12px;
    font-weight: 500;
}

.top-bar-item:hover {
    color: #2563eb;
}

.top-bar-item i {
    font-size: 11px;
}


/* =========================================================
   2. MAIN HEADER
   ========================================================= */

.header {
    position: sticky;

    top: 0;
    left: 0;

    width: 100%;

    z-index: 1000;

    background: rgba(255, 255, 255, 0.97);

    border-bottom: 1px solid #e2e8f0;

    box-shadow:
        0 6px 24px rgba(15, 23, 42, 0.06);

    transition:
        background 0.3s ease,
        box-shadow 0.3s ease,
        top 0.3s ease;
}


/* =========================================================
   3. HEADER CONTAINER
   ========================================================= */

.header-container {
    width: min(1400px, calc(100% - 40px));

    min-height: 76px;

    margin: 0 auto;

    padding: 10px 20px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 24px;
}


/* =========================================================
   4. LOGO
   ========================================================= */

.logo-wrapper {
    display: flex;

    align-items: center;

    gap: 12px;

    flex-shrink: 0;

    text-decoration: none;
}

.round-logo-container {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 50%;

    background: #ffffff;

    border: 1px solid rgba(37, 99, 235, 0.12);

    box-shadow:
        0 6px 18px rgba(15, 23, 42, 0.08);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.round-logo-container img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;
}

.logo-text {
    color: #07203a;

    font-size: 23px;

    font-weight: 800;

    letter-spacing: 1px;

    white-space: nowrap;

    transition: color 0.3s ease;
}

.logo-wrapper:hover .round-logo-container {
    transform: scale(1.04) rotate(-2deg);

    box-shadow:
        0 10px 25px rgba(37, 99, 235, 0.14);
}

.logo-wrapper:hover .logo-text {
    color: #2563eb;
}


/* =========================================================
   5. NAVIGATION CONTAINER
   ========================================================= */

.nav-container {
    flex: 1;

    display: flex;

    align-items: center;

    justify-content: center;

    min-width: 0;
}


/* =========================================================
   6. NAVIGATION MENU
   ========================================================= */

.nav-menu {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 26px;

    margin: 0;

    padding: 0;

    list-style: none;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    position: relative;

    display: inline-flex;

    align-items: center;

    gap: 7px;

    padding: 10px 0;

    color: #0f172a;

    font-size: 15px;

    font-weight: 600;

    line-height: 1.4;

    white-space: nowrap;

    text-decoration: none;

    transition:
        color 0.25s ease;
}

.nav-menu > li > a:hover {
    color: #2563eb;
}


/* =========================================================
   7. NAVIGATION ACTIVE UNDERLINE
   ========================================================= */

.nav-menu > li > a::after {
    content: "";

    position: absolute;

    left: 0;

    bottom: 2px;

    width: 0;

    height: 3px;

    border-radius: 50px;

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #6d5ef5
        );

    transition:
        width 0.3s ease;
}

.nav-menu > li > a:hover::after,
.nav-menu > li > a.active::after {
    width: 100%;
}

.nav-menu > li > a.active {
    color: #2563eb;
}


/* =========================================================
   8. PRODUCTS DROPDOWN ARROW
   ========================================================= */

.has-dropdown > a i {
    font-size: 10px;

    transition:
        transform 0.3s ease;
}

.has-dropdown:hover > a i {
    transform: rotate(180deg);
}


/* =========================================================
   9. MEGA MENU
   ========================================================= */

.has-dropdown {
    position: relative;
}

.mega-menu {
    position: absolute;

    top: calc(100% + 14px);

    left: 50%;

    width: 760px;

    max-width: calc(100vw - 40px);

    padding: 22px;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 20px;

    box-shadow:
        0 25px 70px rgba(15, 23, 42, 0.15);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateX(-50%)
        translateY(10px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}

.has-dropdown:hover .mega-menu,
.has-dropdown:focus-within .mega-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =========================================================
   10. MEGA MENU GRID
   ========================================================= */

.mega-menu-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}


/* =========================================================
   11. MEGA MENU ITEM
   ========================================================= */

.mega-menu-item {
    display: flex;

    align-items: flex-start;

    gap: 14px;

    min-width: 0;

    padding: 16px;

    border-radius: 15px;

    color: #0f172a;

    text-decoration: none;

    background: #ffffff;

    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

.mega-menu-item:hover {
    background: #f8fafc;

    transform: translateY(-2px);
}


/* =========================================================
   12. MEGA MENU ICON
   ========================================================= */

.mega-menu-item > i {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 12px;

    color: #ffffff;

    font-size: 17px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #6d5ef5
        );
}


/* =========================================================
   13. MEGA MENU TEXT
   ========================================================= */

.mega-menu-text {
    min-width: 0;
}

.mega-menu-text h3 {
    margin: 0 0 5px;

    color: #0f172a;

    font-size: 15px;

    font-weight: 700;

    line-height: 1.4;
}

.mega-menu-text p {
    margin: 0;

    color: #64748b;

    font-size: 13px;

    line-height: 1.5;
}


/* =========================================================
   14. HEADER ACTION BUTTONS
   ========================================================= */

.header-action {
    display: flex;

    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}

.header-action .btn {
    white-space: nowrap;
}

.btn-sm {
    padding: 10px 15px;

    font-size: 13px;

    border-radius: 10px;
}


/* =========================================================
   15. MOBILE TOGGLE BUTTON
   ========================================================= */

.mobile-toggle {
    display: none;

    width: 44px;
    height: 44px;

    flex-shrink: 0;

    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid #e2e8f0;

    border-radius: 10px;

    background: #f8fafc;

    color: #07203a;

    font-size: 21px;

    cursor: pointer;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.mobile-toggle:hover {
    background: #e2e8f0;

    color: #2563eb;
}

.mobile-toggle:active {
    transform: scale(0.95);
}


/* =========================================================
   16. STICKY HEADER
   ========================================================= */

.header.sticky {
    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.10);

    background:
        rgba(255, 255, 255, 0.98);
}


/* =========================================================
   17. HEADER OVERLAY
   ========================================================= */

.header-menu-overlay {
    display: none;
}


/* =========================================================
   18. TABLET
   ========================================================= */

@media (max-width: 1150px) {

    .header-container {
        gap: 18px;
    }

    .nav-menu {
        gap: 18px;
    }

    .nav-menu > li > a {
        font-size: 14px;
    }

    .header-action {
        gap: 7px;
    }

    .header-action .btn {
        padding: 9px 11px;

        font-size: 12px;
    }
}


/* =========================================================
   19. MOBILE / TABLET MENU
   ========================================================= */

@media (max-width: 992px) {

    .header-container {
        min-height: 68px;

        padding-top: 8px;
        padding-bottom: 8px;
    }


    /* Hide desktop navigation */

    .nav-container {
        position: static;

        flex: 0 0 auto;
    }


    .nav-menu {
        position: fixed;

        top: 68px;

        left: 12px;
        right: 12px;

        width: auto;

        max-height:
            calc(100vh - 84px);

        overflow-y: auto;

        display: none;

        flex-direction: column;

        align-items: stretch;

        justify-content: flex-start;

        gap: 2px;

        padding: 12px;

        margin: 0;

        background: #ffffff;

        border: 1px solid #e2e8f0;

        border-radius: 18px;

        box-shadow:
            0 25px 70px rgba(15, 23, 42, 0.16);

        z-index: 3000;
    }


    .nav-menu.active {
        display: flex;
    }


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


    .nav-menu > li > a {
        width: 100%;

        display: flex;

        align-items: center;

        justify-content: space-between;

        padding: 14px 13px;

        border-radius: 10px;

        font-size: 15px;
    }


    .nav-menu > li > a:hover,
    .nav-menu > li > a.active {
        background: #f1f5f9;
    }


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


    /* Hide desktop buttons */

    .header-action {
        display: none;
    }


    /* Show hamburger */

    .mobile-toggle {
        display: inline-flex;
    }


    /* =====================================================
       MOBILE MEGA MENU
       ===================================================== */

    .mega-menu {
        position: static;

        width: 100%;

        max-width: none;

        margin: 3px 0 5px;

        padding: 8px;

        display: none;

        opacity: 1;

        visibility: visible;

        pointer-events: auto;

        transform: none;

        border-radius: 14px;

        border: 1px solid #e2e8f0;

        box-shadow: none;

        background: #f8fafc;
    }


    .has-dropdown.mobile-open .mega-menu {
        display: block;
    }


    .has-dropdown.mobile-open > a i {
        transform: rotate(180deg);
    }


    .mega-menu-grid {
        grid-template-columns: 1fr;

        gap: 4px;
    }


    .mega-menu-item {
        padding: 12px;

        border-radius: 10px;
    }


    .mega-menu-item > i {
        width: 38px;
        height: 38px;

        font-size: 15px;
    }


    .mega-menu-text h3 {
        font-size: 14px;
    }


    .mega-menu-text p {
        font-size: 12px;
    }
}


/* =========================================================
   20. MOBILE TOP BAR
   ========================================================= */

@media (max-width: 768px) {

    .top-bar {
        font-size: 9px;

        line-height: 1.2;
    }


    .top-bar .container {
        width: 100%;

        padding-left: 8px;
        padding-right: 8px;
    }


    .top-bar-wrapper {
        min-height: auto;

        display: block;

        padding: 4px 0;
    }


    .top-bar-left {
        width: 100%;

        display: flex;

        align-items: center;

        justify-content: center;

        gap: 6px;

        overflow: hidden;
    }


    .top-bar-right {
        width: 100%;

        display: flex;

        align-items: center;

        justify-content: center;

        gap: 7px;

        margin-top: 3px;

        overflow: hidden;
    }


    .top-bar-item {
        max-width: 100%;

        font-size: 9px;

        gap: 3px;
    }


    .top-bar-item i {
        font-size: 8px;
    }


    .header-container {
        width: calc(100% - 20px);

        padding-left: 10px;
        padding-right: 10px;
    }


    .nav-menu {
        top: 68px;

        left: 8px;
        right: 8px;

        max-height:
            calc(100vh - 82px);
    }
}


/* =========================================================
   21. SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .top-bar {
        font-size: 8.5px;
    }


    .top-bar-left {
        gap: 4px;
    }


    .top-bar-right {
        gap: 5px;
    }


    .top-bar-item {
        font-size: 8.5px;
    }


    .top-bar-item i {
        font-size: 7px;
    }


    .header-container {
        width: calc(100% - 12px);

        min-height: 62px;

        padding-left: 6px;
        padding-right: 6px;

        gap: 8px;
    }


    .round-logo-container {
        width: 42px;
        height: 42px;
    }


    .logo-wrapper {
        gap: 8px;
    }


    .logo-text {
        font-size: 18px;

        letter-spacing: .6px;
    }


    .mobile-toggle {
        width: 42px;
        height: 42px;

        font-size: 20px;
    }


    .nav-menu {
        top: 62px;

        left: 6px;
        right: 6px;

        border-radius: 15px;
    }
}


/* =========================================================
   22. VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 360px) {

    .logo-text {
        font-size: 16px;
    }


    .round-logo-container {
        width: 38px;
        height: 38px;
    }


    .mobile-toggle {
        width: 40px;
        height: 40px;
    }
}


/* =========================================================
   23. ACCESSIBILITY
   ========================================================= */

.nav-menu a:focus-visible,
.mobile-toggle:focus-visible,
.mega-menu-item:focus-visible,
.logo-wrapper:focus-visible {
    outline: 3px solid #2563eb;

    outline-offset: 3px;
}


/* =========================================================
   24. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .header,
    .logo-wrapper,
    .round-logo-container,
    .logo-text,
    .nav-menu,
    .mega-menu,
    .mega-menu-item,
    .mobile-toggle {
        transition: none !important;
    }
}