/* =========================================================
   EDELWEISS PROPERTIES - ESTILOS DEL SHORTCODE
   ========================================================= */

/* Nuestro contenedor padre (et_pb_row equivalente). 
   Lo forzamos a flexbox para disponer las columnas */
.edelweiss-properties-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 3%;
    row-gap: 30px;
    width: 100%;
}

/* Redefinimos los anchos de columna para sobreescribir posibles conflictos con Divi fuera de su loop */
.edelweiss-properties-grid .edelweiss-property-card.et_pb_column_1_3 {
    width: 31.333333%;
    margin-right: 0 !important;
    margin-bottom: 20px;
}

/* Título de la tarjeta, heredamos tipografía de Divi pero aseguramos peso y color */
.edelweiss-properties-grid h4 {
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 10px;
    margin-top: 7px; /* Reducido a la mitad (antes 15px) */
    color: #333;
}

/* Alineación de iconos e información */
.edelweiss-properties-grid .et_pb_text_inner p {
    font-size: 16px;
    color: #666;
    /* Hemos retirado display:flex para permitir que vertical-align: baseline funcione en los iconos */
}

/* Para que la imagen ocupe de manera regular todo el card */
.edelweiss-properties-grid .et_pb_image_wrap img {
    width: 100%;
    height: 250px;       /* Altura uniforme para que todas las casas cuadren en el grid */
    object-fit: cover;   /* Recorta la imagen protegiendo la relación de aspecto */
    border-radius: 4px;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.edelweiss-properties-grid .et_pb_image_wrap {
    overflow: hidden;    /* Necesario junto con el border radius y la escala */
    display: block;
    border-radius: 4px;
    background-color: #f7f7f7;
}

/* Reducir el margen inferior del módulo imagen de Divi en las tarjetas */
.edelweiss-properties-grid .et_pb_module.et_pb_image {
    margin-bottom: 10px !important; /* Divi pone ~20px por defecto, lo reducimos a la mitad */
}

/* Efecto hover ligero premium sobre la imagen */
.edelweiss-properties-grid .et_pb_image_wrap:hover img {
    transform: scale(1.05);
    opacity: 0.95;
    cursor: pointer;
}

/* ------- RESPONSIVE ------- */
@media screen and (max-width: 980px) {
    /* Tablet: Pasamos a 2 columnas */
    .edelweiss-properties-grid .edelweiss-property-card.et_pb_column_1_3 {
        width: 48%;
    }
}

@media screen and (max-width: 767px) {
    /* Móvil: Pasamos a 1 columna completa */
    .edelweiss-properties-grid .edelweiss-property-card.et_pb_column_1_3 {
        width: 100%;
    }
}

/* =========================================================
   EDELWEISS PROPERTIES - FICHA INDIVIDUAL
   ========================================================= */

.edelweiss-ficha-container {
    width: 100%;
}

.edelweiss-ficha-hero {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
    background-color: transparent !important;
}

.edelweiss-hero-image img {
    width: 100%;
    max-height: 700px;
    object-fit: cover;
    display: block;
}

.edelweiss-hero-title-box {
    background-color: #981c31 !important; /* Granate sólido exacto */
    padding: 26px 50px;
    margin: -50px auto 0 auto;
    position: relative;
    max-width: 80%;
    z-index: 10;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.edelweiss-hero-title-box h1 {
    color: #ffffff !important;
    margin: 0;
    font-family: 'Alumni Sans', Helvetica, Arial, Lucida, sans-serif;
    font-size: 40px;
    font-weight: 300;
    letter-spacing: 1px;
}

.edelweiss-hero-details {
    padding: 30px 10%;
    text-align: center;
}

.edelweiss-hero-details h5.lp-h5 {
    color: #b22234;
    font-size: 26px;
    margin-bottom: 5px;
    margin-top: 0;
}

.edelweiss-hero-details h2.lp-h2 {
    font-size: 18px;
    color: #666;
    margin-bottom: 25px;
    font-weight: 400;
}

.edelweiss-ficha-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.edelweiss-ficha-icons .icon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    color: #444;
}

.edelweiss-ficha-desc {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

/* Galeria de Fotos Grid */
.edelweiss-ficha-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.edelweiss-ficha-gallery .gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.edelweiss-ficha-gallery .gallery-item:hover img {
    transform: scale(1.03);
    opacity: 0.9;
    cursor: pointer;
}

/* Responsive */
@media screen and (max-width: 767px) {
    .edelweiss-hero-title-box {
        max-width: 95%;
        padding: 20px;
        margin-top: -30px;
    }
    .edelweiss-hero-title-box h1 {
        font-size: 24px;
    }
    .edelweiss-ficha-icons {
        gap: 15px;
        flex-direction: column;
        align-items: center;
    }
}

/* =========================================================
   ESTILOS FILAS DESCRIPCION / UBICACION / ESTADO
   ========================================================= */

.et_pb_with_border {
    border-top: 2px dotted #898989 !important;
    border-bottom: 2px dotted #898989 !important;
    padding: 25px 0 !important;
    margin-top: -2px !important; /* Superpone los bordes inferiores de las filas contiguas */
}

.edelweiss-row-title {
    font-family: ''Alumni Sans'', Helvetica, Arial, Lucida, sans-serif;
    font-size: 29px !important;
    font-weight: 500 !important;
    color: #333333;
    text-transform: uppercase;
    text-align: right;
    margin: 0;
    line-height: 1.2;
}

.edelweiss-row-content p, .edelweiss-row-content {
    font-family: ''Carrois Gothic'', Helvetica, Arial, Lucida, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #666666;
    text-align: justify;
    line-height: 1.6;
}

.edelweiss-text-estado {
    color: #981C31 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
}

@media screen and (max-width: 980px) {
    .edelweiss-row-title {
        text-align: left;
        margin-bottom: 15px;
    }
}

/* Fondo de la seccion de Descripcion */
.edelweiss-ficha-body {
    background-color: #efefef !important;
    padding: 100px 0 !important;
}

/* Modificacion especifica para asegurar fuentes sobre defaults del Theme Divi */
.edelweiss-row-title {
    font-family: 'Alumni Sans', Helvetica, Arial, sans-serif !important;
    font-size: 29px !important;
    font-weight: 500 !important;
    color: #333333 !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
}

.edelweiss-row-content p, .edelweiss-row-content {
    font-family: 'Carrois Gothic', Helvetica, Arial, sans-serif !important;
    font-size: 16px !important;
    color: #666666 !important;
    line-height: 1.6 !important;
}

/* Fuerzo el ancho de las filas interiores para que coincidan con la vista orignal ampliada */
.edelweiss-ficha-body .et_pb_row {
    width: 80% !important;
    max-width: 2560px !important;
}

/* =========================================================
   ESTILOS PRECIO DIRECCION E ICONOS CABECERA
   ========================================================= */

h5.edelweiss-h5-precio {
    font-family: 'Carrois Gothic', sans-serif !important;
    font-size: 28px !important;
    color: #333333 !important;
    font-weight: 500 !important;
    text-align: center !important;
    padding-bottom: 10px !important;
    margin: 0 !important;
}

h2.edelweiss-h2-direccion {
    font-family: 'Alumni Sans', sans-serif !important;
    font-size: 50px !important;
    color: #981C31 !important;
    font-weight: 500 !important;
    line-height: 50px !important;
    text-align: center !important;
    padding-bottom: 10px !important;
    margin: 0 0 15px 0 !important;
}

.edelweiss-ficha-icons-inline p {
    font-family: 'Carrois Gothic', sans-serif !important;
    font-size: 16px !important;
    color: #666666 !important;
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
}

.edelweiss-ficha-icons-inline img {
    vertical-align: middle !important;
    margin-bottom: 3px !important;
}

/* =========================================================
   ESTILOS SLIDER HERO SECTION
   ========================================================= */

.edelweiss-hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f5f5f5; /* Fondo neutral mientras carga */
}

.edelweiss-slider-track {
    display: flex;
    width: 100%;
    /* No flex wrap, los slides estan absolutos con display block/none controlados via JS */
}

.edelweiss-slide {
    width: 100%;
}

.edelweiss-slide img {
    width: 100%;
    height: 650px !important; /* Altura fija en escritorio */
    object-fit: cover;
    object-position: center center;
    display: block;
    animation: fadeIn 0.4s;
}

/* Forzar reset de padding que trae Divi por defecto en .et_pb_section */
.edelweiss-ficha-hero {
    padding: 0 !important;
}

/* Botones de control del Slider */
.edelweiss-slider-btn {
    position: absolute;
    top: calc(50% - 35px);
    background-color: rgba(255, 255, 255, 0.7);
    color: #981C31;
    border: none;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    z-index: 20;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 4px;
}

.edelweiss-slider-btn:hover {
    background-color: #981C31 !important;
    color: #ffffff !important;
}

.edelweiss-slider-prev {
    left: 20px;
}

.edelweiss-slider-next {
    right: 20px;
}

/* Animacion transversal */
@keyframes fadeIn {
    from { opacity: 0.8; } /* Transición suave en vez de flash */
    to { opacity: 1; }
}

/* Anulamos la hero-image antigua que sobreescribimos */
.edelweiss-hero-image {
    display: none;
}

/* =========================================================
   ESTILO BOTON "ME INTERESA"
   ========================================================= */

.edelweiss-boton-interesa {
    display: inline-block !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    font-family: 'Alumni Sans', sans-serif !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 5px !important;
    padding: 8px 18px !important;
    border-radius: 0px !important;
    border: none !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    line-height: 30px !important;
    cursor: pointer;
}

.edelweiss-boton-interesa:hover {
    background-color: #981C31 !important;
    color: #ffffff !important;
}

/* =========================================================
   ESTILOS LISTADO DE PROPIEDADES (GRID PRINCIPAL)
   ========================================================= */

.edelweiss-properties-grid {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.edelweiss-property-card .et_pb_image_wrap img {
    width: 100% !important;
    aspect-ratio: 3 / 2 !important;
    object-fit: cover !important;
    display: block !important;
}

/* Expansión forzada de la fila Padre original de Divi que encapsule nuestro script */
.et_pb_row:has(.edelweiss-properties-grid) {
    width: 80% !important;
    max-width: 2560px !important;
}

/* 2. Hacer que las fotos del listado sean 100% responsivas y mantengan el ratio 3:2 */
.edelweiss-properties-grid .et_pb_image_wrap img {
    width: 100% !important;
    height: auto !important; /* Elimina los 250px fijos heradados de versiones antiguas */
    aspect-ratio: 3 / 2 !important; /* Forza la proporción horizontal del original */
    object-fit: cover !important;
    border-radius: 0px !important; /* Bordes rectos como en el modelo */
    display: block !important;
}

/* 3. Asegurar que el contenedor de la imagen no corte el contenido */
.edelweiss-properties-grid .et_pb_image_wrap {
    height: auto !important;
    border-radius: 0px !important;
}

/* =========================================================
   ESTILOS TIPOGRAFIA TARJETAS PROPIEDAD
   ========================================================= */

.edelweiss-property-card h4 {
    color: #981c31 !important;
    font-family: 'Carrois Gothic', Helvetica, Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 18px !important;
    text-transform: uppercase !important;
    text-align: left !important;
    margin-bottom: 0px !important;
    padding-bottom: 10px !important;
}

.edelweiss-property-card p {
    color: #666666 !important;
    font-family: 'Carrois Gothic', Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 23.8px !important;
    text-align: left !important;
}

/* Alineacion exacta de iconos pie de tarjeta base */
.edelweiss-property-card p img {
    display: inline !important;
    vertical-align: baseline !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Selector estilos */
.edelweiss-filter-select {
    width: 100%;
    background-color: #e5e5e5;
    border: none;
    color: #666666;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    padding-left: 10px; /* Para que no se pegue totalmente al borde del cajetín negro/gris */
    text-transform: uppercase;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

@media screen and (max-width: 767px) {
    .edelweiss-slide img {
        height: 100vw !important; /* Proporción cuadrada: alto = ancho de pantalla */
        object-position: center center;
    }
}
