/*
 * visor-vertical.css -- Visor vertical compartido por Clasica, App, Libro y
 * Temas (docs/specs/fotos-videos-verticales.md v2, 2026-10-10). Nunca se
 * encola en el diseño Vertical. Reglas portadas de carta-vertical.css (.vc-*)
 * bajo el prefijo .pv-, todas dentro de .pv-overlay para no chocar con el CSS
 * de cada piel; tipografia heredada de la piel (font-family: inherit).
 * Incluye tambien el distintivo ▶ (.pf-play), el boton "Ver en vertical"
 * (.pv-abrir, su posicion la fija el CSS de cada piel) y la foto vertical
 * completa sobre fondo desenfocado en las cajas grandes (.is-foto-vertical /
 * .pf-fondo, spec 3.3). Sin atributos style="" (L-684).
 */

/* ---------- boton de cabecera "Ver en vertical" ---------- */

.pv-abrir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent;
}
.pv-abrir:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pv-abrir-txt { letter-spacing: .01em; }

/* ---------- pista "Desliza para ver más" y contador (QA comensal 10-oct) ---------- */

.pv-overlay .pv-pista {
  position: absolute; left: 50%; top: 46%; transform: translateX(-50%); z-index: 4;
  padding: 9px 16px; border-radius: 999px; background: rgba(0, 0, 0, .62); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; white-space: nowrap; pointer-events: none;
  animation: pv-pista-sube 1.6s ease-in-out 3;
}
.pv-overlay .pv-pista[hidden] { display: none; }
@keyframes pv-pista-sube { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }
.pv-overlay .pv-contador {
  position: absolute; top: 14px; left: 14px; z-index: 4; padding: 5px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); color: #fff; font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1; pointer-events: none;
}
.pv-overlay .pv-contador[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .pv-overlay .pv-pista { animation: none; } }

/* ---------- distintivo ▶ sobre la foto de un plato con video ---------- */

/* La caja de la foto debe ser contenedor del ▶ y de la copia desenfocada.
   (.noc-sel-foto ya es position:absolute en su piel: no se toca.) */
.menu-item-thumb:not(.noc-sel-foto) { position: relative; }

.pf-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  pointer-events: none;
}
.pf-play svg { width: 14px; height: 14px; margin-left: 1px; }
.noc-card-foto .pf-play, .mk-foto .pf-play, .noc-sel-foto .pf-play { width: 44px; height: 44px; }
.noc-card-foto .pf-play svg, .mk-foto .pf-play svg, .noc-sel-foto .pf-play svg { width: 22px; height: 22px; }

/* ---------- spec 3.3: foto vertical completa en las cajas grandes ---------- */

.menu-item-thumb.is-foto-vertical { background: #000; }
.menu-item-thumb > img.pf-fondo {
  position: absolute;
  top: -12%;
  left: -12%;
  width: 124%;
  height: 124%;
  max-width: none;
  object-fit: cover;
  filter: blur(16px) brightness(0.5) saturate(1.15);
  transform: none;
  transition: none;
  pointer-events: none;
}
.menu-item-thumb.is-foto-vertical > img:not(.pf-fondo) {
  position: relative;
  z-index: 1;
  object-fit: contain;
}

/* ---------- aviso suelto (sin platos con foto) ---------- */

.pv-aviso {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 141;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #1a1014;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.pv-aviso.on { opacity: 1; }

/* ---------- visor ---------- */

html.pv-lock { overflow: hidden; }

.pv-overlay {
  --pv-col: 100vw;
  position: fixed;
  inset: 0;
  /* Por debajo del selector de tamaños (.comanda-overlay: 150 en Clasica, 230
     en las demas) y del pedido, para que "Elegir" se vea ENCIMA del visor. */
  z-index: 140;
  display: flex;
  justify-content: center;
  background: #000;
  color: #fff;
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}
.pv-overlay[hidden] { display: none; }
.pv-overlay *, .pv-overlay *::before, .pv-overlay *::after { box-sizing: border-box; }
.pv-overlay button { font-family: inherit; cursor: pointer; }
@media (min-width: 600px) {
  .pv-overlay { --pv-col: 440px; }
}

.pv-col { position: relative; width: 100%; height: 100%; }
@media (min-width: 600px) {
  .pv-col { width: 440px; box-shadow: 0 0 60px rgba(255, 255, 255, 0.08); }
}

.pv-feed {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.pv-feed::-webkit-scrollbar { display: none; }

.pv-card {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #111;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-width: 0;
}

.pv-bg {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  max-width: none;
  object-fit: cover;
  filter: blur(26px) brightness(0.5) saturate(1.15);
}
.pv-ph {
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  width: 100%;
  max-width: none;
  /* 15-oct (Carlos: "las fotos en vertical no están centradas"): la caja ocupa TODO el hueco entre la barra
     de arriba (64 px) y la ficha del plato (290 px); object-fit: contain centra la foto dentro. Antes la caja
     se recortaba a --pv-col y la foto quedaba pegada arriba con un vacío debajo en pantallas altas. */
  height: calc(100% - 64px - 290px);
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45));
  background: transparent;
  opacity: 0;
  transition: opacity 0.15s;
}
.pv-card.is-listo .pv-ph { opacity: 1; }
.pv-card.is-vertical .pv-ph { top: 0; height: 100%; object-fit: cover; filter: none; }
.pv-card.is-vertical .pv-bg { display: none; }
.pv-video { background: #000; }

.pv-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.9) 100%);
}

.pv-info {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 2;
  min-width: 0;
}
.pv-cat {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.pv-nombre {
  margin: 0;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.pv-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 6px 0 0;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #fff;
  opacity: 0.92;
}
.pv-fila { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pv-precio {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--carta-acento, #782634);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}
.pv-accion { display: flex; align-items: center; }
.pv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #1a1014;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}
.pv-paso {
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
  color: #1a1014;
}
.pv-paso[hidden], .pv-btn[hidden], .pv-bar[hidden] { display: none; }
.pv-paso-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #1a1014;
  font-size: 1.2rem;
  font-weight: 600;
}
.pv-paso-n { min-width: 22px; text-align: center; font-weight: 600; color: #1a1014; }

.pv-cerrar {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  z-index: 5;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  backdrop-filter: blur(6px);
}
.pv-cerrar:focus-visible, .pv-btn:focus-visible, .pv-paso-btn:focus-visible, .pv-bar-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.pv-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 6;
}
.pv-bar-btn {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 16px;
  background: #15803d;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@media print { .pv-overlay, .pv-abrir, .pv-aviso { display: none !important; } }

/* ---------- A3 (carta-mejoras-competencia-v1): zonas tactiles de 44 px ---------- */

/* Boton "Fotos" (36 px de alto): la caja mide 44 y la pildora visible se dibuja en ::before con su
   medida de siempre (inset 4 px); el margen negativo devuelve a su fila los 36 px de antes. Cada piel lo
   coloca (absoluto o dentro de un flex) y esta regla no toca `position`. */
.pv-abrir {
  isolation: isolate;
  height: 44px;
  margin-block: -4px;
  padding: 0 13px 0 11px;
  border: 0;
  background: none;
  backdrop-filter: none;
}
.pv-abrir::before {
  content: '';
  position: absolute;
  inset: 4px 0;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

/* Dentro del visor (modal a pantalla completa) los controles pequenos crecen a 44 px. */
.pv-btn { min-height: 44px; }
.pv-paso-btn { width: 44px; height: 44px; }
