@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@400;600;700&display=swap');
@import url('estilos/tokens.css');

.nombre-ciudad {
    font-family: 'Nunito', sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    /* Un poco de sombra ayuda a la lectura */
}

/* --- VARIABLES --- */
:root {
    --primary: #000000;
    /* Azul marino profundo */
    --accent: #ff1616;
    /* Dorado/Arena */
    --accent-hover: #cc0000;
    --red-primary: #dc3545;
    /* Rojo principal */
    --red-hover: #c82333;
    /* Rojo hover */
    --bg-light: #f8f9fa;
    --text-dark: #545454;
    --text-muted: #888888;
}

/* --- GENERAL --- */
body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    color: var(--text-dark);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.card-title,
.navbar-brand,
.section-title,
.hero-title,
.prefooter-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.text-accent {
    color: var(--accent);
}

.section-padding {
    padding: 80px 0;
}

#propiedades {
    padding-top: 40px;
}

/* --- NAVBAR --- */
.navbar {
    background-color: rgba(232, 232, 232, 0.85);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.28s ease, background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
    padding: 10px 0;
    backdrop-filter: blur(5px);
    transform: translateY(0);
}

.navbar.navbar-hidden {
    transform: translateY(-120%);
}

/* ==================================
   ESTILOS DEL LOGO EN LA NAVEGACIÓN
   ================================== */

