/* ══════════════════════════════════════════════════════════════════════════════════════════
   HOME FIJO · Freshslice (2026-11-22) — PANTALLA APROBADA, NO TOCAR SIN INDICACIÓN DEL DUEÑO
   Acomodo del home en CELULAR 100 % CSS: ya no se mide ni se escala con JavaScript (eso fallaba
   según cuándo llegaban las imágenes, sobre todo en iPhone). El JS de vista_home.php solo pone
   la clase según la forma de la pantalla:  body.hm-css-v = parado · body.hm-css-h = acostado.
   Todo lo demás lo resuelve el navegador; los bloques con arte (tarjeta/anuncio y banner del torneo)
   se ajustan al alto que les toca conservando su proporción.
   PARADO (método v4): los tamaños salen del alto ESTABLE (svh: con la barra del navegador), así el arte
   sale IGUAL en cada recarga; la página llena el alto real (dvh) y lo que sobre se reparte entre bloques.
   ══════════════════════════════════════════════════════════════════════════════════════════ */

/* ───────────── CELULAR PARADO · método v4 (2026-11-22) ─────────────
   Una sola regla de juego: alto estable (svh) → piezas fijas con alto explícito → el resto es para el arte.
   Tarjeta y banner van SIEMPRE de orilla a orilla; lo que sobre de alto se reparte entre los bloques. */
body.pv-on.pv-v-home.hm-css-v{
  --hm-vh:var(--prueba-svh,100svh);                                   /* alto estable: con la barra del navegador */
  --hm-sat:var(--prueba-sat,env(safe-area-inset-top,0px));
  --hm-sab:var(--prueba-sab,env(safe-area-inset-bottom,0px));
  --hm-W:calc(100vw - 16px);                                          /* ancho útil (8 px de orilla) */
  --hm-pt:16px;                                                       /* aire arriba del encabezado */
  --hm-toph:63px;                                                     /* alto del encabezado */
  --hm-top:calc(var(--hm-sat) + var(--hm-pt) + var(--hm-toph));
  --hm-bot:calc(var(--pv-nav,72px) + var(--hm-sab) + 6px);           /* menú de abajo */
  --hm-hola:44px;
  --hm-cta:clamp(34px,calc(var(--hm-vh) * .05),48px);
  --hm-fh:clamp(50px,calc(var(--hm-vh) * .08),96px);
  --hm-head:22px;
  --hm-con:48px;
  --hm-g:4px;                                                          /* espacio mínimo entre bloques */
  --hm-fijo:calc(var(--hm-hola) + var(--hm-cta) + var(--hm-fh) + var(--hm-head) + var(--hm-con) + 9px + var(--hm-g) * 4);   /* 9 px = 3 bajo el encabezado + 6 sobre Conecta */
  --hm-arte:calc(var(--hm-vh) - var(--hm-top) - var(--hm-bot) - var(--hm-fijo));
  --hm-ban:clamp(min(calc(var(--hm-arte) * .36),calc(var(--hm-W) / 3.1)),calc(var(--hm-arte) * .4),calc(var(--hm-W) / 2.8));
  --hm-banW:min(var(--hm-W),calc(var(--hm-ban) * 3.1));              /* el banner solo se angosta en pantallas diminutas */
  --hm-card:clamp(96px,calc(var(--hm-arte) - var(--hm-ban)),calc(var(--hm-W) / 1.585));
  --hm-cardW:min(var(--hm-W),calc(var(--hm-card) * 2.05));           /* el verde: de orilla a orilla (salvo pantallas diminutas) */
  --hm-esc:min(var(--hm-W),calc(var(--hm-card) * 1.585));            /* ancho de DISEÑO del contenido de la tarjeta */
  --hm-pad:calc(var(--hm-esc) * .0472);                               /* orilla interna, igual que el diseño aprobado */
  padding-bottom:0 !important;height:100vh;height:100dvh;overflow:hidden}
body.pv-v-home.hm-css-v .wrap{box-sizing:border-box;height:100vh;height:100dvh;min-height:0 !important;display:flex;flex-direction:column;overflow:hidden;
  padding-top:calc(var(--hm-sat) + var(--hm-pt)) !important;padding-bottom:var(--hm-bot) !important}
body.pv-v-home.hm-css-v .pv-top{flex:none;box-sizing:border-box;height:var(--hm-toph);min-height:0 !important}
body.pv-on.pv-v-home.hm-css-v .pv-top::before{top:calc((var(--hm-sat) + var(--hm-pt)) * -1)}   /* el verde llega hasta arriba (muesca del iPhone) */
body.pv-v-home.hm-css-v main.hm{flex:1 1 0;min-height:0;display:flex;flex-direction:column;justify-content:space-evenly;gap:var(--hm-g);
  margin:0 !important;padding:0 !important;width:100% !important;max-width:none !important}
