.agora-back-to-top {
    background-color: #ed2127 !important;
    background-image: none !important;
}

/* Scroll Logo Switch */
.h-logo .logo-scroll {
    display: none !important;
}

.h-logo .logo-main {
    display: block !important;
}

/* When body has .scroll class */
body.scroll .h-logo .logo-scroll {
    display: block !important;
}

body.scroll .h-logo .logo-main {
    display: none !important;
}

/* Mobile Header & Overlay Styles */
@media (max-width: 1024px) {
    #nav {
        display: none !important;
    }

    html,
    body {
        margin: 0;
        padding: 0;
        margin-top: 30px !important;
    }

    /* Hide old header */

    /* Mobile Header Bar */
    .mobile-header-bar {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0px;
        background: #121212 !important;
        /* Dark Background */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 9999;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        /* Darker shadow */
    }

    .mobile-header-bar .logo img {
        height: 60px;
        width: auto;
    }

    .mobile-header-bar .burger-icon {
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
        color: #fff !important;
        /* White Icon */
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #000;
        z-index: 10000;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3sease, visibility 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-overlay .close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 32px;
        color: #fff;
        cursor: pointer;
    }

    /* Menu Links */
    .mobile-menu-nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        width: 100%;
    }

    .mobile-menu-nav a {
        color: #fff;
        font-family: 'Lato', sans-serif;
        /* Using existing font */
        font-size: 24px;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s;
    }

    .mobile-menu-nav a:hover {
        color: #bbb;
    }

    /* CTA Button */
    .mobile-menu-cta {
        margin-top: 40px;
        background-color: #ed2127;
        /* Red CTA */
        color: #fff !important;
        padding: 15px 40px;
        border-radius: 30px;
        font-size: 18px;
        font-weight: 700;
        text-decoration: none;
        transition: transform 0.2s;
    }

    .mobile-menu-cta:active {
        transform: scale(0.98);
    }

    /* Social Icons */
    .mobile-socials {
        display: flex;
        gap: 20px;
        margin-top: 50px;
    }

    .mobile-socials a {
        color: #fff !important;
        font-size: 24px;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 1025px) {

    .mobile-header-bar,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Style Featured Properties Section (Black Theme) - STRICTLY for Home Page */
#featured-section-home {
    background-color: #000 !important;
    color: #fff !important;
}

/* Red Title Header */
#featured-section-home .highlight-red {
    color: #ed2127 !important;
    display: block;
    margin-bottom: 5px;
}

/* White Subtitle and general text */
#featured-section-home h2,
#featured-section-home p {
    color: #fff !important;
}

/* Reset Property Cards to White Background with Black Text */
#featured-section-home article {
    background-color: #fff !important;
    color: #000 !important;
    border-radius: 4px;
    /* Optional: adds subtle polish */
}

/* Ensure text inside cards is black */
#featured-section-home article h3,
#featured-section-home article price,
#featured-section-home article p,
#featured-section-home article .c-4,
#featured-section-home article .c-2 {
    color: #000 !important;
}

/* Ensure links inside headers are black for the cards */
#featured-section-home article h3 a {
    color: #000 !important;
}

/* Button Styling (Red) */
#featured-section-home a.res-btn {
    background-color: #ed2127 !important;
    color: #fff !important;
    border: none !important;
    padding: 0px 20px;
    text-transform: capitalize;
}

/* Ensure accents remain red where appropriate (non-card links) */
#featured-section-home>a.a-b-1 {
    color: #ed2127 !important;
}

/* Reclamaciones Mobile Readability */
@media (max-width: 768px) {
    .reclamaciones-container label {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }

    .reclamaciones-container input,
    .reclamaciones-container select,
    .reclamaciones-container textarea {
        font-size: 18px !important;
        /* Prevents zoom on iOS */
        padding: 12px !important;
    }

    .reclamaciones-container .btn-submit {
        font-size: 1.3rem !important;
        padding: 15px !important;
    }

    .reclamaciones-container .legal-info,
    .reclamaciones-container .subtitle,
    .reclamaciones-container .info-header {
        font-size: 16px !important;
    }
}

/* =========================================
   GLOBAL DARK MODE CONVERSION
   ========================================= */

/* Force Dark Background and Light Text Globally */
html,
body {
    background-color: #000000 !important;
    /* Forces pitch black as requested */
    color: #e0e0e0 !important;
    margin: 0;
    padding: 0;
}

@media (max-width: 1024px) {

    html,
    body {
        background-color: #000000 !important;
        /* Double force for mobile */
    }
}

/* Override White Background Classes & Common Sections */
.s-b-w,
.bg-white,
.white-bg,
header,
nav,
section,
article,
.item-s,
.item-Card,
.card,
.mobile-header-bar {
    background-color: #000000 !important;
    /* Consistent black background */
    color: #e0e0e0 !important;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div:not(.highlight-red),
li,
dt,
dd {
    color: #e0e0e0 !important;
}

/* Links - White by default, Grey on hover */
a {
    color: #ffffff !important;
}

a:hover {
    color: #cccccc !important;
}

/* Form Elements - Dark Mode */
input,
select,
textarea,
.item-onse,
.OneSearchBox {
    background-color: #1e1e1e !important;
    color: #fff !important;
    border: 1px solid #333 !important;
}

/* Ensure placeholders are visible */
::placeholder {
    color: #888 !important;
}

/* Dropdowns & Menus */
.item-dr-c,
.con-menu {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

.con-menu a {
    color: #fff !important;
}

.con-menu a:hover {
    background-color: #333 !important;
}

/* RED CONSISTENCY - CRITICAL PRESERVATION */
.highlight-red,
.text-red,
.red-text,
a.highlight-red,
[class*="primary-color"],
.mobile-menu-cta {
    color: #ed2127 !important;
}

/* Re-apply red background where needed */
.bg-red,
.red-bg,
.btn-red,
.mobile-menu-cta {
    background-color: #ed2127 !important;
    color: #fff !important;
    /* White text on red background */
}

/* Specific Home Page Featured Section Fixes */
#featured-section-home,
#saleProperties,
#rentalProperties,
#latestProperties {
    background-color: #000 !important;
}

#featured-section-home article,
#saleProperties article,
#rentalProperties article,
#latestProperties article {
    background-color: #121212 !important;
    /* Dark Card for Home */
    color: #ffffff !important;
    /* White Text */
    border: 1px solid #333 !important;
}

