/* ======================================================= */
/* TRUST GLASS — Casos de Éxito y Confianza · APEX        */
/* Cristal monumental · supera menú, FAQ, hero y footer    */
/* ======================================================= */

@property --shine-o {
    syntax: '<number>';
    initial-value: 0;
    inherits: false;
}

.referencias-corporativas--apex {
    position: relative;
    padding:
        clamp(4rem, 10vw, 6.5rem)
        clamp(0.75rem, 4vw, 2rem)
        clamp(4.5rem, 11vw, 7rem);
    text-align: center;
    background:
        radial-gradient(ellipse 120% 70% at 50% -15%, rgba(255, 120, 40, 0.14) 0%, transparent 58%),
        radial-gradient(ellipse 80% 50% at 50% 110%, rgba(255, 180, 60, 0.08) 0%, transparent 55%),
        linear-gradient(180deg, #08090c 0%, #0e1016 45%, #0a0c10 100%);
    border-top: none !important;
    overflow: hidden;
    isolation: isolate;
}

/* Grid ambiental */
.referencias-corporativas--apex::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.11;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 85% 70% at 50% 48%, #000 10%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 48%, #000 10%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* Scanline suave — solo en esta sección */
.referencias-corporativas--apex::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 150, 60, 0.06) 48%,
        rgba(255, 200, 120, 0.1) 50%,
        rgba(255, 150, 60, 0.06) 52%,
        transparent 100%
    );
    filter: blur(10px);
    animation: trustGlassScan 18s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.65;
}

@keyframes trustGlassScan {
    0% { top: -8%; opacity: 0; }
    10% { opacity: 0.55; }
    90% { opacity: 0.55; }
    100% { top: 108%; opacity: 0; }
}

/* ── Bóveda principal — cristal más grueso del sitio ── */
.referencias-corporativas--apex .container-empresas {
    position: relative;
    z-index: 2;
    max-width: 1080px;
    margin: 0 auto;
    padding:
        clamp(2.75rem, 7vw, 4.25rem)
        clamp(1.75rem, 5vw, 3.25rem)
        clamp(3rem, 7vw, 4.5rem);
    --shine-x: 50%;
    --shine-y: 42%;
    --shine-o: 0;
    transform-style: preserve-3d;
    transform: translateZ(0);
    background-image:
        radial-gradient(
            circle 220px at var(--shine-x) var(--shine-y),
            rgba(255, 255, 255, calc(var(--shine-o) * 0.14)) 0%,
            rgba(255, 190, 110, calc(var(--shine-o) * 0.07)) 32%,
            transparent 62%
        ),
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.22) 0%,
            rgba(255, 255, 255, 0.08) 4%,
            rgba(12, 14, 20, 0.55) 28%,
            rgba(6, 8, 12, 0.58) 100%
        );
    background-color: transparent;
    backdrop-filter: blur(20px) saturate(165%);
    -webkit-backdrop-filter: blur(20px) saturate(165%);
    border-top: 9px solid rgba(255, 255, 255, 0.36);
    border-bottom: 12px solid rgba(0, 0, 0, 0.55);
    border-left: 6px solid rgba(255, 255, 255, 0.14);
    border-right: 6px solid rgba(0, 0, 0, 0.32);
    border-radius: 6px;
    box-shadow:
        inset 0 36px 64px rgba(255, 255, 255, 0.11),
        inset 0 -40px 72px rgba(0, 0, 0, 0.48),
        inset 18px 0 40px rgba(255, 255, 255, 0.07),
        inset -18px 0 40px rgba(0, 0, 0, 0.22),
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 0 0 8px rgba(255, 255, 255, 0.035),
        0 0 0 14px rgba(255, 120, 40, 0.04),
        0 40px 100px rgba(0, 0, 0, 0.65),
        0 0 60px rgba(255, 160, 80, calc(var(--shine-o) * 0.05));
    transition: --shine-o 0.45s ease, box-shadow 0.35s ease, filter 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    overflow: hidden;
}

