
        /* --- Universal Resets for WordPress Theme Compatibility --- */
        *, *::before, *::after {
            box-sizing: border-box;
        }

        /* Common theme wrappers to prevent spacing issues */
        .container, .ast-container, .elementor-section, .et_pb_section {
            margin-top: 0 !important;
            padding-top: 0 !important;
        }

        /* --- Global Resets for Header Positioning --- */
        
        /* Prevent horizontal scrollbar on the entire page */
        html {
            overflow-x: hidden;
        }

        /* MODIFICATION: Hide body initially to prevent FOUC (Flash of Unstyled Content) */
        body {
            overflow-x: hidden;
            min-height: 100vh; /* Ensures layout stability */
            opacity: 0; /* Start invisible */
            transition: opacity 0.3s ease-in-out; /* Smooth fade-in transition */
        }


        /* --- Header-specific CSS Variables (Aligned with main page's :root) --- */
        :root {
            --brand-green-dark: #1e4620;
            --brand-green-accent: #2a9d8f;
            --brand-green-mid: #81c784;
            --brand-green-light: #e8f5e9;
            --glow-color: rgba(129, 199, 132, 0.5);
            --text-primary: #1a3b1a;
            --text-secondary: #36533c;
            --bg-light: #fbfdfb;
            /* Header-specific variables, derived from main theme colors for consistency */
            --header-dark-bg: rgba(30, 70, 32, 0.85); /* rgba(var(--brand-green-dark), 0.85) */
            --menu-dark-bg: #1a3b1a; /* var(--text-primary) */
            --menu-dark-border: rgba(30, 70, 32, 0.7); /* rgba(var(--brand-green-dark), 0.7) */
            --text-on-dark: #fff;
            --text-on-dark-hover: #fff;
            /* This variable is now primarily for consistency, direct color used below for transparent state */
            --text-on-transparent-header: var(--text-on-dark); 
            --animation-duration: 0.3s;
        }

        /* --- Header & Navigation --- */
        #main-header {
            /* ENHANCED: Forced positioning and high z-index for theme override */
            position: fixed !important;
            top: 0 !important;
            width: 100%;
            /* Z-index is set high to ensure header is always on top.
             If other modals/popups appear, ensure their z-index is higher than this (e.g., 1001+). */
            z-index: 1000 !important; 

            transition: all var(--animation-duration) ease-in-out;
            background-color: transparent;
            /* Updated vertical padding for non-scrolled state */
            padding: 0.75rem 0; /* Slightly reduced initial padding for less clutter */
            border-bottom: 1px solid transparent;
        }

        /* EDITED: Always keep logo text and SVG white */
        #main-header #header-logo-text,
        #main-header #header-logo-svg {
            color: #fff !important;
        }

        #main-header.scrolled {
            background: rgba(30, 70, 32, 0.5); /* Darker, semi-transparent background on scroll */
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
            /* Updated vertical padding for scrolled state */
            padding: 0.6rem 0; /* Further reduced padding when scrolled */
            border-bottom-color: rgba(42, 157, 143, 0.5); /* Accent border on scroll */
        }
        
        /* Style for the logo link to remove default underline and ensure tap target size */
        #header-logo-link {
            text-decoration: none !important; /* Force remove underline */
            padding: 0.5rem; /* Add padding to increase tap target area */
            min-width: 48px; /* Ensure minimum tap target size */
            min-height: 48px; /* Ensure minimum tap target size */
            display: inline-flex; /* Ensure padding applies correctly */
            align-items: center; /* Vertically align content */
            flex-shrink: 0; /* Prevent logo from shrinking */
        }

        #header-logo-svg {
            /* Color is now explicitly set by the #main-header rule */
            fill: currentColor !important; /* Ensure SVG fills with the current text color */
            transition: color var(--animation-duration) ease;
        }

        #header-logo-text {
            /* Color is now explicitly set by the #main-header rule */
            transition: color var(--animation-duration) ease;
        }

        /* EDITED: Remove hover color change from logo */
        #header-logo-link:hover #header-logo-text,
        #header-logo-link:hover #header-logo-svg {
            color: #fff !important; /* Ensure it stays white on hover */
        }


        #header-mobile-menu-button {
            color: var(--text-on-transparent-header); /* White on transparent header */
            transition: color var(--animation-duration) ease;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.5rem; /* Added padding for better tap target */
            min-width: 48px; /* Ensure minimum tap target size */
            min-height: 48px; /* Ensure minimum tap target size */
            border-radius: 0.25rem; /* Subtle rounded corners */
            transition: background-color 0.2s ease; /* Smooth transition for hover/focus */
        }

        #header-mobile-menu-button:hover,
        #header-mobile-menu-button:focus-visible {
            background-color: rgba(42, 157, 143, 0.1); /* Light accent background on hover/focus */
            outline: none; /* Remove default outline */
        }

        #main-header.scrolled #header-logo-text,
        #main-header.scrolled #header-logo-svg,
        #main-header.scrolled #header-mobile-menu-button {
            color: var(--text-on-dark); /* White on scrolled header */
        }

        /* Desktop Navigation Links */
        .header-nav-link {
            font-size: 1rem;
            font-weight: 600; /* Consistent with main theme's smaller text */
            padding: 0.5rem 0.5rem; /* Adjusted padding for better spacing */
            margin: 0 0.25rem; /* Adjusted margin for better spacing */
            min-height: 48px; /* Ensure minimum tap target size */
            display: inline-flex; /* Use flexbox to center content vertically within 48px */
            align-items: center;
            transition: color 0.2s ease;
            position: relative;
            letter-spacing: 0.2px; /* Adjusted to be slightly less prominent than buttons */
            color: var(--text-on-transparent-header); /* Default color for transparent header */
            text-decoration: none; /* Ensure no default underline */
            font-family: 'Manrope', sans-serif;
            text-transform: none; /* Keep as is for navigation links */
            white-space: nowrap; /* Prevent text wrapping within nav links */
            flex-shrink: 0; /* Prevent nav links from shrinking */
        }

        #main-header.scrolled .header-nav-link {
            color: var(--text-on-dark); /* Color for scrolled header */
        }

        .header-nav-link:focus-visible {
            outline: 2px solid var(--brand-green-accent);
            outline-offset: 2px;
        }

        /* Keep hover effect for specific button, but not for all nav links (handled by ::after) */
        #header-list-property-button.header-nav-link:hover {
            color: var(--brand-green-accent);
        }

        /* --- Navigation Hover Effects --- */
        .header-nav-link span {
            display: inline-block;
        }

        .header-nav-link::after {
            content: '';
            position: absolute;
            bottom: -4px;
            left: 0;
            width: 100%; /* Full width underline */
            height: 2px;
            background-color: var(--text-on-dark); /* Underline color */
            transform: scaleX(0); /* Start hidden */
            transform-origin: bottom left; /* Grow from left */
            transition: transform var(--animation-duration) ease-out; /* Consistent transition */
        }

        .header-nav-link:hover::after,
        .header-nav-link:focus-visible::after {
            transform: scaleX(1); /* Show on hover/focus */
        }

        /* --- Action Buttons (Aligned with .btn-primary) --- */
        #header-list-property-button {
            color: var(--text-on-transparent-header);
            transition: color var(--animation-duration) ease;
            font-weight: 700; /* Aligned with .btn-primary */
            background: none;
            border: none;
            cursor: pointer;
            font-family: 'Manrope', sans-serif;
            text-transform: uppercase; /* Aligned with .btn-primary */
            letter-spacing: 1.3px; /* Aligned with .btn-primary */
            padding: 1rem 1.25rem; /* Standardized padding for better visual balance */
            min-width: 48px; /* Ensure minimum tap target size */
            min-height: 48px; /* Ensure minimum tap target size */
            white-space: nowrap; /* Prevent text wrapping */
            flex-shrink: 0; /* Prevent button from shrinking */
        }

        #main-header.scrolled #header-list-property-button {
            color: var(--text-on-dark);
        }

        #header-list-property-button:hover,
        #header-list-property-button:focus-visible {
            color: var(--brand-green-accent);
            outline: none;
        }

        #header-signin-button {
            display: inline-block;
            padding: 0.75rem 1.25rem; /* Reduced vertical padding to 0.75rem, horizontal to 1.25rem */
            border-radius: 0; /* Consistent with main theme */
            font-family: 'Manrope', sans-serif;
            font-weight: 700;
            text-transform: uppercase; /* Aligned with .btn-primary */
            letter-spacing: 1.3px; /* Aligned with .btn-primary */
            font-size: 1rem; /* Aligned with .btn-primary */
            color: #fff;
            background-image: linear-gradient(110deg, var(--brand-green-accent) 0%, var(--brand-green-mid) 100%);
            box-shadow: 0 10px 30px -5px rgba(42, 157, 143, 0.4), 0 0 15px var(--glow-color) inset;
            border: none;
            transition: all var(--animation-duration) cubic-bezier(0.2, 0.8, 0.2, 1);
            background-size: 250% auto;
            text-decoration: none;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            min-width: 48px; /* Ensure minimum tap target size */
            min-height: 48px; /* Ensure minimum tap target size */
            white-space: nowrap; /* Prevent text wrapping */
            flex-shrink: 0; /* Prevent button from shrinking */
        }

        #header-signin-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        #header-signin-button:hover::before,
        #header-signin-button:focus-visible::before {
            left: 100%;
        }

        #header-signin-button:hover,
        #header-signin-button:focus-visible {
            background-position: right center;
            transform: translateY(-4px) scale(1.05); /* Aligned with .btn-primary */
            box-shadow: 0 18px 45px -8px rgba(42, 157, 143, 0.5), 0 0 20px var(--glow-color) inset; /* Aligned with .btn-primary */
            outline: none;
        }

        /* --- Mobile Menu --- */
        #header-mobile-menu {
            position: fixed;
            width: 100%;
            top: 0;
            left: 0;
            height: 100vh;
            background-color: rgba(26, 59, 26, 0.8); /* Dark green semi-transparent */
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 1000;
            transform: translateX(-100%);
            opacity: 0; /* Added for fade effect */
            transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.6s ease-in-out; /* Added opacity transition */
            overflow-y: auto;
        }

        #header-mobile-menu.active { 
            transform: translateX(0); 
            opacity: 1; /* Fade in */
        }

        .header-mobile-menu-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--menu-dark-border);
        }

        #header-mobile-menu-close-button {
            color: var(--text-on-dark);
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.5rem; /* Added padding for better tap target */
            min-width: 48px; /* Ensure minimum tap target size */
            min-height: 48px; /* Ensure minimum tap target size */
        }

        #header-mobile-menu-close-button:focus-visible {
            outline: 2px solid var(--brand-green-accent); /* Added focus-visible outline */
            outline-offset: 2px;
        }

        .header-mobile-nav-link {
            /* Reduced font weight for a sleeker look */
            font-weight: 600; /* Changed from 700 */
            /* Reduced vertical padding for a sleeker look */
            padding: 0.75rem 1.5rem; /* Changed from 1rem */
            font-size: 1.2rem;
            border-bottom: 1px solid var(--menu-dark-border);
            display: block;
            width: 100%;
            min-height: 48px; /* Ensure minimum tap target size */
            text-align: left;
            transition: background-color 0.2s ease, color 0.2s ease;
            color: var(--text-on-dark);
            text-decoration: none;
            background: none;
            border: none;
            cursor: pointer;
            font-family: 'Manrope', sans-serif;
            text-transform: none;
        }

        .header-mobile-nav-link:hover,
        .header-mobile-nav-link:focus-visible {
            background-color: rgba(42, 157, 143, 0.1); /* Light accent background on hover */
            color: var(--brand-green-accent);
            outline: none;
        }

        /* Mobile CTAs (Aligned with .btn-primary) */
        .header-mobile-cta-primary,
        .header-mobile-cta-secondary {
            display: block;
            text-align: center;
            padding: 1rem 2.25rem; /* Aligned with .btn-primary */
            border-radius: 0; /* Consistent with main theme */
            font-family: 'Manrope', sans-serif;
            font-weight: 700;
            text-transform: uppercase; /* Aligned with .btn-primary */
            letter-spacing: 1.3px; /* Aligned with .btn-primary */
            font-size: 1rem; /* Aligned with .btn-primary */
            transition: all var(--animation-duration) cubic-bezier(0.2, 0.8, 0.2, 1);
            text-decoration: none;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            min-width: 48px; /* Ensure minimum tap target size */
            min-height: 48px; /* Ensure minimum tap target size */
        }

        .header-mobile-cta-primary {
            color: #fff;
            background-image: linear-gradient(110deg, var(--brand-green-accent) 0%, var(--brand-green-mid) 100%);
            box-shadow: 0 10px 30px -5px rgba(42, 157, 143, 0.4), 0 0 15px var(--glow-color) inset;
            border: none;
        }

        .header-mobile-cta-secondary {
            background-color: transparent;
            border: 1px solid var(--brand-green-accent);
            color: var(--brand-green-accent);
        }

        .header-mobile-cta-primary::before,
        .header-mobile-cta-secondary::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        .header-mobile-cta-primary:hover::before,
        .header-mobile-cta-primary:focus-visible::before,
        .header-mobile-cta-secondary:hover::before,
        .header-mobile-cta-secondary:focus-visible::before {
            left: 100%;
        }

        .header-mobile-cta-primary:hover,
        .header-mobile-cta-primary:focus-visible {
            background-position: right center;
            transform: translateY(-4px) scale(1.05);
            box-shadow: 0 18px 45px -8px rgba(42, 157, 143, 0.5), 0 0 20px var(--glow-color) inset;
            outline: none;
        }

        .header-mobile-cta-secondary:hover,
        .header-mobile-cta-secondary:focus-visible {
            background-color: var(--brand-green-accent);
            color: #fff;
            box-shadow: 0 8px 20px rgba(42, 157, 143, 0.3);
            transform: translateY(-2px);
            outline: none;
        }

        /* --- Font Family Classes --- */
        .header-font-playfair {
            font-family: 'Playfair Display', serif;
            letter-spacing: -0.02em;
        }

        /* --- Utility Classes --- */
        .header-container {
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 0 1.5rem;
            /* Removed overflow: hidden; to allow dropdown to be visible */
            /* overflow: hidden; */
        }
        .header-flex { 
            display: flex; 
            flex-wrap: nowrap; /* Keep items on a single line for desktop */
            /* Removed overflow-x: auto to eliminate horizontal scrollbar */
        }
        .header-justify-between { justify-content: space-between; }
        .header-items-center { align-items: center; }
        .header-space-x-3 > * + * { margin-left: 0.75rem; }
        .header-space-x-4 > * + * { margin-left: 1rem; }
        .header-hidden { display: none; }
        
        @media (min-width: 1024px) {
            .header-lg-flex { 
                display: flex; 
                flex-wrap: nowrap; /* Keep items on a single line for desktop */
                overflow-x: visible; /* Ensure content is not clipped by overflow-x */
                -webkit-overflow-scrolling: touch; 
                flex-grow: 1; /* Allow this section to grow and take available space */
                justify-content: flex-end; /* Push nav items to the right */
            }
            /* Ensure the navigation links container has enough space */
            .header-lg-flex:first-of-type {
                flex-grow: 1;
                justify-content: flex-start;
            }
            .header-lg-hidden { display: none; }
        }
        
        @media (max-width: 1023px) {
            .header-lg-hidden { display: block; }
            .header-lg-flex { display: none; }

            /* Mobile specific padding for header container */
            /* Reduced horizontal padding to 0.25rem */
            .header-container {
                padding: 0 0.25rem; 
            }

            /* Mobile menu button specific styling */
            #header-mobile-menu-button {
                padding: 0.5rem; /* Added padding for better tap target */
                border-radius: 0.25rem; /* Subtle rounded corners */
                transition: background-color 0.2s ease; /* Smooth transition for hover/focus */
            }

            #header-mobile-menu-button:hover,
            #header-mobile-menu-button:focus-visible {
                background-color: rgba(42, 157, 143, 0.1); /* Light accent background on hover/focus */
                outline: none; /* Remove default outline */
            }
        }

        /* Accessibility: Reduce motion for users who prefer it */
        @media (prefers-reduced-motion: reduce) {
            #main-header,
            .header-nav-link::after,
            #header-signin-button,
            #header-signin-button::before,
            #header-mobile-menu,
            #header-mobile-submenu a,
            .header-mobile-cta-primary,
            .header-mobile-cta-secondary,
            .header-mobile-cta-primary::before,
            .header-mobile-cta-secondary::before,
            #header-mobile-menu-button { /* Added mobile menu button to reduced motion */
                transition: none !important;
                animation: none !important;
            }
        }
    