/* =========================================================
   MOTOGRAPHIX V9
   HERO FIJO — ESCRITORIO
   Imagen independiente: hero-desktop.webp
   ========================================================= */

.mgx-home-hero-shell {
    width: 100%;
    overflow: hidden;
    background: #000;
}

.hero {
    position: relative;
    width: 100%;
    height: clamp(560px, 52vw, 820px);
    overflow: hidden;
    isolation: isolate;
    background: #000;
}

/* =========================================================
   IMAGEN / PICTURE
   ========================================================= */

.mgx-hero-picture {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.mgx-hero-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;

    display: block;

    /*
     * DESKTOP:
     * la ALTURA manda y el ancho se calcula automáticamente.
     * Así nunca cortamos la imagen por arriba o por abajo.
     * Si sobra o falta ancho, el recorte/espacio queda en los
     * costados, donde el fondo negro + degradado lo disimula.
     */
    width: auto;
    height: 100%;
    max-width: none;

    object-fit: contain;
    object-position:
        var(--mgx-hero-position-desktop, right center);

    transform: none;
    transform-origin: right center;

    user-select: none;
    -webkit-user-drag: none;
}

/* =========================================================
   OVERLAY
   Deja una zona de lectura limpia a la izquierda.
   ========================================================= */

.mgx-hero-image-overlay {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            rgba(0,0,0,.92) 0%,
            rgba(0,0,0,.78) 15%,
            rgba(0,0,0,.52) 29%,
            rgba(0,0,0,.25) 43%,
            rgba(0,0,0,.07) 58%,
            rgba(0,0,0,0) 72%
        ),
        linear-gradient(
            180deg,
            rgba(0,0,0,.14) 0%,
            rgba(0,0,0,0) 55%,
            rgba(0,0,0,.10) 74%,
            rgba(0,0,0,.48) 100%
        );
}

/* =========================================================
   CONTENIDO
   ========================================================= */

.mgx-hero-content {
    position: absolute;
    z-index: 5;
    inset: 0;

    width: 100%;
    height: 100%;
    max-width: none;

    color: #fff;
    pointer-events: none;
}

.mgx-hero-copy {
    position: absolute;
    top: 50%;
    left: clamp(48px, 6.6vw, 132px);

    width: min(650px, 43vw);

    transform: translateY(-50%);
    text-align: left;

    pointer-events: auto;
}

.mgx-hero-heading {
    margin: 0;
    color: #fff;
    font-family:
        "Bebas Neue",
        "Arial Narrow",
        Impact,
        Haettenschweiler,
        sans-serif;
    font-weight: 400;
    text-transform: uppercase;
}

/* =========================================================
   TÍTULO
   ========================================================= */

.mgx-hero-main-title {
    display: block;
    opacity: 0;
    transform: translateX(-34px);
    text-shadow:
        0 2px 2px rgba(0,0,0,.95),
        0 6px 18px rgba(0,0,0,.88),
        0 12px 30px rgba(0,0,0,.52);
    -webkit-text-stroke: .55px rgba(0,0,0,.82);
    paint-order: stroke fill;

    animation:
        mgxHeroTitleIn
        .72s
        cubic-bezier(.2,.8,.2,1)
        .10s
        forwards;
}

.mgx-hero-main-title > span {
    display: block;
    width: max-content;
    max-width: 100%;
    font-size: clamp(70px, 6.2vw, 116px);
    line-height: .79;
    letter-spacing: .2px;
    white-space: nowrap;
}

.mgx-hero-main-title > span + span {
    margin-top: 9px;
}

/* =========================================================
   CINTA ROJA
   ========================================================= */

.mgx-hero-category {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: calc(100% - 30px);
    margin-top: 28px;
    padding: 10px 25px;
    color: #fff;
    font-family:
        "Bebas Neue",
        "Arial Narrow",
        Impact,
        sans-serif;
    font-size: clamp(25px, 2vw, 36px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: .8px;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-30px);
    text-shadow:
        0 2px 2px rgba(0,0,0,.90),
        0 4px 10px rgba(0,0,0,.62);
    -webkit-text-stroke: .35px rgba(0,0,0,.72);
    paint-order: stroke fill;
    isolation: isolate;

    animation:
        mgxHeroCategoryIn
        .68s
        cubic-bezier(.2,.8,.2,1)
        .28s
        forwards;
}

.mgx-hero-category::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    right: -10px;
    bottom: 0;
    left: -10px;
    background:
        linear-gradient(
            135deg,
            #ff1630 0%,
            #f0001a 56%,
            #c90012 100%
        );
    transform: skewX(-24deg);
    box-shadow:
        0 8px 24px rgba(0,0,0,.30),
        0 5px 18px rgba(227,6,19,.20);
}

/* =========================================================
   DESCRIPCIÓN
   ========================================================= */

.mgx-hero-text {
    max-width: 520px;
    margin: 20px 0 0;
    color: rgba(255,255,255,.94);
    font-family: var(--mgx-font-ui);
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.5;
    font-weight: 500;
    opacity: 0;
    transform: translateY(18px);
    text-shadow:
        0 1px 2px rgba(0,0,0,1),
        0 4px 12px rgba(0,0,0,.95),
        0 8px 20px rgba(0,0,0,.58);
    -webkit-text-stroke: .18px rgba(0,0,0,.72);
    paint-order: stroke fill;

    animation:
        mgxHeroTextIn
        .66s
        ease
        .43s
        forwards;
}

