/* ===================================================
   SnapBook · App.css
   Modern, mobile-first restaurant ordering UI
=================================================== */

:root {
  --c-bg: #fffaf6;
  --c-surface: #ffffff;
  --c-text: #1d1b1a;
  --c-text-muted: #76706c;
  --c-border: #ece4dc;
  --c-soft: #f7efe7;

  --c-primary: #ff5b2e;
  --c-primary-2: #ff8a3d;
  --c-accent: #2d1b14;
  --c-success: #16a34a;
  --c-danger: #dc2626;

  --grad-primary: linear-gradient(135deg, #ff7a18 0%, #ff3d3d 100%);
  --grad-warm: linear-gradient(135deg, #ffb347 0%, #ff5b2e 60%, #c81d3b 100%);

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow-sm: 0 4px 14px rgba(40, 25, 15, .06);
  --shadow-md: 0 10px 30px rgba(40, 25, 15, .10);
  --shadow-lg: 0 24px 60px rgba(40, 25, 15, .18);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  padding-bottom: calc(120px + var(--safe-bottom));
}

img { max-width: 100%; }

/* ============ SPLASH ============ */
.splash {
  position: fixed; inset: 0;
  background: var(--grad-warm);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity .4s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; color: #fff; }
.splash-logo {
  width: 88px; height: 88px;
  border-radius: 26px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px;
  margin: 0 auto 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
  animation: pop .9s cubic-bezier(.2,.9,.3,1.4);
}
.splash-name {
  font-size: 30px; font-weight: 800; letter-spacing: .5px;
  text-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.splash-bar {
  width: 160px; height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 4px; margin: 18px auto 0;
  overflow: hidden;
}
.splash-bar span {
  display: block; height: 100%; width: 40%;
  background: #fff; border-radius: 4px;
  animation: load 1.2s ease-in-out infinite;
}
@keyframes pop {
  0% { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 480px;
  padding: 14px 18px 36px;
  color: #fff;
  overflow: hidden;
  border-bottom-left-radius: var(--r-xl);
  border-bottom-right-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}
.hero-bg {
  position: absolute; inset: 0;
  background: var(--grad-warm);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  transform: scale(1.06);
  filter: saturate(1.1);
  animation: kenburns 18s ease-in-out infinite alternate;
}
@keyframes kenburns {
  0% { transform: scale(1.05) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1%, -2%); }
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20,10,5,0) 0%, rgba(20,10,5,.10) 40%, rgba(20,10,5,.72) 100%);
  z-index: 1;
}
.hero-top, .hero-content { position: relative; z-index: 2; }

.hero-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

.icon-btn {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  transition: all .2s ease;
}
.icon-btn:active { transform: scale(.92); }

.lang-flag {
  position: absolute;
  bottom: -4px; right: -4px;
  font-size: 14px;
  background: #fff;
  width: 22px; height: 22px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--c-primary);
  font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--c-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.cart-badge.hidden { display: none; }

.brand-pill {
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 60vw;
  overflow: hidden;
}
.brand-pill span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.hero-logo {
  display: block;
  max-height: 120px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 0 14px;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .35));
}
.hero-logo[src=""], .hero-logo:not([src]) { display: none; }

.hero-content {
  margin-top: auto;
  padding-top: 60px;
}
.hero-eyebrow {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  font-weight: 700; opacity: .85; margin-bottom: 10px;
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
}
.hero-title {
  font-size: 38px;
  font-weight: 800; line-height: 1.02;
  letter-spacing: -.8px;
  margin: 0 0 10px;
  text-shadow: 0 4px 24px rgba(0,0,0,.35);
}
.hero-sub {
  margin: 0; opacity: .92; font-size: 15px;
  max-width: 32ch;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.table-pill {
  margin-top: 22px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(20px);
  color: var(--c-text);
  padding: 12px 14px;
  border-radius: 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform .15s ease;
  border: 1px solid rgba(255,255,255,.6);
}
.table-pill:active { transform: scale(.985); }
.table-pill > i {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--grad-primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.table-pill-text { flex: 1; min-width: 0; line-height: 1.2; }
.table-pill-text small {
  font-size: 11px; color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  display: block;
}
.table-pill-text strong {
  font-size: 16px; font-weight: 700;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.table-pill-cta {
  font-size: 12px; font-weight: 700;
  color: var(--c-primary);
  background: rgba(255, 91, 46, .1);
  padding: 6px 10px; border-radius: 999px;
}

/* ============ CATEGORY BAR ============ */
.cat-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 250, 246, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
  padding: 10px 12px;
}
.cat-bar-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding: 2px;
}
.cat-bar-inner::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  color: var(--c-text);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.cat-chip .cat-count {
  font-size: 11px;
  background: var(--c-soft);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--c-text-muted);
}
.cat-chip.active {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.cat-chip.active .cat-count {
  background: rgba(255,255,255,.25);
  color: #fff;
}

/* ============ PRODUCT LIST ============ */
.product-wrap { padding: 18px 12px; }

.prod-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .25s cubic-bezier(.2,.9,.3,1.2);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  border: 1px solid transparent;
}
.prod-card:active { transform: scale(.985); }
.prod-card:hover { box-shadow: var(--shadow-md); border-color: var(--c-border); }

