/* ============================================================
   Responsive Styles – index.php (FORCE 2-COL MOBILE, HIGHEST SPECIFICITY)
   ============================================================ */

/* ========== HERO SEARCH – REMOVE CITY DROPDOWN (hide any 4th col) ========== */
.hero-search .col-lg-3:nth-child(4),
.hero-search .col-md-3:nth-child(4),
.hero-search .row > div:nth-child(4) select[name="city"] {
    display: none !important;
}
.hero-search .row.g-3 {
    --bs-gutter-x: 0.8rem;
    --bs-gutter-y: 0.8rem;
}
@media (max-width: 991.98px) {
    .hero-search .col-lg-3,
    .hero-search .col-md-4,
    .hero-search .col-md-3 {
        width: 50%;
        flex: 0 0 50%;
        max-width: 50%;
    }
    .hero-search .row > div:last-child {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
}
@media (max-width: 575.98px) {
    .hero-search .row.g-3 {
        --bs-gutter-x: 0.6rem;
        --bs-gutter-y: 0.6rem;
    }
    .hero-search .col-lg-3,
    .hero-search .col-md-4,
    .hero-search .col-md-3 {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    .hero-search .row > div:last-child {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .hero-search .form-control-lg,
    .hero-search .form-select-lg {
        padding: 0.45rem 0.65rem !important;
        font-size: 0.8rem;
    }
}

/* =============================================================
   #1 HOME: FEATURED PROPERTIES – FORCE 2 COLUMNS
   (BREAKS AT <768px because col-md-4 stacks to 100%)
   APPLY 2-COL AT BOTH ≤767px AND ≤575px
   ============================================================= */

/* ---- TABLET (<768px) — 2 COLUMNS (prevents 1 col on md-stack) ---- */
@media (max-width: 767.98px) {
    body > section:nth-of-type(2) .row.g-4 > .col-md-4.col-md-4 {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;
    }
    body > section:nth-of-type(2) .row.g-4 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }
    body > section:nth-of-type(2) .property-card .card-img-top {
        height: 170px !important;
    }
    body > section:nth-of-type(2) .property-card .card-body {
        padding: 0.7rem 0.65rem !important;
    }
    body > section:nth-of-type(2) .property-card .fw-bold {
        font-size: 0.85rem !important;
    }
    body > section:nth-of-type(2) .property-card h5.card-title {
        font-size: 0.88rem !important;
        margin-bottom: 0.3rem !important;
    }
    body > section:nth-of-type(2) .property-card .card-text {
        font-size: 0.72rem !important;
        margin-bottom: 0.45rem !important;
    }
    body > section:nth-of-type(2) .property-card .d-flex.gap-3 {
        gap: 0.45rem !important;
        font-size: 0.7rem !important;
        margin-bottom: 0.5rem !important;
    }
    body > section:nth-of-type(2) .property-card .badge {
        font-size: 0.62rem !important;
        padding: 0.22rem 0.45rem !important;
    }
    body > section:nth-of-type(2) .property-card .btn-outline-primary {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.72rem !important;
    }
}

/* ---- MOBILE (<576px) — 2 COLUMNS (STRICT, NEVER 1) ---- */
@media (max-width: 575.98px) {
    body > section:nth-of-type(2) .row.g-4 > .col-md-4.col-md-4.col-md-4 {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    body > section:nth-of-type(2) .row.g-4 {
        --bs-gutter-x: 0.7rem;
        --bs-gutter-y: 0.6rem;
    }
    body > section:nth-of-type(2) .row.g-4 > * {
        padding-left: calc(var(--bs-gutter-x) * .5);
        padding-right: calc(var(--bs-gutter-x) * .5);
    }
    /* Shrunk card internals so 2 cards can fit next to each other */
    body > section:nth-of-type(2) .property-card {
        border-radius: 12px !important;
    }
    body > section:nth-of-type(2) .property-card .card-img-top {
        height: 135px !important;
        object-fit: cover;
    }
    body > section:nth-of-type(2) .property-card .featured-badge {
        font-size: 0.58rem !important;
        padding: 2px 6px !important;
    }
    body > section:nth-of-type(2) .property-card .card-body {
        padding: 0.5rem 0.45rem !important;
    }
    body > section:nth-of-type(2) .property-card .d-flex.justify-content-between {
        margin-bottom: 0.22rem !important;
        flex-wrap: wrap;
        gap: 0.2rem;
    }
    body > section:nth-of-type(2) .property-card .badge {
        font-size: 0.55rem !important;
        padding: 0.18rem 0.35rem !important;
    }
    body > section:nth-of-type(2) .property-card .fw-bold {
        font-size: 0.72rem !important;
        line-height: 1.15;
    }
    body > section:nth-of-type(2) .property-card h5.card-title {
        font-size: 0.78rem !important;
        line-height: 1.2;
        margin-bottom: 0.2rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    body > section:nth-of-type(2) .property-card .card-text.text-muted.small {
        font-size: 0.62rem !important;
        margin-bottom: 0.3rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    body > section:nth-of-type(2) .property-card .d-flex.flex-wrap.gap-3 {
        gap: 0.25rem !important;
        font-size: 0.6rem !important;
        margin-bottom: 0.35rem !important;
    }
    body > section:nth-of-type(2) .property-card .d-flex.flex-wrap.gap-3 span {
        font-size: 0.6rem !important;
    }
    body > section:nth-of-type(2) .property-card .btn-outline-primary {
        padding: 0.25rem 0.35rem !important;
        font-size: 0.63rem !important;
        line-height: 1.25;
        border-radius: 6px !important;
    }
}

/* =============================================================
   #2 HOME: ABOUT SECTION – CENTER TEXT + EQUAL L/R PADDING
   ============================================================= */

/* Base: always start symmetric */
body > section:nth-of-type(4) .row.align-items-center > .col-lg-6:first-child,
body > section:nth-of-type(4) .row.align-items-center > .col-lg-6:last-child {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
body > section:nth-of-type(4) h2.section-title,
body > section:nth-of-type(4) p.text-muted,
body > section:nth-of-type(4) ul.list-unstyled,
body > section:nth-of-type(4) .btn {
    text-align: center;
}
body > section:nth-of-type(4) ul.list-unstyled {
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}
body > section:nth-of-type(4) .btn {
    display: block;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
}

/* Desktop ≥992 */
@media (min-width: 992px) {
    body > section:nth-of-type(4) .row.align-items-center > .col-lg-6:first-child {
        padding-right: 1.5rem !important;
        padding-left: 0 !important;
    }
    body > section:nth-of-type(4) .row.align-items-center > .col-lg-6:last-child {
        padding-left: 1.5rem !important;
        padding-right: 0 !important;
    }
    body > section:nth-of-type(4) h2.section-title,
    body > section:nth-of-type(4) p.text-muted,
    body > section:nth-of-type(4) ul.list-unstyled,
    body > section:nth-of-type(4) .btn {
        text-align: left;
    }
    body > section:nth-of-type(4) ul.list-unstyled {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
    body > section:nth-of-type(4) .btn {
        display: inline-block;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Tablet <992 — stacks 1 col → BALANCE EVERYTHING */
@media (max-width: 991.98px) {
    body > section:nth-of-type(4) .row.align-items-center.g-4 {
        --bs-gutter-y: 1rem;
    }
    body > section:nth-of-type(4) .row.align-items-center > .col-lg-6:first-child,
    body > section:nth-of-type(4) .row.align-items-center > .col-lg-6:last-child {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
    }
    body > section:nth-of-type(4) h2.section-title {
        font-size: 1.5rem;
        text-align: center !important;
        margin-bottom: 0.75rem !important;
    }
    body > section:nth-of-type(4) p.text-muted {
        text-align: center !important;
        font-size: 0.92rem;
        margin-bottom: 1rem !important;
    }
    body > section:nth-of-type(4) ul.list-unstyled {
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
    }
    body > section:nth-of-type(4) ul.list-unstyled li {
        font-size: 0.9rem;
        text-align: left;
    }
    body > section:nth-of-type(4) .btn {
        display: block;
        max-width: 230px;
        margin-left: auto;
        margin-right: auto;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Mobile <576px — strictly equal padding on both sides */
@media (max-width: 575.98px) {
    body > section:nth-of-type(4).py-5 {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }
    body > section:nth-of-type(4) .row.align-items-center > .col-lg-6:first-child,
    body > section:nth-of-type(4) .row.align-items-center > .col-lg-6:last-child {
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
    }
    body > section:nth-of-type(4) h2.section-title {
        font-size: 1.3rem !important;
        margin-bottom: 0.6rem !important;
    }
    body > section:nth-of-type(4) p.text-muted {
        font-size: 0.84rem !important;
        line-height: 1.55;
        margin-bottom: 0.75rem !important;
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }
    body > section:nth-of-type(4) ul.list-unstyled li {
        font-size: 0.82rem;
        margin-bottom: 0.4rem !important;
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }
    body > section:nth-of-type(4) .btn {
        max-width: 220px;
        padding: 0.45rem 0.9rem;
        font-size: 0.84rem;
    }
}

/* Featured Agents on home also 2 cols on mobile */
@media (max-width: 575.98px) {
    body > section:nth-of-type(5) .row.g-4 > .col-md-6.col-md-6.col-md-6 {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }
    body > section:nth-of-type(5) .row.g-4 {
        --bs-gutter-x: 0.6rem;
        --bs-gutter-y: 0.6rem;
    }
}