.logo-link img {
    height: 110px;
    /* Ajustá esta altura según el diseño de tu logo */
    width: fit-content;
    /* Esto hace que el ancho se ajuste solo para no deformar la imagen */
    vertical-align: middle;
    /* Ayuda a que se alinee bien con el resto de los elementos */
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-navbar {
    height: 110px;
    width: fit-content;
    vertical-align: middle;
}

.nav-link {
    color: var(--primary) !important;
    font-weight: 500;
    margin: 0 15px;
    font-size: 0.95rem;
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    color: var(--accent) !important;
}

.nav-link.active {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.nav-link:hover {
    text-decoration: underline;
    /* <--- ESTO ES LO QUE FALTABA */
    text-decoration-thickness: 2px;
    /* Grosor de la línea */
    text-decoration-color: #ee1717dc;
    /* Color de la línea */
    text-underline-offset: 8px;
    /* RECOMENDADO: Separa la línea un poco del texto */
}


.btn-tasar {
    background-color: var(--accent);
    color: white;
    border-radius: 50px;
    padding: 8px 25px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-tasar:hover {
    background-color: var(--accent-hover);
    color: white;
}

/* --- HERO SECTION --- */
.hero-section {
    position: relative;
    height: 90vh;
    /* Ocupa casi toda la pantalla */
    min-height: 600px;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 60px;
    /* Offset del navbar */
    z-index: 1;
    justify-content: flex-start;
    padding-top: 120px;
    padding-bottom: 180px;
    margin-top: 0;
    overflow: visible;
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('Images/Foto_Hero-69.png') center/cover no-repeat;
    z-index: 0;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(220, 53, 69, 0.42) 0%, rgba(220, 53, 69, 0.20) 22%, rgba(220, 53, 69, 0.04) 44%, rgba(220, 53, 69, 0) 66%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.0) 58%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 90%;
    max-width: 900px;
    margin-top: 200px;
}

.hero-title {
    font-size: 3.5rem;
    color: var(--primary);
    /* AHORA ES NEGRO (Elegante sobre crema) */
    font-size: 3rem;
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.6);
    font-weight: 700;
    line-height: 1.2;
}

.hero-content .lead {
    color: #ffffff !important;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 0, 0, 0.5) !important;
    font-weight: 500;
}

/* --- TARJETA TASADOR SUPERPUESTA --- */
.tasador-card-overlay {
    position: absolute;
    bottom: -210px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 90%;
    max-width: 900px;
}

.tasador-card {
    display: flex;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    min-height: 280px;
}

.tasador-card-image {
    width: 35%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px;
}

.tasador-close {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Espaciador que sustituye a los <br> tras el hero; en desktop deja sitio
   a la tarjeta superpuesta que se sale del flujo normal */
.hero-spacer {
    height: 220px;
}

.tasador-card-content {
    width: 65%;
    padding: 35px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tasador-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.3;
}

.tasador-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    text-shadow: none;
}

/* Centrar el título y subtítulo dentro de la tarjeta del tasador */
.tasador-title,
.tasador-subtitle {
    text-align: center;
}

/* El texto pequeño debajo del título */
.hero-content .lead {
    color: white !important;
    /* AHORA ES BLANCO */
    font-weight: 500;
}

.tasador-form .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.tasador-form .input-group-text {
    background: white;
    border: 1px solid #ddd;
    border-right: none;
    color: #999;
}

.tasador-form .form-control {
    border: 1px solid #ddd;
    border-left: none;
    padding: 12px 15px;
}

.tasador-form .form-control:focus,
.tasador-form .form-control:focus-visible {
    box-shadow: none;
    border-color: #ddd;
    outline: none !important;
}

.btn-tasar-ahora {
    background-color: var(--red-primary);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 14px 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.3s;
}

.btn-tasar-ahora:hover {
    background-color: var(--red-hover);
    color: white;
}

/* Tablets y móviles: la tarjeta deja de ser un overlay absoluto y pasa
   al flujo normal debajo del texto del hero, para no recortarlo nunca
   (el offset fijo en px no escalaba con la altura real del viewport) */
@media (max-width: 991.98px) {
    .hero-section {
        height: auto;
        min-height: auto;
        padding-top: 130px;
        padding-bottom: 60px;
    }

    .hero-content {
        margin-top: 0;
    }

    .tasador-card-overlay {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 92%;
        margin: 40px auto 0;
    }

    .hero-spacer {
        height: 0;
    }
}

@media (max-width: 768px) {
    .tasador-card {
        flex-direction: column;
    }

    .tasador-card-image {
        width: 100%;
        height: 170px;
    }

    .tasador-card-content {
        width: 100%;
        padding: 25px;
    }

    .tasador-title {
        font-size: 1.3rem;
    }
}

/* Móviles pequeños: el logo de 110px de la navbar se come casi una
   cuarta parte de la pantalla; lo reducimos y ajustamos el padding del
   hero que lo compensaba para que no quede un hueco vacío debajo */
@media (max-width: 767.98px) {
    .logo-navbar,
    .logo-link img {
        height: 60px;
    }

    .navbar {
        padding: 6px 0;
    }

    .hero-section {
        padding-top: 90px;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.7rem;
    }

    .tasador-title {
        font-size: 1.15rem;
    }
}

/* --- BOTONES CTA --- */
.btn-cta-red {
    background-color: var(--red-primary);
    color: white;
    border-radius: 5px;
    padding: 15px 40px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    transition: 0.3s;
    text-transform: uppercase;
    display: inline-block;
    text-decoration: none;
}

.btn-cta-red:hover {
    background-color: var(--red-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* --- SEARCH BOX --- */
.search-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.search-tabs {
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

/* Featured properties carousel (sliding pages) */
.featured-properties-viewport {
    position: relative;
    overflow: hidden;
    padding-bottom: 20px;
}

#featuredPropertiesTrack {
    display: flex;
    align-items: stretch;
    transition: transform 520ms cubic-bezier(.22,.9,.35,1);
    will-change: transform;
}

#featuredPropertiesTrack.no-transition {
    transition: none !important;
}

.featured-page {
    flex: 0 0 100%;
    box-sizing: border-box;
    padding: 0 8px;
}

.featured-page .row {
    margin: 0;
}

.featured-carousel-btn {
    position: relative;
    z-index: 6;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.06);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.featured-carousel-prev {
    margin-right: 12px;
}

.featured-carousel-next {
    margin-left: 12px;
}

.tab-btn {
    background: none;
    border: none;
    padding-bottom: 10px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-btn.active {
    color: var(--primary);
    border-color: var(--primary);
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.form-select {
    border: 1px solid #eee;
    background-color: #fcfcfc;
    padding: 10px;
}

.btn-search {
    background-color: var(--accent);
    color: white;
    padding: 10px;
    font-weight: 600;
}

.btn-search:hover {
    background-color: var(--accent-hover);
    color: white;
}

/* =========================================
   ESTILOS ROBUSTOS DEL MAPA
   ========================================= */

/* ==============================================
   NUEVO ESTILO TIPO TARJETA PARA MAPA
   ============================================== */

/* La caja blanca que envuelve al mapa */
.card-mapa {
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Sombra muy suave */
    padding: 30px;
    position: relative;
    height: 600px;
    /* Misma altura que la columna derecha */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* El breadcrumb (texto arriba izquierda) */
.map-header .breadcrumb-text {
    font-size: 0.9rem;
    margin-bottom: 0;
    font-family: 'Nunito', sans-serif;
}

/* Ajuste del contenedor SVG dentro de la tarjeta */
.card-mapa .contenedor-mapa {
    width: 80%;
    /* Un poco más pequeño para que respire */
    max-width: 500px;
    margin: 0 auto;
}

/* La flecha negra a la izquierda del mapa */
.nav-arrow-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary);
    /* Negro */
    cursor: pointer;
    padding: 10px;
    opacity: 0.7;
    transition: 0.3s;
}

.nav-arrow-left:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Botón Rojo (Buscar en esta zona) */
.btn-buscar-zona {
    background-color: #dc3545;
    /* Rojo corporativo */
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(255, 22, 22, 0.3);
}

.btn-buscar-zona:hover {
    background-color: var(--primary);
    /* Negro al pasar el ratón */
    transform: translateY(-2px);
}

/* Ajuste de la tarjeta derecha para que coincida en diseño */
.card-provincia-vertical {
    border-radius: 20px;
    /* La altura ya estaba en 600px en tu CSS original, perfecto */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* TITULOS DE SECCIÓN (h2) */
.fw-bold {
    font-weight: 700 !important;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.02em;
    color: var(--primary);
    /* Negro */
}

/* Ajuste Responsive */
@media (max-width: 992px) {
    .card-mapa {
        height: auto;
        min-height: 400px;
    }

    .card-provincia-vertical {
        height: 450px;
    }
}

@media (max-width: 575.98px) {
    .card-provincia-vertical {
        height: 320px;
    }

    .card-info-overlay {
        padding: 25px 20px;
    }

    .card-info-overlay h3 {
        font-size: 1.5rem;
    }
}



.contenedor-mapa {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 1. EL MAPA (ESTADO NORMAL) */
.interactive-map .comarca path {
    align-items: stretch;
    transition: transform 520ms cubic-bezier(.22,.9,.35,1);
    will-change: transform;
}

#featuredPropertiesTrack.no-transition {
    transition: none !important;
}

.featured-page {
    flex: 0 0 100%;
    box-sizing: border-box;
    padding: 0 8px;
}

.featured-page .row {
    margin: 0;
}

.featured-carousel-btn {
    position: relative;
    z-index: 6;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.06);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.featured-carousel-prev {
    margin-right: 12px;
}

.featured-carousel-next {
    margin-left: 12px;
}

.tab-btn {
    background: none;
    border: none;
    padding-bottom: 10px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-btn.active {
    color: var(--primary);
    border-color: var(--primary);
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.form-select {
    border: 1px solid #eee;
    background-color: #fcfcfc;
    padding: 10px;
}

.btn-search {
    background-color: var(--accent);
    color: white;
    padding: 10px;
    font-weight: 600;
}

.btn-search:hover {
    background-color: var(--accent-hover);
    color: white;
}

/* =========================================
   ESTILOS ROBUSTOS DEL MAPA
   ========================================= */

/* ==============================================
   NUEVO ESTILO TIPO TARJETA PARA MAPA
   ============================================== */

/* La caja blanca que envuelve al mapa */
.card-mapa {
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Sombra muy suave */
    padding: 30px;
    position: relative;
    height: 600px;
    /* Misma altura que la columna derecha */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* El breadcrumb (texto arriba izquierda) */
.map-header .breadcrumb-text {
    font-size: 0.9rem;
    margin-bottom: 0;
    font-family: 'Nunito', sans-serif;
}

/* Ajuste del contenedor SVG dentro de la tarjeta */
.card-mapa .contenedor-mapa {
    width: 80%;
    /* Un poco más pequeño para que respire */
    max-width: 500px;
    margin: 0 auto;
}

/* La flecha negra a la izquierda del mapa */
.nav-arrow-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary);
    /* Negro */
    cursor: pointer;
    padding: 10px;
    opacity: 0.7;
    transition: 0.3s;
}

.nav-arrow-left:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Botón Rojo (Buscar en esta zona) */
.btn-buscar-zona {
    background-color: var(--accent);
    /* Rojo corporativo */
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(255, 22, 22, 0.3);
}

.btn-buscar-zona:hover {
    background-color: var(--primary);
    /* Negro al pasar el ratón */
    transform: translateY(-2px);
}

/* Ajuste de la tarjeta derecha para que coincida en diseño */
.card-provincia-vertical {
    border-radius: 20px;
    /* La altura ya estaba en 600px en tu CSS original, perfecto */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* TITULOS DE SECCIÓN (h2) */
.fw-bold {
    font-weight: 700 !important;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.02em;
    color: var(--primary);
    /* Negro */
}

/* Ajuste Responsive */
@media (max-width: 992px) {
    .card-mapa {
        height: auto;
        min-height: 400px;
    }
}



.contenedor-mapa {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 1. EL MAPA (ESTADO NORMAL) */
.interactive-map .comarca path {
    /* Estado base neutro; el JS pinta luego las zonas con propiedades */
    fill: #f11e1e !important;
    opacity: 0.95;
    stroke: #ffffff !important;
    stroke-width: 3.5px;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.18));
    transition: fill 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
    cursor: pointer;
}

/* 2. EL MAPA (HOVER) */
.interactive-map .comarca:hover path {
    opacity: 1;
    filter: brightness(1.04) drop-shadow(0 10px 20px rgba(255, 22, 22, 0.18));
    position: relative;
    z-index: 10;
    fill: var(--accent-hover) !important;
}

/* 3. TEXTOS Y PUNTOS (BLANCOS) */
.interactive-map text,
.interactive-map .nombre-ciudad {
    fill: #ffffff !important;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 18px;
    pointer-events: none;
    /* Para que el click traspase el texto y vaya a la zona */
    text-shadow: 0px 2px 8px rgba(0, 0, 0, 0.9);
    /* Sombra más profunda para legibilidad */
    transition: all 0.3s ease;
}



.interactive-map .punto {
    fill: #ffffff !important;
    pointer-events: none;
    animation: pulsePoint 3s infinite alternate;
}

@keyframes pulsePoint {
    0% {
        r: 5;
        opacity: 0.8;
    }

    100% {
        r: 7;
        opacity: 1;
        filter: drop-shadow(0 0 5px #fff);
    }
}

/* 4. LÍNEAS DE BORDE DECORATIVAS */
.interactive-map .border-line {
    fill: none !important;
    /* Importante: que no tenga fondo */
    stroke: #ffffff !important;
    stroke-width: 2px;
    pointer-events: none;
}

/* --- BOTÓN DEBAJO DEL MAPA --- */
.btn-buscar-zona {
    background-color: #e65540;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(230, 85, 64, 0.4);
    transition: 0.3s;
}

.btn-buscar-zona:hover {
    background-color: #c4271b;
    /* Rojo más oscuro */
    color: white;
    transform: translateY(-2px);
}

/* --- COLUMNA DERECHA: CARD VERTICAL --- */
.card-provincia-vertical {
    position: relative;
    width: 100%;
    height: 600px;
    /* Altura fija para parecer un banner vertical */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-provincia-vertical img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-provincia-vertical:hover img {
    
    /* Zoom suave al pasar el ratón */
}

/* Overlay oscuro abajo para que se lea el texto */
.card-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 40px 30px;
    color: white;
}

.card-info-overlay h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.card-info-overlay p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
    cursor: pointer;
    text-decoration: underline;
}

/* --- Estilos Carrusel Stories --- */

.stories-bar {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    padding: 0 20px;
    gap: 5px;
    z-index: 10;
}

.stories-bar .bar {
    flex: 1;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    /* Fondo grisáceo */
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    /* Necesario para lo de abajo */
}

/* El relleno blanco animado */
.stories-bar .bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    /* Empieza vacío */
    background-color: #ffffff;
    transition: none;
    /* Importante para el reset */
}

/* CLASE 1: Barra activa (Animación de 5 segundos) */
.stories-bar .bar.active::after {
    width: 0%;
    /* Asegura que empiece en 0 */
    animation: fillBar 5s linear forwards;
    /* 5s exactos como el JS */
}

/* CLASE 2: Barra pasada (Ya vista, se queda llena) */
.stories-bar .bar.passed::after {
    width: 100%;
}

/* --- Carrusel Zero-Flash --- */

/* El contenedor asegura que no se salgan */
.stories-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Al fondo */
}

/* Todas las fotos están ahí, pero invisibles */
.story-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Para que no se deformen */
    opacity: 0;
    /* Invisibles por defecto */
    transition: opacity 0.8s ease-in-out;
    /* Transición súper suave de casi 1 segundo */
    z-index: 0;
}

/* La foto activa se vuelve visible */
.story-img.active {
    opacity: 1;
    z-index: 1;
}

/* Definición de la animación */
@keyframes fillBar {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* Flechas laterales */
.nav-arrows {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    pointer-events: none;
    /* Para poder hacer click en la imagen */
}

.nav-arrows i {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    pointer-events: auto;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    opacity: 0.7;
    transition: 0.3s;
}

.nav-arrows i:hover {
    opacity: 1;
}

/* --- PROPERTY CARDS --- */
.featured-properties-shell {
    position: relative;
    padding: 0 3.25rem;
}

.featured-properties-viewport {
    overflow: hidden;
}

.featured-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    z-index: 3;
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.featured-carousel-btn:hover:not(:disabled) {
    background: #000;
    transform: translateY(-50%) scale(1.04);
}

.featured-carousel-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.featured-carousel-prev {
    left: 0;
}

.featured-carousel-next {
    right: 0;
}

.featured-carousel-footer {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.featured-carousel-counter {
    font-size: 0.9rem;
    color: #666;
    letter-spacing: 0.02em;
}

.featured-property-card {
    height: 100%;
}

.featured-property-card .card-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.featured-property-card .card-title-link:hover .card-title {
    color: #555;
}

.featured-property-card .card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #1a1a1a;
    letter-spacing: 0;
}

@media (max-width: 991.98px) {
    .featured-properties-shell {
        padding: 0 2rem;
    }
}

@media (max-width: 767.98px) {
    .featured-properties-shell {
        padding: 0 1rem;
    }

    .featured-carousel-btn {
        width: 2.75rem;
        height: 2.75rem;
    }
}

.property-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.property-card:hover .card-img-top {
    
}

.badge-status {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary);
    color: white;
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
    z-index: 2;
}

.price-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: white;
    color: var(--primary);
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.property-features {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- CTA TASADOR --- */
.cta-section {
    background-color: var(--primary);
    padding: 80px 0;
}

.cta-section-white {
    background-color: #ffffff;
    padding: 80px 0;
}

.btn-tasar-red {
    background-color: var(--red-primary);
    color: white;
    font-weight: bold;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-tasar-red:hover {
    background-color: var(--red-hover);
    color: white;
}

.btn-accent {
    background-color: var(--accent);
    color: white;
    font-weight: bold;
    border: none;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    color: white;
}

/* --- CONTACTO --- */
.icon-box {
    width: 40px;
    height: 40px;
    background-color: var(--color-bg-icon);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-social {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-bg-icon);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition-base);
}

.btn-social:hover {
    background-color: var(--color-primary);
    color: white;
}

/* --- FORMULARIO DE CONTACTO PREMIUM --- */
.contact-form-container {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
}

.contact-form-container:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-5px);
}

.contact-form .form-label {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.contact-form .form-control {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.contact-form .form-control:focus {
    background: #fff;
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus-accent);
    outline: none;
}

.btn-submit-premium {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    padding: 14px 30px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    margin-top: 15px;
    transition: var(--transition-base);
    box-shadow: 0 4px 15px rgba(255, 22, 22, 0.3);
}

.btn-submit-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 22, 22, 0.4);
    filter: brightness(1.1);
}

