/* Hoja inferior de Tatigo (ver sheet.js): la usan las 4 apps. Solo anima transform y opacity/fondo.
   --sheet-dim (0 a 1) lo pone sheet.js al arrastrar: el fondo oscuro se aclara mientras la hoja baja. */
.sheet-backdrop {
  --sheet-dim: 1;
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgb(0 0 0 / calc(.45 * var(--sheet-dim)));
  animation: sheet-fade .22s ease-out;
  overscroll-behavior: contain; touch-action: none; /* el dedo sobre el fondo no mueve la página de atrás */
}
.sheet-backdrop.closing { --sheet-dim: 0; }
.sheet {
  position: relative; width: 100%; max-width: 680px; max-height: calc(100dvh - 24px);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--surface); color: var(--text);
  border-radius: var(--r-lg, 20px) var(--r-lg, 20px) 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg, 0 -8px 30px rgb(0 0 0 / .18));
  animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1);
  will-change: transform; outline: none;
}
.sheet-backdrop.no-enter, .sheet-backdrop.no-enter .sheet { animation: none; }
/* Agarradera: indica que se puede arrastrar */
.sheet-grab, .sheet > .grab {
  position: sticky; top: 0; z-index: 2;
  width: 40px; height: 5px; margin: 2px auto 14px; border-radius: 999px; background: var(--line-strong);
  cursor: grab; touch-action: none;
}
.sheet h3 { margin: 0 0 6px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.sheet .sheet-text { margin: 0 0 16px; color: var(--muted); }
.sheet .qty-row { display: flex; justify-content: center; margin: 22px 0; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
/* Hoja de pantalla completa (producto con opciones) */
.sheet.sheet-full {
  max-width: none; height: 100dvh; max-height: none; padding: 0; border-radius: 0;
  padding-bottom: 0;
}
.sheet.sheet-full .sheet-grab { position: absolute; left: 50%; top: calc(8px + env(safe-area-inset-top)); margin: 0 0 0 -20px; background: rgb(255 255 255 / .85); box-shadow: 0 1px 4px rgb(0 0 0 / .25); }
/* Con una hoja abierta la página de atrás no se mueve (en html también: store.css le pone overflow-x). */
html.sheet-open, body.sheet-open { overflow: hidden; }
@keyframes sheet-fade { from { background-color: rgb(0 0 0 / 0); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  .sheet-backdrop, .sheet { animation: none; }
}
