/* ========================================
   CONTENEDOR
======================================== */

.pcorp-projects {
    width: 100%;
}


/* ========================================
   FILTROS NORMALES
======================================== */

.pcorp-filters {
    position: relative;
    z-index: 100;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    width: 100%;

    margin: 0 0 40px;
    padding: 18px 0;

    background: #fff;
    border-bottom: 1px solid rgb(0 0 0 / 8%);
}


/* ========================================
   ESTADO FIJO
======================================== */

.pcorp-filters.is-fixed {
    position: fixed !important;

    top: 80px !important;
    left: 0 !important;
    right: 0 !important;

    width: 100% !important;
    box-sizing: border-box;

    z-index: 99990;

    margin: 0 !important;

    padding: 30px max(
        calc((100vw - 1200px) / 2),
        30px
    );

    background: #fff;

    border-bottom: 1px solid rgba(0, 0, 0, .08);

    box-shadow:
        0 4px 12px rgba(0, 0, 0, .05);
}


/* ========================================
   PLACEHOLDER
======================================== */

.pcorp-filter-placeholder {
    display: none;
    width: 100%;
}

.pcorp-filter-placeholder.is-active {
    display: block;
}

.pcorp-filter {
    appearance: none;
    border: 1.5px solid transparent;
    background: #f7f7f7;
    color: #4b5563;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter';
    line-height: 16px;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.pcorp-filter:hover {
    transform: translateY(-1px);
}

.pcorp-filter.is-active {
    background: #b91f3b;
    color: #fff;
}


/* ========================================
   GRID
======================================== */

.pcorp-grid {
    display: grid;
    gap: 15px;
}

.pcorp-grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pcorp-grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pcorp-grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}


/* ========================================
   TARJETAS
======================================== */

.pcorp-card {
    min-width: 0;
}

.pcorp-card-media {
    position: relative;
    aspect-ratio: 1.12 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #eee;
    cursor: pointer;
}

.pcorp-card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition:
        transform .45s ease,
        filter .35s ease;
}


/* Degradado inferior permanente */

.pcorp-card-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 42%,
            rgba(0, 0, 0, .18) 58%,
            rgba(0, 0, 0, .88) 100%
        );
    transition: background .35s ease;
}


/* ========================================
   INFORMACIÓN
======================================== */

.pcorp-card-content {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 15px;
    z-index: 3;
}

.pcorp-card-category {
    color: #db0032;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    margin-bottom: 4px;
    font-family: 'Inter';
}

.pcorp-card-title {
    margin: 0 0 3px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 19px;
    text-transform: unset;
    font-family: 'Inter';
}

.pcorp-card-location {
    color: rgba(255, 255, 255, .65);
    font-size: 12px;
    line-height: 16px;
    font-family: 'Inter';
}


/* ========================================
   BOTÓN HOVER
======================================== */

.pcorp-card-hover {
    position: absolute;
    inset: 0;
    z-index: 4;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.pcorp-detail-button {
    appearance: none;
    border: 0;
    background: #b91f3b;
    color: #fff;

    padding: 11px 20px;
    border-radius: 5px;

    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter';

    cursor: pointer;

    transform: translateY(8px);

    transition:
        transform .3s ease,
        background-color .25s ease;
}

.pcorp-detail-button:hover {
    background: #b91f3b;
}

/* ========================================
   MODAL - BLOQUEO DE PÁGINA
======================================== */

html.pcorp-modal-open,
body.pcorp-modal-open {
    overflow: hidden !important;
}

.pcorp-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 22px;
}

.pcorp-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, .76);
    backdrop-filter: blur(5px);
}


/* ========================================
   CAJA PRINCIPAL
======================================== */

.pcorp-modal-shell {
    position: relative;
    z-index: 2;

    width: min(1000px, 90vw);
    max-height: 90vh;

    background: #fff;
    border-radius: 8px;

    overflow: hidden;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, .35);
}

.pcorp-modal-scroll {
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: #b91f3b transparent;
}

.pcorp-modal-scroll::-webkit-scrollbar {
    width: 4px;
}

.pcorp-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.pcorp-modal-scroll::-webkit-scrollbar-thumb {
    background: #c31d3b;
    border-radius: 10px;
}


/* ========================================
   CERRAR
======================================== */

