/*
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/* Add your custom styles here */
.caracteristicas-listado .elementor-icon-list-items{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Crea 2 columnas iguales */
    gap: 5px 0px; /* Espaciado: 12px arriba/abajo y 24px entre columnas */
    list-style: none; /* Quita los puntos por defecto si los hubiera */
    padding: 0;
    margin: 0;
}


/* Adaptación para móviles (pantallas menores de 768px) */
@media (max-width: 767px) {
    .caracteristicas-listado  .elementor-icon-list-items {
        grid-template-columns: 1fr; /* Pasa a 1 sola columna en móvil */
        gap: 5px;
    }
}

/* Off-canvas filtros viviendas (contenedor atomic Elementor 4) */
@media (max-width: 767px) {
    /* Contenedor filtros en single promoción (data-id 4bdecd0). */
    .elementor-element-4bdecd0,
    .mattec-filters-offcanvas-panel {
        position: fixed !important;
        top: 0;
        left: 0;
        width: min(320px, 86vw) !important;
        max-width: min(320px, 86vw) !important;
        min-width: 0 !important;
        height: 100%;
        height: 100dvh;
        margin: 0 !important;
        padding: 16px 20px 24px !important;
        z-index: 10001;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #fff;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        flex: none !important;
        inset-block-start: 0 !important;
        inset-inline-start: 0 !important;
    }

    .admin-bar .elementor-element-4bdecd0,
    .admin-bar .mattec-filters-offcanvas-panel {
        top: 46px;
        height: calc(100% - 46px);
        height: calc(100dvh - 46px);
    }

    .elementor-element-4bdecd0.mattec-filters-open,
    .mattec-filters-offcanvas-panel.mattec-filters-open {
        transform: translateX(0);
    }

    .mattec-filters-trigger-bar {
        display: flex;
        width: 100%;
        max-width: 100%;
        padding: 0 0 16px;
        flex: 0 0 100%;
    }

    .mattec-filters-trigger {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        border: 1px solid #1a1a1a;
        border-radius: 4px;
        background: #fff;
        color: #1a1a1a;
        font: inherit;
        cursor: pointer;
        line-height: 1.2;
    }

    .mattec-filters-trigger__icon,
    .mattec-filters-close__icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mattec-filters-close {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin: 0 0 16px;
        padding: 10px 0;
        border: 0;
        border-bottom: 1px solid #e5e5e5;
        background: transparent;
        color: #1a1a1a;
        font: inherit;
        cursor: pointer;
        text-align: left;
    }

    .mattec-filters-offcanvas-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10000;
        background: rgba(0, 0, 0, 0.45);
    }

    body.mattec-filters-offcanvas-active {
        overflow: hidden;
    }

    body.mattec-filters-offcanvas-active .mattec-filters-offcanvas-overlay {
        display: block;
    }
}

@media (min-width: 768px) {
    .mattec-filters-trigger-bar,
    .mattec-filters-close,
    .mattec-filters-offcanvas-overlay {
        display: none !important;
    }
}

/* Galería Elementor → slider + thumbs en responsive (viviendas) */
@media (max-width: 768px) {
    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always):has(.mattec-gallery-slider-wrap) .elementor-gallery__container,
    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always):has(.mattec-gallery-slider-wrap) .elementor-gallery__titles-container {
        display: none !important;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-slider-wrap {
        width: 100%;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-main {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Altura dinámica al slide activo (vídeo 9:16 vs imágenes landscape). */
    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-main.swiper-autoheight .swiper-wrapper {
        transition: height 0.28s ease;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-main .swiper-slide {
        display: flex;
        align-items: center;
        justify-content: center;
        height: auto;
        background: #f5f5f5;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-slide-link {
        display: block;
        width: 100%;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-main .swiper-slide img {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 2;
        object-fit: cover;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-thumbs .swiper-slide {
        opacity: 0.55;
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-thumbs .swiper-slide-thumb-active {
        opacity: 1;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-thumbs .swiper-slide img {
        display: block;
        width: 100%;
        height: 64px;
        object-fit: cover;
        border-radius: 2px;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-main .swiper-button-prev,
    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-main .swiper-button-next {
        color: #1a1a1a;
    }

    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-main .swiper-button-prev::after,
    .elementor-widget-gallery.mattec-gallery-slider-active:not(.mattec-gallery-slider-always) .mattec-gallery-main .swiper-button-next::after {
        font-size: 22px;
    }
}

/* Listado portfolio (#listado-portfolio): slider en todas las resoluciones */
#listado-portfolio .elementor-widget-gallery.mattec-gallery-slider-active:has(.mattec-gallery-slider-wrap) .elementor-gallery__container,
#listado-portfolio .elementor-widget-gallery.mattec-gallery-slider-active:has(.mattec-gallery-slider-wrap) .elementor-gallery__titles-container {
    display: none !important;
}

#listado-portfolio .mattec-gallery-slider-wrap {
    display: block !important;
    width: 100%;
}

#listado-portfolio .mattec-gallery-main {
    width: 100%;
    margin-bottom: 10px;
}

#listado-portfolio .mattec-gallery-main.swiper-autoheight .swiper-wrapper {
    transition: height 0.28s ease;
}

#listado-portfolio .mattec-gallery-main .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    background: #f5f5f5;
}

#listado-portfolio .mattec-gallery-slide-link {
    display: block;
    width: 100%;
}

#listado-portfolio .mattec-gallery-main .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

#listado-portfolio .mattec-gallery-thumbs .swiper-slide {
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

#listado-portfolio .mattec-gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
}

#listado-portfolio .mattec-gallery-thumbs .swiper-slide img {
    display: block;
    width: 100%;
    height: 64px;
    object-fit: cover;
    border-radius: 2px;
}

