/* ======================================================= */
/* HERO GLASS FX — Suave · solo #hero · anti-mareo        */
/* ======================================================= */

section#hero,
section.hero {
    position: relative;
    overflow: hidden;
}

.hero-fx {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.72;
}

/* Brillo táctil — sigue el dedo / cursor en el cristal */
@property --shine-o {
    syntax: '<number>';
    initial-value: 0;
    inherits: false;
}

.hero-premium__band,
section.hero:not(.hero-premium) > .container {
    --shine-x: 50%;
    --shine-y: 50%;
    --shine-o: 0;
    transition: --shine-o 0.4s ease, filter 0.25s ease, box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.hero-premium__band.hero-glass--touch,
section.hero:not(.hero-premium) > .container.hero-glass--touch {
    filter: brightness(1.01);
}

.hero-premium__band.hero-glass--touch {
    box-shadow:
        inset 0 14px 28px rgba(255, 255, 255, 0.18),
        inset 0 -18px 36px rgba(0, 0, 0, 0.42),
        inset 6px 0 20px rgba(255, 255, 255, 0.08),
        inset -6px 0 20px rgba(0, 0, 0, 0.18),
        0 2px 0 rgba(255, 255, 255, 0.28),
        0 8px 0 rgba(255, 255, 255, 0.06),
        0 16px 40px rgba(0, 0, 0, 0.45),
        0 32px 80px rgba(0, 0, 0, 0.5),
        0 48px 100px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(255, 180, 100, calc(var(--shine-o) * 0.06));
}

section.hero:not(.hero-premium) > .container.hero-glass--touch {
    box-shadow:
        inset 0 12px 24px rgba(255, 255, 255, 0.14),
        inset 0 -14px 28px rgba(0, 0, 0, 0.38),
        inset 5px 0 16px rgba(255, 255, 255, 0.07),
        inset -5px 0 16px rgba(0, 0, 0, 0.15),
        0 2px 0 rgba(255, 255, 255, 0.22),
        0 12px 36px rgba(0, 0, 0, 0.45),
        0 28px 64px rgba(0, 0, 0, 0.4),
        0 0 36px rgba(255, 180, 100, calc(var(--shine-o) * 0.05));
}

.hero-fx__glass {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.02) 8%,
            transparent 40%
        );
    backdrop-filter: blur(3px) saturate(115%);
    -webkit-backdrop-filter: blur(3px) saturate(115%);
}

/* Cristal grueso en heroes municipales (contenedor) */
section.hero:not(.hero-premium) > .container {
    position: relative;
    transform: translateY(-4px) translateZ(24px);
    transform-style: preserve-3d;
    background-image:
        radial-gradient(
            circle 140px at var(--shine-x) var(--shine-y),
            rgba(255, 255, 255, calc(var(--shine-o) * 0.15)) 0%,
            rgba(255, 210, 140, calc(var(--shine-o) * 0.06)) 28%,
            transparent 58%
        ),
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0.06) 8%,
            rgba(14, 16, 20, 0.62) 24%,
            rgba(8, 10, 14, 0.55) 100%
        );
    background-color: transparent;
    backdrop-filter: blur(12px) saturate(175%);
    -webkit-backdrop-filter: blur(12px) saturate(175%);
    border-top: 3px solid rgba(255, 255, 255, 0.32);
    border-bottom: 5px solid rgba(0, 0, 0, 0.32);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 4px;
    box-shadow:
        inset 0 12px 24px rgba(255, 255, 255, 0.1),
        inset 0 -14px 28px rgba(0, 0, 0, 0.38),
        inset 5px 0 16px rgba(255, 255, 255, 0.05),
        inset -5px 0 16px rgba(0, 0, 0, 0.15),
        0 2px 0 rgba(255, 255, 255, 0.15),
        0 12px 36px rgba(0, 0, 0, 0.45),
        0 28px 64px rgba(0, 0, 0, 0.4);
    padding: 2.5rem 1.75rem !important;
}

section.hero:not(.hero-premium) > .container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.45) 0%,
        rgba(255, 255, 255, 0.15) 60%,
        transparent 100%
    );
    pointer-events: none;
    border-radius: 4px 4px 0 0;
}

section.hero:not(.hero-premium) {
    perspective: 1200px;
    perspective-origin: 50% 40%;
}

.hero-fx__grid {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 75% at 50% 45%, #000 15%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 45%, #000 15%, transparent 78%);
}

.hero-fx__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, transparent 45%, rgba(0, 0, 0, 0.15) 100%),
        radial-gradient(ellipse 90% 50% at 50% 42%, rgba(255, 120, 40, 0.05) 0%, transparent 55%);
}

/* Una sola línea suave — la secundaria desactivada (evita cruce) */
.hero-fx__scanline {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.55;
}

.hero-fx__scanline--reverse {
    display: none;
}

.hero-fx__scanline::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 140, 40, 0.08) 48%,
        rgba(255, 180, 80, 0.12) 50%,
        rgba(255, 140, 40, 0.08) 52%,
        transparent 100%
    );
    filter: blur(8px);
    animation: heroFxScanline 14s ease-in-out infinite;
}

.hero-fx__scanline::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 160, 80, 0.35) 20%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 160, 80, 0.35) 80%,
        transparent 100%
    );
    box-shadow: 0 0 12px rgba(255, 140, 40, 0.2);
    animation: heroFxScanline 14s ease-in-out infinite;
}

@keyframes heroFxScanline {
    0% { top: -5%; opacity: 0; }
    8% { opacity: 0.6; }
    92% { opacity: 0.6; }
    100% { top: 105%; opacity: 0; }
}

/* Contenido del hero por encima del efecto */
section#hero > *:not(.hero-fx),
section.hero > *:not(.hero-fx) {
    position: relative;
    z-index: 1;
}

section.hero.hero-premium .hero-premium__anchors {
    z-index: 2;
}

section.hero.hero-premium {
    background-color: #060608;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 120, 40, 0.08) 0%, transparent 55%),
        linear-gradient(165deg, #060608 0%, #0c0a0e 40%, #121018 72%, #08060a 100%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .hero-fx__glass {
        background: rgba(8, 8, 10, 0.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-fx__scanline::before,
    .hero-fx__scanline::after {
        animation: none;
        opacity: 0;
    }

    .hero-fx__grid {
        opacity: 0.06;
    }
}
