/* ==========================================================================
   1. GRID Y TARJETAS UNIFICADAS (Listados, Buscador y Relacionados)
   ========================================================================== */

.inmo-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 40px;
    margin-left: auto;
    margin-right: auto;
}

/* Tarjeta Base */
.inmo-card-unified {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.inmo-card-unified:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Imagen y Elementos Flotantes */
.inmo-card-image-wrap {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f0f0f0;
}

.inmo-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.inmo-card-unified:hover .inmo-card-image-wrap img {
    transform: scale(1.05);
}

/* Etiqueta (Venta/Alquiler) */
.inmo-card-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #2F80ED;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    z-index: 2;
}

/* Botón Contacta Ahora (Sobre imagen) */
.inmo-card-contact-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #001845;
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    z-index: 2;
}

.inmo-card-contact-btn:hover {
    background: #002D62;
}

/* Contenido de la Tarjeta */
.inmo-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Línea Superior: Ubicación + Precio */
.inmo-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
}

.inmo-card-title {
    font-size: 1.3em;
    margin: 0 0 15px 0;
    font-weight: 500;
    line-height: 1.3;
}

.inmo-card-title a {
    text-decoration: none;
    color: #001845;
}

/* Iconos Lineales */
.inmo-card-icons {
    display: flex;
    gap: 20px;
    color: #555;
    font-size: 0.9em;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: auto; 
}

.inmo-card-icon-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inmo-card-icon-item svg {
    width: 18px;
    height: 18px;
    fill: #555;
}

/* Paginación */
.inmo-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
}

.inmo-pagination .page-numbers.current {
    background: #001845;
    color: #fff;
    border-color: #001845;
}

/* ==========================================================================
   2. FICHA INDIVIDUAL (Single Inmueble) - Estructura Layout
   ========================================================================== */

.inmo-single-layout-wrapper {
    display: grid;
    grid-template-columns: 40% 60%;
    /* Ajusta el 80px si tu cabecera es más alta o más baja */
    height: calc(100vh - 80px); 
    min-height: 600px;
    overflow: hidden; /* Evita doble scroll */
    position: relative;
    background: #fff;
}

.inmo-single-col-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #ffffff;
    color: #002D62;
    overflow-y: auto; /* Scroll SOLO en esta columna */
    height: 100%;
    border-right: 1px solid #eee;
    scroll-behavior: smooth;
    position: relative;
    z-index: 10;
}

.inmo-single-col-right {
    position: relative;
    background: #f0f0f0;
    height: 100%; 
    overflow: hidden;
}

/* Detalles Hero (Parte Izquierda Superior) */
.inmo-hero-details {
    padding: 40px;
    background: #fff;
    flex-shrink: 0;
}

.inmo-hero-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 15px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #555;
}

.inmo-hero-tag {
    background: #005096;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.inmo-hero-ref {
    font-size: 0.9em;
    opacity: 0.8;
}

.inmo-hero-price {
    font-weight: 600;
    color: #111;
    font-size: 1.3em;
    margin-left: auto;
}

