/* Mr. Tapioca Kiosk — touch-optimised tablet UI */
:root {
  --brand-900: #0d1b2a;   /* deep navy */
  --brand-700: #ea580c;   /* orange primary */
  --brand-500: #fb923c;   /* orange light */
  --brand-100: #fff7ed;   /* warm cream tint */
  /* keep legacy aliases so shared rules keep working */
  --wine-900: var(--brand-900);
  --wine-700: var(--brand-700);
  --wine-500: var(--brand-500);
  --wine-100: var(--brand-100);
  --purple-900: var(--brand-900);
  --purple-700: var(--brand-700);
  --purple-500: var(--brand-500);
  --green-400: #22c55e;   /* green — CTA accent */
  --cream: #fafaf9;
  --ink: #1c1917;
  --ink-soft: #78716c;
  --line: #e7e5e4;
  --danger: #d23c5c;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 8px 24px rgba(13,27,42,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  font-size: 18px;
  line-height: 1.4;
}
button { font: inherit; cursor: pointer; border: 0; }
.hidden { display: none !important; }

/* SCREENS */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ATTRACT */
#attract {
  background: linear-gradient(160deg, #0d1b2a 0%, #1a3a5c 55%, #0d2a1a 100%);
  color: white;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.attract-logo {
  width: 300px;
  max-width: 68vw;
  margin-bottom: 36px;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.4));
}
.attract-inner h1 {
  font-size: 76px;
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1.05;
}
.attract-inner .sub {
  font-size: 24px;
  opacity: 0.8;
  margin-bottom: 80px;
}

/* BUTTONS */
.btn-primary {
  background: var(--brand-700);
  color: white;
  padding: 16px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 18px;
  transition: transform 0.05s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-huge {
  padding: 28px 64px;
  font-size: 28px;
  border-radius: 999px;
  background: var(--green-400);
  color: var(--brand-900);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.btn-block { width: 100%; padding: 22px; font-size: 22px; }
.btn-ghost {
  background: transparent;
  color: inherit;
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid currentColor;
  opacity: 0.7;
}
.btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* MENU SCREEN */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 900; letter-spacing: 2px; color: var(--brand-700); font-size: 13px; }
.topbar-logo { height: 38px; width: auto; }

.categories {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: white;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.categories button {
  background: transparent;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  white-space: nowrap;
  border: 2px solid transparent;
}
.categories button.active {
  background: var(--brand-900);
  color: white;
}

/* PROMO BANNER */
.promo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
  background-size: 200% auto;
  animation: promo-shimmer 3s linear infinite;
  color: #0d1b2a;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  text-align: center;
}
.promo-banner:active { opacity: 0.85; }
@keyframes promo-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.promo-banner .promo-tag {
  background: #0d1b2a;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* PROMO MODAL */
.promo-card {
  text-align: center;
  max-width: 560px;
  padding: 40px 36px 36px;
}
.promo-card .promo-day {
  display: inline-block;
  background: var(--brand-900);
  color: var(--green-400);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.promo-card .promo-title {
  font-size: 36px;
  font-weight: 900;
  color: var(--brand-900);
  line-height: 1.1;
  margin-bottom: 10px;
}
.promo-card .promo-sub {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.promo-card .promo-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
}
.promo-card .btn-primary {
  font-size: 18px;
  padding: 18px 40px;
}

/* SUBCATEGORY NAV */
.subcategories {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  background: var(--brand-100);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.subcategories button {
  background: white;
  border: 2px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.subcategories button.active {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: white;
}

/* ── SCROLL WRAPPER (flex child that scrolls) ── */
.items-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
}

/* ── ITEM GRID (pure layout, no overflow) ── */
.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 14px;
}

/* ── ITEM CARD ── */
.item-card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(26,10,46,0.13);
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  color: inherit;
  border: none;
  cursor: pointer;
}

/* Image: fixed 180 px, cover so it always fills the frame */
.item-card .card-img {
  width: 100%;
  height: 180px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
}
.item-card .card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
.item-card .card-img.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
}

/* Name + price always below the image */
.item-card .body {
  padding: 10px 12px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.item-card h3 {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}
.item-card .price {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-700);
}

.cart-bar {
  background: var(--brand-900);
  color: white;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  font-size: 18px;
}
.cart-bar .btn-primary {
  background: var(--green-400);
  color: var(--brand-900);
  padding: 18px 28px;
  font-size: 19px;
}
.cart-bar.empty { display: none; }

/* MODALS */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--line);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

/* ITEM MODAL */
.item-detail h2 { font-size: 30px; margin-bottom: 8px; padding-right: 40px; }
.item-detail .desc { color: var(--ink-soft); margin-bottom: 24px; }
.option-group { margin-bottom: 24px; }
.option-group h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
  margin-bottom: 12px;
  font-weight: 700;
}
.option-group .hint { font-size: 13px; color: var(--ink-soft); font-weight: 400; text-transform: none; letter-spacing: 0; }
.option-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.option-pill {
  border: 2px solid var(--line);
  background: white;
  padding: 14px 16px;
  border-radius: var(--radius);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: inherit;
}
.option-pill.selected { border-color: var(--brand-700); background: rgba(234,88,12,0.07); }
.option-pill .qty-badge {
  display: inline-block;
  background: var(--brand-700);
  color: white;
  font-size: 13px;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 8px;
  font-weight: 800;
  vertical-align: middle;
}
.option-pill .name { font-weight: 700; }
.option-pill .extra-price { font-size: 13px; color: var(--ink-soft); }

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  gap: 16px;
}
.price-tag { font-size: 28px; font-weight: 900; color: var(--brand-900); }

