:root {
    --caando-green: #17483f;
    --caando-green-2: #21695c;
    --caando-honey: #f2b441;
    --caando-honey-soft: #fff5dc;
    --caando-ink: #17211f;
    --caando-muted: #6b7a78;
    --caando-border: #d9e4e1;
    --caando-bg: #f5f8f7;
}

.search-page {
    min-height: 100vh;
    background: var(--caando-bg);
    color: var(--caando-ink);
    padding: 28px 0 80px;
}

.search-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.search-topbar h1 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 900;
}

.search-topbar p {
    margin: 0;
    color: var(--caando-muted);
}

.sort-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-button,
.map-link {
    border: 1px solid var(--caando-border);
    background: #fff;
    color: var(--caando-ink);
    border-radius: 12px;
    padding: 11px 16px;
    text-decoration: none;
    font-weight: 800;
}

.map-link {
    background: var(--caando-green);
    color: #fff;
    border-color: var(--caando-green);
}

.search-layout {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.filter-panel {
    position: sticky;
    top: 18px;
    border: 1px solid var(--caando-border);
    background: #fff;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 12px 38px rgba(23, 72, 63, .08);
}

.filter-panel h2 {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 900;
}

.transaction-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #eef4f2;
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 18px;
}

.transaction-toggle input {
    display: none;
}

.transaction-toggle label {
    cursor: pointer;
    text-align: center;
    border-radius: 10px;
    padding: 11px;
    font-weight: 900;
    color: var(--caando-muted);
}

.transaction-toggle input:checked + label {
    background: var(--caando-green);
    color: #fff;
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--caando-border);
    border-bottom: 1px solid var(--caando-border);
    background: #fff;
    padding: 18px 0;
    margin-bottom: 18px;
    color: var(--caando-ink);
}

.filter-row span,
.filter-label {
    color: var(--caando-muted);
    font-weight: 800;
    font-size: 13px;
}

.filter-row strong {
    font-size: 14px;
}

.filter-label {
    display: block;
    margin: 14px 0 7px;
}

.filter-input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--caando-border);
    border-radius: 12px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7faf9;
    border-radius: 14px;
    margin: 16px 0;
    padding: 13px 14px;
    font-weight: 900;
}

.switch-row input {
    width: 22px;
    height: 22px;
    accent-color: var(--caando-green);
}

.apply-filter {
    width: 100%;
    min-height: 48px;
    margin-top: 14px;
    border: 0;
    border-radius: 13px;
    background: var(--caando-honey);
    color: #553600;
    font-weight: 900;
}

.promo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(242, 180, 65, .55);
    background: var(--caando-honey-soft);
    border-radius: 18px;
    padding: 16px 18px;
}

.promo-banner strong {
    color: #6f4700;
    font-weight: 900;
}

.promo-banner span {
    color: #8a6a28;
    font-size: 13px;
}

.promo-banner.muted {
    border-color: var(--caando-border);
    background: #fff;
}

.promo-banner.muted strong {
    color: var(--caando-green);
}

.promo-banner.muted span {
    color: var(--caando-muted);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.empty-result {
    grid-column: 1 / -1;
    border: 1px dashed var(--caando-border);
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    color: var(--caando-muted);
    font-weight: 800;
    text-align: center;
}

.listing-card {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--caando-border);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(23, 72, 63, .06);
    color: inherit;
    text-decoration: none;
    transition: .2s ease;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 38px rgba(23, 72, 63, .12);
}

.listing-card.is-promoted {
    border-color: rgba(242, 180, 65, .85);
}

.listing-image {
    position: relative;
    min-height: 185px;
    background:
        linear-gradient(180deg, transparent, rgba(0, 0, 0, .52)),
        linear-gradient(135deg, #dbe9e5, #fff2c9);
    background-position: center;
    background-size: cover;
}

.image-count,
.district-pill {
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--caando-ink);
    font-weight: 900;
    font-size: 12px;
    padding: 6px 10px;
}

.image-count {
    top: 12px;
    right: 12px;
}

.district-pill {
    bottom: 12px;
    left: 12px;
}

.listing-body {
    padding: 16px;
}

.listing-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.listing-body h2 {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.7;
}

.promoted-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--caando-honey-soft);
    color: #7a4c00;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 900;
}

.price-lines {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
}

.price-lines strong {
    font-size: 14px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--caando-border);
    border-bottom: 1px solid var(--caando-border);
    padding: 10px 0;
    color: var(--caando-muted);
    font-size: 13px;
    font-weight: 800;
}

.agency-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 13px;
    color: var(--caando-muted);
    font-size: 13px;
}

.agency-row button,
.save-link {
    border: 1px solid var(--caando-border);
    background: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 800;
    color: var(--caando-green);
}

.floating-map-button {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 20;
    border: 0;
    border-radius: 999px;
    background: var(--caando-green);
    color: #fff;
    padding: 15px 26px;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(23, 72, 63, .28);
}

.property-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.property-modal.is-open {
    display: block;
}

.property-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.property-modal-content {
    position: relative;
    max-width: 820px;
    margin: 6vh auto;
    background: #fff;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
}

.modal-close {
    border: 0;
    background: transparent;
    font-size: 44px;
    line-height: 1;
    color: var(--caando-muted);
}

.property-modal-content h2 {
    margin: 0 0 24px;
    text-align: center;
    font-weight: 900;
}

.property-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.property-type-grid button {
    min-height: 150px;
    border: 2px solid rgba(23, 72, 63, .28);
    border-radius: 16px;
    background: #fff;
    font-size: 18px;
    font-weight: 900;
    color: var(--caando-ink);
}

.property-type-grid button span {
    display: block;
    margin-bottom: 12px;
    color: var(--caando-green);
    font-size: 42px;
}

@media (max-width: 1200px) {
    .search-layout {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        position: static;
        order: -1;
    }
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .listing-card {
        grid-template-columns: 180px minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .search-page {
        padding-top: 18px;
    }

    .search-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .sort-wrap {
        width: 100%;
    }

    .sort-button,
    .map-link {
        flex: 1;
        text-align: center;
    }

    .filter-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .promo-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .listing-card {
        grid-template-columns: 1fr;
    }

    .listing-image {
        min-height: 210px;
    }

    .property-modal-content {
        margin: 3vh 12px;
        padding: 18px;
    }

    .property-type-grid {
        grid-template-columns: 1fr;
    }

    .property-type-grid button {
        min-height: 110px;
    }
}