.btn-submit-premium:active {
    transform: translateY(0);
}

/* iOS hace zoom automático en cualquier input con font-size < 16px al
   enfocarlo; el formulario de contacto usaba 0.95rem (~15.2px) */
@media (max-width: 767.98px) {
    .contact-form .form-control {
        font-size: 16px;
    }
}

/* --- PRE-FOOTER CON IMAGEN --- */
.prefooter-section {
    position: relative;
    background-image: url('Images/footer.jpg');
    background-size: cover;
    background-position: center;
    padding: 40px 0;
    min-height: 220px;
}

.prefooter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0.7) 100%);
}

.prefooter-content {
    position: relative;
    z-index: 1;
}

.prefooter-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    letter-spacing: 0.02em;
}

.prefooter-text {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 20px;
    max-width: 500px;
}

/* Justify paragraphs so text blocks look neat */
.prefooter-text,
.prefooter-text-right {
    text-align: justify;
}
/* Right column paragraph alignment for larger screens */
.prefooter-text-right {
    text-align: right;
    margin-bottom: 0;
    max-width: 520px;
}

/* Centered contact row styling */
.prefooter-contact-row .prefooter-contacto-item {
    color: var(--text-dark);
    font-size: 0.95rem;
}

.prefooter-contact-row .prefooter-contacto-item i {
    font-size: 1.05rem;
    color: var(--text-dark);
}

