header {
    background-color: var(--card-bg-color); /* Use variable */
    border-bottom: 1px solid var(--border-color); /* Use variable */
    padding: calc(var(--spacing-unit) * 1.5) 0; /* 12px */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.header-container {
    max-width: 1280px; /* Match container width */
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3); /* 24px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Add relative positioning */
}

/* Style the logo container */
.logo {
    display: flex; /* Use flexbox for alignment */
    align-items: center; /* Center image vertically if needed */
    width: 180px;
}

/* Style the logo link and image */
.logo a {
    display: inline-block; /* Allows setting height/max-height */
    height: 100%; /* Make link fill the height of .logo */
}

.logo img {
    max-height: 100%; /* Ensure image fits within the link/logo height */
    width: auto; /* Maintain aspect ratio */
    vertical-align: middle; /* Improve vertical alignment if needed */
}

/* Style for the added support icon (PC Default) */
.header-support-icon {
    bottom: auto;
    background-color: #fff;
    padding: 10px;
    width: 90px;
    right: 24px;
    top: 58px;
    position: absolute;
    z-index: 1001;
    transition: top 0.4s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out; /* Add opacity/visibility transition */
}

.header-support-icon img {
    width: 100%; /* Adjust icon size */
    height: auto;
    display: block; /* Remove extra space below image */
    transition: transform 0.2s ease;
}

.header-support-icon a:hover img {
    transform: scale(1.1); /* Slight zoom effect on hover */
}

/* Desktop Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: calc(var(--spacing-unit) * 3); /* 24px gap between items */
}

nav ul li {
    margin-left: 0; /* Remove left margin, use gap */
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500; /* Regular weight */
    font-size: 0.95em;
    padding: calc(var(--spacing-unit) * 0.5) 0; /* 4px top/bottom padding */
    transition: color 0.2s ease;
    position: relative;
    display: inline-block; /* Set display to inline-block for text-width */
}

/* Restore ::after underline styles */
nav ul li a::after {
    content: '';
    position: absolute;
    width: 0; 
    height: 2px;
    bottom: -2px; /* Adjust position closer to text */
    left: 0;
    background-color: var(--primary-color); 
    transition: width 0.3s ease;
}

nav ul li a:hover::after { /* Apply underline on hover */
    width: 100%; 
}

/* Active menu item style - Color only */
.desktop-nav ul li.active > a {
    color: var(--primary-color);
    font-weight: 600; /* Optional: make active item bolder */
}

/* Restore ::after rule for active item underline */
.desktop-nav ul li.active > a::after {
    width: 100%; 
}

/* Header Utils (Admin links, etc.) */
.header-utils {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5); /* 12px */
}

.header-utils .admin-welcome {
    font-size: 0.9em;
    color: var(--light-text-color);
}

.header-utils .btn {
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5); /* Smaller padding for header buttons */
    font-size: 0.85em;
    box-shadow: none; /* Remove shadow for header buttons */
}

.header-utils .btn-admin {
    background-color: var(--accent-color);
    color: var(--text-color);
}
.header-utils .btn-admin:hover {
     background-color: #e6a700; /* Darker yellow */
     color: var(--text-color);
}

.header-utils .btn-logout {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.header-utils .btn-logout:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Header Phone Number */
.header-phone {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.5); /* 4px gap */
    margin-right: calc(var(--spacing-unit) * 1); /* Space before admin/login */
    font-size: 0.9em;
}

.header-phone .phone-label {
    color: var(--light-text-color);
}

.header-phone .phone-number {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none; /* Remove underline from link */
}
.header-phone .phone-number:hover {
    text-decoration: underline; /* Add underline on hover */
}

/* Mobile Menu Button */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-unit);
    line-height: 1;
    width: 40px; /* Fixed width */
    height: 40px; /* Fixed height */
    position: relative; /* For positioning spans */
    z-index: 1001; /* Ensure button is clickable above menu */
}