.inmo-hero-location {
    font-size: 0.95em;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.inmo-hero-main-title {
    color: #001845;
    font-size: 2.2em;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

/* Iconos de características en Hero */
.inmo-hero-key-features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px;
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.inmo-key-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.inmo-key-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inmo-key-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.inmo-key-label {
    font-size: 0.8em;
    color: #666;
    display: block;
}

.inmo-key-value {
    font-weight: bold;
    color: #111;
    font-size: 1em;
}

/* Menú de Anclas */
.inmo-hero-options ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inmo-anchor-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: color 0.2s;
}
.inmo-anchor-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.inmo-anchor-link:hover {
    color: #005096;
}

/* Caja de Agente en Hero */
.inmo-contact-box {
    background: #001845;
    color: #fff;
    padding: 40px;
    margin-top: auto;
    flex-shrink: 0;
}

.inmo-contact-box h3 {
    color: #fff;
    margin-top: 0;
    font-size: 1.4em;
    margin-bottom: 20px;
}

.inmo-agent {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.inmo-agent-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    flex-shrink: 0;
}
.inmo-agent-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inmo-agent-details strong { display: block; font-size: 1.1em; color: #fff; }
.inmo-agent-details span { opacity: 0.8; font-size: 0.9em; color: #ddd; }

.inmo-contact-button {
    display: inline-block;
    border: 1px solid #fff;
    color: #fff;
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.inmo-contact-button:hover {
    background: #fff;
    color: #001845;
}

/* ==========================================================================
   3. FICHA INDIVIDUAL - Contenido Principal (Texto, Mapa, Extras)
   ========================================================================== */

.inmo-content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Columna texto ancha, sidebar estrecho */
    gap: 40px;
    margin: 0 auto;
    padding-bottom: 60px;
    max-width: 1400px;
}

.inmo-content-main {
    padding: 40px;
}

.inmo-content-section {
    margin-bottom: 50px;
    scroll-margin-top: 100px; /* Para que el ancla no quede tapada */
}

.inmo-section-title {
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    color: #001845;
}

.inmo-description-text {
    line-height: 1.7;
    font-size: 1.05em;
    color: #333;
}

.inmo-description-text p {
    margin-bottom: 1.5em;
}

/* Checkboxes */
.inmo-features-checkbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.inmo-features-checkbox-list li {
    font-size: 1.05em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.inmo-feature-icon {
    color: #005096;
    font-weight: bold;
}

/* Mapas y Videos */
.inmo-map-wrapper iframe,
.inmo-video-wrapper iframe {
    width: 100%;
    border: 0;
    background: #eee;
}
.inmo-map-wrapper iframe { height: 450px; }
.inmo-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.inmo-video-wrapper iframe {
    position: absolute;
    top: 0; left: 0; height: 100%;
}

/* Galería Grid */
.inmo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.inmo-gallery-grid img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    transition: opacity 0.2s;
}
.inmo-gallery-grid img:hover { opacity: 0.8; }


/* ==========================================================================
   4. BARRA LATERAL STICKY (Estilo Tarjeta Blanca)
   ========================================================================== */

.inmo-sticky-banner {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid #f5f5f5;
    position: -webkit-sticky;
    position: sticky;
    top: 110px;
    z-index: 100;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease;
}

.inmo-sticky-banner:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
    border-color: #eaeaea;
}

.inmo-sidebar-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

.inmo-sidebar-price-box {
    text-align: right;
    line-height: 1.2;
}

.inmo-sidebar-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
    margin-bottom: 4px;
}

.inmo-sidebar-price {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #001845;
    letter-spacing: -0.5px;
}

.inmo-sidebar-tag-wrap {
    margin-bottom: 15px;
}

.inmo-sticky-banner .inmo-hero-tag {
    background-color: #001845;
}

.inmo-sidebar-location {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #888;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.inmo-sidebar-title {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0 0 25px 0;
    color: #111;
    font-family: serif; 
}

.inmo-sidebar-divider {
    border: 0;
    border-top: 1px solid #f0f0f0;
    margin: 25px 0;
}

.inmo-sidebar-subtitle {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
}

.inmo-sticky-contact {
    display: flex;
    align-items: center;
    gap: 15px;
}

.inmo-sticky-agent-img-wrap {
    flex-shrink: 0;
}

.inmo-sticky-agent-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.inmo-sticky-agent-info {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.inmo-sticky-agent-name {
    color: #001845;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.inmo-sticky-agent-tel {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
}

.inmo-contact-button.inmo-sticky-btn {
    background-color: #001845;
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid #001845;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
    width: fit-content;
}

.inmo-contact-button.inmo-sticky-btn:hover {
    background-color: transparent;
    color: #001845;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,24,69,0.2);
}

@media (max-width: 1024px) {
    .inmo-sticky-banner {
        position: static;
        margin-top: 40px;
        transform: none !important;
    }
}


/* ==========================================================================
   5. GRÁFICO ENERGÉTICO (Estilo Escalera)
   ========================================================================== */

.inmo-energy-graph-container {
    font-family: sans-serif;
    max-width: 600px;
    background: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.inmo-energy-header {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: #666;
    text-align: center;
    font-weight: bold;
}

.inmo-energy-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 15px;
    margin-bottom: 6px;
    align-items: center;
    min-height: 32px;
}

.inmo-energy-bar {
    position: relative;
    height: 28px;
    line-height: 28px;
    padding-left: 10px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0,0,0,0.4);
    clip-path: polygon(0% 0%, 85% 0%, 100% 50%, 85% 100%, 0% 100%);
}

.inmo-energy-col {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.inmo-energy-marker {
    background: #000;
    color: #fff;
    font-weight: 800;
    font-size: 1.1em;
    padding: 4px 12px;
    position: relative;
    display: inline-block;
    border-radius: 2px;
    min-width: 50px;
    text-align: center;
    margin-left: 10px;
}

.inmo-energy-marker::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 8px 8px 0;
    border-style: solid;
    border-color: transparent #000 transparent transparent;
}

.bar-A { width: 45%; } .bar-B { width: 53%; } .bar-C { width: 61%; }
.bar-D { width: 69%; } .bar-E { width: 77%; } .bar-F { width: 85%; } .bar-G { width: 100%; }


/* ==========================================================================
   6. SECCIÓN RELACIONADOS
   ========================================================================== */

.inmo-related-section {
    margin-top: 60px;
    padding: 60px 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.inmo-related-title {
    font-size: 2em;
    margin-bottom: 40px;
    color: #001845;
    text-align: center;
}


/* ==========================================================================
   7. SLIDER (SPLIDE) OVERRIDES
   ========================================================================== */
   
#inmo-hero-slider {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.splide__track {
    height: 100%;
}

.splide__list {
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

.splide__slide {
    height: 100% !important;
    width: 100%;
    list-style: none !important;
    margin: 0 !important;
}

.splide__slide img.inmo-slider-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
}
.inmo-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Flechas personalizadas */
.splide__arrow {
    background: rgba(255, 255, 255, 0.9);
    opacity: 1;
    width: 40px;
    height: 40px;
    transition: background 0.3s;
}
.splide__arrow:hover { background: #ffffff; }
.splide__arrow svg { fill: #001845; width: 16px; height: 16px; }
.splide__pagination { bottom: 20px; }
.splide__pagination__page { background: rgba(255,255,255,0.5); margin: 0 4px; }
.splide__pagination__page.is-active { background: #ffffff; transform: scale(1.2); }


/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    /* En tablets y móviles, cambiamos a columna vertical */
    .inmo-single-layout-wrapper {
        display: flex; 
        flex-direction: column-reverse; /* Texto abajo, Foto arriba */
        height: auto !important; 
        overflow: visible;
        grid-template-columns: 1fr;
    }
    
    .inmo-single-col-left {
        width: 100%;
        height: auto;
        overflow-y: visible;
        border-right: none;
    }

    .inmo-single-col-right {
        width: 100%;
        height: 450px !important; /* Altura fija para slider móvil */
        min-height: 300px;
    }
    
    .inmo-content-wrapper { 
        display: block; /* Sidebar debajo del contenido o oculto */
        padding: 20px;
    }
    
    .inmo-content-main { padding: 0; }
    
    /* Ocultar el Sidebar Sticky en móvil si molesta, o dejarlo al final */
    .inmo-content-sidebar { 
        margin-top: 40px; 
    }
    .inmo-sticky-banner {
        position: static; /* Ya no es sticky en móvil */
    }
}


/* ==========================================================================
   9. UBICACIONES DESTACADAS (Grid y Slider Móvil FIX DEFINITIVO)
   ========================================================================== */

/* Estilos Generales (Desktop) */
.inmo-locations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 50px;
    width: 100%;
}

.inmo-loc-card {
    /* IMPORTANTE: position relative para contener el overlay */
    position: relative;
    display: block;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    background-color: #f0f0f0; 
    z-index: 1;
}

/* IMAGEN (EL CAMBIO CLAVE): 
   Ya NO es absolute. Ahora es relative. 
   Esto fuerza a la tarjeta a tener altura física y empujar el contenido de abajo.
*/
.inmo-loc-card img.inmo-loc-bg {
    position: relative !important; /* CAMBIO NUCLEAR */
    display: block;
    width: 100% !important;
    height: auto !important; 
    aspect-ratio: 4/3; /* Mantiene la forma rectangular */
    object-fit: cover;
    z-index: 1;
    transition: transform 0.5s ease;
}

.inmo-loc-card:hover img.inmo-loc-bg { transform: scale(1.1); }

/* Overlay y Contenido (Sobre la imagen) */
.inmo-loc-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 60%);
    z-index: 2;
    pointer-events: none;
}