body.pv-v-home.hm-css-v main.hm > *{flex:none;margin-top:0 !important;margin-bottom:0 !important}
/* saludo */
body.pv-v-home.hm-css-v main.hm > .hm-hola{box-sizing:border-box;height:var(--hm-hola);padding:0 !important}
/* TARJETA Come y Gana / anuncio / sucursales: el verde de orilla a orilla; el contenido se mide contra #hmRota */
body.pv-v-home.hm-css-v main.hm > #hmRota{display:block;position:relative;box-sizing:border-box;height:var(--hm-card);width:var(--hm-esc) !important;max-width:none !important;
  margin-inline:0 !important;padding:0 var(--hm-pad) !important;align-self:center;container-type:size}   /* su ancho SIN orillas = la medida del contenido (como el diseño aprobado) */
body.pv-v-home.hm-css-v #hmRota > .hm-lunch,
body.pv-v-home.hm-css-v #hmRota > .hm-anuncio,
body.pv-v-home.hm-css-v #hmRota > .hm-suc{position:absolute !important;inset:auto !important;top:0 !important;left:50% !important;translate:-50% 0;
  box-sizing:border-box;width:var(--hm-cardW) !important;height:100% !important;max-width:none !important;aspect-ratio:auto !important;margin:0 !important}
body.pv-v-home.hm-css-v #hmRota > .hm-lunch{container-type:normal;padding:calc(var(--hm-esc) * .045) var(--hm-pad) calc(var(--hm-esc) * .0354) !important}   /* sus medidas (cqw) salen del ancho de diseño, no del verde */
/* botones y puertas */
body.pv-v-home.hm-css-v main.hm > .hm-acciones{height:var(--hm-cta)}
body.pv-v-home.hm-css-v .hm-acciones .hm-cta{min-height:0 !important;height:100% !important;margin:0 !important}
/* torneo: encabezado, banner de orilla a orilla y «Conecta», cada uno con su alto */
body.pv-v-home.hm-css-v main.hm > .hm-torneo{display:flex;flex-direction:column;gap:0}
body.pv-v-home.hm-css-v .hm-torneo > *{flex:none;margin-top:0 !important;margin-bottom:0 !important}
body.pv-v-home.hm-css-v .hm-torneo .hm-sec-head{box-sizing:border-box;height:var(--hm-head);margin:0 .1rem 3px !important;overflow:hidden;align-items:center}
body.pv-v-home.hm-css-v .hm-torneo .hm-carr-caja{height:var(--hm-ban);width:var(--hm-banW) !important;align-self:center;margin-inline:0 !important;container-type:normal;display:block}
body.pv-v-home.hm-css-v .hm-torneo .hm-carr{width:100% !important;height:100% !important;max-height:none !important}
body.pv-v-home.hm-css-v .hm-torneo .hm-carr .hm-ban{height:100% !important;aspect-ratio:auto !important}
body.pv-v-home.hm-css-v .hm-torneo .hm-puntos:empty{display:none}
body.pv-v-home.hm-css-v .hm-torneo .hm-conecta{box-sizing:border-box;height:var(--hm-con);margin-top:6px !important;overflow:hidden}
/* pantallas bajitas (iPhone SE, Android chico): encabezado, saludo y «Conecta» más compactos */
@media (max-height:680px){
  body.pv-on.pv-v-home.hm-css-v{--hm-pt:8px;--hm-toph:54px;--hm-hola:38px;--hm-con:44px;--hm-head:20px;--hm-fh:clamp(46px,calc(var(--hm-vh) * .08),96px);--hm-cta:clamp(32px,calc(var(--hm-vh) * .05),48px)}
  body.pv-v-home.hm-css-v .pv-top{padding-top:0 !important;padding-bottom:.55rem !important}
  body.pv-v-home.hm-css-v .hm-hola .fs-masc{height:38px;width:auto}
}

/* ───────────── CELULAR ACOSTADO: tres columnas ───────────── */
body.pv-on.pv-v-home.hm-css-h{padding-bottom:0 !important;height:100vh;height:100svh;overflow:hidden}
body.pv-v-home.hm-css-h .wrap{box-sizing:border-box;height:100vh;height:100svh;min-height:0 !important;max-width:none !important;width:100% !important;
  display:flex;flex-direction:column;overflow:hidden;
  padding:4px max(14px,env(safe-area-inset-right,0px)) calc(46px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px)) !important}
