@media (min-width: 992px) {

    /* =========================================
   IDX IMPress Omnibar Styles
   ========================================= */
    /* Wrapper Class: .lux-hero-search (Apply this to the GB Container) */
    .lux-hero-search form {
        display: flex;
        justify-content: center;
        background: rgba(0, 0, 0, 0.4);
        padding: 1rem;
        border-radius: 4px;
        width: 100%;
    }

    .lux-hero-search input[type="text"] {
        flex-grow: 1;
        border: none !important;
        background: transparent !important;
        border-bottom: 2px solid #fff !important;
        color: #fff !important;
        font-size: 1.2rem !important;
        padding: 0.5rem 1rem !important;
        border-radius: 0 !important;
    }

    .lux-hero-search input::placeholder {
        color: rgba(255, 255, 255, 0.8);
    }

    .lux-hero-search input[type="submit"],
    .lux-hero-search button {
        background: var(--lux-color-gold) !important;
        color: #fff !important;
        border: none !important;
        padding: 0 2rem !important;
        font-weight: 600 !important;
        text-transform: uppercase;
        letter-spacing: 1px;
        cursor: pointer;
        margin-left: 1rem;
    }

    .lux-hero-search input[type="submit"]:hover,
    .lux-hero-search button:hover {
        background: #fff !important;
        color: var(--lux-color-dark) !important;
    }

    /* Mobile */
    @media (max-width: 600px) {
        .lux-hero-search form {
            flex-direction: column;
            gap: 1rem;
        }

        .lux-hero-search input[type="submit"],
        .lux-hero-search button {
            margin-left: 0;
            padding: 1rem !important;
        }
    }

    /* =========================================
   IDX IMPress Results Styles
   ========================================= */
    #IDX-newSearch,
    #IDX-modifySearch,
    #IDX-saveSearch {
        background: #fff !important;
        color: var(--lux-color-dark) !important;
        border: 1px solid var(--lux-color-dark) !important;
        padding: 0.5rem 1.5rem !important;
        text-transform: uppercase;
        font-size: 0.75rem !important;
        letter-spacing: 1px;
        border-radius: 0 !important;
        transition: all 0.3s ease;
        cursor: pointer;
        font-family: inherit !important;
    }

    #IDX-saveSearch:hover {
        background: var(--lux-color-dark) !important;
        color: #fff !important;
    }

    /* Fix generic IDX container text and layout */
    #IDX-main,
    #IDX-wrapper,
    .IDX-wrapper-standard,
    div[id^="IDX-main"] {
        font-family: inherit !important;
        color: var(--lux-color-dark) !important;
        max-width: 1400px !important;
        margin: 0 auto !important;
        padding: 2rem;
        width: 100%;
    }

    /* =========================================
   IDX IMPress Widget Overrides (Lux Card - Advanced Layout)
   ========================================= */

    /* Main Grid Container */
    .impress-showcase-widget,
    .impress-property-showcase {
        /* Added class from user HTML */
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
        /* row-gap removed as it wasn't effective */
        width: 100% !important;
    }

    @media (max-width: 900px) {

        .impress-showcase-widget,
        .impress-property-showcase {
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
        }
    }

    /* FIX: Hide everything that is NOT a property card (e.g. Script tags, empty divs) */
    /* 1. Hide potential script tags or empty divs */
    .impress-showcase-widget>*:not(.impress-showcase-property),
    .impress-property-showcase>*:not(.impress-showcase-property) {
        display: none !important;
    }

    /* 2. CRITICAL FIX: Hide pseudo-elements (clearfixes) that act as ghost grid items */
    .impress-showcase-widget::before,
    .impress-showcase-widget::after,
    .impress-property-showcase::before,
    .impress-property-showcase::after {
        content: none !important;
        display: none !important;
    }

    /* Individual Card Wrapper */
    /* IMPORTANT: Override Foundation/Bootstrap width classes (e.g. medium-3) to fill the Grid Cell */
    .impress-showcase-property {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;

        position: relative;
        background: #fff;
        border: 1px solid rgba(0, 0, 0, 0.05);
        /* Matching Lux Card Border */
        border-radius: 2px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        display: flex;
        flex-direction: column;

        /* REMOVE SIDE PADDING to allow full-bleed image */
        padding: 0 0 60px 0 !important;
        /* ADD MARGIN BOTTOM for row spacing */
        margin-bottom: 3rem !important;
    }

    .impress-showcase-property:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    }

    /* Inner Link Container - Advanced Grid Layout */
    /* We set font-size: 0 here to hide anonymous text nodes (like the comma in address) */
    a.impress-showcase-photo {
        display: grid !important;
        grid-template-areas:
            "header"
            "image"
            "title"
            "price";
        grid-template-rows: auto auto auto auto;
        text-decoration: none !important;
        color: inherit !important;
        width: 100%;
        position: relative;
        font-size: 0 !important;
        /* Hide direct text nodes */
    }

    /* 1. Header (Location) - Created by unboxing the address */
    p.impress-address {
        display: contents !important;
        /* No visual box. Children become grid items of <a> */
    }

    /* City -> Header Area */
    p.impress-address .impress-cityname {
        grid-area: header;
        font-size: 0.75rem !important;
        /* Restore font size */
        color: #333 !important;

        /* Left Align */
        justify-self: start !important;
        margin: 1rem 0 0.75rem 1.5rem !important;
        /* Left margin matches padding */

        font-family: 'Inter', sans-serif;
        font-weight: 700 !important;
        text-transform: uppercase;
        letter-spacing: 1px;
        display: inline-block !important;
        visibility: visible !important;
    }

    /* State -> Hidden */
    p.impress-address .impress-state {
        display: none !important;
    }

    /* Add Gold Icon to City via pseudo */
    p.impress-address .impress-cityname::before {
        content: "";
        display: inline-block;
        width: 10px;
        height: 12px;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23C5A059"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>');
        background-size: contain;
        background-repeat: no-repeat;
        margin-right: 6px;
        vertical-align: middle;
    }

    /* 2. Street -> Title Area */
    p.impress-address .impress-street {
        grid-area: title !important;
        font-size: 1.25rem !important;
        /* Restore font size */
        color: #000 !important;
        display: block !important;
        visibility: visible !important;
        margin: 1rem 1.5rem 0.25rem 1.5rem !important;
        /* Side margins */
        font-family: 'Outfit', sans-serif !important;
        font-weight: 600 !important;
        text-transform: none;
        line-height: 1.2;
        text-align: left;
        width: auto !important;
    }

    /* 3. Image Area */
    a.impress-showcase-photo img {
        grid-area: image;
        width: 100% !important;
        aspect-ratio: 4/3 !important;
        object-fit: cover !important;
        display: block !important;
        margin: 0 !important;
    }

    /* 4. Price */
    span.impress-price {
        grid-area: price;
        display: block !important;
        font-family: 'Outfit', sans-serif;
        font-size: 1.1rem !important;
        /* Restore font size */
        font-weight: 700 !important;
        color: #111 !important;
        margin: 0.25rem 1.5rem 0.25rem 1.5rem !important;
    }

    /* Status Overlay */
    span.impress-status {
        grid-area: image;
        justify-self: start;
        align-self: end;
        margin: 0 0 10px 10px !important;
        z-index: 5;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(2px);
        border: 1px solid rgba(255, 255, 255, 0.5);
        color: #fff !important;
        padding: 0.25rem 0.75rem !important;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 1px;
        font-size: 0.6rem !important;
        /* Restore font size */
        display: inline-block !important;
        visibility: visible !important;
        border-radius: 0 !important;
    }

    /* Specs Container */
    .impress-beds-baths-sqft,
    .impress-showcase-property .impress-beds-baths-sqft {
        margin: 1rem 1.5rem 1rem 1.5rem !important;
        padding-top: 1rem !important;
        border-top: 1px solid #eee;
        display: flex !important;
        flex-wrap: wrap;
        gap: 15px;
        color: #666 !important;
        /* REMOVED UPPERCASE to match Lux */
        letter-spacing: 0.5px;
        align-items: center;
    }

    /* Ensure all child spans are same size */
    .impress-beds-baths-sqft span,
    .impress-showcase-property .impress-beds-baths-sqft span {
        font-family: 'Inter', sans-serif;
        font-size: 0.8rem !important;
        /* Slightly smaller */
        line-height: 1;
        text-transform: none !important;
        /* Force no uppercase */
        /* Note: "BEDS" comes from HTML, try capitalize? */
        text-transform: capitalize !important;
    }

    /* Hide Acres */
    .impress-acres {
        display: none !important;
    }

    /* Chevrons for Specs */
    .impress-beds::before,
    .impress-baths::before,
    .impress-sqft::before {
        content: "\203A";
        /* Chevron > */
        display: inline-block;
        color: #C5A059;
        /* Gold */
        margin-right: 4px;
        font-size: 1.2em;
        line-height: 0.8;
    }

    /* Footer Button */
    .impress-showcase-property::after {
        content: "VIEW LISTING \2192";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        /* Taller footer area */
        background-color: #fafafa;
        /* Restore Grey */
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Outfit', sans-serif;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: #111;
        pointer-events: none;
        border-top: 1px solid #eee;
    }

    .impress-showcase-property::before {
        content: none;
    }

    .impress-showcase-property:hover::after {
        background-color: #111;
        color: #fff;
    }

    /* =========================================
   IDX Property Detail Page Styles
   ========================================= */

    /* 1. Wrapper Adjustments 
   If using the Standard Wrapper, this ensures the content isn't hidden behind a fixed header.
   We assume the user follows the guide to disable merged header, but this is a safety net.
*/
    body.idx-pages #site-navigation,
    body.single-property #site-navigation {
        /* If the header is fixed/transparent, we might need a background here specifically for IDX pages */
        background-color: #0c1d2d;
        /* Lux Dark Blue */
        position: relative;
        /* Force relative to push content down */
    }

    /* 2. Simple Header Styling (If using default page title) */
    body.idx-pages .entry-header {
        background: #f9f9f9;
        padding: 3rem 0;
        margin-bottom: 2rem;
        text-align: center;
    }

    body.idx-pages .entry-title {
        color: #0c1d2d;
        font-family: var(--lux-font-serif);
        font-size: 2.5rem;
    }

    /* 3. IDX Broker Container Styling */
    #idx-wrapper {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
    }

    /* Hide the default IDX "Back to Results" top bar if it conflicts */
    #IDX-backToResults {
        margin-top: 1rem;
        margin-bottom: 1rem;
        font-family: 'Inter', sans-serif;
        font-size: 0.9rem;
    }

    /* Sometimes used for title or address */
    .impress-showcase-property .impress-street {
        font-family: 'Outfit', sans-serif;
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        color: #000 !important;
        margin-bottom: 0.25rem !important;
        line-height: 1.3;
    }

    /* =========================================
   IDX Property Detail Page - "Lux-ification"
   ========================================= */

    /* 1. Global Typography Override for IDX Area */
    #idx-wrapper,
    .idx-content,
    #IDX-main {
        font-family: 'Inter', sans-serif !important;
        color: #333 !important;
        line-height: 1.6 !important;
    }

    /* 2. Headings & Titles (Lux Style) */
    #idx-wrapper h1,
    #idx-wrapper h2,
    #idx-wrapper h3,
    #idx-wrapper h4,
    #IDX-propertyAddress {
        font-family: 'Outfit', sans-serif !important;
        color: #0c1d2d !important;
        /* Navy */
        font-weight: 600 !important;
        letter-spacing: -0.5px !important;
    }

    /* Address & Price Hero Section */
    #IDX-detailsHead {
        margin-bottom: 2rem !important;
        border-bottom: 1px solid #eee !important;
        padding-bottom: 2rem !important;
    }

    #IDX-propertyAddress {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }

    #IDX-price {
        font-size: 2rem !important;
        color: #c5a47e !important;
        /* Gold */
        font-family: 'Outfit', sans-serif !important;
        font-weight: 500 !important;
    }

    /* 3. Section Headers (Description, Features) */
    #IDX-description h2,
    #IDX-features h2,
    #IDX-map h2,
    .IDX-panelHeader {
        font-size: 1.1rem !important;
        text-transform: uppercase !important;
        letter-spacing: 2px !important;
        color: #c5a47e !important;
        /* Gold Details */
        border-bottom: 2px solid #c5a47e !important;
        padding-bottom: 1rem !important;
        margin-top: 3rem !important;
        margin-bottom: 1.5rem !important;
        display: inline-block !important;
        width: 100% !important;
        background: transparent !important;
        /* Remove IDX standard bg */
    }

    /* 4. Data Lists & Fields */
    .IDX-fieldContainer {
        margin-bottom: 0.5rem !important;
    }

    .IDX-fieldLabel {
        font-weight: 600 !important;
        color: #0c1d2d !important;
        /* Feature Labels in Navy */
        min-width: 150px !important;
        display: inline-block !important;
    }

    .IDX-fieldValue {
        color: #666 !important;
    }

    /* 5. Buttons (Primary Actions) */
    #IDX-saveProperty,
    #IDX-newSearch,
    .IDX-btn {
        background-color: #0c1d2d !important;
        color: #fff !important;
        border: none !important;
        border-radius: 50px !important;
        /* Pill shape */
        padding: 12px 25px !important;
        font-family: 'Outfit', sans-serif !important;
        font-size: 0.9rem !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        transition: all 0.3s ease !important;
        margin-right: 10px !important;
        cursor: pointer !important;
    }

    #IDX-saveProperty:hover,
    #IDX-newSearch:hover,
    .IDX-btn:hover {
        background-color: #c5a47e !important;
        transform: translateY(-2px);
    }

    /* 6. Photo Gallery Carousel styling (Simple fix) */
    #IDX-photoGallery {
        margin-bottom: 3rem !important;
    }

    /* =========================================
   UX/UI Refinements (Final Polish V5)
   ========================================= */

    /* 1. TOP NAV & SEARCH CONTROLS */
    #IDX-detailsTopNav {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        background: #ffffff !important;
        padding: 15px 20px !important;
        margin-bottom: 0 !important;
        border-bottom: 1px solid #eee !important;
        min-height: 50px !important;
    }

    /* "Back to Results" - Left Side */
    /* 
   HTML is <a id="IDX-backToResults" class="IDX-btn IDX-btn__link">...</a> 
   So we must target the ID directly, not a descendant a 
*/
    a#IDX-backToResults,
    #IDX-backToResults {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        color: #0c1d2d !important;
        /* Force Navy */
        font-weight: 800 !important;
        text-transform: uppercase !important;
        font-size: 0.75rem !important;
        letter-spacing: 1px !important;
        text-decoration: none !important;
        align-items: center !important;
        cursor: pointer !important;
    }

    /* Force state colors */
    a#IDX-backToResults:visited,
    a#IDX-backToResults:link,
    a#IDX-backToResults:active,
    #IDX-backToResults:visited,
    #IDX-backToResults:link {
        color: #0c1d2d !important;
    }

    a#IDX-backToResults:hover,
    #IDX-backToResults:hover {
        color: #c5a47e !important;
    }

    /* Add custom arrow if image is missing or to reinforce it */
    a#IDX-backToResults::before,
    #IDX-backToResults::before {
        content: "« ";
        margin-right: 5px;
        color: #c5a47e;
        font-size: 1.2em;
        line-height: 1;
    }

    /* Hide the native image if we want our clean arrow, or style it */
    #IDX-backToResults img {
        display: none !important;
        /* Hide native chevron image to use our clean text arrow */
    }

    /* Search Controls - Right Side */
    #IDX-searchControls {
        display: flex !important;
        gap: 25px !important;
        align-items: center !important;
        margin-left: auto !important;
        font-size: 0 !important;
    }

    #IDX-searchControls a,
    #IDX-detailsTopModifySearch,
    #IDX-detailsTopNewSearch {
        background: transparent !important;
        border: none !important;
        color: #888 !important;
        font-size: 0.75rem !important;
        /* Restore font size */
        font-weight: 600 !important;
        text-transform: uppercase !important;
        text-decoration: none !important;
        padding: 0 !important;
        display: inline-block !important;
        letter-spacing: 0.5px !important;
    }

    #IDX-searchControls a:hover {
        color: #0c1d2d !important;
    }

    /* Remove pipes/lines */
    #IDX-searchControls span,
    #IDX-searchControls::after,
    #IDX-searchControls a::after {
        display: none !important;
        content: none !important;
    }

    /* 2. MAIN HEADER (The Dark Bar) */
    #IDX-detailsHeader {
        background-color: #0c1d2d !important;
        padding: 35px 50px !important;
        margin-bottom: 40px !important;
        color: #fff !important;
    }

    /* CORRECT FLEX CONTAINER (The internal .IDX-row) */
    #IDX-detailsHeader .IDX-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        /* Align top for text block */
        width: 100% !important;
        margin: 0 !important;
    }

    /* LEFT COLUMN - 2/3 Width */
    #IDX-detailsAddress {
        flex: 0 0 66.66% !important;
        max-width: 66.66% !important;
        padding-right: 20px !important;
    }

    /* Address Title (Street) */
    #IDX-detailsAddressStreet {
        display: block !important;
        font-size: 2.2rem !important;
        color: #fff !important;
        font-family: 'Outfit', sans-serif !important;
        font-weight: 600 !important;
        line-height: 1.1 !important;
        margin-bottom: 8px !important;
        white-space: normal !important;
    }

    #IDX-detailsAddressStreet span {
        color: #fff !important;
    }

    /* Region (City/State/Zip + Bed/Bath + Price) */
    #IDX-detailsAddressRegion {
        display: block !important;
        color: rgba(255, 255, 255, 0.7) !important;
        font-size: 1.1rem !important;
        font-weight: 400 !important;
        line-height: 1.5 !important;
    }

    /* Inner spans (City, State, Zip, Bed/Bath) */
    #IDX-detailsAddressRegion span {
        display: inline !important;
        color: rgba(255, 255, 255, 0.8) !important;
    }

    /* Hide Divider Pipes */
    .IDX-detailsAddress__divider {
        display: none !important;
    }

    /* PRICE - Forced to New Line */
    #IDX-detailsAddressRegion span:last-child {
        color: #c5a47e !important;
        /* Gold Price */
        font-size: 2rem !important;
        font-family: 'Outfit', sans-serif !important;
        font-weight: 500 !important;
        margin-top: 15px !important;
        display: block !important;
        /* Block to force new line */
        width: 100% !important;
    }

    /* RIGHT COLUMN - 1/3 Width */
    #IDX-detailsHeaderActions {
        flex: 0 0 33.33% !important;
        max-width: 33.33% !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        /* Vertically center buttons relative to column */
        padding-top: 10px !important;
        /* Optical alignment with text cap-height */
    }

    /* Button Group */
    .IDX-inline-buttons {
        display: flex !important;
        gap: 15px !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
    }

    #IDX-saveProperty,
    #IDX-printable {
        background: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        color: #fff !important;
        padding: 12px 24px !important;
        border-radius: 4px !important;
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
        letter-spacing: 1.5px !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 45px !important;
    }

    #IDX-saveProperty:hover,
    #IDX-printable:hover {
        border-color: #c5a47e !important;
        color: #c5a47e !important;
    }

    /* 3. MEDIA BUTTONS */
    #IDX-detailsSlidesActions {
        margin: 30px 0 !important;
        width: 100% !important;
    }

    /* Flex container for the buttons */
    #IDX-detailsSlidesActions>div,
    .IDX-inline-buttons__lg,
    .IDX-inline-buttons {
        display: flex !important;
        flex-direction: row !important;
        /* Force row */
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important;
        flex-wrap: nowrap !important;
        /* Prevent wrapping if possible */
    }

    /* Individual Buttons */
    #IDX-detailsPhotoGalleryLink,
    .IDX-detailsVirtualTourAction,
    #IDX-detailsDescriptionActionsMortgageLink,
    a[onclick*="Mortgage"] {
        background: #0c1d2d !important;
        color: #fff !important;
        padding: 12px 25px !important;
        border-radius: 50px !important;
        font-size: 0.8rem !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        text-decoration: none !important;
        border: none !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
        min-width: auto !important;
        /* Allow shrinking */
        width: auto !important;
        /* Stop full width */
        text-align: center !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 1 auto !important;
        white-space: nowrap !important;
    }

    /* 4. DESCRIPTION ACTIONS */
    #IDX-detailsDescriptionActions {
        display: flex !important;
        align-items: center !important;
        gap: 30px !important;
        margin-top: 20px !important;
        border-top: 1px solid #eee !important;
        padding-top: 20px !important;
    }

    .IDX-clamp__button,
    #IDX-detailsDescriptionActionsMoreInfo,
    #IDX-detailsDescriptionActionsDirections {
        background: transparent !important;
        color: #666 !important;
        font-weight: 600 !important;
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
        border: none !important;
        padding: 0 !important;
        letter-spacing: 1px !important;
    }

    .IDX-clamp__button:hover,
    #IDX-detailsDescriptionActionsMoreInfo:hover,
    #IDX-detailsDescriptionActionsDirections:hover {
        color: #0c1d2d !important;
    }

    /* 5. ACCORDIONS & FIELDS */
    .IDX-fieldTwoColumn,
    .IDX-fieldOneColumn {
        width: 100% !important;
        float: none !important;
        display: block !important;
        clear: both !important;
        margin-bottom: 20px !important;
    }

    .IDX-panel-heading {
        padding: 12px 0 !important;
        border-bottom: 2px solid #c5a47e !important;
    }

    .IDX-panel-title a {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        color: #0c1d2d !important;
        font-family: 'Outfit', sans-serif !important;
        font-size: 1.2rem !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        width: 100% !important;
    }

    .IDX-icon-arrow-up,
    .IDX-icon-arrow-down {
        order: 2 !important;
        color: #c5a47e !important;
    }

    .IDX-panel-body .IDX-field {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid #f2f2f2 !important;
    }

    .IDX-panel-body .IDX-label {
        font-weight: 700 !important;
        color: #0c1d2d !important;
        text-transform: uppercase !important;
        font-size: 0.7rem !important;
        letter-spacing: 0.5px !important;
        flex: 0 0 40% !important;
        line-height: 1.5 !important;
    }

    .IDX-panel-body .IDX-text {
        flex: 1 !important;
        text-align: right !important;
        color: #444 !important;
        line-height: 1.5 !important;
    }

    /* 6. CLEANUP */
    /* Hide the messy wrapper dividers or old data fields */
    #IDX-detailsContainer-d016--hopoZoning {
        display: none !important;
    }

    /* =========================================
   IDX Search Results Page Customization
   ========================================= */

    /* 0. Main Container Layout (Fixing Width & Centering) */
    /* Force the main wrappers to be wide enough */
    #IDX-main,
    .IDX-wrapper-standard,
    .IDX-page-listings,
    #lux-idx-container {
        width: 100% !important;
        max-width: 1400px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 !important;
        /* REMOVED PADDING per user request */
        box-sizing: border-box !important;
        display: block !important;
    }

    /* 1. Top Controls (Buttons + Filters) - Minimized Height */
    /* 1. Top Controls (Buttons + Filters) - FLEXBOX REFACTOR FIXED */
    /* Use flex on the parent wrapper to arrange ALL children (Layout, Map, Controls) */
    .IDX-page-listings .idx-results.idx-results--map,
    .IDX-wrapper-standard .idx-results,
    .IDX-wrapper-standard {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        margin-top: 10px !important;
    }

    /* BUTTONS: Order -2 (First) */
    .IDX-page-listings .IDX-topAction {
        order: -2 !important;
        /* Force to START of flex container */
        float: none !important;
        display: inline-flex !important;
        align-items: center !important;
        margin-bottom: 10px !important;
        margin-right: 20px !important;
        width: auto !important;
    }

    /* STYLING FOR NEW/MODIFY BUTTONS */
    .IDX-page-listings .IDX-topAction a.IDX-btn,
    .IDX-page-listings .IDX-topAction a {
        font-size: 11px !important;
        padding: 0 12px !important;
        height: 30px !important;
        line-height: 30px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        background: transparent !important;
        border: 1px solid #c5a47e !important;
        color: #0c1d2d !important;
        border-radius: 2px !important;
        margin-right: 8px !important;
        box-shadow: none !important;
        font-weight: 600 !important;
        display: inline-block !important;
        vertical-align: middle !important;
    }

    .IDX-page-listings .IDX-topAction a:hover {
        background: #c5a47e !important;
        color: #fff !important;
    }

    /* FILTERS: Order -1 (Second) */
    .IDX-page-listings #idx-results-refinement,
    .IDX-wrapper-standard .idx-results__refinement {
        order: -1 !important;
        /* Force to Second Position */
        float: none !important;
        display: inline-flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        margin-bottom: 10px !important;
        width: auto !important;
        padding-left: 0 !important;
        /* Remove Left Padding */
        margin-left: 0 !important;
    }

    /* Hide Redundant Header */
    .IDX-page-listings #idx-results-header {
        display: none !important;
    }

    /* EVERYTHING ELSE: Order 0 (Default) - Force Full Width */
    .IDX-page-listings #idx-results-content,
    .IDX-page-listings .IDX-alert,
    .IDX-page-listings #IDX-map,
    .IDX-page-listings .idx-results__content {
        order: 0 !important;
        width: 100% !important;
        /* Force onto new line below controls */
        flex-basis: 100% !important;
        display: block !important;
        clear: both !important;
    }

    /* FIX INTERNAL BUTTON ALIGNMENT (Apply / Save) */
    #idx-results-refinement .IDX-btn,
    #idx-results-refinement input[type="submit"],
    #idx-results-refinement button,
    .IDX-saveSearch,
    #IDX-saveSearch {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 38px !important;
        /* Enforce height */
        min-height: 38px !important;
        padding: 0 15px !important;
        line-height: 1.2 !important;
        vertical-align: middle !important;
        margin-top: 0 !important;
        text-decoration: none !important;
        border: 1px solid #0c1d2d !important;
        /* Ensure generic borders don't mess up */
    }

    /* Fix "Save Search" specifically if it's white */
    #IDX-saveSearch {
        background: #fff !important;
        color: #333 !important;
        border: 1px solid #ccc !important;
    }


    /* 2. Main Content Area (Header + Map + Grid) */
    .IDX-page-listings #idx-results-header,
    .IDX-page-listings #idx-results-content,
    .IDX-page-listings .IDX-alert {
        display: block !important;
        clear: both !important;
        /* Ensure they drop below the floated toolbar */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Reduce Header Spacing */
    .IDX-page-listings #idx-results-header {
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        padding: 0 !important;
    }

    /* Reduce Alert Bar Height if possible */
    .IDX-page-listings .IDX-alert {
        padding: 8px 15px !important;
        margin-bottom: 10px !important;
        line-height: 1.2 !important;
    }

    /* Hide redundant "500 Listings" text if it appears separately below header */
    .IDX-page-listings .IDX-resultsCount,
    .IDX-page-listings .idx-results-count {
        display: none !important;
    }

    /* 3. Map & Result Grid (CSS Grid) */

    /* PARENT CONTAINER: Holds Map + Listings Wrapper */
    .IDX-page-listings #idx-results-content {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        /* FORCE GROW */
        min-height: 500px !important;
        overflow: visible !important;
        /* Allow children to show */
    }

    /* Map - Ensure it has height and is visible */
    .IDX-page-listings #idx-results-content #IDX-map {
        width: 100% !important;
        height: 600px !important;
        margin-bottom: 40px !important;
        display: block !important;
        position: relative !important;
        z-index: 1 !important;
    }

    /* 3. LISTINGS CONTAINER - 3 COLUMN GRID */
    #idx-results-category-active,
    .idx-results__category.idx-results__category--active,
    .idx-results__content,
    .idx-results__category,
    #idx-results-listings,
    .IDX-results-listings,
    .IDX-wrapper-standard .IDX-results-listings {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        /* Changed to 3 columns */
        gap: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        align-items: start !important;
        margin-bottom: 50px !important;
        /* Add space before footer */
    }

    /* CLEARFIX HACK : Ensure the main container wraps the grid */
    #IDX-main::after,
    .IDX-wrapper-standard::after,
    .IDX-page-listings::after,
    #idx-results-content::after {
        content: "" !important;
        display: table !important;
        clear: both !important;
    }

    /* FORCE PARENT TO GROW */
    #IDX-main,
    .IDX-wrapper-standard,
    .IDX-page-listings {
        display: flow-root !important;
        /* Modern clearfix */
        height: auto !important;
        overflow-x: hidden !important;
        /* Fix horizontal scroll */
        overflow-y: visible !important;
    }

    /* Custom Card Styling Removed for Default View */

    /* =========================================
   7. PAGINATION & FOOTER FIXES
   ========================================= */

    /* Center Pagination */
    #IDX-pagination,
    .IDX-pagination,
    .idx-results-pagination {
        text-align: center !important;
        display: block !important;
        width: 100% !important;
        margin: 30px auto !important;
        clear: both !important;
    }

    #IDX-pagination a,
    .IDX-pagination a,
    .idx-results-pagination a {
        display: inline-block !important;
        float: none !important;
    }

    /* Fix Disclaimer Overflow */
    .IDX-disclaimer,
    .IDX-disclaimer *,
    .IDX-footer-disclaimer,
    .idx-disclaimer {
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Mobile Responsiveness */
    @media (max-width: 900px) {

        .IDX-page-listings #idx-results-content,
        .idx-results__content,
        .IDX-results-listings,
        .IDX-wrapper-standard .IDX-results-listings {
            grid-template-columns: 1fr !important;
        }

        .IDX-page-listings .IDX-topAction,
        .IDX-page-listings #idx-results-refinement {
            display: flex !important;
            width: 100% !important;
            justify-content: center !important;
            margin-right: 0 !important;
        }
    }

    /* =========================================
   8. IDX SEARCH PAGE STYLES (Advanced Search)
   ========================================= */

    /* Main Container on Search Page */
    .IDX-page-search #IDX-main {
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 6rem 2rem 4rem 2rem !important;
        /* Added 6rem top padding */
        background: #fff !important;
    }

    /* Search Navigation Tabs */
    .IDX-nav-items-container,
    .IDX-searchNavWrapper,
    #IDX-searchNav {
        border-bottom: none !important;
        margin-bottom: 3rem !important;
        margin-top: 2rem !important;
        text-align: left !important;
        display: flex !important;
        justify-content: flex-start !important;
        gap: 5px !important;
        flex-wrap: wrap !important;
        padding: 0 !important;
        /* User Request: Set padding to 0 */
        max-width: 1200px !important;
        margin-left: 0 !important;
        /* User Request: Remove margin-left/right */
        margin-right: 0 !important;
    }

    /* User Request: Remove background-color from container active state override */
    .IDX-nav-items-container .IDX-active {
        background-color: transparent !important;
    }

    /* User Request: Remove background-color from searchNavItem wrapper */
    .IDX-nav-items-container .IDX-searchNavItem {
        background-color: transparent !important;
        padding: 0 !important;
        /* Ensure tight packing */
        margin: 0 !important;
    }

    /* User Request: Target first child padding */
    .IDX-nav-items-container .IDX-searchNavItem:first-child {
        padding-left: 0 !important;
    }

    .IDX-searchNavLink,
    .IDX-nav-items-container a,
    #IDX-searchNav a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 12px 20px !important;
        text-decoration: none !important;
        color: #fff !important;
        background-color: #0c1d2d !important;
        /* Dark Navy Inactive */
        font-family: 'Outfit', sans-serif !important;
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
        letter-spacing: 1.5px !important;
        font-weight: 700 !important;
        border: none !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        border-radius: 2px !important;
        min-width: auto !important;
    }

    /* Active Tab Override - Target Parent Class */
    .IDX-searchNavItem.IDX-active .IDX-searchNavLink,
    .IDX-nav-items-container .IDX-active a,
    .IDX-searchNavLink.IDX-active,
    #IDX-searchNav a.IDX-active {
        background-color: #c5a47e !important;
        /* Gold Active */
        color: #fff !important;
        box-shadow: 0 4px 10px rgba(197, 164, 126, 0.3) !important;
    }

    /* Cleanup hacks */
    .IDX-searchNavLink.IDX-active::after,
    #IDX-searchNav a.IDX-active::after,
    .IDX-nav-items-container a.IDX-active::after {
        content: none !important;
        display: none !important;
    }

    .IDX-searchNavLink:hover,
    .IDX-nav-items-container a:hover,
    #IDX-searchNav a:hover {
        background-color: #c5a47e !important;
        color: #fff !important;
        transform: translateY(-2px) !important;
    }

    /* Form Layout */
    /* Form Layout */
    #IDX-searchForm {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas:
            "core adv"
            "submit submit" !important;
        column-gap: 4rem !important;
        /* Wider gap for cleaner look */
        row-gap: 2rem !important;
        align-items: start !important;
        /* Align columns to top */
    }

    #IDX-coreSearchFields {
        grid-area: core !important;
        width: 100% !important;
    }

    #IDX-advancedSearchFields,
    .IDX-advancedSearchFields {
        grid-area: adv !important;
        width: 100% !important;
        margin-top: 0 !important;
        display: block !important;
        border-top: none !important;
        /* User Request: Remove border top */
    }

    /* User Request: Hide Advanced Fields Header and Loading */
    .IDX-advanced-fields__header,
    #IDX-loadingScreen {
        display: none !important;
    }

    @media (max-width: 900px) {
        #IDX-searchForm {
            grid-template-columns: 1fr !important;
            grid-template-areas:
                "core"
                "adv"
                "submit" !important;
        }
    }

    /* Form Fields */
    .IDX-control-group,
    .IDX-field {
        margin-bottom: 0 !important;
        /* Let grid handle gap */
        width: 100% !important;
    }

    /* Labels */
    .IDX-control-label,
    .IDX-label,
    label {
        display: block !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 0.7rem !important;
        text-transform: uppercase !important;
        letter-spacing: 1.5px !important;
        color: #1a1a1a !important;
        /* Dark */
        font-weight: 700 !important;
    }

    /* Inputs - Global Catch-all for IDX Form */
    #IDX-searchForm input,
    #IDX-searchForm select,
    .IDX-controls input,
    .IDX-controls select,
    input.IDX-input,
    select.IDX-select {
        width: 100% !important;
        padding: 14px 16px !important;
        /* Removed global border to prevent double borders */
        font-family: 'Outfit', sans-serif !important;
        font-size: 1rem !important;
        color: #333 !important;
        background: #fff !important;
        transition: all 0.3s ease !important;
        height: 50px !important;
        /* Uniform height */
        box-shadow: none !important;
        appearance: none !important;
    }

    /* Targeted Borders for Specific Fields (Year Built, Tax, Remarks) */
    input[name*="yb"],
    input[name*="tax"],
    input[name*="remarks"],
    .IDX-controls-pair input {
        border: 1px solid #e5e5e5 !important;
        border-radius: 0 !important;
    }

    #IDX-searchForm input:focus,
    #IDX-searchForm select:focus,
    .IDX-controls input:focus,
    .IDX-controls select:focus,
    input.IDX-input:focus,
    select.IDX-select:focus {
        border-color: #c5a47e !important;
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(197, 164, 126, 0.1) !important;
    }

    /* Min/Max Fields (Price, Beds, etc) */
    .IDX-controls-pair {
        display: flex !important;
        gap: 15px !important;
        align-items: center !important;
    }

    .IDX-controls-pair input,
    .IDX-controls-pair select {
        width: 100% !important;
        flex: 1 !important;
        /* Border handled above */
    }

    /* Buttons */
    #IDX-formSubmit,
    #IDX-btn-search,
    button.IDX-btn {
        grid-area: submit !important;
        justify-self: center !important;
        margin-top: 1rem !important;

        background: #0c1d2d !important;
        /* User Request: Dark Navy */
        color: #fff !important;
        border: none !important;
        padding: 8px 60px !important;
        font-family: 'Outfit', sans-serif !important;
        font-size: 0.85rem !important;
        text-transform: uppercase !important;
        letter-spacing: 2.5px !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        border-radius: 0 !important;
        /* Square button */
        width: auto !important;
        min-width: 200px !important;
    }

    #IDX-formSubmit:hover,
    #IDX-btn-search:hover,
    button.IDX-btn:hover {
        background: #1a1a1a !important;
        /* Dark */
        transform: translateY(-2px) !important;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
    }

    /* =========================================
   Custom Borders for Advanced Search Fields (User Request)
   ========================================= */
    #IDX-a_yearBuilt_min,
    #IDX-a_yearBuilt_max,
    #IDX-a_lotSizeSquareFeet_min,
    #IDX-a_lotSizeSquareFeet_max,
    #IDX-a_acres_min,
    #IDX-a_acres_max,
    #IDX-a_sqFt_min,
    #IDX-a_sqFt_max {
        border: 1px solid #ccc !important;
    }

    /* Remove border-top from Advanced Fields container (User Request) */
    .IDX-searchAdvancedFields {
        border-top: none !important;
    }

    /* Hide 'Historical Results' title (User Request) */
    #idx-results-active-title {
        display: none !important;
    }

    /* Align Property Details action links to left and reduce spacing (User Request) */
    #IDX-detailsDescriptionActions {
        display: flex !important;
        justify-content: flex-start !important;
        gap: 10px !important;
    }

    #IDX-detailsDescriptionActions>* {
        margin-left: 0 !important;
        margin-right: 10px !important;
    }
}