.inmo-loc-content {
    position: absolute;
    bottom: 25px;
    left: 25px;
    z-index: 3;
    color: #fff;
    text-align: left;
    width: calc(100% - 50px);
}

.inmo-loc-subtitle {
    display: block;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: 400;
}

.inmo-loc-title {
    display: block;
    font-size: 1.8em; 
    font-weight: 400; 
    line-height: 1;
    font-family: serif; 
}


/* RESPONSIVE */

@media (max-width: 900px) {
    .inmo-locations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Slider Horizontal en Móvil (<768px) */
@media (max-width: 768px) {
    .inmo-locations-grid {
        display: flex !important;
        grid-template-columns: none !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 16px;
        /* Un poco de padding abajo para que la sombra de la tarjeta no se corte */
        padding-bottom: 20px; 
        margin-bottom: 40px !important;
        scrollbar-width: none; 
        -webkit-overflow-scrolling: touch;
        align-items: stretch;
    }

    .inmo-locations-grid::-webkit-scrollbar {
        display: none; 
    }

    .inmo-loc-card {
        flex: 0 0 85% !important; /* Ancho fijo */
        width: 85% !important;
        max-width: 320px;
        scroll-snap-align: center;
        margin-right: 0;
        margin-bottom: 0 !important;
        
        /* Aseguramos altura automática basada en la imagen */
        height: auto !important; 
        aspect-ratio: auto !important; /* Dejamos que la imagen mande */
    }
    
    /* Refuerzo para móvil: Imagen sólida */
    .inmo-loc-card img.inmo-loc-bg {
        position: relative !important;
        height: auto !important;
        aspect-ratio: 4/3 !important;
    }
}



.inmo-footer-title {
    color: #66A3E1;
    font-family: "DM Sans", sans-serif;
    font-size: 12.8px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0;
    line-height: 1.2em;
    letter-spacing: 0.5px;
}

ul.inmo-footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.inmo-footer-list li {
    padding: 0;
}

ul.inmo-footer-list li a {
    color: #FDFDFD;
    font-family: "DM Sans", sans-serif;
    font-size: 12.8px;
    text-decoration: none;
    font-weight: 400;
    display: block;
    transition: color 0.3s ease;
}

ul.inmo-footer-list li a:hover {
    color: #66A3E1;
}