#featured-section-home article h3,
#featured-section-home article h3 a,
#featured-section-home article p,
#featured-section-home article price,
#featured-section-home article .c-4,
#featured-section-home article .c-2,
#featured-section-home article span,
#featured-section-home article div,
#saleProperties article h3,
#saleProperties article h3 a,
#saleProperties article p,
#saleProperties article price,
#saleProperties article .c-4,
#saleProperties article .c-2,
#saleProperties article span,
#saleProperties article div,
#rentalProperties article h3,
#rentalProperties article h3 a,
#rentalProperties article p,
#rentalProperties article price,
#rentalProperties article .c-4,
#rentalProperties article .c-2,
#rentalProperties article span,
#rentalProperties article div,
#latestProperties article h3,
#latestProperties article h3 a,
#latestProperties article p,
#latestProperties article price,
#latestProperties article .c-4,
#latestProperties article .c-2,
#latestProperties article span,
#latestProperties article div {
    color: #ffffff !important;
}

/* Fix for Masonry Grid Inner Div Inline White Background */
#saleProperties article .p-20,
#saleProperties article div[style*="background: #fff"] {
    background-color: #121212 !important;
}

/* Force Properties & Popups to White Background with Black Text */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip,
.item-Card,
.card,
.property-marker-popup {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Ensure text inside these containers is black (Granular Override) */
.leaflet-popup-content h3,
.leaflet-popup-content p,
.leaflet-popup-content span,
.leaflet-popup-content div,
.leaflet-popup-content li,
.leaflet-popup-content label,
.leaflet-popup-content dt,
.leaflet-popup-content dd,
.item-Card h3,
.item-Card p,
.item-Card span,
.item-Card div,
.item-Card li,
.item-Card label,
.card h3,
.card p,
.card span,
.card div,
.card li,
.card label,
.detail-label,
.detail-value,
.description-text,
.inline-detail,
.inline-detail li,
.idx-disclaimer,
.listing-courtesy,
.property-price,
.property-address,
.gallery-grid-item span,
.gallery-grid-item p {
    color: #000000 !important;
}

/* Specific Red Protections (Higher Specificity) */
.leaflet-popup-content .section-title,
.leaflet-popup-content .view-details-btn,
.item-Card .highlight-red,
.card .highlight-red,
.text-red,
.section-title,
a.active {
    color: #ed2127 !important;
    /* Keep Red */
}

/* GRANULAR OVERRIDES FOR LEAFLET POPUP TEXT */
/* Using ID selector #property-popup-body to beat JS injected styles */

#property-popup-body .detail-row span,
#property-popup-body .detail-row,
#property-popup-body .idx-disclaimer p,
#property-popup-body .idx-disclaimer span,
#property-popup-body .listing-courtesy p,
#property-popup-body .description-text,
#property-popup-body .header-top h1,
#property-popup-body .header-top h2,
#property-popup-body .inline-detail li,
#property-popup-body .inline-detail li span,
#property-popup-body .inline-detail li b,
#property-popup-body .inline-detail li i,
#property-popup-body .section-title .light-address {
    color: #000000 !important;
}

/* Ensure Logo Text is also black if it's just text */
#property-popup-body .idx-logo span {
    color: #000000 !important;
}

/* Maintain Red for Section Titles and specific accents */
#property-popup-body .section-title,
#property-popup-body .view-details-btn {
    color: #ed2127 !important;
}

#property-popup-body .view-details-btn {
    color: #ffffff !important;
    /* Button text white */
}

/* GRANULAR OVERRIDES FOR PROPERTY CARDS (LIST VIEW) */
/* The JS injects inline styles like #999, #555, #222. We must override them. */
.property-details-new h2,
.property-details-new p,
.property-details-new span,
.property-details-new div {
    color: #000000 !important;
}

/* Ensure red badge remains white text on red background */
.property-badge-new {
    color: #ffffff !important;
}

/* Ensure Logo Areas don't have white boxes if possible */
.h-logo,
.logo-main,
.logo-scroll {
    background: transparent !important;
}

/* User Requested Fix: Force .grey:before to black */

/* User Requested Fix: Force .grey:before to black */
.grey:before {
    background: #000000 !important;
}

/* User Requested: Article Header Red Background */
.article-header {
    background: #ed2127 !important;
    flex: 1;
    gap: 1rem;
    line-height: 27px;
}

/* AVM and Footer Overrides */
.search-wrapper .intro {
    background: rgb(0 0 0);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}

footer {
    border-top: 1px solid var(--avm-border--color);
    background: rgb(0 0 0);
    margin-top: 32px;
}

.footer-avm {
    background: #1e1e1e;
    border: 1px solid #dadada;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
    border-radius: 10px;
}

/* User Requested: Item HS Positioning */
.item-hs {
    bottom: 0px !important;
    position: absolute;
    z-index: 10;
}