/* Home v2 (variante B de la prueba de la portada, includes/home_v2.php). Solo se carga en esa variante.
   Usa los tokens de style.css: fondo blanco, profundidad con tintes azules, sombras y halo; Manrope + Inter.
   Una columna en el celular (≤ 860 px), dos en escritorio. Clases con prefijo hv2- para no pisar style.css. */

.hv2 { --hv2-gap: 48px; }
.hv2 h1, .hv2 h2, .hv2 h3 { text-wrap: balance; }
.hv2-sec { font-weight: 600; text-decoration: none; }
.hv2-sec:hover { text-decoration: underline; }
.hv2-dos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--hv2-gap); align-items: center; }

/* Hero: titular, clase con play, un botón y la línea de confianza. */
.hv2-hero { background: var(--halo), var(--white); padding: 48px 0 56px; }
.hv2-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--hv2-gap); align-items: center; }
.hv2-hero-txt { display: grid; gap: 18px; }
.hv2-hero-txt .eyebrow { margin: 0; }
.hv2-hero h1 { margin: 0; font-size: clamp(30px, 4.4vw, 48px); line-height: 1.1; letter-spacing: -.01em; }
.hv2-lead { margin: 0; font-size: 18px; line-height: 28px; color: var(--text-2); max-width: 48ch; }
.hv2-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0; }
.hv2-confianza { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding-top: 4px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.hv2-confianza b { color: var(--navy); font-family: var(--font-head); font-size: 16px; }
.hv2-clase { position: relative; display: block; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--elev-3); aspect-ratio: 16 / 9; background: #0E1A33; margin: 0; }
.hv2-clase img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
a.hv2-clase:hover img { transform: scale(1.03); }
.hv2-play { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: var(--r-pill); background: #FFFFFFF2; color: var(--navy); font: 700 14px/20px var(--font-body); box-shadow: var(--elev-2); }
.hv2-play i { position: relative; flex: none; width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--primary); }
.hv2-play i::after { content: ""; position: absolute; left: 14px; top: 11px; border-left: 12px solid var(--white); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

/* El protocolo de muestra: texto, puerta gratis y enlaces a los protocolos públicos; a la derecha la ficha. */
.hv2-proto-txt { display: grid; gap: 16px; }
.hv2-proto-txt .eyebrow { margin: 0; }
.hv2-proto-txt h2 { margin: 0; font-size: 26px; line-height: 33px; }
.hv2-proto-txt > p:not(.eyebrow) { margin: 0; color: var(--text-2); font-size: 17px; line-height: 27px; }
.hv2-proto-txt > p.hv2-gratis { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-card-sm); background: var(--success-bg); color: var(--success); font-size: 15px; line-height: 23px; }
.hv2-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; }
.hv2-chips p { width: 100%; margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.hv2-chips a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--tint-50); color: var(--navy); font-size: 14px; text-decoration: none; }
.hv2-chips a:hover { border-color: var(--primary); color: var(--primary); }
.hv2-ficha { overflow: hidden; border: 1px solid var(--tint-200); border-top: 4px solid var(--primary); border-radius: var(--r-card); background: var(--white); box-shadow: var(--elev-2); }
.hv2-ficha img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.hv2-ficha-in { display: grid; gap: 12px; padding: 18px 20px 20px; }
.hv2-ficha h3 { margin: 0; font-size: 19px; line-height: 26px; }
.hv2-ficha h3 a { color: var(--navy); text-decoration: none; }
.hv2-ficha h3 a:hover { color: var(--primary); text-decoration: underline; }
.hv2-ficha dl { display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: 15px; }
.hv2-ficha dt, .hv2-ficha dd { padding: 9px 0; border-bottom: 1px solid var(--tint-100); }
.hv2-ficha dt { padding-right: 16px; color: var(--text-2); }
.hv2-ficha dd { margin: 0; font-weight: 700; color: var(--navy); text-align: right; font-variant-numeric: tabular-nums; }
.hv2-ficha dl > :nth-last-child(-n+2) { border-bottom: 0; }
.hv2-ficha-nota { margin: 0; font-size: 12px; line-height: 18px; color: var(--text-2); }

/* Clases de muestra (portadas completas, sin recortar). */
.hv2-muestras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hv2-muestra { display: grid; gap: 8px; color: var(--navy); text-decoration: none; }
.hv2-muestra-img { position: relative; display: block; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-card-sm); background: var(--white); box-shadow: var(--elev-1); }
.hv2-muestra-img img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
.hv2-muestra-img span { position: absolute; top: 8px; right: 8px; padding: 2px 10px; border: 1px solid #16653433; border-radius: var(--r-pill); background: var(--success-bg); color: var(--success); font: 700 12px/18px var(--font-body); }
.hv2-muestra b { font-family: var(--font-head); font-size: 17px; line-height: 24px; }
.hv2-muestra small { color: var(--text-2); font-size: 14px; line-height: 20px; }
.hv2-muestra:hover b { color: var(--primary); text-decoration: underline; }

/* Qué vas a dominar. */
.hv2-dominar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.hv2-dom { display: grid; align-content: start; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-card-sm); background: var(--white); }
.hv2-dom img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; border-bottom: 1px solid var(--border); }
.hv2-dom div { display: grid; gap: 4px; padding: 14px 16px 16px; }
.hv2-dom h3 { margin: 0; font-size: 17px; line-height: 24px; }
.hv2-dom p { margin: 0; font-size: 14px; line-height: 21px; color: var(--text-2); }
.hv2-dom-pie { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin: 20px 0 0; font-size: 15px; color: var(--text-2); }
.hv2-dom-pie b { color: var(--navy); }