/* CART */
.cart-list { list-style: none; margin: 16px 0 24px; }
.cart-list li {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.cart-list li:last-child { border-bottom: 0; }
.cart-list .ci-name { font-weight: 700; }
.cart-list .ci-mods { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.cart-list .ci-note { font-size: 13px; color: var(--brand-700); margin-top: 4px; font-style: italic; }
.cart-list .ci-actions { display: flex; gap: 8px; align-items: center; }
.cart-list .ci-body { flex: 1; cursor: pointer; min-width: 0; }
.cart-list .ci-body:active { opacity: 0.65; }
.cart-list .ci-edit-hint { font-size: 11px; color: var(--ink-soft); margin-top: 4px; opacity: 0.55; }
.cart-list .ci-qty { min-width: 28px; text-align: center; font-weight: 800; font-size: 18px; }
.cart-list .ci-qty-btn {
  width: 38px; height: 38px;
  background: var(--line);
  border-radius: 50%;
  font-weight: 800;
  font-size: 20px;
  color: var(--brand-900);
  border: 0;
  cursor: pointer;
}
.cart-list .ci-price { margin-left: 8px; min-width: 64px; text-align: right; font-size: 17px; }
.cart-list button {
  width: 36px; height: 36px;
  background: var(--line);
  border-radius: 50%;
  font-weight: 700;
  font-size: 16px;
}
.cart-totals { border-top: 2px solid var(--ink); padding-top: 16px; margin-bottom: 22px; }
.cart-totals .row { display: flex; justify-content: space-between; font-size: 22px; }
.cart-promo-row { font-size: 17px !important; color: #16a34a; margin-bottom: 6px; }

/* PAYMENT MODAL */
.pay-state { text-align: center; padding: 24px 12px; }
.pay-state h2 { font-size: 28px; margin-bottom: 8px; }
.pay-state p { color: var(--ink-soft); margin-bottom: 24px; }
.pay-amount { font-size: 56px; font-weight: 900; color: var(--brand-900); margin-bottom: 24px; }
.spinner {
  width: 64px; height: 64px;
  border: 6px solid var(--line);
  border-top-color: var(--brand-700);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pay-state.success .spinner,
.pay-state.error .spinner { display: none; }
.pay-state.success::before,
.pay-state.error::before {
  content: "";
  display: block;
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 24px;
  font-size: 48px;
  font-weight: 900;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pay-state.success::before { background: var(--green-400); content: "✓"; color: white; }
.pay-state.error::before { background: var(--danger); content: "!"; }

/* Item note textarea */
.item-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.item-note label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.item-note textarea {
  width: 100%;
  min-height: 64px;
  max-height: 140px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  resize: vertical;
  background: white;
  color: var(--ink);
  box-sizing: border-box;
}
.item-note textarea:focus { outline: none; border-color: var(--brand-700); }

/* Customer name input */
.cart-customer { margin: 22px 0 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.cart-customer label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cart-customer input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 18px;
  background: white;
  color: var(--ink);
  box-sizing: border-box;
}
.cart-customer input:focus { outline: none; border-color: var(--brand-700); }

/* Pagar en efectivo button */
.btn-cash {
  background: #c9e265;
  color: var(--brand-900);
  padding: 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  width: 100%;
  cursor: pointer;
  transition: transform 0.05s;
}
.btn-cash:active { transform: scale(0.97); }
.btn-cash.btn-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* COMBO STRIP */
.combo-strip {
  display: flex;
  gap: 14px;
  padding: 16px 14px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}
.combo-strip:empty { display: none; }
.combo-strip::-webkit-scrollbar { display: none; }

.combo-card {
  min-width: 190px;
  max-width: 210px;
  border-radius: 20px;
  padding: 18px 16px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: none;
  text-align: left;
  color: white;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  flex-shrink: 0;
  transition: transform 0.08s;
}
.combo-card:active { transform: scale(0.95); }
.combo-card .combo-emoji { font-size: 28px; margin-bottom: 6px; }
.combo-card .combo-name { font-size: 15px; font-weight: 900; line-height: 1.15; }
.combo-card .combo-desc { font-size: 11px; opacity: 0.88; line-height: 1.35; margin-top: 4px; }
.combo-card .combo-price { font-size: 26px; font-weight: 900; margin-top: 8px; }
.combo-card .combo-cta {
  background: rgba(255,255,255,0.22);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
  margin-top: 10px;
  align-self: flex-start;
  letter-spacing: 0.5px;
}

/* COMBO MODAL SLOT HEADERS */
.combo-slot-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--brand-700);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.combo-size-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.combo-slot-check {
  display: inline-block;
  background: var(--green-400);
  color: white;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  line-height: 18px;
}

@media (min-width: 900px) {
  .items-grid { grid-template-columns: repeat(3, 1fr); }
}