@media (max-width: 991px) {
    .prefooter-text-right {
        text-align: left;
        margin-top: 15px;
    }
    .prefooter-top {
        gap: 20px;
    }
    .prefooter-section {
        padding: 30px 0;
    }
}

/* Tablets/móviles: el bloque de contacto ya no entra en una sola fila
   (los dos teléfonos + el email se quedaban sin espacio y el texto se
   partía en varias líneas sin centrar). Lo apilamos en columna. */
@media (max-width: 767.98px) {
    .prefooter-contact-row {
        flex-direction: column;
        align-items: center;
        gap: 14px !important;
    }

    .prefooter-contact-row .prefooter-contacto-item {
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }

    .prefooter-contact-row .prefooter-contacto-item span {
        margin-left: 0 !important;
        word-break: break-word;
    }
}

.btn-ver-detalles {
    background-color: #333;
    color: white;
    padding: 10px 25px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-ver-detalles:hover {
    background-color: #555;
    color: white;
}

.prefooter-contacto-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.prefooter-contacto-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #333;
    font-size: 0.95rem;
}

.prefooter-contacto-item i {
    width: 20px;
    text-align: center;
    color: #555;
}

/* --- FOOTER CLARO (3 columnas) --- */
.footer-light {
    position: relative;
    background-image: url('Images/footer.jpg');
    background-size: cover;
    background-position: center;
    padding: 48px 0 28px;
    color: #333;
}