.mobile-menu-button span {
    display: block;
    width: 24px; /* Span width */
    height: 3px; /* Span height (thickness) */
    background-color: var(--text-color);
    border-radius: 3px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease, background-color 0.3s ease, top 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-button span:nth-child(1) {
    top: 10px; /* Position first span */
}

.mobile-menu-button span:nth-child(2) {
    top: 18px; /* Position second span (center) */
}

.mobile-menu-button span:nth-child(3) {
    top: 26px; /* Position third span */
}

/* Active state (X shape) */
.mobile-menu-button.active span:nth-child(1) {
    top: 18px;
    transform: translateX(-50%) rotate(45deg);
}

.mobile-menu-button.active span:nth-child(2) {
    opacity: 0; /* Hide middle span */
}

.mobile-menu-button.active span:nth-child(3) {
    top: 18px;
    transform: translateX(-50%) rotate(-45deg);
}

/* Mobile Menu Styles */
header .mobile-menu { /* Increased specificity */
    /* display: none; Removed to allow transition */
    display: block; /* Ensure it takes space for transition */
    position: absolute;
    top: 100%; /* Position below header */
    left: 0;
    width: 100%;
    background-color: var(--card-bg-color);
    max-height: 0; /* Initially hidden */
    overflow: hidden; /* Hide content when collapsed - REQUIRED for max-height transition */
    transition: max-height 0.4s ease-out; /* Smooth transition */
    border-top: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1002; /* Ensure it's above other content */
}

header .mobile-menu.active { /* Increased specificity */
    max-height: 70vh; /* Adjust as needed */
    /* display: block; Redundant as base is block */
    overflow-y: auto; /* Allow scrolling for long menus */
}

.mobile-menu ul {
    flex-direction: column;
    gap: 0; /* Remove gap for column layout */
}

.mobile-menu ul li {
    text-align: left; /* Align text left */
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu ul li:last-child {
    border-bottom: none;
}

.mobile-menu ul li a {
    display: block;
    padding: calc(var(--spacing-unit) * 1.8) calc(var(--spacing-unit) * 3); /* 14px 24px */
    color: var(--text-color);
    font-weight: 500;
}

.mobile-menu ul li a:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

/* Submenu Toggle Icon */
.mobile-menu ul li .submenu-toggle {
    float: right;
    padding-left: 10px; /* Space before icon */
    transition: transform 0.3s ease;
    font-size: 0.8em; /* Adjust icon size */
    color: var(--light-text-color);
}

.mobile-menu ul li.active > a .submenu-toggle {
    transform: rotate(180deg); /* Rotate icon when active */
}

/* Mobile Submenu Styles */
.mobile-submenu {
    list-style: none;
    padding-left: calc(var(--spacing-unit) * 3); /* Indent submenu */
    background-color: var(--bg-color); /* Slightly different background */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-submenu li {
    border-bottom: none; /* Remove border from submenu items initially */
    border-top: 1px solid var(--border-color); /* Add top border */
}

.mobile-submenu li:first-child {
    border-top: none; /* Remove top border for the first item */
}

.mobile-submenu li a {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3); /* Adjust padding */
    font-size: 0.9em; /* Slightly smaller font */
    color: var(--light-text-color);
}

.mobile-submenu li a:hover {
    color: var(--primary-color);
}

/* Active parent shows submenu */
/* We will control max-height via JS for simplicity and potentially better performance/control */
/* 
.mobile-menu ul li.has-submenu.active > .mobile-submenu {
    max-height: 500px; /* Adjust as needed */
/* } */

/* Mobile admin links inside menu */
.mobile-menu .mobile-header-utils {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column; /* Stack vertically */
    gap: var(--spacing-unit);
}

.mobile-menu .mobile-header-utils .admin-welcome {
    font-size: 0.9em;
    color: var(--light-text-color);
    text-align: center;
}

.mobile-menu .mobile-header-utils .btn {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1.25);
    font-size: 0.9em;
}

/* Mobile Styles */
@media (max-width: 1024px) { /* Tablet and smaller */
    header .desktop-nav { /* Increased specificity */
        display: none;
    }

    /* Hide only admin-related utils on mobile, keep phone */
    /* header .header-container > .header-utils { 
        display: none;
    } */
    header .header-utils .admin-welcome,
    header .header-utils .btn-logout,
    header .header-utils .btn-login /* If login button exists */ {
        display: none;
    }
    
    /* Adjust layout if needed, e.g., center phone and button */
    header .header-container {
        /* Example: could adjust justification if needed */
        /* justify-content: space-between; /* default */
    }
    header .header-utils {
        /* Ensure phone number aligns nicely with mobile button */
        margin-left: auto; /* Push utils (phone) to the right */
    }

    header .mobile-menu-button { /* Increased specificity */
        display: block; /* Show mobile menu button */
    }

    /* Mobile position for support icon (Default state - hidden initially) */
    .header-support-icon {
        right: 0; /* Align with container padding (as per user edit) */
        opacity: 0; /* Hidden initially */
        visibility: hidden; /* Hidden initially */
        transform: translateY(20px); /* Start slightly lower for slide-in effect */
        transition: top 0.4s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out, transform 0.3s ease-out; /* Add transform transition */
    }

    /* Style to show the icon */
    .header-support-icon.show-support-icon {
        opacity: 1;
        visibility: visible;
        transform: translateY(0); /* Slide up to original position */
    }
    
    /* Adjust icon position when mobile menu is active */
    body.mobile-menu-active .header-support-icon {
        top: 330px; /* Move down when menu is active - Adjust this value as needed */
        border-top: 1px solid var(--border-color);
        /* Ensure it remains visible even when menu is active */
        opacity: 1; 
        visibility: visible;
        transform: translateY(0); 
    }

    /* ... other mobile styles ... */
}

/* Desktop Navigation Dropdown */
.desktop-nav ul li.has-dropdown {
    position: relative; /* Needed for absolute positioning of dropdown */
}

.desktop-nav ul li .dropdown-menu {
    /* display: none; Hide dropdown by default */
    display: block; /* Keep it block, control visibility with max-height */
    position: absolute;
    top: 100%; /* Position below the parent menu item */
    left: 0;
    min-width: 180px; /* Adjust width as needed */
    background-color: #fff; /* Background color */
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px; /* Rounded corners at the bottom */
    padding: 10px 0; /* Vertical padding */
    z-index: 1050; /* Ensure it appears above other content */
    list-style: none; /* Remove default list bullets */
    margin: 0; /* Remove default margin */
    max-height: 0; /* Initially hidden */
    overflow: hidden; /* Hide content when collapsed */
    transition: max-height 0.3s ease-out, padding 0.3s ease-out, border-width 0.3s ease-out; /* Smooth transition for height, padding, and border */
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0 1px;
}

/* Show dropdown on hover */
.desktop-nav ul li.has-dropdown:hover > .dropdown-menu {
    /* display: block; */
    max-height: 400px; /* Adjust max-height as needed to fit content */
    padding-top: 10px;
    padding-bottom: 10px;
    border-width: 1px;
}

/* Dropdown Item Styling */
.desktop-nav .dropdown-menu li {
    padding: 0;
}

.desktop-nav .dropdown-menu li a {
    display: block;
    padding: 8px 20px; /* Padding for dropdown items */
    color: #555; /* Link color */
    text-decoration: none;
    white-space: nowrap; /* Prevent wrapping */
    font-size: 0.9em; /* Slightly smaller font size */
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Dropdown Item Hover Effect */
.desktop-nav .dropdown-menu li a:hover {
    background-color: #f8f9fa; /* Light background on hover */
    color: #333; /* Darker text on hover */
}

/* Prevent underline pseudo-element on dropdown links */
.desktop-nav .dropdown-menu li a::after {
    display: none; /* Ensure no underline appears on dropdown items */
}

/* Active Dropdown Item Style - Color only */
.desktop-nav .dropdown-menu li.active a {
    color: var(--primary-color);
    font-weight: 600; /* Optional: make active sub-item bolder */
}

/* Ensure dropdown doesn't affect main nav item padding */
.desktop-nav ul li.has-dropdown > a {
    /* Main nav item styles are typically applied here */
    /* padding-right might need adjustment if an arrow is added */
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0; /* top: 0; right: 0; bottom: 0; left: 0; */
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 998; /* Below menu (999), above content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0s linear 0.4s;
}

body.mobile-menu-active .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease-out, visibility 0s linear 0s;
}

/* Prevent body scroll when mobile menu is active */
body.mobile-menu-active {
    overflow: hidden;
} 

@media (max-width: 768px) {
    .logo {
        width: 120px;
    }
    .phone-label-text{
        display: none;
    }
    .show-support-icon{
        top: 53px;
    }
}