/*
 * Site Kit - Listing styles.
 */

.imobcrm-listing-page {
    background: #ffffff;
    padding-bottom: 56px;
}

.post-type-archive-imoveis .imobcrm-header,
.tax-cidade .imobcrm-header,
.tax-bairros .imobcrm-header,
.tax-tipo-do-imovel .imobcrm-header,
.tax-finalidade .imobcrm-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(48, 36, 28, 0.08);
    box-shadow: 0 14px 34px rgba(23, 18, 14, 0.05);
}

.post-type-archive-imoveis .imobcrm-header__nav a,
.tax-cidade .imobcrm-header__nav a,
.tax-bairros .imobcrm-header__nav a,
.tax-tipo-do-imovel .imobcrm-header__nav a,
.tax-finalidade .imobcrm-header__nav a,
.post-type-archive-imoveis .imobcrm-header__social a,
.tax-cidade .imobcrm-header__social a,
.tax-bairros .imobcrm-header__social a,
.tax-tipo-do-imovel .imobcrm-header__social a,
.tax-finalidade .imobcrm-header__social a {
    color: #3b2f27;
}

.post-type-archive-imoveis .imobcrm-header__social a,
.tax-cidade .imobcrm-header__social a,
.tax-bairros .imobcrm-header__social a,
.tax-tipo-do-imovel .imobcrm-header__social a,
.tax-finalidade .imobcrm-header__social a {
    background: color-mix(in srgb, var(--imobcrm-primary) 12%, transparent);
}

.imobcrm-listing-page .imobcrm-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-left: 12px;
    padding-right: 24px;
}

.imobcrm-listing-hero {
    background: #faf9f7;
    padding: 18px 0;
    border-bottom: 1px solid rgba(48, 36, 28, 0.06);
}

.imobcrm-listing-hero .imobcrm-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.imobcrm-listing-hero .imobcrm-breadcrumbs {
    padding: 0;
    background: transparent;
    border: 0;
    color: #9a918a;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.imobcrm-listing-hero .imobcrm-breadcrumbs a {
    color: var(--imobcrm-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.imobcrm-listing-hero .imobcrm-breadcrumbs a:hover {
    color: var(--imobcrm-tertiary);
    text-decoration: underline;
}

.imobcrm-listing-hero .imobcrm-breadcrumbs__sep {
    color: #c5bfb8;
    font-size: 0.7rem;
}

.imobcrm-listing-hero .imobcrm-breadcrumbs__current {
    color: #6b6158;
    font-weight: 500;
}

.imobcrm-listing-hero__title {
    display: none;
}

.imobcrm-listing-hero__desc {
    max-width: 760px;
    color: #6e645e;
    line-height: 1.75;
    font-size: 1rem;
}

.imobcrm-listing-hero__desc p+p {
    margin-top: 10px;
}

.imobcrm-listing-shell {
    padding-top: 34px;
}

.imobcrm-listing-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.imobcrm-listing-layout__sidebar {
    position: sticky;
    top: 110px;
    background: #faf8f4;
    border-radius: 16px;
    padding: 4px;
}

.imobcrm-listing-layout__content {
    min-width: 0;
}

.imobcrm-filters {
    padding: 24px;
    margin-bottom: 0;
    border: 1px solid rgba(48, 36, 28, 0.06);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(23, 18, 14, 0.03);
    max-width: 100%;
    min-width: 0;
}

.imobcrm-filters__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.imobcrm-filters__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.imobcrm-filters__field--search {
    grid-column: span 1;
}

.imobcrm-filters__field label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #7a7067;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.imobcrm-filters__field--price {
    gap: 10px;
}

.imobcrm-price-range {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.imobcrm-price-range__values {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #43342b;
    word-break: break-word; /* Prevent long strings like R$2.199... from expanding container */
    max-width: 100%;
}

.imobcrm-price-range__slider {
    position: relative;
    height: 26px;
}

.imobcrm-price-range__limits {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8rem;
    color: #7a7067;
}

.imobcrm-price-range__track,
.imobcrm-price-range__fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    border-radius: 999px;
}

.imobcrm-price-range__track {
    left: 0;
    right: 0;
    background: rgba(48, 36, 28, 0.12);
}

.imobcrm-price-range__fill {
    background: var(--imobcrm-primary);
}

.imobcrm-price-range input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 26px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.imobcrm-price-range input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid var(--imobcrm-primary);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
}

.imobcrm-price-range input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid var(--imobcrm-primary);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    pointer-events: auto;
}

.imobcrm-price-range input[type="range"]::-webkit-slider-runnable-track,
.imobcrm-price-range input[type="range"]::-moz-range-track {
    background: transparent;
    border: 0;
}

.imobcrm-sitekit-page .imobcrm-select,
.imobcrm-sitekit-page .imobcrm-input {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(48, 36, 28, 0.10);
    border-radius: 8px;
    background: #fafaf8;
    color: #302721;
    font-size: 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.imobcrm-sitekit-page .imobcrm-select:hover,
.imobcrm-sitekit-page .imobcrm-input:hover {
    border-color: rgba(48, 36, 28, 0.18);
    background: #ffffff;
}

.imobcrm-sitekit-page .imobcrm-select:focus,
.imobcrm-sitekit-page .imobcrm-input:focus {
    background: #fff;
    border-color: var(--imobcrm-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--imobcrm-primary) 12%, transparent);
    outline: none;
}