body.pv-v-home.hm-css-h .pv-top{flex:none;padding:2px 0 4px !important;min-height:0 !important}
body.pv-v-home.hm-css-h .pv-top .pv-brand img{height:30px !important;width:auto !important}
body.pv-v-home.hm-css-h .pv-top .pv-top-acts{transform:scale(.8);transform-origin:right center}
body.pv-v-home.hm-css-h .pv-nav{padding:3px 6px !important}
body.pv-v-home.hm-css-h .pv-nav .pv-nav-it{flex-direction:row !important;gap:6px;padding:0 !important;min-height:0 !important;height:36px}
body.pv-v-home.hm-css-h .pv-nav .pv-nav-ic{width:30px !important;height:30px !important}
body.pv-v-home.hm-css-h .pv-nav .pv-nav-ic svg{width:18px;height:18px}
body.pv-v-home.hm-css-h main.hm{flex:1 1 0;min-height:0;display:grid;margin:0 !important;padding:0 !important;width:100% !important;max-width:none !important;
  grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);column-gap:14px;row-gap:6px}
body.pv-v-home.hm-css-h main.hm > *{margin:0 !important;min-width:0}
body.pv-v-home.hm-css-h main.hm > .pv-hola{grid-column:1 / -1}
body.pv-v-home.hm-css-h main.hm > #hmRota{grid-column:1;grid-row:2 / 4;width:100% !important;min-height:0;container-type:size;place-items:center}
body.pv-v-home.hm-css-h #hmRota > .hm-lunch{width:min(100cqw,100cqh * 1.595) !important;justify-self:center;align-self:center}
body.pv-v-home.hm-css-h #hmRota > .hm-anuncio,
body.pv-v-home.hm-css-h #hmRota > .hm-suc{inset:auto !important;left:50% !important;top:50% !important;translate:-50% -50%;
  width:min(100cqw,100cqh * 1.595) !important;height:auto !important;aspect-ratio:1.595}
body.pv-v-home.hm-css-h main.hm > .hm-acciones{grid-column:2;grid-row:2;display:grid !important;grid-template-columns:1fr !important;gap:6px}
body.pv-v-home.hm-css-h .hm-acciones .hm-cta{min-height:0 !important;height:clamp(32px,9svh,46px);width:100%}
body.pv-v-home.hm-css-h main.hm > .pv-fichas{grid-column:2;grid-row:3;min-height:0;display:grid !important;grid-template-columns:1fr 1fr !important;grid-auto-rows:1fr;gap:6px}
body.pv-v-home.hm-css-h .hm-fichas .pv-ficha{--fh:100%;height:auto !important;min-height:0 !important}
body.pv-v-home.hm-css-h main.hm > .hm-torneo{grid-column:3;grid-row:2 / 4;min-height:0;display:flex;flex-direction:column}
body.pv-v-home.hm-css-h .hm-torneo > *{flex:none}
body.pv-v-home.hm-css-h .hm-torneo .hm-sec-head{flex-wrap:wrap;margin:0 0 .2rem !important}
body.pv-v-home.hm-css-h .hm-torneo .hm-carr-caja{flex:1 1 0 !important;min-height:0;container-type:size;margin-inline:0 !important;width:auto !important;display:grid;place-items:center}
body.pv-v-home.hm-css-h .hm-torneo .hm-carr{width:min(100cqw,100cqh * 2.72) !important;max-height:100cqh}
body.pv-v-home.hm-css-h .hm-torneo .hm-sec-head h2{font-size:clamp(.78rem,2.1vw,1.05rem)}
/* acostado y MUY bajito (iPhone SE con barras, 667×320): las puertas no caben con el ícono arriba → ícono al lado del texto */
@media (orientation:landscape) and (max-height:335px){
  body.pv-v-home.hm-css-h .hm-fichas .pv-ficha{flex-direction:row !important;justify-content:center;align-items:center;gap:6px !important;padding:2px 6px !important}
  body.pv-v-home.hm-css-h .hm-fichas .pv-ficha svg{width:18px !important;height:18px !important;flex:none}
  body.pv-v-home.hm-css-h .hm-fichas .pv-ficha span{font-size:11px !important;line-height:1.05 !important;text-align:left;margin:0 !important}
  body.pv-v-home.hm-css-h .hm-acciones .hm-cta{height:clamp(28px,9svh,46px)}
}

/* ══ 2026-11-23 ══ VENTANAS CENTRADAS (dueño: «la ventana flotante se sube mucho; que todo esté centrado»). Las reglas de
   arriba le quitan el margen de arriba/abajo (acostado: todo el margen) a cada hijo de main.hm, y la ventana BROADCAST
   (<dialog id="hmBroad">) es hija de main: perdía el margin:auto que la centra y quedaba pegada arriba. */
body.pv-v-home main.hm > dialog[open]{margin:auto !important}

/* v182 (dueño 2026-11-27): celular ACOSTADO de 900 px o más (iPhone Pro Max/Plus 932×430, Android 915×412):
   la regla de PC de home.css (min-width:900px) ponía align-items:start y la tarjeta Eat & Earn y el
   banner del torneo quedaban en alto 0 (no se veían). En el modo acostado del celular se estiran a su celda. */
body.pv-v-home.hm-css-h main.hm{align-items:stretch}
body.pv-v-home.hm-css-h main.hm > .hm-torneo{align-self:stretch}
