/* =====================================================================
   PRODUCTO · MEDICINA · SECCIÓN 1 · HERO
   ---------------------------------------------------------------------
   Cabecera de la página de software para medicina,
   con la MISMA maqueta que el hero de talleres, pero COPIA INDEPENDIENTE:
   namespace propio g-pmh-* y hoja propia. No comparte nada con
   g-prod-taller-hero.css (g-pth-*): tocar una no afecta a la otra.

   - Fondo: foto clínica a la izquierda, fundida a azul sólido hacia la
     derecha (doble máscara + velo azul en degradé).
   - Mockup del software GRANDE, en absoluto, que SOBRESALE y se recorta
     por el borde derecho del viewport (overflow-x: clip).
   - Los elementos DECORATIVOS FLOTANTES (2 imágenes + 2 avatares) están
     maquetados pero OCULTOS desde la vista con la clase .d-none de
     Bootstrap. Su CSS se conserva íntegro para poder activarlos más
     adelante quitando ese .d-none del markup (cero cambios aquí).

   Consume SOLO tokens del contrato (g-colors.css).
   ===================================================================== */

.g-pmh-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 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 (intersección): un degradé HORIZONTAL que funde la foto
   hacia la derecha + un degradé VERTICAL que la disuelve hacia el borde
   INFERIOR, para que el filo inferior del hero quede azul uniforme y la
   transición con la sección siguiente sea natural. */
.g-pmh-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-pmh-hero-bg = url del .jpg
       (universal) y --g-pmh-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-pmh-hero-bg, url("../../img/producto/default/hero-bg.jpg"));
    background-image: -webkit-image-set(
        var(--g-pmh-hero-bg-webp, url("../../img/producto/default/hero-bg.webp")) type("image/webp"),
        var(--g-pmh-hero-bg,      url("../../img/producto/default/hero-bg.jpg"))  type("image/jpeg"));
    background-image: image-set(
        var(--g-pmh-hero-bg-webp, url("../../img/producto/default/hero-bg.webp")) type("image/webp"),
        var(--g-pmh-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 y cada vez más opaco hacia la derecha hasta volverse azul
   sólido, integrándose con el fondo del mockup. */
.g-pmh-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-pmh-hero > .container {
    position: relative;
    z-index: 2;
}

/* ---------- Columna de texto ---------- */
.g-pmh-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-pmh-hero__content > .badge {
    margin-bottom: 26px;
}

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

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

.g-pmh-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-pmh-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) */

/* ---------- Mockup grande (absoluto, sobresale por la derecha) ---------- */
.g-pmh-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-pmh-hero__mockup {
    display: block;
    position: relative;
    z-index: 2;           /* por encima del flotante 01, por debajo del 02/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);
}

/* ---------------------------------------------------------------------
   DECORATIVOS FLOTANTES — hoy OCULTOS con .d-none en el markup.
   Se conserva su CSS para reactivarlos quitando esa clase de la vista.
   --------------------------------------------------------------------- */

/* Tarjeta CUADRADA para las dos imágenes flotantes: la imagen (fondo
   claro propio) RELLENA la tarjeta de borde a borde; el radio recorta. */
.g-pmh-hero__01,
.g-pmh-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;
}
/* Flotante 01: DETRÁS del mockup, montado sobre su esquina sup-izq. */
.g-pmh-hero__01 {
    z-index: 1;
    top: -110px;
    left: -80px;
    width: 150px;
    height: 150px;
}
/* Flotante 02: por delante del mockup, sobre su borde superior. */
.g-pmh-hero__02 {
    z-index: 3;
    top: -66px;
    left: 47%;
    width: 158px;
    height: 158px;
}

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

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

.g-pmh-hero__01 {
    animation: g-pmh-float-01 6s ease-in-out -1s infinite alternate;
    will-change: transform;
}
.g-pmh-hero__02 {
    animation: g-pmh-float-02 7.5s ease-in-out -3s infinite alternate;
    will-change: transform;
}
.g-pmh-hero__circulo--paciente {
    animation: g-pmh-float-paciente 5.5s ease-in-out -2s infinite alternate;
    will-change: transform;
}
.g-pmh-hero__circulo--profesional {
    animation: g-pmh-float-profesional 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-pmh-hero__01,
    .g-pmh-hero__02,
    .g-pmh-hero__circulo--paciente,
    .g-pmh-hero__circulo--profesional {
        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-pmh-hero__media { width: 980px; left: 50%; }
    .g-pmh-hero__title { font-size: 38px; }
    .g-pmh-hero__02 { left: 60%; }
    .g-pmh-hero__circulo--profesional { left: 50%; }
}

/* Tablet/móvil (<992): el mockup deja de sobresalir; se apila debajo,
   centrado. Se OCULTAN los elementos flotantes para una lectura limpia
   y sin desbordes horizontales. */
@media (max-width: 991.98px) {
    .g-pmh-hero {
        padding: 52px 0 56px;
        overflow-x: hidden;
    }
    .g-pmh-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-pmh-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-pmh-hero .col-12 { min-width: 0; }
    .g-pmh-hero__content { text-align: center; }
    .g-pmh-hero__title,
    .g-pmh-hero__text {
        max-width: 100%;
        overflow-wrap: break-word;
        margin-left: auto;
        margin-right: auto;
    }
    .g-pmh-hero__title { font-size: 33px; }
    .g-pmh-hero__actions { justify-content: center; }

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

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

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