/* Overlay blanco para que el footer sea claro y continúe con el prefooter */
.footer-light::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    z-index: 0;
}

.footer-light > * {
    position: relative;
    z-index: 1;
}

/* Títulos de columna */
.footer-col-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #333;
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* Lista de enlaces de columna */
.footer-col-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col-list li {
    margin-bottom: 10px;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 0.9rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.25s;
}

.footer-link i {
    color: #c09b6e;
    font-size: 0.85rem;
    width: 14px;
    text-align: center;
}

.footer-link:hover {
    color: #c09b6e;
}

/* Columna del logo dentro del footer */
.footer-brand-col {
    display: flex;
    align-items: flex-start;
}

.footer-brand-col .footer-brand {
    display: inline-block;
}

/* Fila de contacto + redes (reutiliza .prefooter-contact-row) dentro del footer */
.footer-light .prefooter-contact-row {
    margin-top: 4px;
}

.footer-social {
    color: #555;
    font-size: 1.05rem;
    font-family: 'Nunito', sans-serif;
    margin: 0 8px;
    transition: color 0.25s;
}

/* Iconos de redes junto al contacto */
.footer-social-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Separador + copyright centrado */
.footer-divider {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin: 26px 0 16px;
}

.footer-copy {
    text-align: center;
    color: #777;
    font-size: 0.78rem;
    font-family: 'Nunito', sans-serif;
    letter-spacing: 0.01em;
    margin: 0;
}