.imobcrm-filters__actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}

.imobcrm-sitekit-page .imobcrm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
}

.imobcrm-sitekit-page .imobcrm-btn--primary {
    background: var(--imobcrm-primary);
    color: #fff;
}

.imobcrm-sitekit-page .imobcrm-btn--outline {
    background: #fff;
    color: #43342b;
    border-color: rgba(48, 36, 28, 0.14);
}

.imobcrm-sitekit-page .imobcrm-btn--primary:hover {
    background: var(--imobcrm-tertiary);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--imobcrm-primary) 25%, transparent);
}

.imobcrm-sitekit-page .imobcrm-btn--outline:hover {
    background: #f8f6f2;
    border-color: rgba(48, 36, 28, 0.22);
}

/* --- Button Group (Quartos, Banheiros, Suítes, Vagas) --- */
.imobcrm-btn-group {
    display: flex;
    gap: 6px;
}

.imobcrm-btn-group__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(48, 36, 28, 0.12);
    border-radius: 8px;
    background: #fafaf8;
    color: #5d534c;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.imobcrm-btn-group__btn:hover {
    border-color: var(--imobcrm-primary);
    color: var(--imobcrm-primary);
    background: color-mix(in srgb, var(--imobcrm-primary) 6%, transparent);
}

.imobcrm-btn-group__btn.is-active {
    background: var(--imobcrm-primary);
    border-color: var(--imobcrm-primary);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--imobcrm-primary) 30%, transparent);
}

/* WHY: Constrain listing card images to match home card proportions */
.imobcrm-grid--listing .imobcrm-card__image {
    aspect-ratio: 3 / 2;
}

.imobcrm-grid--listing .imobcrm-card__body {
    padding: 14px 16px 12px;
}

.imobcrm-grid--listing .imobcrm-card__title {
    font-size: 17px;
}

.imobcrm-listing-results__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.imobcrm-listing-results {
    position: relative;
}

.imobcrm-listing-results::before {
    content: '';
    position: absolute;
    inset: -12px 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(48, 36, 28, 0.12), transparent);
}

.imobcrm-listing-results__count {
    margin: 0;
    color: #5d534c;
    font-weight: 600;
}

.imobcrm-grid--listing {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    max-width: 1210px;
}

.imobcrm-grid--listing .imobcrm-card {
    max-width: 390px;
}



.imobcrm-pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 32px;
}

.imobcrm-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(48, 36, 28, 0.12);
    text-decoration: none;
    color: #2f241d;
    background: #fff;
}

.imobcrm-pagination .current {
    background: var(--imobcrm-primary);
    color: #fff;
    border-color: var(--imobcrm-primary);
}

.imobcrm-empty-state {
    padding: 56px 24px;
    text-align: center;
    border: 1px dashed rgba(48, 36, 28, 0.14);
    border-radius: 28px;
    background: linear-gradient(180deg, #fff, #faf7f2);
}

.imobcrm-sitekit-form-wrap .imobcrm-form {
    max-width: 640px;
}

@media (max-width: 1100px) {
    .imobcrm-listing-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .imobcrm-listing-layout__sidebar {
        position: static;
        top: auto;
    }

    .imobcrm-grid--listing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .imobcrm-listing-page .imobcrm-container {
        width: 100%;
        max-width: none;
        padding-left: 12px;
        padding-right: 12px;
    }

    .imobcrm-filters {
        padding: 16px;
    }

    .imobcrm-listing-hero {
        padding-top: 42px;
    }

    .imobcrm-listing-hero__title {
        font-size: clamp(2rem, 11vw, 3.2rem);
    }

    .imobcrm-grid--listing {
        grid-template-columns: 1fr;
    }

    .imobcrm-filters__actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ── Button Group Selectors (Quartos, Banheiros, etc.) ── */
.imobcrm-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.imobcrm-btn-group__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d5cfc7;
    border-radius: 6px;
    background: #fff;
    color: #6b5e52;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.imobcrm-btn-group__btn:hover {
    border-color: var(--imobcrm-primary);
    color: #3b2f27;
    background: #faf8f4;
}

.imobcrm-btn-group__btn.is-active {
    background: #3b2f27;
    border-color: #3b2f27;
    color: #fff;
    box-shadow: 0 1px 3px rgba(59, 47, 39, 0.2);
}

.imobcrm-load-more-container {
    margin-top: 32px;
}

.imobcrm-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.imobcrm-pagination__item,
.imobcrm-pagination__ellipsis {
    min-width: 42px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(48, 36, 28, 0.12);
    border-radius: 999px;
    background: #fff;
    color: #3b2f27;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.imobcrm-pagination__item:hover {
    border-color: var(--imobcrm-primary);
    color: var(--imobcrm-primary);
    box-shadow: 0 10px 24px rgba(23, 18, 14, 0.08);
}

.imobcrm-pagination__item.is-active {
    background: var(--imobcrm-primary);
    border-color: var(--imobcrm-primary);
    color: #fff;
    pointer-events: none;
}

.imobcrm-pagination__item--nav {
    padding: 0 18px;
}

.imobcrm-pagination__ellipsis {
    min-width: auto;
    padding: 0 2px;
    border-color: transparent;
    background: transparent;
}
