/* =====================================================================
   PRODUCTO · TALLERES · SECCIÓN 1 · HERO
   ---------------------------------------------------------------------
   Cabecera de la página de software para talleres.
   - Fondo: foto de operario en DUOTONO AZUL a la izquierda, fundida a
     azul sólido hacia la derecha (mask + background-blend-mode: color).
   - Mockup del software GRANDE, posicionado en absoluto, que SOBRESALE y
     se recorta por el borde derecho del viewport (overflow-x: clip), con
     imágenes flotantes (auto y teléfono) y avatares (CLIENTE / TÉCNICO).
   Namespacing g-pth-*. Consume el contrato de colores.
   ===================================================================== */

.g-pth-hero {
    position: relative;
    background-color: var(--g-primary-dark);
    /* clip solo el eje X: recorta el sangrado derecho del mockup sin
       generar scroll horizontal; deja el sangrado vertical visible. */
    overflow-x: clip;
    padding: 78px 0 96px;
}

/* Fondo (capa 1): la FOTO del operario con sus colores naturales,
   anclada a la izquierda y desvanecida hacia la derecha para revelar el
   azul sólido del contenedor bajo el mockup.
   DOBLE MÁSCARA (compuestas con intersección): un degradé HORIZONTAL que
   funde la foto hacia la derecha + un degradé VERTICAL que la disuelve
   hacia el borde INFERIOR. Así, al terminar la imagen no queda un corte
   duro contra la sección blanca de abajo: el filo inferior del hero pasa
   a ser azul sólido uniforme en todo el ancho (transición de sección
   natural), disimulando la línea. La foto solo se muestra donde AMBAS
   máscaras son opacas. */