/* Móvil: columnas y logo apilados y centrados */
@media (max-width: 767.98px) {
    .footer-light {
        padding: 36px 0 24px;
        text-align: center;
    }

    .footer-brand-col {
        justify-content: center;
        margin-bottom: 24px;
    }

    .footer-col {
        margin-bottom: 28px;
    }

    .footer-link {
        justify-content: center;
    }

    .footer-social-group {
        justify-content: center;
        margin-top: 6px;
    }
}

/* Header completo: enlaces y navegación con tipografía de lectura */
.navbar,
.navbar .nav-link,
.navbar .btn,
.navbar .dropdown-menu,
.navbar .dropdown-item {
    font-family: 'Nunito', sans-serif;
}

.footer-social:hover {
    color: #c09b6e;
}

/* --- CHATBOT --- */
.chatbot-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s;
}

.chatbot-btn:hover {
    transform: scale(1.1);
}

/* En iPhones con barra de gestos (home indicator) el botón flotante
   quedaba pegado al borde inferior; respetamos el safe-area de iOS y
   lo reducimos un poco para que no tape contenido en pantallas pequeñas */
@media (max-width: 575.98px) {
    .chatbot-btn {
        width: 52px;
        height: 52px;
        font-size: 26px;
        bottom: max(16px, env(safe-area-inset-bottom));
        right: 16px;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .search-box {
        padding: 20px;
    }

    .map-container-shadow {
        height: auto;
        display: block;
    }

    .zone-list {
        height: auto;
        max-height: 200px;
    }

    .map-view {
        height: 300px;
    }
}

#autocomplete-results {
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    cursor: pointer;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
    color: #e63946;
    /* Color corporativo si tienes uno */
}