.prod-img-wrap {
  position: relative;
  width: 110px;
  flex-shrink: 0;
  background: var(--c-soft);
}
.prod-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.prod-img-wrap .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted); font-size: 28px;
}

.prod-body {
  flex: 1;
  padding: 12px 14px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.prod-name {
  font-size: 15px; font-weight: 700;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-desc {
  font-size: 12.5px; color: var(--c-text-muted);
  margin: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.prod-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  gap: 8px;
}
.prod-price {
  font-weight: 800;
  font-size: 16px;
  color: var(--c-text);
}
.prod-price .from {
  font-size: 11px; color: var(--c-text-muted);
  font-weight: 600; margin-right: 3px;
  text-transform: uppercase; letter-spacing: 1px;
}

.btn-add {
  background: var(--c-text);
  color: #fff;
  border: 0;
  width: 36px; height: 36px;
  border-radius: 12px;
  font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s ease;
  flex-shrink: 0;
}
.btn-add:active { transform: scale(.9); }
.btn-add.has-variants {
  background: var(--grad-primary);
  width: auto; padding: 0 14px;
  font-size: 13px; font-weight: 700;
  gap: 5px;
}

.prod-qty-inline {
  display: inline-flex; align-items: center;
  background: var(--c-text); color: #fff;
  border-radius: 12px;
  overflow: hidden;
}
.prod-qty-inline button {
  background: transparent; color: #fff; border: 0;
  width: 32px; height: 36px;
  font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.prod-qty-inline span {
  min-width: 26px; text-align: center;
  font-weight: 700; font-size: 14px;
}

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--c-text-muted);
}
.empty-state i { font-size: 56px; margin-bottom: 12px; opacity: .5; }
.empty-state h5 { font-weight: 700; }

/* ============ FLOATING CART BUTTON ============ */
.cart-fab {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 16px; right: 16px;
  height: 60px;
  border: 0;
  border-radius: 18px;
  background: var(--c-text);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
  z-index: 50;
  font-weight: 700;
  animation: cart-pop .35s cubic-bezier(.2,.9,.3,1.4);
}
.cart-fab-left {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.13);
  padding: 6px 11px;
  border-radius: 12px;
  font-size: 14px;
}
.cart-fab-count {
  background: var(--c-primary);
  border-radius: 999px;
  min-width: 22px;
  padding: 1px 7px;
  font-size: 12px;
  text-align: center;
  display: inline-block;
}
.cart-fab-mid { font-size: 15px; }
.cart-fab-right { font-size: 16px; font-weight: 800; }
@keyframes cart-pop {
  0% { transform: translateY(120%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ============ SHEETS ============ */
.sheet {
  position: fixed; inset: 0;
  z-index: 100;
  pointer-events: none;
}
.sheet[aria-hidden="false"] { pointer-events: auto; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 12, 8, .55);
  opacity: 0;
  transition: opacity .3s ease;
}
.sheet[aria-hidden="false"] .sheet-backdrop { opacity: 1; }

.sheet-card {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--c-surface);
  border-radius: 24px 24px 0 0;
  max-height: 92vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.05);
  box-shadow: 0 -20px 60px rgba(0,0,0,.25);
  padding-bottom: var(--safe-bottom);
}
.sheet[aria-hidden="false"] .sheet-card { transform: translateY(0); }

.sheet-card-full { height: 92vh; }

.sheet-handle {
  width: 44px; height: 5px;
  background: var(--c-border);
  border-radius: 999px;
  margin: 10px auto 0;
}

.sheet-head {
  padding: 14px 18px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--c-border);
}
.sheet-head img {
  width: 64px; height: 64px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}
