/*
 * REDE Theme Comercial 1.1.25 — Proyectos reales V2 (solo presentación).
 * Reutiliza Capture Mobile 1.7.9: NO reescribe post_content ni URLs.
 * Pantallas <768 px: 1 columna / 2 miniaturas; >=768 px: hero 2 columnas / 4 miniaturas.
 */

/* La estructura no modifica ninguna de las páginas comerciales o históricas. */
body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] {
    max-width: 1160px !important;
    margin-bottom: 24px !important;
}

body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] > .rede-section {
    padding: 24px 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
}

body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] > .rede-hero + .rede-section {
    padding-top: 18px !important;
    padding-bottom: 16px !important;
}

body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-project-card {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-compact-gallery {
    margin: 0 !important;
}

/* Título completo y legible; nunca truncar texto indexable con line-clamp. */
body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero h1 {
    font-size: clamp(27px, 3.25vw, 43px) !important;
    line-height: 1.13 !important;
    letter-spacing: -.025em !important;
    overflow-wrap: break-word;
}

/* Escritorio: fotografía a la izquierda y texto/CTA a la derecha. */
@media screen and (min-width: 768px) and (hover: hover) {
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero {
        display: grid !important;
        grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
        align-items: center;
        gap: 0;
        min-width: 0;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero-image {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: 580px !important;
        aspect-ratio: auto !important;
        object-fit: contain !important;
        align-self: center;
        justify-self: center;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] img.rede-hero-image.rede-media-web-vertical {
        width: auto !important;
        max-width: 100% !important;
        max-height: 560px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero-copy {
        min-width: 0;
        padding: 24px 26px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero-copy .rede-wa {
        width: 100% !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
    }
}

/*
 * 1.1.27 LAB: Tamaño fijo de miniaturas sin depender de la cantidad.
 * En PC caben hasta 4 y en tableta hasta 3; no estirar si hay 1-3.
 * El carrusel conserva desplazamiento si hay mas fotografias.
 * El maximo de 2 en movil se mantiene sin cambios.
 * Este bloque es la referencia para REDE Proyectos V2.
 */
/* CTA de proyecto en PC queda dentro del contenido, no flotante. */
@media screen and (min-width: 768px) {
    body.rede-commercial-universal.rede-project-landing-v2 .rede-floating-wa,
    body.rede-commercial-universal.rede-project-landing-v2 .rede-sales-landing a.rede-floating-wa[href*="wa.me"] {
        display: none !important;
    }
}

@media screen and (max-width: 767px), screen and (hover: none) and (pointer: coarse) {
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] {
        margin-bottom: 10px !important;
        padding-bottom: 74px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero {
        display: block !important;
        border-radius: 0 !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero-image {
        aspect-ratio: auto !important;
        height: auto !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero-copy {
        padding: 16px 18px 18px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero .rede-eyebrow {
        margin-bottom: 9px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero h1 {
        font-size: clamp(25px, 7vw, 30px) !important;
        line-height: 1.12 !important;
        margin-bottom: 9px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-hero p {
        font-size: 15px !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] > .rede-section,
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] > .rede-hero + .rede-section {
        padding: 14px 6px !important;
        min-height: 0 !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-compact-gallery__head {
        gap: 8px !important;
        flex-wrap: wrap;
        margin-bottom: 8px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-compact-gallery__track {
        grid-auto-columns: calc((100% - 10px) / 2) !important;
        gap: 10px !important;
        padding-bottom: 5px !important;
    }
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-project-summary .rede-details {
        padding: 19px 16px !important;
        gap: 16px !important;
    }
    /* La ruta completa permanece en DOM pero no ensancha la pantalla. */
    body.rede-project-landing-v2 .woocommerce-breadcrumb,
    body.rede-project-landing-v2 .breadcrumb,
    body.rede-project-landing-v2 .breadcrumbs {
        width: 100% !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    /* Sin doble CTA: el flotante solo aparece cuando el CTA principal no es visible. */
    body.rede-commercial-universal.rede-project-landing-v2 .rede-floating-wa[hidden],
    body.rede-commercial-universal.rede-project-landing-v2 .rede-sales-landing a.rede-floating-wa[hidden] {
        display: none !important;
    }
    body.rede-commercial-universal.rede-project-landing-v2 .rede-floating-wa:not([hidden]) {
        display: flex !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.rede-project-landing-v2 .rede-floating-wa { animation: none !important; }
}


/*
 * 1.1.26 LAB — únicamente tres microajustes aprobados para proyectos REDE V2.
 * Sin modificar el HTML guardado, las fotos, el carrusel ni el diseño general.
 */

/* 1. El botón ya tiene SVG de WhatsApp: quitar glifos decorativos heredados. */
body.rede-commercial-universal.rede-project-landing-v2
.rede-sales-landing[data-rede-generation="rede-new-v2"] a.rede-wa::before,
body.rede-commercial-universal.rede-project-landing-v2
.rede-sales-landing[data-rede-generation="rede-new-v2"] a.rede-floating-wa::before,
body.rede-commercial-universal.rede-project-landing-v2
.rede-sales-landing[data-rede-generation="rede-new-v2"] a.rede-universal-wa::before {
    content: none !important;
    display: none !important;
}

@media screen and (max-width: 767px) {
    /* 2. Portada tocando el borde inferior de la franja gris "Inicio > ...". */
    body.rede-project-landing-v2 #content .woocommerce-breadcrumb {
        box-sizing: border-box !important;
        margin-bottom: 0 !important;
    }
    body.rede-project-landing-v2 #content > .container > .site-content-inner,
    body.rede-project-landing-v2 #content #primary,
    body.rede-project-landing-v2 #content #main,
    body.rede-project-landing-v2 #content #main > article,
    body.rede-project-landing-v2 #content #main > article > .entry-content {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    body.rede-project-landing-v2 #content #main > article > .entry-content >
    .rede-sales-landing[data-rede-generation="rede-new-v2"] {
        margin-top: 0 !important;
    }
    body.rede-project-landing-v2 #content .rede-sales-landing[data-rede-generation="rede-new-v2"] > .rede-hero {
        margin-top: 0 !important;
    }

    /* 3. CTA flotante compacto. Queda a un lado en vez de tapar todo el ancho. */
    body.rede-commercial-universal.rede-project-landing-v2
    .rede-sales-landing[data-rede-generation="rede-new-v2"] a.rede-floating-wa:not([hidden]) {
        left: auto !important;
        right: 12px !important;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        width: max-content !important;
        max-width: calc(100vw - 24px) !important;
        min-height: 48px !important;
        padding: 10px 15px !important;
        margin: 0 !important;
        border-radius: 999px !important;
        font-size: 14px !important;
        line-height: 1.1 !important;
    }
    body.rede-commercial-universal.rede-project-landing-v2
    .rede-sales-landing[data-rede-generation="rede-new-v2"] a.rede-floating-wa[hidden] {
        display: none !important;
    }
}

/* REDE 1.1.27: prioridad frente a reglas táctiles heredadas. */
@media screen and (min-width:768px) and (max-width:1023px) {
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-compact-gallery__track {
        grid-auto-columns: calc((100% - 24px) / 3) !important;
        gap: 12px !important;
    }
}
@media screen and (min-width:1024px) {
    body.rede-project-landing-v2 .rede-sales-landing[data-rede-generation="rede-new-v2"] .rede-compact-gallery__track {
        grid-auto-columns: calc((100% - 36px) / 4) !important;
        gap: 12px !important;
    }
}

/* 1.1.29: los banners aprobados de REDE Marketing no recortan su imagen.
   Únicamente landings V2; no afecta al hero ni a las fotografías reales. */
.rede-sales-landing .rede-theme-v2-banner-slot{box-sizing:border-box;width:100%;max-width:1180px;margin:12px auto 18px;min-width:0}
.rede-sales-landing .rede-theme-v2-banner-slot--secondary{margin:22px auto 14px}
.rede-sales-landing .rede-theme-v2-banner-slot picture,
.rede-sales-landing .rede-theme-v2-banner-slot img{display:block;max-width:100%;width:100%;height:auto;object-fit:contain}
.rede-sales-landing .rede-theme-v2-banner-slot>a{max-width:100%;display:block}
@media(max-width:767px){.rede-sales-landing .rede-theme-v2-banner-slot{margin:8px auto 14px}.rede-sales-landing .rede-theme-v2-banner-slot--secondary{margin:18px auto 12px}}