/* Evitar que el dropdown se oculte detrás de otros elementos */
.position-relative {
    position: relative;
}

/* Estilos para el dropdown flotante del autocompletado */
#autocomplete-results-floating {
    position: absolute;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    max-height: 280px;
    max-height: 520px;
    /* espacio para ~10 items */
    z-index: 3000;
}

#autocomplete-results-floating .list-group-item {
    padding: 10px 14px;
    font-size: 0.95rem;
    line-height: 1.2;
}

/* Asegurar que los elementos list-group-action se vean bien */
.list-group-item-action:hover {
    background-color: rgba(230, 230, 230, 0.6);
}

/* === Accesibilidad === */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: #1a1a1a;
    color: #fff;
    padding: 10px 20px;
    z-index: 10000;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0 0 6px 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

:focus-visible {
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible,
a:focus-visible {
    outline: 3px solid #1a1a1a !important;
    outline-offset: 2px;
    box-shadow: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.footer-brand img {
    height: 160px;
    width: auto;
}

@media (max-width: 767.98px) {
    .footer-brand img {
        height: 90px;
    }
}
/* Reglas para las hojas del mapa interactivo */
.map-region-clickable path, path.map-region-clickable {
    pointer-events: auto !important;
}

input.has-selection::placeholder {
    color: #212529 !important;
    opacity: 1;
}

svg.interactive-map {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Territorios SIN propiedades */
.interactive-map .no-properties path {
    fill: #ff9393 !important; /* Rojo blanquecino */
    opacity: 0.72;
}
.interactive-map .no-properties:hover path {
    fill: #ff9393 !important;
    opacity: 0.82;
}

/* Tooltip de zona en mapa */
.map-tooltip {
    position: fixed;
    background: rgba(18, 18, 18, 0.88);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 12px));
    z-index: 9999;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ==================================
   SECCIÓN DE CONTACTO (formulario)
   ================================== */
.contact-form-section {
    background-color: #f8f9fa;
}

.contact-location-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background-color: #ffdad9;
    color: #92001f;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
}

.contact-info-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #e7e8e9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.1rem;
}

.contact-info-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
}

.contact-info-value {
    font-weight: 700;
    color: var(--accent);
}

.contact-card {
    background-color: #ffffff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px -10px rgba(220, 53, 69, 0.18);
    max-width: 540px;
    margin-left: auto;
}

.contact-card-title {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-size: 1.8rem;
}

.contact-card .form-control {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid #cfc4c5;
}

.contact-card .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.25rem rgba(255, 22, 22, 0.1);
}

.btn-contact-submit {
    padding: 0.9rem 1.5rem;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 8px 16px -4px rgba(220, 53, 69, 0.28);
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.btn-contact-submit:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

@media (max-width: 991.98px) {
    .contact-card {
        margin-left: 0;
    }
}