.pcorp-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 20;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    margin: 0 !important;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 80%);
    color: #222;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: Arial, sans-serif !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, .15);
    transition: background-color .25s ease, transform .25s ease;
    font-family: 'Inter';
}

.pcorp-modal-close:hover {
    background: #fff;
    transform: scale(1.05);
}


/* ========================================
   GALERÍA GRANDE
======================================== */

.pcorp-gallery-main {
    position: relative;
    width: 100%;

    height: clamp(340px, 48vh, 520px);

    overflow: hidden;
    background: #111;
}

.pcorp-gallery-main-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
}


/* ========================================
   FLECHAS
======================================== */

.pcorp-gallery-arrow {
    position: absolute;
    top: 50%;
    z-index: 8;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    margin: 0 !important;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 80%);
    color: #222;
    cursor: pointer;
    transform: translateY(-50%);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: 'Inter';
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, .18);
    transition: background-color .25s ease, transform .25s ease;
}

.pcorp-gallery-arrow:hover {
    background: #fff;
}

.pcorp-gallery-prev {
    left: 28px;
}

.pcorp-gallery-next {
    right: 28px;
}


/* ========================================
   PUNTOS
======================================== */

.pcorp-gallery-dots {
    position: absolute;

    left: 50%;
    bottom: 14px;

    z-index: 8;

    display: flex;
    align-items: center;
    gap: 8px;

    transform: translateX(-50%);
}

.pcorp-gallery-dot {
    width: 9px;
    height: 9px;

    padding: 0;

    border: 0;
    border-radius: 999px;

    background: rgba(255, 255, 255, .7);

    cursor: pointer;

    transition:
        width .25s ease,
        background-color .25s ease;
}

.pcorp-gallery-dot.is-active {
    width: 24px;
    background: #e31837;
}


/* ========================================
   MINIATURAS GALERÍA
======================================== */

.pcorp-gallery-thumbs {
    display: flex;
    gap: 9px;

    padding: 14px 30px 10px;

    overflow-x: auto;

    background: #fff;

    scrollbar-width: none;
}

.pcorp-gallery-thumbs::-webkit-scrollbar {
    display: none;
}

/* Por defecto: repartir todo el espacio */
.pcorp-gallery-thumb {
    flex: 1 1 0;
    min-width: 0;

    height: 72px;

    padding: 2px;

    border: 2px solid transparent;
    border-radius: 6px;

    background: transparent;

    overflow: hidden;
    cursor: pointer;

    transition:
        border-color .2s ease,
        transform .2s ease;
}

.pcorp-gallery-thumb img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    border-radius: 3px;
}

.pcorp-gallery-thumb.is-active {
    border-color: #b91f3b;
}

.pcorp-gallery-thumb:hover {
    transform: translateY(-1px);
}

/* Si hay 6 o más imágenes:
   usamos miniaturas de tamaño fijo + scroll */
.pcorp-gallery-thumbs:has(.pcorp-gallery-thumb:nth-child(6))
.pcorp-gallery-thumb {
    flex: 0 0 145px;
}


/* ========================================
   CONTENIDO
======================================== */

.pcorp-modal-content {
    padding: 14px 30px 34px;
}

.pcorp-modal-category {
    display: inline-flex;
    padding: 7px 16px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: #a32035;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Inter';
}

.pcorp-modal-title {
    margin: 0 0 24px;
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 700;
    line-height: 32px;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: 'Inter';
}


/* ========================================
   DATOS
======================================== */

.pcorp-project-data {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 32px;
    padding: 17px 0px;
    border-radius: 8px;
}

.pcorp-data-card {
    padding: 19px 20px;

    background: #f6f6f6;

    border-radius: 8px;
}

.pcorp-data-card span {
    display: block;
    margin-bottom: 6px;
    color: #6b7280;
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    font-family: 'Inter';
}

.pcorp-data-card strong {
    display: block;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter';
    line-height: 20px;
}


/* ========================================
   DESCRIPCIÓN
======================================== */

.pcorp-description h3 {
    margin: 0 0 14px;
    color: #a32035;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    font-family: 'Inter';
}

.pcorp-description-text {
    color: #59616d;
    font-size: 14px;
    line-height: 23px;
    font-family: 'Inter';
    font-weight: 400;
}

.pcorp-description-text p:first-child {
    margin-top: 0;
}