/* Profesionales: testimonios (solo con 3 o más aprobados) y fichas Pro del Mapa. */
.hv2-testis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.hv2-testi { display: grid; gap: 14px; align-content: space-between; margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-card-sm); background: var(--white); box-shadow: var(--elev-1); }
.hv2-testi blockquote { margin: 0; }
.hv2-testi blockquote p { margin: 0; color: var(--text); line-height: 1.6; }
.hv2-testi figcaption { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--text-2); }
.hv2-testi figcaption b { display: block; color: var(--navy); }
.hv2-fichas { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }

/* El precio en una línea, con la garantía. */
.hv2-precio { display: grid; gap: 16px; max-width: 760px; padding: 24px; border: 1px solid var(--tint-200); border-top: 4px solid var(--primary); border-radius: var(--r-card); background: var(--white); box-shadow: var(--elev-2); }
.hv2-precio-linea { margin: 0; font-size: 18px; line-height: 30px; color: var(--text); }
.hv2-precio-linea b { font-family: var(--font-head); font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hv2-incluye { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--text-2); }
.hv2-incluye li::before { content: "✓ "; color: var(--primary); font-weight: 700; }
.hv2-garantia { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: var(--navy); font-size: 15px; line-height: 23px; font-weight: 600; }
.hv2-garantia svg { flex: none; width: 26px; height: 26px; color: var(--primary); }
.hv2-garantia a { font-weight: 500; }

/* Mapa, más corto que el de la portada A. */
.hv2-mapa .hv2-dos { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
.hv2-mapa h2 { margin: 0 0 12px; font-size: 26px; line-height: 33px; }
.hv2-mapa .hv2-dos > div > p:not(.eyebrow) { margin: 0 0 16px; color: var(--text-2); font-size: 17px; line-height: 27px; }
.hv2-mapa-fig { max-width: 380px; justify-self: center; width: 100%; }

/* Cierre: un botón y lo gratis como enlace. */
.hv2 .cierre-pub .acciones { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; }

/* Botón fijo del celular: sale al pasar el botón del hero y se esconde en el cierre (assets/js/home.js). */
.hv2-fijo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--border); background: #FFFFFFF5; box-shadow: 0 -8px 24px #0B2D8F14; transform: translateY(110%); transition: transform .25s ease; }
.hv2-fijo.hv2-ver { transform: none; }
.hv2-fijo-in { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto; }
.hv2-fijo-txt { flex: 1; font-size: 13px; line-height: 18px; color: var(--text-2); }
.hv2-fijo-txt b { display: block; color: var(--navy); font-size: 14px; }
.hv2-fijo .btn { min-height: 48px; }

/* Ventana del video (dialog nativo). */
/* margin e inset explícitos: el reinicio de márgenes de style.css le quitaba el centrado de <dialog>. */
.hv2-modal { position: fixed; inset: 0; width: min(960px, calc(100% - 32px)); height: fit-content; max-width: none; max-height: calc(100% - 32px); margin: auto; padding: 0; border: 0; background: transparent; overflow: visible; }
.hv2-modal::backdrop { background: #0B1B3DE6; }
.hv2-modal-in { display: grid; gap: 10px; }
.hv2-modal video { width: 100%; height: auto; border-radius: var(--r-card-sm); background: #000; }
.hv2-modal p { margin: 0; color: var(--white); font-size: 14px; text-align: center; }
.hv2-modal-cerrar { justify-self: end; min-height: 44px; padding: 8px 16px; border: 0; border-radius: var(--r-pill); background: var(--white); color: var(--navy); font: 700 15px/20px var(--font-body); cursor: pointer; }

@media (max-width: 960px) {
  .hv2-dominar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hv2 { --hv2-gap: 24px; }
  .hv2-hero { padding: 28px 0 40px; }
  .hv2-hero-in, .hv2-dos, .hv2-mapa .hv2-dos { grid-template-columns: minmax(0, 1fr); }
  /* En el celular la clase sube justo debajo de la entrada, antes del botón. */
  .hv2-hero-txt { display: contents; }
  .hv2-hero .eyebrow { order: 1; } .hv2-hero h1 { order: 2; } .hv2-lead { order: 3; font-size: 16px; line-height: 25px; }
  .hv2-clase-wrap { order: 4; } .hv2-acciones { order: 5; } .hv2-confianza { order: 6; justify-content: center; }
  .hv2-hero .hv2-acciones, .hv2-precio .hv2-acciones { flex-direction: column; align-items: stretch; text-align: center; }
  .hv2-hero .hv2-acciones .btn, .hv2-precio .hv2-acciones .btn, .hv2-proto-txt .btn { width: 100%; }
  .hv2-testis, .hv2-fichas { grid-template-columns: minmax(0, 1fr); }
  .hv2-mapa-fig { max-width: 240px; }
}
@media (min-width: 861px) { .hv2-fijo { display: none; } }
@media (max-width: 560px) {
  .hv2-muestras { gap: 12px; }
  .hv2-muestra b { font-size: 14px; line-height: 20px; }
  .hv2-muestra small { font-size: 12px; }
  .hv2-dominar { gap: 10px; }
  .hv2-dom div { padding: 10px 12px 12px; }
  .hv2-dom h3 { font-size: 15px; line-height: 21px; }
  .hv2-dom p { font-size: 13px; line-height: 19px; }
  .hv2-precio { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) { .hv2-fijo, .hv2-clase img { transition: none; } }