.g-pth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    /* La FOTO varía por rubro. La vista inyecta DOS custom properties por rubro
       (img_rubro, fallback a default/ vía helper): --g-pth-hero-bg = url del .jpg
       (universal) y --g-pth-hero-bg-webp = url del .webp. Entrega WebP con
       image-set y fallback en cascada:
         1) background-image jpg  → SIEMPRE válido (navegadores sin image-set); es
            el fondo del rubro, no el default (cero regresión).
         2) -webkit-image-set     → Safari/Chrome anteriores a 2023.
         3) image-set (estándar)  → resto de navegadores modernos.
       Los que no soporten image-set se quedan en (1). No se usa la property para
       CONTENER el image-set porque las custom properties NO hacen fallback por
       valor inválido (aceptan cualquier token): el image-set debe vivir sobre una
       property REAL (background-image) para que el prefijo -webkit- degrade bien. */
    background-image: var(--g-pth-hero-bg, url("../../img/producto/default/hero-bg.jpg"));
    background-image: -webkit-image-set(
        var(--g-pth-hero-bg-webp, url("../../img/producto/default/hero-bg.webp")) type("image/webp"),
        var(--g-pth-hero-bg,      url("../../img/producto/default/hero-bg.jpg"))  type("image/jpeg"));
    background-image: image-set(
        var(--g-pth-hero-bg-webp, url("../../img/producto/default/hero-bg.webp")) type("image/webp"),
        var(--g-pth-hero-bg,      url("../../img/producto/default/hero-bg.jpg"))  type("image/jpeg"));
    background-size: auto 100% !important;
    background-position: left center !important;
    background-repeat: no-repeat !important;

    -webkit-mask-image:
        linear-gradient(90deg, #000 0%, #000 30%, rgba(0,0,0,.55) 44%, transparent 55%),
        linear-gradient(180deg, #000 0%, #000 76%, transparent 97%);
            mask-image:
        linear-gradient(90deg, #000 0%, #000 30%, rgba(0,0,0,.55) 44%, transparent 55%),
        linear-gradient(180deg, #000 0%, #000 76%, transparent 97%);
    -webkit-mask-composite: source-in;   /* legacy WebKit: intersección */
            mask-composite: intersect;   /* estándar: intersección */
}
/* Fondo (capa 2): VELO azul en degradé sobre la foto; translúcido a la
   izquierda (deja ver el taller) y cada vez más opaco hacia la derecha
   hasta volverse azul sólido, integrándose con el fondo del mockup. */
.g-pth-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(90deg,
        rgba(0, 62, 92, .48) 0%,
        rgba(0, 70, 104, .62) 24%,
        rgba(0, 78, 116, .84) 40%,
        var(--g-primary-dark) 50%);
}

/* El .container es el ancla del mockup absoluto */
.g-pth-hero > .container {
    position: relative;
    z-index: 2;
}

/* ---------- Columna de texto ---------- */
.g-pth-hero__content {
    position: relative;
    z-index: 5;           /* el texto siempre por encima del mockup/flotantes */
    color: var(--g-white);
    padding: 8px 0;
}

/* Badge / eyebrow → SISTEMA ÚNICO de badges: .badge.badge-secondary dentro
   del contexto .g-on-dark ("vidrio" translúcido). Ver g-bootstrap.css.
   Aquí solo su separación vertical. */
.g-pth-hero__content > .badge {
    margin-bottom: 26px;
}

.g-pth-hero__title {
    color: var(--g-white);
    font-size: 44px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 26px;
    max-width: 560px;
}

.g-pth-hero__text {
    color: rgba(255, 255, 255, .94);
    font-size: 17px;
    line-height: 1.6;
    max-width: 500px;
    margin-bottom: 18px;
}

.g-pth-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

/* Los botones del hero usan el SISTEMA ESTÁNDAR del sitio (g-bootstrap.css):
   el contenedor .g-pth-hero__actions lleva la clase .g-on-dark, y dentro:
     · "Probar gratis"  → .btn.btn-primary  (contorno blanco → se rellena en hover)
     · WhatsApp          → .btn.btn-success  (verde de marca)
   Las clases g-pth-hero__btn* quedaron obsoletas. */

/* ---------- Mockup grande (absoluto, sobresale por la derecha) ---------- */
.g-pth-hero__media {
    position: absolute;
    top: 44px;
    left: 52%;            /* arranca pasado el centro del container (no pisa el texto) */
    width: 1180px;        /* grande: sobresale del viewport por la derecha */
    z-index: 1;
}

.g-pth-hero__mockup {
    display: block;
    position: relative;
    z-index: 2;           /* por encima del auto, por debajo de teléfono/avatares */
    width: 100%;
    max-width: none;      /* anula el max-width:100% global */
    height: auto;
    border-radius: var(--g-radius-md);
    box-shadow: 0 26px 64px rgba(0, 0, 0, .34);
}

/* Tarjeta CUADRADA para auto y teléfono: la imagen (fondo claro propio)
   RELLENA la tarjeta de borde a borde; el radio recorta las esquinas. */
.g-pth-hero__01,
.g-pth-hero__02 {
    position: absolute;
    background-color: var(--g-white);
    border-radius: var(--g-radius-lg);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .28);
    object-fit: cover;
}
/* Auto: DETRÁS del mockup (z-index 1), montado sobre su esquina sup-izq;
   la interfaz lo tapa parcialmente por la derecha/abajo. */
.g-pth-hero__01 {
    z-index: 1;
    top: -110px;
    left: -80px;
    width: 150px;
    height: 150px;
}
/* Teléfono: por delante del mockup */
.g-pth-hero__02 {
    z-index: 3;
}
/* Teléfono: montado sobre el borde superior del mockup, zona central
   (por encima de la barra de búsqueda), no pegado al borde derecho. */
.g-pth-hero__02 {
    top: -66px;
    left: 47%;
    width: 158px;
    height: 158px;
}

/* Avatares (CLIENTE / TÉCNICO): el PNG ya trae la etiqueta naranja
   incrustada; se coloca tal cual, sin marco ni texto adicional. */
.g-pth-hero__circulo {
    position: absolute;
    z-index: 4;
    display: block;
    width: 150px;
    height: auto;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .32));
}
/* CLIENTE: sobre el borde izquierdo del mockup, zona media-baja */
.g-pth-hero__circulo--cliente {
    top: 48%;
    left: -100px;
}
/* TÉCNICO: abajo a la derecha, montado sobre el borde inferior */
.g-pth-hero__circulo--tecnico {
    bottom: -64px;
    left: 40%;
    width: 168px;
}

