/* Header */
.site-header {
    height: auto;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    /* Increased shadow */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s;
}

/* Top Bar */
.header-top-bar {
    background: #3a3a3a;
    border-bottom: 1px solid #2a2a2a;
    height: 36px;
    font-size: 13px;
    color: #f6f6f6;
}

.top-bar-inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hide welcome text on mobile */
@media (max-width: 768px) {
    .top-bar-left {
        display: none;
    }

    .top-bar-inner {
        justify-content: center;
        /* Center contact info if welcome is hidden */
    }

    .top-bar-right .contact-item:first-child {
        margin-left: 0;
    }
}

.top-bar-right .contact-item {
    margin-left: 0px;
}

.top-bar-right i {
    color: var(--primary-color);
    margin-right: 5px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    /* Fixed height for main nav area */
}

.logo {
    height: 100%;
    display: flex;
    align-items: center;
    background: var(--primary-color);
    position: relative;
    padding-right: 0;
    /* Padding moved to link */
    margin-left: -15px;
    /* Pull left to align with container edge if needed, or just 0 */
}

/* Extend red background to left edge */
.logo::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 0;
    height: 100%;
    width: 100vw;
    background: var(--primary-color);
}

.logo a {
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: 15px;
    /* Inner padding */
    padding-right: 40px;
    /* Padding added here to make full area clickable */
    text-decoration: none;
    width: 100%;
}

.logo img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
    /* Make logo white if it's an image */
}

.site-title {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    /* White text */
}

.main-nav {
    height: 100%;
    margin-left: auto;
    margin-right: 40px;
}

.menu-list {
    display: flex;
    height: 100%;
    align-items: center;
}

.menu-item {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.menu-item>a {
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    color: var(--secondary-color);
}

.menu-item:hover>a,
.menu-item.current>a {
    color: var(--primary-color);
}

.menu-item.current {
    background-color: #e4e4e4;
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 200px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-top: 3px solid var(--primary-color);
    padding: 10px 0;
}

.menu-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 10px 20px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

.dropdown-content a:hover {
    background: #f9f9f9;
    color: var(--primary-color);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-trigger {
    cursor: pointer;
    padding: 8px;
    color: var(--secondary-color);
    transition: color 0.3s;
}

.search-trigger:hover {
    color: var(--primary-color);
}

/* Search Bar Overlay */
.search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 20px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.search-overlay.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #eee;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.search-submit {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 46px;
    width: 46px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    /* Hidden on desktop */
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 1002;
    /* High z-index */
    padding: 5px;
    /* Clickable area */
}

.mobile-menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.mobile-menu-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--secondary-color);
    transition: all 0.3s;
}

.menu-text {
    font-size: 13px;
    font-weight: bold;
    color: var(--secondary-color);
    display: none;
    /* Hidden by default, shown in media query */
}

/* Responsive Header */
@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: flex;
        /* Show on mobile/tablet */
    }

    .menu-text {
        display: block;
        /* Show text on tablet */
    }

    .main-nav {
        position: fixed;
        top: 96px;
        left: 0;
        right: 0;
        width: 100%;
        height: 50vh;
        background: rgba(255, 255, 255, 0.98);
        transform: translateY(-110%);
        transition: transform 0.28s ease, opacity 0.28s ease;
        margin: 0;
        overflow-y: auto;
        padding: 14px 18px 20px;
        box-sizing: border-box;
        z-index: 998;
        border-top: 1px solid #e4e4e4;
        border-bottom: 1px solid #e4e4e4;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
        display: block;
        /* Ensure visible for animation */
        opacity: 0;
    }


    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
    }

    /* Fix search overlay on mobile */
    .search-overlay {
        top: 116px;
        /* Match nav top */
        padding: 15px;
    }

    .search-form {
        width: 100%;
    }

    .search-input {
        padding-right: 50px;
        /* Ensure text doesn't go under button */
    }

    .menu-list {
        flex-direction: column;
        height: auto;
        align-items: flex-start;
        width: 100%;
    }

    .menu-item {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: stretch;
        border-bottom: 1px solid #eee;
    }

    .menu-item>a {
        width: 100%;
        padding: 14px 14px;
        justify-content: space-between;
        display: flex;
        align-items: center;
        box-sizing: border-box;
    }

    /* Add arrow indicator */
    .menu-item.has-dropdown>a::after {
        content: '';
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid #999;
        margin-right: 10px;
        transition: transform 0.3s;
    }

    .menu-item.has-dropdown.active>a::after {
        transform: rotate(180deg);
        border-top-color: var(--primary-color);
    }

    .dropdown-menu {
        position: static !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: none !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        border-top: none !important;
        border-bottom: none !important;
        background: #fff !important;
        transition: none !important;
        height: auto !important;
    }

    .dropdown-content {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .menu-item.active .dropdown-menu {
        display: block !important;
    }

    .menu-item.active>a {
        background: #f6f6f6;
        color: var(--primary-color);
    }
}

@media (max-width: 768px) {
    .menu-item>a {
        width: 100%;
        padding: 13px 12px;
        justify-content: space-between;
    }

    .site-title {
        font-size: 14px;
    }

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

    .dropdown-content a {
        display: block !important;
        width: 100% !important;
        text-align: left;
        padding: 12px 20px !important;
        color: #333 !important;
        background: #fff !important;
        border-bottom: 1px solid #ececec;
        box-sizing: border-box;
        white-space: normal;
        line-height: 1.4;
    }

    .dropdown-content a:hover,
    .dropdown-content a:focus {
        color: var(--primary-color) !important;
        background: #f8f3ee !important;
    }

    .menu-item.active .dropdown-content a {
        background: #fff !important;
    }
}