/* ============================================================
   INMOBILIARIO - Estilos específicos
   /inmobiliario/inmobiliario.css
   ============================================================ */

/* --- Botón Ampliar Mapa (dentro del contenedor del mapa) --- */
.btn-fullscreen {
    position: absolute;
    bottom: 20px;
    right: 10px;
    z-index: 1000;
    padding: 8px 12px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.btn-fullscreen:hover {
    background: #f4f4f4;
}

/* --- Contenedor del mapa principal (necesario para que el botón quede dentro) --- */
.map-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    max-height: 80vh;
    margin-bottom: 30px;
}

/* --- Fichas de Propiedades --- */
.property-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    justify-content: center;
}

.property-card {
    width: 200px;
    height: 300px;
    background: #fff;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    cursor: pointer;
}
.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    border-color: var(--accent, #ff4444);
}
.property-card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid var(--accent, #ff4444);
    padding-bottom: 5px;
}
.property-card p {
    margin: 4px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}
.property-card .price {
    margin-top: auto;
    font-weight: bold;
    font-size: 18px;
    color: var(--accent, #2196F3);
    text-align: right;
}

/* --- Ventana Emergente (Modal) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.property-modal {
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 12px;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}
.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}
.btn-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}
.btn-close-modal:hover {
    color: #333;
}
.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    font-size: 16px;
}
.modal-info-grid p { margin: 0; color: #444; }
.modal-info-grid b { color: #111; }

.modal-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent, #2196F3);
    text-align: right;
}

/* --- Compartir enlace --- */
.share-link-box {
    background: #fcfcfc;
    border: 1px dashed #ccc;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.share-link-box input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.btn-copy {
    padding: 8px 12px;
    background: var(--accent, #607D8B);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* --- Mapa del Modal --- */
.modal-map-container {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    border: 1px solid #ccc;
    overflow: hidden;
    position: relative;
}
.btn-modal-fullscreen {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 999;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.btn-modal-fullscreen:hover { background: #f0f0f0; }

/* --- Carrusel de imágenes --- */
.modal-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}
.modal-carousel img {
    height: 150px;
    border-radius: 6px;
    object-fit: cover;
    scroll-snap-align: start;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: transform 0.2s;
}
.modal-carousel img:hover { transform: scale(1.02); }

/* --- Botón WhatsApp --- */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.3s;
    margin-top: 5px;
    margin-bottom: 20px;
    text-align: center;
    cursor: pointer;
    border: none;
    width: 100%;
    box-sizing: border-box;
}
.btn-whatsapp:hover { background: #1ebe57; color: white; text-decoration: none; }

/* --- Filtros y Búsqueda --- */
.filters-section {
    background: #fdfdfd;
    border: 1px solid #eaeaea;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.search-main {
    display: flex;
    gap: 10px;
    align-items: center;
}
.search-main input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}
.btn-clear-filters {
    padding: 10px 16px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-clear-filters:hover { background: #c62828; }

.filters-selects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.filters-selects select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}
.sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}
.sort-buttons button {
    padding: 6px 10px;
    font-size: 13px;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}
.sort-buttons button:hover { background: #ddd; }
.sort-buttons button.active-sort {
    background: var(--accent, #607D8B);
    color: white;
    border-color: transparent;
}

/* --- Responsivo móvil --- */
@media (max-width: 600px) {
    /* Botón Limpiar debajo del buscador en móvil */
    .search-main {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-clear-filters {
        width: 100%;
        text-align: center;
    }
}
