/**
 * Materia Estates - Frontend Styles
 *
 * Usa las variables globales de Elementor:
 * --e-global-color-primary: #0A2B25
 * --e-global-color-accent: #68959B
 * --e-global-color-text: #525252
 * --e-global-color-91845fb: #1A1A1A (dark)
 * --e-global-color-b67ac50: #A3A3A3 (border)
 *
 * @package Materia_Estates
 */

/* =====================================================
   GRID DE PROPIEDADES
   ===================================================== */

.prop-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
}

/* Grid de 2 columnas cuando el mapa está oculto */
.mapa-columna-oculta + .e-con .prop-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

@media (max-width: 768px) {
    .prop-grid,
    .mapa-columna-oculta + .e-con .prop-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Columnas manuales (parámetro columnas="X") */
.prop-grid--col-1 { grid-template-columns: 1fr !important; }
.prop-grid--col-2 { grid-template-columns: repeat(2, 1fr) !important; }
.prop-grid--col-3 { grid-template-columns: repeat(3, 1fr) !important; }
.prop-grid--col-4 { grid-template-columns: repeat(4, 1fr) !important; }

@media (max-width: 1024px) {
    .prop-grid--col-4,
    .prop-grid--col-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .prop-grid--col-4,
    .prop-grid--col-3,
    .prop-grid--col-2 {
        grid-template-columns: 1fr !important;
    }
}

.prop-no-resultados {
    text-align: center;
    padding: 40px 20px;
    color: var(--e-global-color-text, #525252);
}

/* =====================================================
   GRID CONTAINER (AJAX)
   ===================================================== */

.prop-grid-container {
    position: relative;
}

.prop-grid-content {
    transition: opacity 0.2s ease;
}

.prop-grid-loading .prop-grid-content {
    opacity: 0.5;
    pointer-events: none;
}

.prop-grid-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--e-global-color-b67ac50, #A3A3A3);
    border-top-color: var(--e-global-color-primary, #0A2B25);
    border-radius: 50%;
    animation: prop-spin 0.8s linear infinite;
}

@keyframes prop-spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   PAGINACION
   ===================================================== */

.prop-paginacion {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.prop-paginacion a,
.prop-paginacion span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.prop-paginacion a {
    background: #fff;
    color: var(--e-global-color-primary, #0A2B25);
    border: 1px solid var(--e-global-color-b67ac50, #A3A3A3);
}

.prop-paginacion a:hover {
    background: var(--e-global-color-accent, #68959B);
    color: #fff;
    border-color: var(--e-global-color-accent, #68959B);
}

.prop-paginacion .current {
    background: var(--e-global-color-primary, #0A2B25);
    color: #fff;
    border: 1px solid var(--e-global-color-primary, #0A2B25);
}

/* =====================================================
   TARJETA DE PROPIEDAD
   ===================================================== */

.prop-tarjeta {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.prop-tarjeta:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Imagen container */
.prop-tarjeta__imagen-container {
    position: relative;
    width: 100%;
    flex: 0 0 240px; /* Altura fija: no crece ni se encoge */
    height: 240px;
    max-height: 240px;
    overflow: hidden;
}

.prop-tarjeta__slider {
    width: 100%;
    height: 240px;
}

.prop-tarjeta__slide {
    height: 240px;
}

.prop-tarjeta__slide img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

/* Etiqueta */
.prop-tarjeta__etiqueta {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 0;
    color: #fff;
}

.prop-tarjeta__etiqueta--novedad {
    background: var(--e-global-color-secondary, #1A4A42);
}

.prop-tarjeta__etiqueta--destacada {
    background: var(--e-global-color-674c6cd, #A89778);
}

.prop-tarjeta__etiqueta--exclusiva {
    background: var(--e-global-color-primary, #0A2B25);
}

.prop-tarjeta__etiqueta--rebajada {
    background: var(--e-global-color-c2382d4, #527A7F);
}

.prop-tarjeta__etiqueta--reservada {
    background: var(--e-global-color-5e63865, #C1AF95);
    color: var(--e-global-color-91845fb, #1A1A1A);
}

.prop-tarjeta__etiqueta--vendida {
    background: var(--e-global-color-c99ba9b, #737373);
}

.prop-tarjeta__etiqueta--lujo {
    background: #7D6544;
}

/* Precio */
.prop-tarjeta__precio {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--e-global-color-91845fb, #1A1A1A);
    padding: 6px 10px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 0;
}

/* Dots */
.prop-tarjeta__dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 10;
}

.prop-tarjeta__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.prop-tarjeta__dot.activo {
    background: #fff;
    transform: scale(1.2);
}

/* Contenido */
.prop-tarjeta__contenido {
    padding: 16px;
    flex: 1; /* Absorbe el espacio extra si el grid estira la tarjeta */
}

.prop-tarjeta__titulo {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--e-global-color-primary, #0A2B25);
    margin: 0 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prop-tarjeta__zona {
    font-size: 0.9rem;
    color: var(--e-global-color-text, #525252);
    margin: 0 0 12px;
}

.prop-tarjeta__detalles {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--e-global-color-primary, #0A2B25);
}

.prop-tarjeta__detalle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.prop-tarjeta__detalle svg {
    width: 16px;
    height: 16px;
    color: var(--e-global-color-accent, #68959B);
}

/* =====================================================
   BUSCADOR
   ===================================================== */

/* =====================================================
   BUSCADOR
   ===================================================== */
.prop-buscador {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.prop-buscador--horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
}

.prop-buscador--vertical {
    flex-direction: column;
}

.prop-buscador__campo {
    flex: 1 1 160px;
    min-width: 140px;
    max-width: 100%;
}

.prop-buscador--vertical .prop-buscador__campo {
    width: 100%;
    flex: none;
}

.prop-buscador select,
.prop-buscador__select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--e-global-color-b67ac50, #A3A3A3);
    border-radius: 0;
    font-size: 0.95rem;
    background: #fff;
    height: 48px;
    box-sizing: border-box;
}

/* Botón */
.prop-buscador__boton {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    padding: 12px 24px;
    background: var(--e-global-color-primary, #0A2B25);
    color: #fff;
    border: none !important;
    outline: none !important;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none;
    height: 48px;
    flex-shrink: 0;
    white-space: nowrap;
    box-shadow: none !important;
}

.prop-buscador__boton:hover {
    background: var(--e-global-color-accent, #68959B);
}

.prop-buscador__boton:focus,
.prop-buscador__boton:focus-visible,
.prop-buscador__boton:active {
    background: var(--e-global-color-primary, #0A2B25);
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.prop-buscador__boton svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .prop-buscador--horizontal {
        gap: 10px;
    }

    .prop-buscador__campo {
        flex: 1 1 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }

    .prop-buscador__boton {
        display: flex !important;
        flex: 1 1 100%;
        width: 100%;
        margin-top: 8px;
        margin-left: 0 !important;
        height: 48px !important;
        padding: 12px 24px !important;
    }

    .prop-buscador__boton-fila {
        justify-content: stretch;
    }
}

@media (max-width: 768px) {
    .prop-buscador--horizontal {
        flex-direction: column;
        gap: 10px;
    }

    .prop-buscador__campo {
        width: 100%;
        flex: none;
        min-width: 100%;
    }

    .prop-buscador__boton {
        display: flex !important;
        width: 100%;
        margin-top: 8px;
        margin-left: 0 !important;
        height: 48px !important;
        padding: 12px 24px !important;
    }

    .prop-buscador__boton-fila {
        justify-content: stretch;
    }
}

/* Botón en fila separada */
.prop-buscador__boton-fila {
    flex-basis: 100%;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

/* =====================================================
   SELECT2 - Estilos del buscador
   ===================================================== */
.prop-buscador .select2-container {
    width: 100% !important;
    box-sizing: border-box !important;
}

.prop-buscador .select2-container--default .select2-selection--single {
    height: 48px !important;
    padding: 0 16px !important;
    border: 1px solid var(--e-global-color-b67ac50, #A3A3A3) !important;
    border-radius: 0 !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    position: relative !important;
}

.prop-buscador .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--e-global-color-text, #525252) !important;
    line-height: 48px !important;
    padding-left: 0 !important;
    padding-right: 30px !important;
    font-size: 0.95rem !important;
}

.prop-buscador .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--e-global-color-b67ac50, #A3A3A3) !important;
}

/* Flecha */
.prop-buscador .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
    right: 12px !important;
    top: 0 !important;
}

.prop-buscador .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--e-global-color-b67ac50, #A3A3A3) transparent transparent transparent !important;
    border-width: 6px 5px 0 5px !important;
    margin-top: -3px !important;
}

.prop-buscador .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--e-global-color-b67ac50, #A3A3A3) transparent !important;
    border-width: 0 5px 6px 5px !important;
    margin-top: -3px !important;
}

/* Botón limpiar (X) */
.prop-buscador .select2-selection__clear {
    display: inline-flex !important;
    justify-content: flex-start; !important;
    align-items: center !important;
    color: #999 !important;
    padding-left: 4px !important;
}

.prop-buscador .select2-selection__clear:hover {
    color: #333 !important;
}

/* Focus state */
.prop-buscador .select2-container--default.select2-container--focus .select2-selection--single,
.prop-buscador .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--e-global-color-primary, #0A2B25) !important;
    outline: none !important;
}

/* =====================================================
   SELECT2 - Dropdown (global, fuera del contenedor)
   ===================================================== */
.select2-dropdown {
    border: 1px solid var(--e-global-color-b67ac50, #A3A3A3) !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    z-index: 99999 !important;
}

.select2-dropdown--below {
    margin-top: 35px !important;
}

.select2-dropdown--above {
    margin-bottom: 4px !important;
}

.select2-search--dropdown {
    padding: 8px !important;
}

.select2-search--dropdown .select2-search__field {
    padding: 10px 12px !important;
    border: 1px solid var(--e-global-color-b67ac50, #A3A3A3) !important;
    border-radius: 0 !important;
    font-size: 0.95rem !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--e-global-color-primary, #0A2B25) !important;
    outline: none !important;
}

.select2-results__option {
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--e-global-color-primary, #0A2B25) !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option--selected {
    background-color: #f0f0f0 !important;
}

/* =====================================================
   ORDENAR
   ===================================================== */

.prop-ordenar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prop-ordenar__label {
    font-size: 0.95rem;
    color: var(--e-global-color-text, #525252);
    white-space: nowrap;
}

.prop-ordenar__select {
    padding: 10px 40px 10px 16px;
    font-size: 0.95rem;
    border: 1px solid var(--e-global-color-b67ac50, #A3A3A3);
    border-radius: 0;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23525252' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    cursor: pointer;
    color: var(--e-global-color-primary, #0A2B25);
    min-width: 180px;
}

.prop-ordenar__select:focus {
    outline: none;
    border-color: var(--e-global-color-accent, #68959B);
}

/* =====================================================
   CONTADOR
   ===================================================== */

/* Sin estilos propios - hereda de Elementor */

/* =====================================================
   MAPA - CONTENEDOR Y TOGGLE
   ===================================================== */

.mapa-propiedades-container {
    position: relative;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
}

.mapa-propiedades-container.oculto {
    max-height: 0 !important;
    opacity: 0;
    margin: 0;
}

.mapa-propiedades-wrapper {
    position: relative;
    border-radius: 0;
    overflow: hidden;
}

/* Toggle del mapa */
.mapa-toggle-container {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #fff;
    padding: 8px 12px;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: opacity 0.3s ease;
}

.mapa-toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--e-global-color-primary, #0A2B25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mapa-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--e-global-color-accent, #68959B);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.4s ease;
}

.mapa-toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.4s ease;
    transform: translateX(20px);
}

.mapa-toggle-switch.inactivo {
    background: #ccc;
}

.mapa-toggle-switch.inactivo::after {
    transform: translateX(0);
}

/* Toggle externo */
.toggle-mapa-externo {
    display: flex;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: fit-content;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: opacity 0.4s ease, max-height 0.4s ease, padding 0.4s ease;
}

.toggle-mapa-externo.visible {
    opacity: 1;
    max-height: 50px;
    padding: 8px 12px;
}

/* =====================================================
   MAPA - ESTILOS LEAFLET
   ===================================================== */

.prop-mapa {
    width: 100%;
    border-radius: 0;
    z-index: 1;
}

.prop-mapa-vacio {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #f5f5f5;
    color: var(--e-global-color-text, #525252);
    border-radius: 0;
}

/* Marcador en el mapa */
.marcador-propiedad {
    background: var(--e-global-color-primary, #0A2B25);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Overlay del mapa */
.mapa-overlay {
    position: absolute;
    top: -1000px;
    left: -1000px;
    width: 5000px;
    height: 5000px;
    background: rgba(90, 151, 156, 0.3);
    z-index: 450;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mapa-overlay.activo {
    opacity: 1;
}

/* Leaflet popup overrides */
.leaflet-popup-pane {
    z-index: 1500 !important;
}

.leaflet-popup {
    z-index: 1500 !important;
}

.leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1500 !important;
}

.leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.leaflet-popup-tip-container {
    z-index: 1500 !important;
}

.leaflet-popup-tip {
    background: #fff;
}

/* =====================================================
   MAPA - POPUP DE PROPIEDAD
   ===================================================== */

.propiedad-popup {
    width: 280px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
}

.propiedad-popup-imagen-container {
    position: relative;
    width: 100%;
    height: 180px;
}

.propiedad-popup-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.propiedad-popup-etiqueta {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #fff;
    padding: 5px 10px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 0;
}

.propiedad-popup-etiqueta--novedad { background: var(--e-global-color-secondary, #1A4A42); }
.propiedad-popup-etiqueta--destacada { background: var(--e-global-color-674c6cd, #A89778); }
.propiedad-popup-etiqueta--exclusiva { background: var(--e-global-color-primary, #0A2B25); }
.propiedad-popup-etiqueta--rebajada { background: var(--e-global-color-c2382d4, #527A7F); }
.propiedad-popup-etiqueta--reservada { background: var(--e-global-color-5e63865, #C1AF95); color: var(--e-global-color-91845fb, #1A1A1A); }
.propiedad-popup-etiqueta--vendida { background: var(--e-global-color-c99ba9b, #737373); }
.propiedad-popup-etiqueta--lujo { background: #7D6544; }

.propiedad-popup-precio {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--e-global-color-91845fb, #1A1A1A);
    padding: 6px 10px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 0;
}

.propiedad-popup-contenido {
    padding: 16px;
    background: #fff;
}

.propiedad-popup-titulo {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--e-global-color-primary, #0A2B25);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.propiedad-popup-zona {
    font-size: 0.9rem;
    color: var(--e-global-color-text, #525252);
    margin-bottom: 12px;
}

.propiedad-popup-detalles {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--e-global-color-c99ba9b, #737373);
}

.propiedad-popup-detalle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.propiedad-popup-detalle svg {
    width: 16px;
    height: 16px;
    color: var(--e-global-color-accent, #68959B);
}

/* =====================================================
   GALERIA
   ===================================================== */

.prop-galeria {
    position: relative;
}

.prop-galeria__main {
    position: relative;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
}

.prop-galeria__slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.prop-galeria__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.prop-galeria__nav:hover {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.prop-galeria__nav svg {
    width: 20px;
    height: 20px;
    color: var(--e-global-color-primary, #0A2B25);
}

.prop-galeria__nav--prev {
    left: 16px;
}

.prop-galeria__nav--next {
    right: 16px;
}

.prop-galeria__counter {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 0.85rem;
}

.prop-galeria__thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.prop-galeria__thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.prop-galeria__thumb.activo,
.prop-galeria__thumb:hover {
    opacity: 1;
}

.prop-galeria__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prop-galeria-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    color: #999;
    border-radius: 0;
}

/* =====================================================
   GRID DE ZONAS
   ===================================================== */

.prop-grid-zonas {
    display: grid !important;
    gap: 16px !important;
}

.prop-grid-zonas--col-1 {
    grid-template-columns: 1fr !important;
}

.prop-grid-zonas--col-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.prop-grid-zonas--col-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.prop-grid-zonas--col-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

@media (max-width: 1024px) {
    .prop-grid-zonas--col-4,
    .prop-grid-zonas--col-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .prop-grid-zonas--col-4,
    .prop-grid-zonas--col-3,
    .prop-grid-zonas--col-2 {
        grid-template-columns: 1fr !important;
    }
}

/* Layout bento (destacado) */
.prop-grid-zonas--bento {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

/* Sección superior: 40% / 60% */
.prop-grid-zonas__superior {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    width: 100% !important;
}

.prop-grid-zonas__columna-izq {
    flex: 0 0 40% !important;
    width: 40% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.prop-grid-zonas__columna-der {
    flex: 1 1 auto !important;
    width: calc(60% - 16px) !important;
}

/* Sección inferior: 50% / 25% / 25% */
.prop-grid-zonas__inferior {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    width: 100% !important;
}

.prop-grid-zonas__inferior .prop-zona-tarjeta--grande {
    flex: 0 0 calc(50% - 8px) !important;
    width: calc(50% - 8px) !important;
}

.prop-grid-zonas__inferior .prop-zona-tarjeta--pequena {
    flex: 0 0 calc(25% - 12px) !important;
    width: calc(25% - 12px) !important;
}

/* Tarjeta destacada (60%, altura completa) */
.prop-zona-tarjeta--destacada {
    height: 100%;
}

.prop-zona-tarjeta--destacada .prop-zona-tarjeta__imagen {
    height: 100%;
    min-height: 400px;
}

.prop-zona-tarjeta--destacada .prop-zona-tarjeta__nombre {
    font-size: 1.8rem;
}

/* Tarjetas medianas (40%, apiladas) */
.prop-zona-tarjeta--mediana {
    flex: 1;
}

.prop-zona-tarjeta--mediana .prop-zona-tarjeta__imagen {
    height: 100%;
    min-height: 180px;
}

/* Tarjeta grande inferior (50%) */
.prop-zona-tarjeta--grande .prop-zona-tarjeta__imagen {
    height: 440px;
}

/* Tarjetas pequeñas inferior (25%) */
.prop-zona-tarjeta--pequena .prop-zona-tarjeta__imagen {
    height: 440px;
}

/* Responsive layout bento */
@media (max-width: 1024px) {
    .prop-grid-zonas__superior {
        flex-direction: column !important;
    }

    .prop-grid-zonas__columna-izq {
        flex: 1 !important;
        width: 100% !important;
        flex-direction: row !important;
    }

    .prop-grid-zonas__columna-izq .prop-zona-tarjeta--mediana {
        flex: 1 !important;
    }

    .prop-grid-zonas__columna-der {
        flex: 1 !important;
        width: 100% !important;
    }

    .prop-zona-tarjeta--destacada .prop-zona-tarjeta__imagen,
    .prop-zona-tarjeta--mediana .prop-zona-tarjeta__imagen,
    .prop-zona-tarjeta--grande .prop-zona-tarjeta__imagen,
    .prop-zona-tarjeta--pequena .prop-zona-tarjeta__imagen {
        height: 200px !important;
        min-height: 200px !important;
    }

    /* Inferior: 50% / 50% en dos filas */
    .prop-grid-zonas__inferior {
        flex-wrap: wrap !important;
    }

    .prop-grid-zonas__inferior .prop-zona-tarjeta--grande {
        flex: 0 0 100% !important;
        width: 100% !important;
    }

    .prop-grid-zonas__inferior .prop-zona-tarjeta--pequena {
        flex: 0 0 calc(50% - 8px) !important;
        width: calc(50% - 8px) !important;
    }
}

@media (max-width: 768px) {
    .prop-grid-zonas__columna-izq {
        flex-direction: column !important;
    }

    .prop-grid-zonas__inferior .prop-zona-tarjeta--grande,
    .prop-grid-zonas__inferior .prop-zona-tarjeta--pequena {
        flex: 0 0 100% !important;
        width: 100% !important;
    }

    .prop-zona-tarjeta--destacada .prop-zona-tarjeta__nombre {
        font-size: 1.4rem !important;
    }

    .prop-zona-tarjeta--destacada .prop-zona-tarjeta__imagen,
    .prop-zona-tarjeta--mediana .prop-zona-tarjeta__imagen,
    .prop-zona-tarjeta--grande .prop-zona-tarjeta__imagen,
    .prop-zona-tarjeta--pequena .prop-zona-tarjeta__imagen {
        height: 180px !important;
        min-height: 180px !important;
    }
}

/* Tarjeta de zona */
.prop-zona-tarjeta {
    display: block;
    text-decoration: none;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.prop-zona-tarjeta:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.prop-zona-tarjeta__imagen {
    position: relative;
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.prop-zona-tarjeta__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.1) 60%, rgba(0, 0, 0, 0) 100%);
}

.prop-zona-tarjeta__contenido {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    color: #fff;
}

.prop-zona-tarjeta__nombre {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
    color: #fff !important;
}

.prop-zona-tarjeta__contador {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* =====================================================
   GRID ZONAS 3 (50% + 25% + 25%)
   ===================================================== */

.prop-grid-zonas--tres {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    width: 100% !important;
}

.prop-grid-zonas--tres .prop-zona-tarjeta--grande {
    flex: 0 0 calc(50% - 8px) !important;
    width: calc(50% - 8px) !important;
}

.prop-grid-zonas--tres .prop-zona-tarjeta--pequena {
    flex: 0 0 calc(25% - 12px) !important;
    width: calc(25% - 12px) !important;
}

.prop-grid-zonas--tres .prop-zona-tarjeta__imagen {
    height: 300px;
}

@media (max-width: 1024px) {
    .prop-grid-zonas--tres {
        flex-wrap: wrap !important;
    }
    .prop-grid-zonas--tres .prop-zona-tarjeta--grande {
        flex: 0 0 100% !important;
        width: 100% !important;
    }
    .prop-grid-zonas--tres .prop-zona-tarjeta--pequena {
        flex: 0 0 calc(50% - 8px) !important;
        width: calc(50% - 8px) !important;
    }
}

@media (max-width: 768px) {
    .prop-grid-zonas--tres .prop-zona-tarjeta {
        flex: 0 0 100% !important;
        width: 100% !important;
    }
}

/* =====================================================
   GALERIA FICHA (BENTO + LIGHTBOX)
   ===================================================== */

.prop-ficha {
    position: relative;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
}

.prop-ficha__grid {
    display: grid;
    gap: 8px;
    height: 480px;
}

/* Layout 1 foto */
.prop-ficha--1 .prop-ficha__grid {
    grid-template-columns: 1fr;
}

/* Layout 2 fotos: 50/50 */
.prop-ficha--2 .prop-ficha__grid {
    grid-template-columns: 1fr 1fr;
}

/* Layout 3 fotos: 50% izq + 2 apiladas derecha */
.prop-ficha--3 .prop-ficha__grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.prop-ficha--3 .prop-ficha__celda--principal {
    grid-row: 1 / 3;
}

/* Layout 4+ fotos: bento completo */
.prop-ficha--4 .prop-ficha__grid,
.prop-ficha--5plus .prop-ficha__grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.prop-ficha--4 .prop-ficha__celda--principal,
.prop-ficha--5plus .prop-ficha__celda--principal {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.prop-ficha--4 .prop-ficha__celda--alargada,
.prop-ficha--5plus .prop-ficha__celda--alargada {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
}

.prop-ficha--4 .prop-ficha__celda--cuadrada:nth-child(3),
.prop-ficha--5plus .prop-ficha__celda--cuadrada:nth-child(3) {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

.prop-ficha--4 .prop-ficha__celda--cuadrada:nth-child(4),
.prop-ficha--5plus .prop-ficha__celda--cuadrada:nth-child(4) {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}

/* Celdas */
.prop-ficha__celda {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.prop-ficha__celda:hover {
    opacity: 0.9;
}

/* Botón Ver todas */
.prop-ficha__ver-todas {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #fff !important;
    color: var(--e-global-color-primary, #0A2B25) !important;
    border: none !important;
    padding: 8px 12px;
    border-radius: 0;
    font-size: 0.75rem !important;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.prop-ficha__ver-todas:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    background: #f5f5f5 !important;
}

/* En desktop: mostrar solo el de desktop, ocultar móvil */
.prop-ficha__ver-todas--movil {
    display: none !important;
}

.prop-ficha__ver-todas--desktop {
    display: block;
}

/* Placeholder */
.prop-ficha-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 300px;
    background: #f0f0f0;
    color: #999;
    border-radius: 0;
}

/* =====================================================
   LIGHTBOX
   ===================================================== */

.prop-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.prop-lightbox.activo {
    opacity: 1;
    visibility: visible;
}

.prop-lightbox__imagen {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0;
}

.prop-lightbox__cerrar {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none !important;
    color: #fff;
    cursor: pointer;
    padding: 8px 10px !important;
    transition: background 0.2s ease;
}

.prop-lightbox__cerrar:hover {
    background: rgba(255, 255, 255, 0.2);
}

.prop-lightbox__cerrar:focus,
.prop-lightbox__cerrar:focus-visible,
.prop-lightbox__cerrar:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.prop-lightbox__cerrar svg {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.prop-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none !important;
    color: #fff;
    cursor: pointer;
    padding: 12px !important;
    transition: background 0.2s ease;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
}

.prop-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.prop-lightbox__nav:focus,
.prop-lightbox__nav:focus-visible,
.prop-lightbox__nav:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.prop-lightbox__nav svg {
    width: 24px;
    height: 24px;
    margin-top: 1px;
}

.prop-lightbox__nav--prev {
    left: 20px;
}

.prop-lightbox__nav--next {
    right: 20px;
}

.prop-lightbox__contador {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 0;
}

/* Responsive galería ficha - Tablet */
@media (max-width: 1024px) {
    .prop-ficha__grid {
        height: auto;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto !important;
    }

    .prop-ficha__celda {
        height: 180px;
    }

    .prop-ficha__celda--principal {
        grid-column: 1 / 3 !important;
        grid-row: auto !important;
        height: 280px;
    }

    .prop-ficha__celda--alargada,
    .prop-ficha__celda--cuadrada {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    /* En tablet/móvil mostrar máximo 3 celdas */
    .prop-ficha--4 .prop-ficha__celda:nth-child(n+4),
    .prop-ficha--5plus .prop-ficha__celda:nth-child(n+4) {
        display: none;
    }

    /* En tablet/móvil: mostrar solo el de móvil, ocultar desktop */
    .prop-ficha__ver-todas--movil {
        display: block !important;
    }

    .prop-ficha__ver-todas--desktop {
        display: none !important;
    }

    /* Lightbox responsive tablet */
    .prop-lightbox__nav svg {
        margin-top: 0;
    }
}

/* Responsive galería ficha - Móvil */
@media (max-width: 768px) {
    .prop-ficha__celda--principal {
        height: 240px;
    }

    .prop-ficha__celda {
        height: 160px;
    }

    /* Lightbox responsive */
    .prop-lightbox__nav {
        width: 44px;
        height: 44px;
    }

    .prop-lightbox__nav svg {
        margin-top: 0;
    }

    .prop-lightbox__nav--prev {
        left: 10px;
    }

    .prop-lightbox__nav--next {
        right: 10px;
    }

    .prop-lightbox__cerrar {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .prop-lightbox__cerrar svg {
        width: 18px;
        height: 18px;
    }
}

/* =====================================================
   UTILIDADES
   ===================================================== */

/* Mostrar o ocultar según propiedades */
.no-hay-propiedades .ocultar-sin-propiedades {
    display: none !important;
}

.mostrar-sin-propiedades {
    display: none !important;
}

.no-hay-propiedades .mostrar-sin-propiedades {
    display: block !important;
}

/* =====================================================
   PROYECTOS - FILTROS
   ===================================================== */

.proy-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.proy-filtros__boton {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    border: 1px solid var(--e-global-color-primary, #0A2B25) !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: var(--e-global-color-primary, #0A2B25) !important;
    cursor: pointer !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
    white-space: nowrap !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
}

.proy-filtros__boton:hover {
    background: var(--e-global-color-primary, #0A2B25) !important;
    border-color: var(--e-global-color-primary, #0A2B25) !important;
    color: #fff !important;
}

.proy-filtros__boton--activo {
    background: var(--e-global-color-primary, #0A2B25) !important;
    color: #fff !important;
    border-color: var(--e-global-color-primary, #0A2B25) !important;
}

.proy-filtros__boton--activo:hover {
    background: var(--e-global-color-ca8ef9e, #1A4A42) !important;
    border-color: var(--e-global-color-ca8ef9e, #1A4A42) !important;
    color: #fff !important;
}

.proy-filtros__boton:focus,
.proy-filtros__boton:focus-visible,
.proy-filtros__boton:active {
    outline: none !important;
    box-shadow: none !important;
}

/* =====================================================
   PROYECTOS - CONTADOR
   ===================================================== */

.proy-contador {
    color: var(--e-global-color-primary, #0A2B25);
}

/* =====================================================
   PROYECTOS - GRID
   ===================================================== */

.proy-grid {
    display: grid;
    gap: 16px;
}

.proy-grid--col-1 { grid-template-columns: 1fr; }
.proy-grid--col-2 { grid-template-columns: repeat(2, 1fr); }
.proy-grid--col-3 { grid-template-columns: repeat(3, 1fr); }
.proy-grid--col-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .proy-grid--col-2,
    .proy-grid--col-3,
    .proy-grid--col-4 {
        grid-template-columns: 1fr;
    }
}

.proy-no-resultados {
    text-align: center;
    padding: 40px 20px;
    color: var(--e-global-color-text, #525252);
}

/* =====================================================
   PROYECTOS - TARJETA
   ===================================================== */

.proy-tarjeta {
    position: relative;
    display: block;
    text-decoration: none;
    overflow: hidden;
    border-radius: 0;
    aspect-ratio: 16 / 9;
}

.proy-tarjeta__imagen {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.proy-tarjeta:hover .proy-tarjeta__imagen {
    transform: scale(1.03);
}

/* Card sin imagen */
.proy-tarjeta--sin-imagen {
    background: #e8e8e8;
}

/* Overlay degradado */
.proy-tarjeta__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.proy-tarjeta--sin-imagen .proy-tarjeta__overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
}

/* Etiqueta tipo */
.proy-tarjeta__etiqueta {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 5px 10px 3px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--e-global-color-91845fb, #1A1A1A);
    color: #fff;
    border-radius: 0;
    z-index: 2;
}

/* Contenido inferior */
.proy-tarjeta__contenido {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 2;
}

.proy-tarjeta__titulo {
    color: #fff !important;
    margin: 0 0 10px;
}

.proy-tarjeta__ubicacion {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* Ocultar tarjeta al filtrar */
.proy-tarjeta--oculta {
    display: none;
}

@media (max-width: 768px) {
    .proy-filtros {
        gap: 8px !important;
    }

    .proy-filtros__boton {
        padding: 7px 12px !important;
        font-size: 0.8rem !important;
    }

    .proy-tarjeta__contenido {
        padding: 16px;
    }

    .proy-tarjeta__titulo {
        font-size: 1.1rem;
    }
}