.sheet-head-text { flex: 1; min-width: 0; }
.sheet-head-text h4 {
  margin: 0; font-size: 18px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-head-text p {
  margin: 2px 0 0; font-size: 13px; color: var(--c-text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.sheet-head-simple {
  padding: 18px;
}
.sheet-head-simple h4 {
  margin: 0; font-size: 20px; font-weight: 800;
  flex: 1;
}

.icon-btn-close {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--c-soft);
  border: 0;
  font-size: 16px;
  color: var(--c-text);
}
.icon-btn-close:active { transform: scale(.92); }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.sheet-foot {
  border-top: 1px solid var(--c-border);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
}

/* ============ VARIANT GROUPS ============ */
.var-group { margin-bottom: 18px; }
.var-group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.var-group-title { font-size: 15px; font-weight: 800; margin: 0; }
.var-group-sub { font-size: 12px; color: var(--c-text-muted); margin: 2px 0 0; }
.req-tag {
  background: rgba(255, 91, 46, .12);
  color: var(--c-primary);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.var-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.var-option { position: relative; cursor: pointer; }
.var-option input { position: absolute; opacity: 0; pointer-events: none; }
.var-option-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: 14px;
  transition: all .2s ease;
  background: var(--c-surface);
}
.var-option-radio {
  width: 20px; height: 20px;
  border-radius: 999px;
  border: 2px solid var(--c-border);
  flex-shrink: 0;
  position: relative;
  transition: all .2s ease;
}
.var-option input:checked + .var-option-card {
  border-color: var(--c-primary);
  background: linear-gradient(135deg, rgba(255,138,61,.06), rgba(255,91,46,.06));
}
.var-option input:checked + .var-option-card .var-option-radio {
  border-color: var(--c-primary);
  background: var(--c-primary);
  box-shadow: inset 0 0 0 4px #fff;
}
.var-option-name { flex: 1; font-weight: 600; font-size: 14.5px; }
.var-option-price { font-weight: 800; font-size: 15px; color: var(--c-text); }

/* ============ QTY CONTROL ============ */
.qty-control {
  display: inline-flex; align-items: center;
  background: var(--c-soft);
  border-radius: 14px;
  padding: 4px;
}
.qty-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 0;
  background: var(--c-surface);
  font-size: 16px;
  color: var(--c-text);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.qty-btn:active { transform: scale(.92); }
.qty-val { min-width: 38px; text-align: center; font-weight: 800; font-size: 16px; }

/* ============ MAIN GRADIENT BUTTON ============ */
.btn-grad {
  background: var(--grad-primary);
  color: #fff;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 30px rgba(255, 91, 46, .35);
  transition: all .2s ease;
  min-height: 52px;
}
.btn-grad:active { transform: scale(.98); }
.btn-grad:disabled {
  opacity: .55;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-grad strong {
  background: rgba(255,255,255,.2);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 14px;
}

.btn-link-amber {
  background: transparent; border: 0;
  color: var(--c-primary); font-weight: 700;
  font-size: 13px;
}

/* ============ CART ITEMS ============ */
.cart-table-banner {
  background: linear-gradient(135deg, #fff8f3 0%, #ffeadd 100%);
  border: 1px solid #ffd5bd;
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  margin: 14px 18px 4px;
}
.cart-table-banner > i {
  width: 36px; height: 36px;
  background: var(--c-primary);
  color: #fff;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.cart-table-banner > div { flex: 1; line-height: 1.2; min-width: 0; }
.cart-table-banner small {
  font-size: 11px; color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  display: block;
}
.cart-table-banner strong {
  font-size: 14.5px; font-weight: 700;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cart-empty { text-align: center; padding: 60px 20px; color: var(--c-text-muted); }
.cart-empty i { font-size: 56px; margin-bottom: 12px; opacity: .4; }

.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  margin-bottom: 10px;
}
.cart-item img {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}
.cart-item-img-ph {
  width: 56px; height: 56px;
  background: var(--c-soft); color: var(--c-text-muted);
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 14px; font-weight: 700; margin: 0 0 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cart-item-meta {
  font-size: 12px; color: var(--c-text-muted);
  margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cart-item-price { font-size: 13px; color: var(--c-primary); font-weight: 700; margin-top: 2px; }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-item-qty { display: inline-flex; align-items: center; background: var(--c-soft); border-radius: 10px; }
.cart-item-qty button { width: 28px; height: 28px; background: transparent; border: 0; font-size: 14px; color: var(--c-text); }
.cart-item-qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: 13px; }
.btn-trash { background: transparent; border: 0; color: var(--c-danger); font-size: 14px; padding: 2px 6px; }

.cart-foot {
  border-top: 1px solid var(--c-border);
  padding: 14px 18px;
  background: var(--c-surface);
}
.cart-total-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cart-total-row span { color: var(--c-text-muted); font-size: 14px; }
.cart-total-row strong {
  font-size: 22px; font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ TABLE PICKER ============ */
.muted-sm { color: var(--c-text-muted); font-size: 13px; margin-bottom: 14px; }

.btn-qr {
  background: var(--grad-primary);
  border: 0;
  border-radius: 18px;
  padding: 14px 14px;
  color: #fff;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  box-shadow: 0 12px 30px rgba(255,91,46,.3);
  transition: all .2s ease;
}
.btn-qr:active { transform: scale(.98); }
.btn-qr-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.btn-qr-text { flex: 1; line-height: 1.2; }
.btn-qr-text strong { display: block; font-size: 15px; font-weight: 700; }
.btn-qr-text small { display: block; font-size: 12px; opacity: .85; margin-top: 2px; }

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}
.tbl-card {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 16px;
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
}
.tbl-card.active {
  border-color: var(--c-primary);
  background: linear-gradient(135deg, rgba(255,138,61,.06), rgba(255,91,46,.06));
  box-shadow: 0 4px 14px rgba(255,91,46,.18);
}
.tbl-card i { font-size: 24px; color: var(--c-primary); margin-bottom: 4px; }
.tbl-card strong { display: block; font-size: 15px; }
.tbl-card small { display: block; font-size: 11px; color: var(--c-text-muted); margin-top: 2px; }

.divider-or {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 14px;
  color: var(--c-text-muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: 2px;
}
.divider-or::before, .divider-or::after {
  content: ''; flex: 1; height: 1px; background: var(--c-border);
}

/* ============ QR SCANNER ============ */
.qr-stage {
  position: absolute; inset: 0;
  background: #000;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.05);
  color: #fff;
}
.sheet[aria-hidden="false"] .qr-stage { transform: translateY(0); }

.qr-header {
  position: relative;
  z-index: 5;
  padding: 18px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.7), transparent);
}
.qr-close {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.qr-title-wrap { flex: 1; line-height: 1.2; }
.qr-title-wrap strong { display: block; font-size: 17px; font-weight: 800; }
.qr-title-wrap small { display: block; font-size: 12px; opacity: .8; margin-top: 2px; }

.qr-camera-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}
#qrReader {
  position: absolute;
  inset: 0;
  background: #000;
}
#qrReader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
#qrReader > * { border: 0 !important; }
#qrReader__dashboard,
#qrReader__scan_region img,
#qrReader__header_message,
#qrReader__dashboard_section_csr,
#qrReader__dashboard_section_swaplink { display: none !important; }
#qrReader__scan_region { background: transparent !important; min-height: 0 !important; }

.qr-frame {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 70vmin; height: 70vmin;
  max-width: 320px; max-height: 320px;
  pointer-events: none;
  z-index: 3;
}
.qr-corner {
  position: absolute;
  width: 36px; height: 36px;
  border: 4px solid #fff;
  border-radius: 4px;
}
.qr-corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.qr-corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.qr-corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.qr-corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }

.qr-laser {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 70vmin; max-width: 320px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ff5b2e, transparent);
  box-shadow: 0 0 20px #ff5b2e;
  border-radius: 4px;
  z-index: 4;
  animation: laser 2s ease-in-out infinite;
}
@keyframes laser {
  0%, 100% { transform: translate(-50%, calc(-35vmin + 0px)); opacity: .8; }
  50% { transform: translate(-50%, calc(35vmin - 0px)); opacity: 1; }
}

.qr-footer {
  position: relative;
  z-index: 5;
  padding: 18px;
  padding-bottom: calc(18px + var(--safe-bottom));
  text-align: center;
  background: linear-gradient(0deg, rgba(0,0,0,.7), transparent);
}
.qr-help {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: .85;
}
.qr-cancel-btn {
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 12px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

/* ============ LANGUAGE PICKER ============ */
.lang-list { display: flex; flex-direction: column; gap: 8px; }
.lang-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-surface);
  cursor: pointer;
  transition: all .2s ease;
}
.lang-item:active { transform: scale(.98); }
.lang-item.active {
  border-color: var(--c-primary);
  background: linear-gradient(135deg, rgba(255,138,61,.06), rgba(255,91,46,.06));
}
.lang-flag-big { font-size: 28px; flex-shrink: 0; }
.lang-text { flex: 1; line-height: 1.2; }
.lang-text strong { display: block; font-size: 15px; font-weight: 700; }
.lang-text small { display: block; font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }
.lang-item .bi-check2 {
  font-size: 22px;
  color: var(--c-primary);
  opacity: 0;
}
.lang-item.active .bi-check2 { opacity: 1; }

/* ============ CHECKOUT ============ */
.ck-section { margin-bottom: 16px; }
.ck-label {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.ck-hint { font-size: 12px; color: var(--c-text-muted); }
.ck-hint.error { color: var(--c-danger); }

.form-control {
  border: 1.5px solid var(--c-border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  transition: all .2s ease;
}
.form-control:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(255, 91, 46, .12);
}

.pay-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-option { cursor: pointer; }
.pay-option input { position: absolute; opacity: 0; pointer-events: none; }
.pay-card {
  border: 1.5px solid var(--c-border);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  transition: all .2s ease;
}
.pay-card i { font-size: 24px; color: var(--c-primary); margin-bottom: 4px; display: block; }
.pay-card strong { display: block; font-size: 14px; }
.pay-card small { display: block; font-size: 11px; color: var(--c-text-muted); margin-top: 2px; }
.pay-option input:checked + .pay-card {
  border-color: var(--c-primary);
  background: linear-gradient(135deg, rgba(255,138,61,.06), rgba(255,91,46,.06));
  box-shadow: 0 4px 14px rgba(255,91,46,.18);
}

.ck-recap {
  background: var(--c-soft);
  border-radius: var(--r-md);
  padding: 14px;
  margin-top: 6px;
}
.ck-recap-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }
.ck-recap-row span { color: var(--c-text-muted); }
.ck-recap-row span i { margin-right: 6px; }
.ck-recap-row.total { border-top: 1px dashed var(--c-border); margin-top: 6px; padding-top: 12px; font-size: 18px; }
.ck-recap-row.total strong {
  font-size: 22px; font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ SUCCESS ============ */
.success-card {
  text-align: center;
  padding: 40px 24px;
  align-items: center;
  justify-content: center;
}
.success-anim { position: relative; width: 110px; height: 110px; margin: 32px auto 18px; }
.success-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--grad-primary);
  animation: ring-pulse 1.4s ease-in-out infinite;
}
.success-anim i {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 60px;
  animation: check-pop .6s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,91,46,.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(255,91,46,0); }
}
@keyframes check-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.success-card h2 { font-weight: 800; font-size: 26px; margin: 0 0 4px; }
.success-code {
  display: inline-block;
  margin: 14px 0;
  background: var(--c-soft);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 1px;
  font-family: monospace;
  font-size: 15px;
}
.success-meta {
  display: flex; gap: 14px;
  margin: 8px 0 24px;
  width: 100%;
  max-width: 320px;
}
.success-meta > div {
  flex: 1;
  background: var(--c-soft);
  border-radius: var(--r-md);
  padding: 12px;
  text-align: center;
}
.success-meta span {
  display: block; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--c-text-muted);
  margin-bottom: 4px;
}
.success-meta strong { font-size: 16px; font-weight: 800; }