.referencias-corporativas--apex .container-empresas.hero-glass--touch {
    filter: brightness(1.01);
    box-shadow:
        inset 0 38px 68px rgba(255, 255, 255, 0.13),
        inset 0 -42px 76px rgba(0, 0, 0, 0.5),
        inset 18px 0 42px rgba(255, 255, 255, 0.08),
        inset -18px 0 42px rgba(0, 0, 0, 0.24),
        0 0 0 2px rgba(255, 255, 255, 0.14),
        0 0 0 8px rgba(255, 255, 255, 0.05),
        0 0 0 14px rgba(255, 120, 40, 0.07),
        0 44px 110px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(255, 180, 100, calc(var(--shine-o) * 0.07));
}

/* Bisel superior monumental */
.referencias-corporativas--apex .container-empresas::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.22) 42%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Esquinas de bóveda */
.referencias-corporativas--apex .container-empresas::after {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.15),
        inset 12px 12px 0 -11px rgba(255, 255, 255, 0.12),
        inset -12px -12px 0 -11px rgba(255, 255, 255, 0.06);
}

/* ── Tipografía ── */
.referencias-corporativas--apex .titulo-naranja {
    position: relative;
    z-index: 2;
    margin-bottom: 0.65rem !important;
    font-size: clamp(1.5rem, 5vw, 2.125rem) !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: linear-gradient(
        135deg,
        #ffb347 0%,
        #ff6b35 45%,
        #ffd080 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-shadow: none;
    filter: drop-shadow(0 4px 24px rgba(255, 107, 53, 0.35));
}

.referencias-corporativas--apex .subtitulo-blanco {
    position: relative;
    z-index: 2;
    color: rgba(220, 225, 235, 0.82) !important;
    font-size: clamp(0.9375rem, 3vw, 1.125rem);
    letter-spacing: 0.04em;
    margin-bottom: clamp(2rem, 5vw, 2.75rem) !important;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

/* ── Placas de marcas — cristal grabado ── */
.referencias-corporativas--apex .marcas-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(0.75rem, 2.5vw, 1.25rem);
    margin: 0 0 clamp(2.25rem, 5vw, 3rem);
}

.referencias-corporativas--apex .marca-card {
    position: relative;
    padding: clamp(1rem, 3vw, 1.35rem) clamp(0.75rem, 2vw, 1.25rem);
    background:
        linear-gradient(
            165deg,
            rgba(255, 255, 255, 0.14) 0%,
            rgba(255, 255, 255, 0.04) 18%,
            rgba(10, 12, 18, 0.5) 100%
        );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 800;
    font-size: clamp(0.75rem, 2.2vw, 0.9375rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-top: 3px solid rgba(255, 255, 255, 0.28);
    border-bottom: 4px solid rgba(0, 0, 0, 0.38);
    border-radius: 6px;
    box-shadow:
        inset 0 10px 22px rgba(255, 255, 255, 0.08),
        inset 0 -12px 24px rgba(0, 0, 0, 0.32),
        0 12px 32px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}

.referencias-corporativas--apex .marca-card::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.35) 50%,
        transparent
    );
    pointer-events: none;
}

.referencias-corporativas--apex .marca-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 180, 100, 0.35);
    box-shadow:
        inset 0 12px 26px rgba(255, 255, 255, 0.1),
        inset 0 -12px 26px rgba(0, 0, 0, 0.34),
        0 0 28px rgba(255, 140, 60, 0.12),
        0 16px 40px rgba(0, 0, 0, 0.42);
}

.referencias-corporativas--apex .marca-card:first-child {
    border-color: rgba(255, 180, 100, 0.28);
    box-shadow:
        inset 0 10px 22px rgba(255, 255, 255, 0.1),
        inset 0 -12px 24px rgba(0, 0, 0, 0.32),
        0 0 24px rgba(255, 140, 60, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.38);
}

/* ── Testimonios — losas de cristal ── */
.referencias-corporativas--apex .testimonios-reales {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: clamp(2rem, 5vw, 3rem);
}