/* User Request 2026-01-11: Hide navigation-container on map search page */
.IDX-page-mapsearch #navigation-container {
    display: none !important;
}


/* User Request 2026-01-11: Hide status filter dropdown */
.IDX-page-mapsearch #status-filter-button,
.IDX-page-mapsearch .idx-filter-button--show--mobile#status-filter-button {
    display: none !important;
}

/* User Request 2026-01-11: Highlight City/County/Zip search bar */
.IDX-page-mapsearch .pm-ccz-fly-to-field {
    border: 1px solid #666666 !important;
    border-radius: 2px !important;
    background-color: #fff !important;
    margin-top: 0px !important;
    /* Adjust alignment if needed */
    height: 38px !important;
    /* Match button height if possible */
    max-height: 38px !important;
    /* Match button height if possible */
    display: flex !important;
    align-items: center !important;
}

.IDX-page-mapsearch .pm-ccz-fly-to-field .vue-tags-input {
    width: 450px;
}

/* Match font styles to status button label */
.IDX-page-mapsearch .pm-ccz-fly-to-field input,
.IDX-page-mapsearch .pm-ccz-fly-to-field input::placeholder {
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #666666 !important;
    letter-spacing: 0.4px !important;
}

.IDX-page-mapsearch .pm-ccz-fly-to-field .ti-new-tag-input {
    border: none !important;
    padding: 0 10px !important;
}