/* ============ TOAST ============ */
.toast-wrap {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(100px + var(--safe-bottom));
  z-index: 9000;
  pointer-events: none;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
}
.toast-msg {
  background: rgba(20,12,8,.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in .35s cubic-bezier(.2,.9,.3,1.4);
  max-width: 90vw;
  white-space: pre-line;
  text-align: center;
}
.toast-msg.error { background: var(--c-danger); }
.toast-msg.success { background: var(--c-success); }
@keyframes toast-in {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ============ DESKTOP / TABLET ============ */
@media (min-width: 720px) {
  body {
    background: linear-gradient(135deg, #fff8f3 0%, #ffeadd 60%, #ffd6c2 100%);
    min-height: 100vh;
  }
  .app-shell {
    max-width: 720px;
    margin: 24px auto;
    background: var(--c-bg);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }
  .hero { border-radius: 0; min-height: 540px; }
  .hero-title { font-size: 46px; }
  .product-wrap { padding: 24px; }
  #productList { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  #productList > * { width: 100%; }
  .cart-fab { left: 50%; transform: translateX(-50%); max-width: 680px; width: calc(100% - 32px); }
  .sheet-card { left: 50%; transform: translate(-50%, 100%); max-width: 720px; width: 100%; }
  .sheet[aria-hidden="false"] .sheet-card { transform: translate(-50%, 0); }
  .var-list { grid-template-columns: 1fr 1fr; }
  .qr-stage { left: 50%; transform: translate(-50%, 100%); max-width: 720px; width: 100%; right: auto; }
  .sheet[aria-hidden="false"] .qr-stage { transform: translate(-50%, 0); }
}