#listado-portfolio .mattec-gallery-main .swiper-button-prev,
#listado-portfolio .mattec-gallery-main .swiper-button-next {
    color: #ffffff;
}
#listado-portfolio .mattec-gallery-main .swiper-button-prev:hover,
#listado-portfolio .mattec-gallery-main .swiper-button-next:hover {
    color: #1a1a1a;
}

#listado-portfolio .mattec-gallery-main .swiper-button-prev::after,
#listado-portfolio .mattec-gallery-main .swiper-button-next::after {
    font-size: 22px;
}

#listado-portfolio .elementor-widget-gallery.mattec-gallery-slider-active .mattec-gallery-video-hero {
    display: none !important;
}

#listado-portfolio .mattec-gallery-main .swiper-slide video,
#listado-portfolio .mattec-gallery-slide-video {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: auto;
}

@media (min-width: 769px) {
    .mattec-gallery-slider-wrap {
        display: none !important;
    }

    #listado-portfolio .mattec-gallery-slider-wrap {
        display: block !important;
    }
}

/* Vídeo hero: 100% ancho, relación de aspecto natural del archivo */
.elementor-widget-gallery .mattec-gallery-video-hero {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
    line-height: 0;
}

.mattec-gallery-hero-video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .elementor-widget-gallery.mattec-gallery-slider-active .mattec-gallery-video-hero {
        display: none !important;
    }

    .mattec-gallery-main .swiper-slide video,
    .mattec-gallery-slide-video {
        display: block;
        width: 100% !important;
        max-width: 100%;
        height: auto;
    }
}

.mattec-gallery-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.mattec-gallery-video-play::before {
    content: '▶';
    margin-left: 2px;
}

.mattec-gallery-thumb-video {
    position: relative;
    width: 100%;
    height: 64px;
    overflow: hidden;
    background: #1a1a1a;
}

.mattec-gallery-thumb-video img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mattec-gallery-thumb-video .mattec-gallery-video-play {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.mattec-gallery-slide-video {
    display: block;
    width: 100%;
    height: auto;
}

/* Truncate en shortcodes [get-meta] / [get-portfolio-metas] */
.mattec-meta-truncate {
    overflow: hidden;
}

.mattec-meta-truncate--1 {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mattec-meta-truncate--2,
.mattec-meta-truncate--3,
.mattec-meta-truncate--4,
.mattec-meta-truncate--5,
.mattec-meta-truncate--6,
.mattec-meta-truncate--7,
.mattec-meta-truncate--8,
.mattec-meta-truncate--9,
.mattec-meta-truncate--10 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mattec-meta-truncate--2 { -webkit-line-clamp: 2; line-clamp: 2; }
.mattec-meta-truncate--3 { -webkit-line-clamp: 3; line-clamp: 3; }
.mattec-meta-truncate--4 { -webkit-line-clamp: 4; line-clamp: 4; }
.mattec-meta-truncate--5 { -webkit-line-clamp: 5; line-clamp: 5; }
.mattec-meta-truncate--6 { -webkit-line-clamp: 6; line-clamp: 6; }
.mattec-meta-truncate--7 { -webkit-line-clamp: 7; line-clamp: 7; }
.mattec-meta-truncate--8 { -webkit-line-clamp: 8; line-clamp: 8; }
.mattec-meta-truncate--9 { -webkit-line-clamp: 9; line-clamp: 9; }
.mattec-meta-truncate--10 { -webkit-line-clamp: 10; line-clamp: 10; }