/* ---------- Flotación ambiental de los elementos decorativos ----------
   Movimiento sutil e infinito. Cada elemento tiene su propia dirección,
   duración y desfase (animation-delay negativo) para que floten
   independientes, sin verse sincronizados. Solo se anima `transform`:
   los elementos se posicionan con top/left/bottom (no con transform),
   así que no hay conflicto con su ubicación. */
@keyframes g-pth-float-01 {
    from { transform: translate(0, 0) rotate(0deg); }
    to   { transform: translate(-7px, -14px) rotate(-2deg); }
}
@keyframes g-pth-float-02 {
    from { transform: translate(0, 0) rotate(0deg); }
    to   { transform: translate(10px, -11px) rotate(2deg); }
}
@keyframes g-pth-float-cliente {
    from { transform: translate(0, 0); }
    to   { transform: translate(-11px, 9px); }
}
@keyframes g-pth-float-tecnico {
    from { transform: translate(0, 0); }
    to   { transform: translate(9px, 13px); }
}

.g-pth-hero__01 {
    animation: g-pth-float-01 6s ease-in-out -1s infinite alternate;
    will-change: transform;
}
.g-pth-hero__02 {
    animation: g-pth-float-02 7.5s ease-in-out -3s infinite alternate;
    will-change: transform;
}
.g-pth-hero__circulo--cliente {
    animation: g-pth-float-cliente 5.5s ease-in-out -2s infinite alternate;
    will-change: transform;
}
.g-pth-hero__circulo--tecnico {
    animation: g-pth-float-tecnico 8s ease-in-out -4s infinite alternate;
    will-change: transform;
}

/* Accesibilidad: sin flotación si el usuario prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .g-pth-hero__01,
    .g-pth-hero__02,
    .g-pth-hero__circulo--cliente,
    .g-pth-hero__circulo--tecnico {
        animation: none;
    }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

/* lg intermedio (992–1199): mockup algo menor para no invadir el texto */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .g-pth-hero__media { width: 980px; left: 50%; }
    .g-pth-hero__title { font-size: 38px; }
    .g-pth-hero__02 { left: 60%; }
    .g-pth-hero__circulo--tecnico { left: 50%; }
}

/* Tablet/móvil (<992): el mockup deja de sobresalir; se apila debajo,
   centrado. Se OCULTAN los elementos flotantes (auto, teléfono y avatares)
   para una lectura limpia y sin desbordes horizontales. */
@media (max-width: 991.98px) {
    .g-pth-hero {
        padding: 52px 0 56px;
        overflow-x: hidden;
    }
    .g-pth-hero::before {
        -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 55%, transparent 88%);
                mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 55%, transparent 88%);
        background-position: center, center top;
    }
    .g-pth-hero::after { background: linear-gradient(180deg, rgba(0,40,60,.4), transparent 60%); }

    /* min-width:0 permite que la columna flex encoja por debajo del
       min-content del título (evita el desborde horizontal en móviles). */
    .g-pth-hero .col-12 { min-width: 0; }
    .g-pth-hero__content { text-align: center; }
    .g-pth-hero__title,
    .g-pth-hero__text {
        max-width: 100%;
        overflow-wrap: break-word;
        margin-left: auto;
        margin-right: auto;
    }
    .g-pth-hero__title { font-size: 33px; }
    .g-pth-hero__actions { justify-content: center; }

    /* Mockup apilado, centrado y sin sobresalir */
    .g-pth-hero__media {
        position: relative;
        width: 100%;
        max-width: 560px;
        margin: 46px auto 6px;
        left: auto;
        top: auto;
    }
    .g-pth-hero__mockup { max-width: 100%; }

    /* Flotantes decorativos ocultos en pantallas chicas */
    .g-pth-hero__01,
    .g-pth-hero__02,
    .g-pth-hero__circulo { display: none; }
}

@media (max-width: 575.98px) {
    .g-pth-hero__title { font-size: 27px; }
    .g-pth-hero__actions { flex-direction: column; }
}
