/* ==========================================================================
   Shooting Pack (carrito de cotización) - Cine House Costa Rica
   CSS propio (no depende del runtime de Tailwind). Solo anima opacity/transform
   para que sea ligero. Sin backdrop-filter ni transition: all.
   ========================================================================== */

.ch-pack {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #f4f4f5;
}
.ch-pack [hidden] { display: none !important; }

/* ---------- Botón flotante ---------- */
.ch-pack__fab {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #18181b;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fbbf24, #fcd34d 55%, #fde68a);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.ch-pack__fab.is-visible { display: inline-flex; }
.ch-pack__fab:hover { filter: brightness(1.05); }
.ch-pack__fab:focus-visible,
.ch-pack button:focus-visible,
.ch-pack a:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.ch-pack__fab svg { width: 18px; height: 18px; flex: none; }

/* ---------- Panel ---------- */
.ch-pack__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 24rem;
  max-width: calc(100vw - 32px);
  max-height: min(34rem, 80vh);
  display: flex;
  flex-direction: column;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.ch-pack__panel.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .15s ease, transform .15s ease, visibility 0s;
}
.ch-pack__panel:focus { outline: none; }

.ch-pack__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #27272a;
}
.ch-pack__title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fbbf24;
}
.ch-pack__close {
  background: none;
  border: 0;
  color: #a1a1aa;
  font-size: 16px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
}
.ch-pack__close:hover { color: #fff; }

/* ---------- Lista ---------- */
.ch-pack__list {
  list-style: none;
  margin: 0;
  padding: 12px 18px;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ch-pack__empty {
  margin: 0;
  padding: 32px 18px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #71717a;
}

.ch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #18181b;
  border: 1px solid rgba(39, 39, 42, .7);
  border-radius: 2px;
}
.ch-item__img {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid #3f3f46;
  border-radius: 2px;
  background: #27272a;
}
.ch-item__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ch-item__name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-item__line {
  font-size: 10px;
  text-transform: uppercase;
  color: #a1a1aa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-item__qty { flex: none; display: flex; align-items: center; gap: 4px; }
.ch-item__qty button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #27272a;
  color: #d4d4d8;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.ch-item__qty button:hover { background: #3f3f46; }
.ch-item__n { min-width: 24px; text-align: center; font-size: 12px; font-weight: 800; color: #fbbf24; }
.ch-item__rm {
  flex: none;
  background: none;
  border: 0;
  padding: 6px;
  color: #71717a;
  font-size: 13px;
  cursor: pointer;
}
.ch-item__rm:hover { color: #f87171; }

/* ---------- Acciones ---------- */
.ch-pack__actions {
  padding: 12px 18px 16px;
  border-top: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ch-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 0;
  border-radius: 2px;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.ch-btn--gold { background: #fbbf24; color: #18181b; }
.ch-btn--gold:hover { background: #fcd34d; }
.ch-btn--wa { background: #059669; color: #fff; }
.ch-btn--wa:hover { background: #10b981; }
.ch-btn--ghost { background: #18181b; color: #d4d4d8; border: 1px solid #3f3f46; }
.ch-btn--ghost:hover { background: #27272a; }
.ch-pack__clear {
  background: none;
  border: 0;
  padding: 6px;
  color: #71717a;
  font: inherit;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}
.ch-pack__clear:hover { color: #d4d4d8; }
.ch-pack__clear.is-armed { color: #f87171; }

.ch-pack__toast {
  margin: 0;
  min-height: 14px;
  text-align: center;
  font-size: 11px;
  color: #34d399;
  opacity: 0;
  transition: opacity .15s ease;
}
.ch-pack__toast.is-on { opacity: 1; }

/* ---------- Fondo (solo móvil) ---------- */
.ch-pack__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility 0s linear .15s;
}
.ch-pack__overlay.is-open { opacity: 1; visibility: visible; transition: opacity .15s ease, visibility 0s; }

/* ---------- Móvil: hoja inferior ---------- */
@media (max-width: 639px) {
  .ch-pack { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ch-pack__fab { padding: 11px 18px; font-size: 11px; }
  .ch-pack__overlay { display: block; }
  .ch-pack__panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    max-height: 85vh;
    max-height: 85dvh;
    border-radius: 14px 14px 0 0;
    border-width: 1px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
  }
  .ch-pack__panel.is-open { transform: none; }
  html.ch-pack-lock, html.ch-pack-lock body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-pack__panel, .ch-pack__overlay, .ch-pack__toast { transition: none !important; }
}
