﻿/* ========================= */
/* MAIN HEADER */
/* ========================= */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 2px solid #2a3a8c;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    flex-wrap: wrap;
}

.logo img {
    width: 120%;
}

/* ========================= */
/* HAMBURGER */
/* ========================= */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle .bar {
    width: 22px;
    height: 2px;
    background: #2a3a8c;
}

/* ========================= */
/* NAVBAR BASE */
/* ========================= */

.navbar ul {
    list-style: none;
    display: flex;
    gap: 40px;
    margin: 0;
    padding: 0;
}

.navbar li {
    position: relative;
}

.navbar a {
    text-decoration: none;
    color: #004080;
    font-weight: 600;
    padding: 5px 6px;
}

.navbar a:hover,
.navbar a.active {
    color: #FF6600;
}

/* ========================= */
/* DROPDOWN – LEVEL 1 */
/* ========================= */

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    list-style: none;
    padding: 5px 0;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 999;
}

.dropdown-menu li a {
    display: block;
    padding: 8px 12px;
    color: #004080;
}

.dropdown-menu li a:hover {
    background: #FF6600;
    color: #fff;
}

/* Desktop hover – level 1 */
@media (min-width: 993px) {
    .navbar > ul > li.dropdown:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================= */
/* SUBMENU – LEVEL 2 */
/* ========================= */

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-submenu .arrow {
    font-size: 12px;
    margin-left: 6px;
    transition: transform 0.25s ease;
}

/* Hidden by default */
.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: 0;          /* IMPORTANT: no hover gap */
    transform: translateX(-8px);
}

/* Desktop hover – level 2 (FIXED) */
@media (min-width: 993px) {
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        transform: translateX(0);
    }

    .dropdown-submenu:hover > a .arrow {
        transform: rotate(90deg);
    }
}

/* Mobile open state (JS controlled) */
.dropdown-submenu.open > .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* ========================= */
/* SEARCH BOX */
/* ========================= */

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 5px 8px;
    border-radius: 4px;
    border: none;
}

.search-box button {
    background: #FF6600;
    border: none;
    color: #fff;
    padding: 5px 8px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
}

/* ========================= */
/* MOBILE / TABLET */
/* ========================= */

@media (max-width: 992px) {

    .mobile-menu-toggle {
        display: flex;
    }

    .navbar {
        width: 100%;
    }

    .navbar ul {
        display: none;
        flex-direction: column;
        background: #004080;
        width: 100%;
        margin-top: 10px;
    }

    .navbar ul.show {
        display: flex;
    }

    .navbar li {
        border-bottom: 1px solid #ffffff55;
    }

    .navbar a {
        color: #fff;
        padding: 10px 14px;
    }

    .navbar a:hover {
        background: #FF6600;
    }

    .search-box {
        display: none;
    }

    /* Mobile dropdowns */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        transform: none;
        opacity: 1;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    .dropdown.open > .dropdown-menu {
        display: block;
        max-height: 500px;
    }

    /* Mobile submenu */
    .dropdown-submenu > .dropdown-menu {
        background: #003366;
        max-height: 0;
    }

    .dropdown-submenu.open > .dropdown-menu {
        max-height: 400px;
    }
}

/* ========================= */
/* SMALL DEVICES */
/* ========================= */

@media (max-width: 480px) {
    .navbar a {
        font-size: 14px;
    }
}