/* =========================================================
   CTA
   ========================================================= */

.mgx-hero-cta {
    position: absolute;

    left: 50%;
    bottom: 94px;

    width: min(360px, 32vw);
    min-width: 280px;
    min-height: 54px;

    margin: 0;
    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.18) 0%,
            rgba(255,255,255,.03) 34%,
            rgba(255,255,255,0) 46%
        ),
        linear-gradient(
            135deg,
            #ff1730 0%,
            #f00018 48%,
            #d00012 100%
        );

    color: #fff;
    text-decoration: none;

    font-family:
        "Montserrat",
        var(--mgx-font-ui),
        Arial,
        sans-serif;

    font-size: clamp(15px, 1.15vw, 18px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: .4px;
    text-transform: uppercase;

    opacity: 1;

    transform: translateX(-50%);
    animation: none !important;

    pointer-events: auto;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.26),
        0 10px 30px rgba(255,0,30,.34),
        0 12px 30px rgba(0,0,0,.34);

    -webkit-backdrop-filter: blur(10px) saturate(135%);
    backdrop-filter: blur(10px) saturate(135%);

    transition:
        transform .20s ease,
        filter .20s ease,
        box-shadow .20s ease;
}

.mgx-hero-cta-label {
    display: block;
    width: 90%;

    margin: 0 auto;

    text-align: center;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {

    .mgx-hero-cta:hover {
        transform:
            translateX(-50%)
            translateY(-2px);

        filter: brightness(1.08) saturate(1.10);

        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.30),
            0 13px 36px rgba(255,0,30,.42),
            0 14px 32px rgba(0,0,0,.38);
    }
}

.mgx-hero-cta:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* =========================================================
   TABLET HORIZONTAL / ESCRITORIO PEQUEÑO
   ========================================================= */

@media (min-width: 900px) and (max-width: 1200px) {

    .hero {
        height: clamp(540px, 56vw, 700px);
    }

    .mgx-hero-copy {
        left: 52px;
        width: min(520px, 46vw);
    }

    .mgx-hero-cta {
        bottom: 92px;
        width: min(340px, 38vw);
    }

    .mgx-hero-main-title > span {
        font-size: clamp(58px, 6.2vw, 80px);
    }

    .mgx-hero-category {
        font-size: clamp(23px, 2.3vw, 31px);
        padding: 9px 20px;
    }

    .mgx-hero-text {
        max-width: 450px;
    }
}

/* =========================================================
   ANIMACIONES
   ========================================================= */

@keyframes mgxHeroTitleIn {
    from {
        opacity: 0;
        transform: translateX(-34px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes mgxHeroCategoryIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes mgxHeroTextIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mgxHeroCtaIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .mgx-hero-image,
    .mgx-hero-main-title,
    .mgx-hero-category,
    .mgx-hero-text,
    .mgx-hero-cta {
        animation: none !important;
        transition: none !important;
    }

    .mgx-hero-main-title,
    .mgx-hero-category,
    .mgx-hero-text {
        opacity: 1;
        transform: none;
    }

    .mgx-hero-cta {
        opacity: 1;
        transform: translateX(-50%);
    }
}

/* =========================================================
   MOTOGRAPHIX V9
   DESKTOP — UNIÓN INVISIBLE ENTRE NEGRO E IMAGEN
   =========================================================
   style.css tiene reglas más específicas para el HOME
   (#020202 + otro overlay). Estas reglas las neutralizan
   únicamente en escritorio, sin tocar móvil ni otras páginas.
   ========================================================= */

@media (min-width: 900px) {

    body.home.mgx-glass-ui .mgx-home-hero-shell,
    body.home.mgx-glass-ui .hero,
    body.home.mgx-glass-ui .mgx-hero-picture {
        background: #000 !important;
    }

    /*
     * El degradado permanece NEGRO PURO sobre la zona donde
     * comienza la imagen y recién después se abre suavemente.
     * Así desaparece la línea vertical entre el fondo negro
     * y el borde izquierdo de la fotografía.
     */
    body.home.mgx-glass-ui .mgx-hero-image-overlay {
        background:
            linear-gradient(
                90deg,
                #000 0%,
                #000 18%,
                rgba(0,0,0,.99) 24%,
                rgba(0,0,0,.94) 30%,
                rgba(0,0,0,.78) 38%,
                rgba(0,0,0,.52) 47%,
                rgba(0,0,0,.28) 56%,
                rgba(0,0,0,.10) 64%,
                rgba(0,0,0,0) 73%
            ),
            linear-gradient(
                180deg,
                rgba(0,0,0,.10) 0%,
                rgba(0,0,0,0) 54%,
                rgba(0,0,0,.08) 72%,
                rgba(0,0,0,.38) 100%
            ) !important;
    }

    /*
     * La imagen mantiene la altura exacta del hero.
     * El ancho se calcula solo y queda anclada a la derecha.
     */
    body.home.mgx-glass-ui .mgx-hero-image {
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;

        width: auto;
        height: 100%;
        max-width: none;

        object-fit: contain;
        object-position: right center;

        background: #000;
        transform: none;
    }
}

