/* REF Grid - Skeleton & Layout */

.ref-grid-wrapper {
    position: relative;
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.ref-grid-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Skeleton Loader */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.ref-skeleton {
    background: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ref-skeleton.card-skeleton {
    height: 350px;
    width: 100%;
    display: inline-block;
}

/* Grid Layout fallback (if JetEngine CSS fails) */
/* [v8.0.128] Migrado para Container Queries — responde ao container, não ao viewport */
.ref-grid-layout {
    display: grid;
    grid-template-columns: 1fr; /* base: 1 coluna — container queries sobrescrevem */
    gap: 20px;
    margin-bottom: 40px;
    width: 100%;
}

/* [v8.0.129] Blocos @container removidos — código morto.
   O PHP (ref-grid.php) gera as container queries via wp_add_inline_style,
   injetadas depois deste arquivo no HTML (maior prioridade de cascade).
   Manter apenas o fallback base incondicional acima (grid-template-columns: 1fr). */

/* Pagination */
.ref-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.ref-pagination a,
.ref-pagination span {
    padding: 8px 16px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: all 0.2s;
}

.ref-pagination .current,
.ref-pagination a:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* ═══════════════════════════════════════════════════════════════════════
   [v7.5.0] Click-to-Filter: Badge e estados
   ═══════════════════════════════════════════════════════════════════════ */

.ref-cluster-filter-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: refSlideDown 0.3s ease;
}

@keyframes refSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ref-cluster-filter-badge .ref-cluster-icon {
    font-size: 18px;
    margin-right: 8px;
}

.ref-cluster-filter-badge .ref-cluster-count {
    font-weight: 500;
    font-size: 14px;
    flex: 1;
}

.ref-cluster-filter-badge .ref-clear-cluster-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ref-cluster-filter-badge .ref-clear-cluster-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Estados de items filtrados */
.jet-listing-grid__item.ref-cluster-match {
    animation: refHighlight 0.3s ease;
}

@keyframes refHighlight {
    from {
        transform: scale(0.98);
        opacity: 0.8;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.jet-listing-grid__item.ref-cluster-hidden {
    display: none !important;
}

/* Loading state durante AJAX */
.jet-listing-grid.ref-loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.jet-listing-grid.ref-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: refSpin 1s linear infinite;
}

@keyframes refSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   [v7.6.14] UI Helpers: Checkboxes & Hide Emptiness
   ═══════════════════════════════════════════════════════════════════════ */

/* Ocultação Universal (Lighthouse Friendly) - Alta Especificidade */
body:not(.elementor-editor-active) .elementor.elementor .custom-field-is-empty,
body:not(.elementor-editor-active) .elementor.elementor [class*="custom-field-is-empty"],
body:not(.elementor-editor-active) .elementor.elementor [id*="custom-field-is-empty"],
body:not(.elementor-editor-active) .elementor.elementor [aria-labelledby*="custom-field-is-empty"] {
    display: none !important;
    visibility: hidden;
    height: 0;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border: none !important;
}

/* Seção de Itens/Amenidades (Paridade Total com V1) */
.elementor-shortcode .secao-itens-condominio-v12 ul.lista-itens-condominio-v12,
.secao-itens-condominio-v12 ul.lista-itens-condominio-v12 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.elementor-shortcode .secao-itens-condominio-v12 ul.lista-itens-condominio-v12 li,
.secao-itens-condominio-v12 ul.lista-itens-condominio-v12 li {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    min-width: 200px !important;
    max-width: calc(33.333% - 0.5rem) !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.secao-itens-condominio-v12 .elementor-icon-list-icon {
    margin: 0 !important;
    margin-left: 2px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
}

.secao-itens-condominio-v12 .elementor-icon-list-text {
    font-size: 0.9rem !important;
    color: #231F5C !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    margin-left: 8px;
    /* Ajuste fino do gap entre ícone e texto */
}

@media (max-width: 1024px) {

    .elementor-shortcode .secao-itens-condominio-v12 ul.lista-itens-condominio-v12 li,
    .secao-itens-condominio-v12 ul.lista-itens-condominio-v12 li {
        min-width: 180px !important;
        max-width: calc(50% - 0.5rem) !important;
    }
}

@media (max-width: 767px) {

    .elementor-shortcode .secao-itens-condominio-v12 ul.lista-itens-condominio-v12 li,
    .secao-itens-condominio-v12 ul.lista-itens-condominio-v12 li {
        min-width: 150px !important;
        /* Paridade com V1 */
        max-width: calc(50% - 0.5rem) !important;
    }

    .secao-itens-condominio-v12 .elementor-icon-list-text {
        white-space: normal !important;
        font-size: 0.875rem !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   [v8.0.23] BUG-004 FIX: Mensagem Grid Vazio
   ═══════════════════════════════════════════════════════════════════════ */

.ref-empty-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 12px;
    margin: 20px 0;
    animation: refFadeIn 0.4s ease;
}

@keyframes refFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ref-empty-results__icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.ref-empty-results__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.ref-empty-results__text {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    margin: 0;
}

@media (max-width: 767px) {
    .ref-empty-results {
        padding: 40px 16px;
    }

    .ref-empty-results__icon {
        font-size: 36px;
    }

    .ref-empty-results__title {
        font-size: 1.25rem;
    }

}

/* ═══════════════════════════════════════════════════════════════════════
   [v8.0.43] UI Improvement: Standardized 3:2 Card Ratio + CWV Perf
   ═══════════════════════════════════════════════════════════════════════ */

/* OTIMIZAÇÃO CWV: Isola o layout do card para evitar reflow na página toda */
.jet-listing-grid__item {
    contain: content;
}

.jet-listing-grid__item .elementor-widget-image a,
.jet-listing-grid__item .elementor-widget-image img {
    width: 100%;
    /* Garante que a altura obedeça a proporção */
    height: auto !important;
    display: block;
}

.jet-listing-grid__item .elementor-widget-image img {
    /* Define o retângulo áureo 3:2 */
    aspect-ratio: 3 / 2 !important;

    /* Preenche o retângulo cortando excessos (não estica) */
    object-fit: cover !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   [v8.0.90] CRM-1234: Anti-Flash & Client-Side Grid
   ═══════════════════════════════════════════════════════════════════════ */
.ref-awaiting-js .jet-listing-grid__items {
    opacity: 0;
    transition: opacity 0.2s ease;
}