/* Header */
.site-header {
    height: auto;
    background: #f5f5f5;
    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: #696969; /* Darker top bar */
    border-bottom: 1px solid #000000;
    height: 36px;
    font-size: 13px;
    color: #e0e0e0;
}

.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: 18px;
    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: 14px;
    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: 100px;
        left: 0;
        width: 100%;
        height: calc(100vh - 116px);
        background: #fff;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        margin: 0;
        overflow-y: auto;
        padding: 20px;
        box-sizing: border-box;
        z-index: 998;
        display: block; /* Ensure visible for animation */
    }


    .main-nav.active {
        transform: translateX(0);
    }
    
    /* 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;
    }

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

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

    /* 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;
        width: 100%;
        box-shadow: none;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: none; /* Hidden by default, toggle with JS */
        padding-left: 20px;
        border-top: none;
        background: #f9f9f9;
        height: auto !important; /* Ensure height is not restricted */
    }
    
    .dropdown-content {
        display: block !important; /* Ensure content is visible */
    }
}

@media (max-width: 768px) {


    .menu-item > a {
        width: 100%;
        padding: 15px 0;
        justify-content: space-between;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border-top: none;
        display: none;
        padding-left: 20px;
        background: #f9f9f9;
    }

    .menu-item.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-content a {
        text-align: left;
    }
}