.referencias-corporativas--apex .testimonio {
    position: relative;
    text-align: left;
    padding:
        clamp(1.5rem, 4vw, 2rem)
        clamp(1.25rem, 3.5vw, 1.75rem)
        clamp(1.25rem, 3vw, 1.5rem);
    background:
        linear-gradient(
            155deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.02) 20%,
            rgba(8, 10, 16, 0.45) 100%
        );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid rgba(255, 107, 53, 0.65);
    border-top: 3px solid rgba(255, 255, 255, 0.2);
    border-bottom: 5px solid rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    box-shadow:
        inset 0 14px 28px rgba(255, 255, 255, 0.06),
        inset 0 -16px 32px rgba(0, 0, 0, 0.28),
        0 16px 40px rgba(0, 0, 0, 0.38);
}

.referencias-corporativas--apex .testimonio::before {
    content: "\201C";
    position: absolute;
    top: 0.35rem;
    left: 0.85rem;
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    line-height: 1;
    font-family: Georgia, 'Times New Roman', serif;
    color: rgba(255, 140, 60, 0.22);
    pointer-events: none;
}

.referencias-corporativas--apex .testimonio p {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.92) !important;
    font-style: italic;
    font-size: clamp(1rem, 3vw, 1.15rem) !important;
    line-height: 1.6;
    margin-bottom: 0.85rem !important;
    padding-left: 0.25rem;
}

.referencias-corporativas--apex .testimonio span {
    display: block;
    color: rgba(255, 190, 100, 0.88) !important;
    font-size: clamp(0.8125rem, 2.5vw, 0.9rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── Banner factura — cristal ámbar premium ── */
.referencias-corporativas--apex .banner-factura {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.75rem, 3vw, 1.25rem);
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding:
        clamp(1.15rem, 3.5vw, 1.5rem)
        clamp(1.25rem, 4vw, 2rem);
    text-align: left;
    color: rgba(255, 248, 235, 0.96) !important;
    background:
        linear-gradient(
            135deg,
            rgba(255, 180, 80, 0.28) 0%,
            rgba(255, 107, 53, 0.22) 40%,
            rgba(255, 200, 100, 0.18) 100%
        );
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 2px solid rgba(255, 200, 120, 0.35);
    border-top: 4px solid rgba(255, 230, 160, 0.45);
    border-bottom: 5px solid rgba(120, 50, 10, 0.45);
    border-radius: 8px;
    box-shadow:
        inset 0 12px 28px rgba(255, 255, 255, 0.15),
        inset 0 -14px 28px rgba(0, 0, 0, 0.25),
        0 0 40px rgba(255, 140, 60, 0.15),
        0 20px 48px rgba(0, 0, 0, 0.4);
}

.referencias-corporativas--apex .banner-factura i {
    flex-shrink: 0;
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: rgba(255, 220, 140, 0.95);
    filter: drop-shadow(0 2px 8px rgba(255, 140, 60, 0.4));
}

.referencias-corporativas--apex .banner-factura p {
    margin: 0;
    font-size: clamp(0.875rem, 2.8vw, 1rem);
    line-height: 1.55;
    color: rgba(255, 248, 235, 0.95);
}

.referencias-corporativas--apex .banner-factura strong {
    color: #fff;
    font-weight: 800;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .referencias-corporativas--apex .marcas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .referencias-corporativas--apex {
        padding: 2.75rem 0.65rem 3.25rem;
    }

    .referencias-corporativas--apex .container-empresas {
        padding: 2rem 1.15rem 2.25rem;
        border-top-width: 7px;
        border-bottom-width: 9px;
    }

    .referencias-corporativas--apex .testimonios-reales {
        grid-template-columns: 1fr;
    }

    .referencias-corporativas--apex .banner-factura {
        flex-direction: column;
        text-align: center;
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .referencias-corporativas--apex .container-empresas {
        background: rgba(10, 12, 18, 0.94);
    }

    .referencias-corporativas--apex .marca-card,
    .referencias-corporativas--apex .testimonio,
    .referencias-corporativas--apex .banner-factura {
        background: rgba(14, 16, 22, 0.92);
    }
}

@media (prefers-reduced-motion: reduce) {
    .referencias-corporativas--apex::after {
        animation: none;
        opacity: 0;
    }

    .referencias-corporativas--apex .marca-card {
        transition: none;
    }

    .referencias-corporativas--apex .marca-card:hover {
        transform: none;
    }
}