.pcorp-description-text p:last-child {
    margin-bottom: 0;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 1024px) {

    .pcorp-modal-shell {
        width: min(940px, 95vw);
    }

    .pcorp-gallery-main {
        height: 48vh;
    }

    .pcorp-project-data {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 767px) {

    .pcorp-modal {
        padding: 0;
        align-items: stretch;
    }

    /*.pcorp-modal-shell {
        width: 100%;
        height: 100%;
        max-height: none;

        border-radius: 0;
    }*/

    .pcorp-modal-shell {
        width: 90%;
        height: 90%;
        max-height: none;
        border-radius: 4px;
        top: 5%;
    }

    .pcorp-modal-scroll {
        height: 100%;
        max-height: none;
    }

    .pcorp-modal-close {
        top: 12px;
        right: 12px;

        width: 38px;
        height: 38px;
    }

    .pcorp-gallery-main {
        height: 42vh;
        min-height: 280px;
    }

    .pcorp-gallery-arrow {
        width: 40px;
        height: 40px;

        font-size: 30px;
    }

    .pcorp-gallery-prev {
        left: 12px;
    }

    .pcorp-gallery-next {
        right: 12px;
    }

    .pcorp-gallery-thumbs {
        padding:
            12px 15px 8px;
    }

    .pcorp-gallery-thumb {
        flex-basis: 110px;
        height: 62px;
    }

    .pcorp-modal-content {
        padding:
            18px 18px 35px;
    }

    .pcorp-modal-title {
        margin-bottom: 22px;
    }

    .pcorp-project-data {
        grid-template-columns: 1fr;
        gap: 10px;
    }

}


/* ========================================
   HOVER
======================================== */

@media (hover: hover) {

    .pcorp-card-media:hover img {
        transform: scale(1.035);
    }

    .pcorp-card-media:hover .pcorp-card-overlay {
        background:
            linear-gradient(
                rgba(117, 10, 35, .36),
                rgba(117, 10, 35, .47)
            );
    }

    .pcorp-card-media:hover .pcorp-card-hover {
        opacity: 1;
        visibility: visible;
    }

    .pcorp-card-media:hover .pcorp-detail-button {
        transform: translateY(0);
    }

}


/* ========================================
   FILTRADO
======================================== */

.pcorp-card.is-hidden {
    display: none;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 1024px) {

    .pcorp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 767px) {

    :root {
        --pcorp-header-height: 70px;
    }

    .pcorp-filters {
        /*flex-wrap: nowrap;*/

        overflow-x: auto;
        overflow-y: hidden;

        gap: 8px;

        margin: 0 0 25px;
        /*padding: 12px 15px;*/

        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .pcorp-filters.is-fixed {
        top: 70px !important;

        padding-left: 15px;
        padding-right: 15px;
    }

    .pcorp-filters::-webkit-scrollbar {
        display: none;
    }

    .pcorp-filter {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .pcorp-grid {
        grid-template-columns: 1fr;
    }

    .pcorp-card-media {
        aspect-ratio: 1.2 / 1;
    }

    .pcorp-card-hover {
        display: none;
    }

}

/* =========================================================
   FIX DEFINITIVO ELEMENTOR + PROYECTOS
   Estructura real:
   41e4929
      > e-con-inner
         > 8ada7ee
            > e-con-inner
               > c3a67c6
                  > elementor-shortcode
                     > pcorp-projects
========================================================= */


/* CONTENEDOR PRINCIPAL */
.elementor-element-41e4929,
.elementor-element-41e4929 > .e-con-inner,

/* CONTENEDOR DEL SHORTCODE */
.elementor-element-8ada7ee,
.elementor-element-8ada7ee > .e-con-inner,

/* WIDGET */
.elementor-element-c3a67c6,

/* WRAPPER REAL DEL SHORTCODE */
.elementor-element-c3a67c6 .elementor-shortcode,

/* NUESTRO PLUGIN */
.elementor-element-c3a67c6 .pcorp-projects,

/* GRID */
.elementor-element-c3a67c6 .pcorp-grid {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    overflow: visible !important;
}


/* Evitamos problemas de flex de Elementor */
.elementor-element-8ada7ee > .e-con-inner,
.elementor-element-c3a67c6,
.elementor-element-c3a67c6 .elementor-shortcode {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;

    align-self: auto !important;

    position: relative !important;
}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 767px) {

    .elementor-element-41e4929 {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }

    .elementor-element-41e4929 > .e-con-inner {
        display: flex !important;
        flex-direction: column !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    .elementor-element-8ada7ee {
        display: block !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;

        transform: none !important;
        animation: none !important;
    }


    .elementor-element-8ada7ee > .e-con-inner {
        display: block !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    .elementor-element-c3a67c6 {
        display: block !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    .elementor-element-c3a67c6 .elementor-shortcode {
        display: block !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    /* =========================================
       PROYECTOS
    ========================================= */

    .elementor-element-c3a67c6 .pcorp-projects {
        display: block !important;

        position: relative !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    .elementor-element-c3a67c6 .pcorp-grid {
        display: grid !important;

        grid-template-columns: minmax(0, 1fr) !important;
        grid-auto-flow: row !important;
        grid-auto-rows: auto !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        gap: 16px !important;

        overflow: visible !important;
    }


    .elementor-element-c3a67c6 .pcorp-card {
        position: relative !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        float: none !important;
        clear: none !important;

        overflow: visible !important;

        transform: none !important;
    }


    .elementor-element-c3a67c6 .pcorp-card-media {
        position: relative !important;

        width: 100% !important;
        height: auto !important;

        aspect-ratio: 1.2 / 1 !important;

        overflow: hidden !important;
    }


    .elementor-element-c3a67c6 .pcorp-card-media img {
        position: absolute !important;

        inset: 0 !important;

        width: 100% !important;
        height: 100% !important;

        object-fit: cover !important;
    }

}

/* =========================================================
   FIX HOME - SHORTCODE PROYECTOS EN MÓVIL
========================================================= */

@media (max-width: 767px) {

    /* Contenedor principal del bloque Home */
    .elementor-element-bafc054,
    .elementor-element-bafc054 > .e-con-inner,

    /* Widget shortcode */
    .elementor-element-17aa26c,

    /* Wrapper real del shortcode */
    .elementor-element-17aa26c .elementor-shortcode,

    /* Plugin */
    .elementor-element-17aa26c .pcorp-projects,

    /* Grid */
    .elementor-element-17aa26c .pcorp-grid {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    /* =========================================
       CONTENEDOR ELEMENTOR
    ========================================= */

    .elementor-element-bafc054 {
        display: block !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;

        transform: none !important;
        animation: none !important;
    }


    .elementor-element-bafc054 > .e-con-inner {
        display: block !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    /* =========================================
       WIDGET SHORTCODE
    ========================================= */

    .elementor-element-17aa26c {
        display: block !important;

        position: relative !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;

        flex-grow: 0 !important;
        flex-shrink: 0 !important;
    }


    .elementor-element-17aa26c .elementor-shortcode {
        display: block !important;

        position: relative !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    /* =========================================
       MÓDULO PROYECTOS
    ========================================= */

    .elementor-element-17aa26c .pcorp-projects {
        display: block !important;

        position: relative !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        overflow: visible !important;
    }


    /* =========================================
       GRID HOME
    ========================================= */

    .elementor-element-17aa26c .pcorp-grid {
        display: grid !important;

        grid-template-columns: minmax(0, 1fr) !important;
        grid-auto-flow: row !important;
        grid-auto-rows: auto !important;

        position: relative !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        gap: 16px !important;

        overflow: visible !important;
    }


    /* =========================================
       TARJETAS HOME
    ========================================= */

    .elementor-element-17aa26c .pcorp-card {
        position: relative !important;

        width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        margin: 0 !important;

        float: none !important;
        clear: none !important;

        overflow: visible !important;

        transform: none !important;
    }


    .elementor-element-17aa26c .pcorp-card-media {
        display: block !important;

        position: relative !important;

        width: 100% !important;
        height: auto !important;

        aspect-ratio: 1.2 / 1 !important;

        overflow: hidden !important;
    }


    .elementor-element-17aa26c .pcorp-card-media img {
        position: absolute !important;

        inset: 0 !important;

        width: 100% !important;
        height: 100% !important;

        object-fit: cover !important;
    }

}

/* =========================================================
   FIX FILTRADO EN MÓVIL
========================================================= */

@media (max-width: 767px) {

    .pcorp-projects .pcorp-card.is-hidden {
        display: none !important;
    }

}