/* ══════════════════════════════════════════════════════════
   PIZZARIA — Design System
   Light/Dark · Mobile-first · Modern
   ══════════════════════════════════════════════════════════ */

/* ─── TOKENS ─────────────────────────────────────────────────── */
:root {
  /* Brand */
  --red:       #E63946;
  --red-dk:    #C1121F;
  --red-glow:  rgba(230,57,70,.18);
  --orange:    #F4A261;
  --teal:      #2A9D8F;
  --green-wa:  #25D366;

  /* Light theme */
  --bg:        #FFF8F1;
  --surface:   #FFFFFF;
  --surface2:  #F6EEE4;
  --text:      #1A1614;
  --text2:     #4A3F38;
  --muted:     #8A7A6E;
  --border:    #ECE0D4;
  --shadow-s:  0 2px 8px  rgba(28,20,14,.06);
  --shadow-m:  0 4px 24px rgba(28,20,14,.08);
  --shadow-l:  0 12px 48px rgba(28,20,14,.12);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* Header */
  --hh: 58px;

  /* Transitions */
  --t-fast:   150ms ease;
  --t-norm:   220ms ease;
  --t-slow:   350ms ease;
  --t-theme:  background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease;
}

[data-theme="dark"] {
  --bg:       #0F0D0C;
  --surface:  #1A1714;
  --surface2: #2A2520;
  --text:     #F5EDE4;
  --text2:    #DDD0C0;
  --muted:    #B0A090;
  --border:   #3A3028;
  --shadow-s: 0 2px 8px  rgba(0,0,0,.35);
  --shadow-m: 0 4px 24px rgba(0,0,0,.45);
  --shadow-l: 0 12px 48px rgba(0,0,0,.55);
}

/* ─── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--hh);
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  transition: var(--t-theme);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  touch-action: manipulation;
}

/* ─── HEADER ─────────────────────────────────────────────────── */
#app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--hh);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-s);
  transition: var(--t-theme);
}

[data-theme="dark"] #app-header {
  background: var(--surface2);
}

.hdr-inner {
  max-width: 640px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}

.hdr-logo { display: flex; align-items: center; gap: 10px; }

.logo-ring {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--orange));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; box-shadow: 0 2px 8px var(--red-glow);
  flex-shrink: 0;
}

.logo-text {
  display: flex; flex-direction: column; line-height: 1.1;
}

#store-name-hdr {
  font-weight: 800; font-size: 1rem; color: var(--text);
  letter-spacing: -.02em;
}

.hdr-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-size: 1rem; transition: background var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { background: var(--border); transform: scale(1.05); }
.icon-btn:active { transform: scale(.95); }

.cart-icon-btn { position: relative; }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: .65rem; font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: 999px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  pointer-events: none;
}
@keyframes badgePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  70%  { transform: scale(.88); }
  100% { transform: scale(1); }
}
.cart-badge.badge-pop { animation: badgePop .38s ease; }

/* ─── MAIN CONTAINER ─────────────────────────────────────────── */
#app-main {
  max-width: 640px; margin: 0 auto;
  padding: 10px 10px 0;
  display: flex; flex-direction: column; gap: 10px;
}

/* ─── CARD ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-m);
  overflow: hidden;
  transition: var(--t-theme);
}

[data-theme="dark"] .card {
  background: var(--surface);
}

.card-title-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 0;
}

.card-title {
  font-weight: 700; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}

.flavor-hint {
  font-size: .75rem; color: var(--muted);
  transition: color var(--t-norm);
}

/* ─── SIZE TABS ──────────────────────────────────────────────── */
.pizza-card { padding-bottom: 14px; }

.size-tabs-scroll {
  overflow-x: auto; scrollbar-width: none;
  padding: 12px 12px 4px;
}
.size-tabs-scroll::-webkit-scrollbar { display: none; }

.size-tabs {
  display: flex; gap: 6px;
  width: max-content; min-width: 100%;
}

.size-tab {
  display: flex; flex-direction: column; align-items: center;
  padding: 7px 12px; border-radius: 40px; border: 1.5px solid var(--border);
  background: var(--surface2); cursor: pointer; gap: 1px;
  transition: all var(--t-norm); white-space: nowrap;
}
.size-tab:hover { border-color: var(--red); }
.size-tab.active {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 4px 14px var(--red-glow);
}
.size-tab-name  { font-weight: 700; font-size: .88rem; }
.size-tab-slices, .size-tab-info { font-size: .68rem; opacity: .7; }
.size-tab-price { font-size: .78rem; font-weight: 600; color: var(--red); }
.size-tab.active .size-tab-price,
.size-tab.active .size-tab-slices { color: rgba(255,255,255,.85); }

/* ─── PIZZA AREA ─────────────────────────────────────────────── */
.pizza-area {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 0 10px;
}

.pizza-canvas-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 100%;
  position: relative;
}

/* ★ KEY: pizza responsive */
.pizza-svg-box {
  width: min(280px, 78vw);
  aspect-ratio: 1;
  flex-shrink: 0;
  transition: width .35s cubic-bezier(.175,.885,.32,1.275);
}

/* Tap hint overlay */
.pizza-tap-hint {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  gap: 6px;
  z-index: 2;
}
.pizza-tap-hint.visible { opacity: 1; }
.tap-finger { font-size: 2rem; animation: tapBounce 1.4s ease-in-out infinite; }
.tap-label { font-size: .78rem; font-weight: 600; color: var(--text2); text-align: center; line-height: 1.4; }
@keyframes tapBounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.pizza-svg-box svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Slice interaction */
.pizza-slice {
  transition: opacity .12s, filter .12s;
  cursor: pointer;
}
.pizza-slice:hover { opacity: .82; filter: brightness(1.07); }
.pizza-slice:active { opacity: .7; }

/* ─── PRODUCT BADGES (next to / below pizza) ─────────────────── */
.product-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; min-height: 0;
}

.prod-badge {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 30px; padding: 4px 10px 4px 7px;
  font-size: .78rem; font-weight: 600; color: var(--text2);
  animation: badgePop .25s cubic-bezier(.175,.885,.32,1.275);
  cursor: default;
}
.prod-badge-ico { font-size: 1rem; line-height: 1; }
.prod-badge-name { font-weight: 600; }
.prod-badge-qty {
  background: var(--red); color: #fff;
  border-radius: 20px; padding: 0 5px;
  font-size: .7rem; font-weight: 700; min-width: 18px; text-align: center;
}

@keyframes badgePop {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ─── QUICK CONTROLS ─────────────────────────────────────────── */
.pizza-controls {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}

/* Aviso de sabores faltando */
.flavor-status {
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
  transition: min-height var(--t-norm);
}
.flavor-status.warning { min-height: 36px; }

.flavor-missing-icon {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.fmi-slice {
  font-size: 1.25rem;
  position: relative; z-index: 1;
  animation: fmiPop 1.6s ease-in-out infinite;
}
.fmi-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid #f59e0b;
  animation: fmiSonar 1.6s ease-out infinite;
}
.fmi-ring2 { animation-delay: .8s; }

@keyframes fmiSonar {
  0%   { transform: scale(.55); opacity: .9; }
  100% { transform: scale(1.7);  opacity: 0; }
}
@keyframes fmiPop {
  0%,100% { transform: scale(1);    }
  50%     { transform: scale(1.18); }
}

.ctrl-btn {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 30px; padding: 6px 12px; font-size: .78rem;
  font-weight: 600; cursor: pointer; color: var(--text2);
  transition: all var(--t-fast);
}
.ctrl-btn:hover   { background: var(--red); border-color: var(--red); color: #fff; }
.ctrl-btn:active  { transform: scale(.94); }
.ctrl-danger:hover { background: var(--muted); border-color: var(--muted); color: #fff; }

/* ─── FLAVOR GRID ────────────────────────────────────────────── */
.flavor-card { padding: 0 14px 16px; }

.flavors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 6px;
  padding-top: 12px;
}

@media (max-width: 340px) {
  .flavors-grid { grid-template-columns: repeat(3, 1fr); }
}

.flavor-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; position: relative;
  padding: 4px 2px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast), opacity var(--t-norm);
}
.flavor-item:hover  { background: var(--surface2); }
.flavor-item:active { transform: scale(.93); }

/* Ícone de fatia de pizza */
.flavor-pizza-ico {
  width: 52px; height: 46px;   /* proporcional ao viewBox 52×46 */
  display: block; flex-shrink: 0;
  position: relative;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
  transition: transform var(--t-norm), filter var(--t-norm);
}
.flavor-pizza-ico svg { display: block; overflow: visible; }

.flavor-item:hover  .flavor-pizza-ico { transform: scale(1.08); }
.flavor-item.active .flavor-pizza-ico {
  transform: scale(1.2);
  filter: drop-shadow(0 0 6px var(--red)) drop-shadow(0 3px 8px rgba(0,0,0,.25));
}
.flavor-item.flavor-dimmed { opacity: .32; pointer-events: none; }

/* Slot badge — número da seção (1, 2, 3…) */
.flavor-slot-badge {
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px;
  background: var(--red); color: #fff;
  border-radius: 50%; border: 2px solid var(--surface);
  font-size: .6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; pointer-events: none;
}

.flavor-dot-label {
  font-size: .68rem; font-weight: 600; color: var(--text2);
  text-align: center; line-height: 1.2; max-width: 60px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.flavor-item.active .flavor-dot-label { color: var(--text); font-weight: 700; }
.flavor-dot-desc {
  font-size: .58rem; color: var(--muted); text-align: center;
  line-height: 1.2; max-width: 64px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Flavor legend chips */
.flavor-legend {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding-top: 10px; min-height: 0;
}
.legend-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 600;
  border: 1.5px solid; transition: all var(--t-norm);
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-empty { background: var(--surface2); color: var(--muted); border-color: var(--border); border-style: dashed; }

/* ─── COMPLEMENTS ────────────────────────────────────────────── */
.extras-card { padding: 0 12px 12px; }

.comp-list {
  display: flex; flex-wrap: nowrap; gap: 6px;
  padding: 8px 0 2px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.comp-list::-webkit-scrollbar { display: none; }

.comp-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; white-space: nowrap; flex-shrink: 0;
  border: 1.5px solid var(--border); border-radius: 20px;
  background: var(--surface2); cursor: pointer;
  transition: all var(--t-fast); font-size: .8rem; color: var(--text2);
}
.comp-chip:hover  { border-color: var(--teal); color: var(--teal); }
.comp-chip:active { transform: scale(.95); }
.comp-chip.on {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
  color: var(--teal); font-weight: 600;
}
.comp-chip.on::before { content: '✓ '; }
.comp-price { font-weight: 700; opacity: .85; }

/* ─── PRODUCTS ───────────────────────────────────────────────── */
.prod-row {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 8px 0 2px;
  scrollbar-width: none; scroll-snap-type: x mandatory;
}
.prod-row::-webkit-scrollbar { display: none; }

.prod-card {
  flex-shrink: 0; scroll-snap-align: start;
  width: 120px; background: var(--surface2);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 10px 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: border-color var(--t-norm), box-shadow var(--t-norm);
}
.prod-card:has(.qty-ctrl) { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-glow); }

.prod-emoji  { font-size: 2rem; line-height: 1; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.prod-img-icon { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.prod-name   { font-weight: 600; font-size: .8rem; line-height: 1.2; }
.prod-desc   { font-size: .68rem; color: var(--muted); }
.prod-price  { color: var(--red); font-weight: 700; font-size: .88rem; margin: 2px 0; }

.btn-add-prod {
  background: var(--red); color: #fff; border: none;
  border-radius: 20px; padding: 5px 16px; font-size: .78rem;
  font-weight: 700; cursor: pointer; transition: background var(--t-fast);
  width: 100%;
}
.btn-add-prod:hover  { background: var(--red-dk); }
.btn-add-prod:active { transform: scale(.95); }

.qty-ctrl {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
}
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast); line-height: 1;
}
.qty-btn:hover  { background: var(--red); border-color: var(--red); color: #fff; }
.qty-btn:active { transform: scale(.9); }
.qty-num { font-weight: 800; font-size: .95rem; min-width: 20px; text-align: center; }

/* ─── SAVED PIZZAS ───────────────────────────────────────────── */
.saved-list { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }

.saved-group { display: flex; flex-direction: column; gap: 2px; }

.saved-item-current {
  border-style: dashed;
  border-color: var(--red);
  opacity: .9;
}
.badge-montagem {
  display: inline-block;
  font-size: .64rem; font-weight: 700;
  background: var(--red); color: #fff;
  padding: 1px 7px; border-radius: 20px;
  vertical-align: middle; margin-left: 5px;
  letter-spacing: .02em;
}

.saved-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border-radius: var(--r-sm);
  padding: 10px 12px; border: 1px solid var(--border);
}

.saved-sub-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 12px 3px 28px;
  font-size: .76rem; color: var(--text2);
}
.saved-sub-label { flex: 1; }
.saved-sub-price  { color: var(--teal); font-weight: 600; flex-shrink: 0; }

.saved-section-divider {
  font-size: .74rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 2px 4px;
  border-top: 1px solid var(--border); margin-top: 6px;
}
.saved-item-info { flex: 1; min-width: 0; }
.saved-item-name { font-weight: 700; font-size: .88rem; }
.saved-item-detail { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.saved-flavor-line { display: block; line-height: 1.3; }
.saved-flavor-line + .saved-flavor-line { margin-top: 2px; }
.saved-flavor-desc { font-size: .7rem; color: var(--muted); opacity: .78; }
.saved-item-price { color: var(--red); font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.saved-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-rm, .btn-edit {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all var(--t-fast); flex-shrink: 0;
  padding: 0;
}
.btn-rm svg, .btn-edit svg { pointer-events: none; }
.btn-edit:hover { background: color-mix(in srgb, var(--teal) 12%, var(--surface)); border-color: var(--teal); color: var(--teal); }
.btn-rm:hover   { background: color-mix(in srgb, var(--red)  12%, var(--surface)); border-color: var(--red);  color: var(--red); }
.btn-rm:active, .btn-edit:active { transform: scale(.88); }

.btn-add-more {
  width: 100%; margin-top: 10px; padding: 11px;
  background: none; border: 1.5px dashed var(--border); border-radius: var(--r-sm);
  color: var(--muted); font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-norm);
}
.btn-add-more:hover { border-color: var(--red); color: var(--red); background: var(--red-glow); }

.bottom-spacer { height: 2px; }

/* ─── ORDER BAR ──────────────────────────────────────────────── */
.order-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.10);
  transition: var(--t-theme);
}

.order-bar-left { flex: 1; min-width: 0; }

.bar-desc {
  font-size: .78rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.bar-total { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }

.btn-order {
  display: flex; align-items: center; gap: 6px;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--r-md);
  padding: 12px 20px; font-size: .95rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background var(--t-fast), transform .3s cubic-bezier(.175,.885,.32,1.275), box-shadow var(--t-fast), opacity .3s ease;
  box-shadow: 0 4px 16px var(--red-glow);
}
.btn-order:hover  { background: var(--red-dk); box-shadow: 0 6px 20px var(--red-glow); }
.btn-order:active { transform: scale(.97); }
.btn-order.order-btn-hidden {
  opacity: 0; pointer-events: none;
  transform: scale(.82) translateX(10px);
  box-shadow: none;
}

/* ─── SHEETS / OVERLAYS ──────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn .2s ease;
}
.overlay-centered { align-items: center; justify-content: center; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%; max-width: 640px; margin: 0 auto;
  max-height: 94vh;
  display: flex; flex-direction: column;
  animation: slideUp .28s cubic-bezier(.32,.72,0,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: var(--t-theme);
}
.sheet-sm { max-height: 70vh; }

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.sheet-grip {
  width: 36px; height: 4px; border-radius: 4px;
  background: var(--border); margin: 10px auto 4px; flex-shrink: 0;
}
.sheet-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.sheet-hdr h2 { font-size: 1.1rem; font-weight: 800; }
.x-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
  /* garante área de toque mínima recomendada (44×44px) */
  touch-action: manipulation;
}
.x-btn:hover { background: var(--border); color: var(--text); }
.x-btn:active { transform: scale(0.92); }

.sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.sheet-footer {
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: .9rem;
}
.total-row strong { font-size: 1.2rem; font-weight: 800; color: var(--red); }
.fee-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .82rem; color: var(--muted); margin-bottom: 6px;
}

/* ─── CHECKOUT FORM ──────────────────────────────────────────── */
.order-summary-box {
  background: var(--surface2); border-radius: var(--r-sm);
  padding: 12px 14px; margin-bottom: 16px; font-size: .84rem;
  border: 1px solid var(--border);
}
.sum-row { display: flex; justify-content: space-between; padding: 3px 0; }
.sum-row-sub { padding-left: 12px; color: var(--muted); font-size: .78rem; }
.sum-flavor-list { padding: 2px 0 4px 14px; }
.sum-flavor-line { font-size: .75rem; color: var(--muted); line-height: 1.4; display: block; }
.sum-flavor-line-desc { font-size: .7rem; color: var(--muted); opacity: .72; margin-left: 8px; }
.sum-flavor-line-obs  { font-size: .7rem; color: var(--teal); font-style: italic; margin-left: 6px; }

.field-row { margin-bottom: 14px; }
.field label {
  display: block; font-size: .8rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 6px;
}
.opt-tag {
  font-size: .7rem; font-weight: 500; text-transform: none;
  color: var(--muted); letter-spacing: 0;
}
.field input, .field textarea {
  width: 100%; padding: 11px 14px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); font-size: .95rem; color: var(--text);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--red);
  background: var(--surface);
}
.field input.input-valid {
  border-color: #22c55e;
  background: var(--surface);
}
.field input.input-invalid {
  border-color: #ef4444;
  background: var(--surface);
}
.field-msg {
  font-size: .78rem;
  margin-top: 4px;
  min-height: 16px;
}
.field-msg.ok  { color: #22c55e; }
.field-msg.err { color: #ef4444; }
.field textarea { resize: vertical; min-height: 60px; }

.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-opt input { display: none; }
.pay-card {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; background: var(--surface2); transition: all var(--t-norm);
}
.pay-opt input:checked + .pay-card {
  border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface));
  box-shadow: 0 0 0 3px var(--red-glow);
}
.pay-ico { font-size: 1.5rem; }
.pay-lbl { font-size: .76rem; font-weight: 700; }

.info-box {
  background: color-mix(in srgb, var(--teal) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--border));
  border-radius: var(--r-sm); padding: 10px 12px;
  font-size: .84rem; margin-bottom: 12px;
}

/* ─── PIX QR CODE BOX ────────────────────────────────────────── */
.pix-box-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 14px 12px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--teal) 30%, var(--border));
  border-radius: var(--r-sm);
}
.pix-qr-wrap {
  background: #fff; border-radius: 10px; padding: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
  display: flex; align-items: center; justify-content: center;
}
#pix-qr-container img, #pix-qr-container canvas { display: block; }
.pix-info { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.pix-info-row { display: flex; flex-direction: column; gap: 3px; }
.pix-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--teal);
}
.pix-copy-row { display: flex; gap: 6px; }
.pix-copy-input {
  flex: 1; min-width: 0; font-size: .72rem; padding: 7px 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-pix-copy {
  flex-shrink: 0; padding: 7px 14px; border: none; border-radius: var(--r-sm);
  background: var(--teal); color: #fff; font-size: .8rem; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.btn-pix-copy:active { opacity: .75; }
.pix-hint { font-size: .75rem; color: var(--muted); text-align: center; margin: 0; }
.pix-status-pago {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: #d1fae5; color: #065f46; font-size: .85rem; font-weight: 600;
  animation: pix-fade-in .4s ease;
}
.pix-status-icon { font-size: 1.1rem; }
@keyframes pix-fade-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

/* ─── GEOLOCATION BUTTON ─────────────────────────────────────── */
.btn-geo {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 10px 14px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--teal) 10%, var(--surface2));
  border: 1.5px solid color-mix(in srgb, var(--teal) 35%, var(--border));
  border-radius: var(--r-sm); font-size: .88rem; font-weight: 600;
  color: var(--teal); cursor: pointer;
  transition: all var(--t-fast);
}
.btn-geo:hover  { background: color-mix(in srgb, var(--teal) 18%, var(--surface2)); }
.btn-geo:active { transform: scale(.98); }
.btn-geo:disabled { opacity: .6; cursor: default; }

.geo-result {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: .78rem; color: var(--muted);
  margin-bottom: 8px; padding: 7px 10px;
  background: color-mix(in srgb, var(--teal) 7%, var(--surface2));
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--teal) 25%, var(--border));
}
.geo-link {
  color: var(--teal); font-weight: 700; text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
}
.geo-link:hover { text-decoration: underline; }
.geo-addr { color: var(--text2); overflow: hidden; text-overflow: ellipsis; }
.geo-warn { color: var(--orange); font-weight: 600; }

.toggle-row {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: .9rem; font-weight: 600;
  text-transform: none; letter-spacing: 0;
}
.toggle-cb {
  width: 18px; height: 18px; accent-color: var(--red); cursor: pointer;
  flex-shrink: 0;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  background: var(--green-wa); color: #fff;
  border: none; border-radius: var(--r-md);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: 0 4px 16px rgba(37,211,102,.3);
}
.btn-whatsapp:hover  { background: #128C7E; }
.btn-whatsapp:active { transform: scale(.98); }

.btn-sec {
  display: block; width: 100%; padding: 12px;
  background: var(--surface2); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.btn-sec:hover { border-color: var(--red); color: var(--red); }

.btn-ghost {
  display: block; width: 100%; padding: 10px;
  background: none; border: none; color: var(--muted);
  font-size: .88rem; cursor: pointer; transition: color var(--t-fast);
}
.btn-ghost:hover { color: var(--text); }

/* ─── SUCCESS ────────────────────────────────────────────────── */
.success-body {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 28px 24px;
}
.success-icon-wrap { position: relative; margin-bottom: 16px; }
.success-icon { font-size: 4rem; position: relative; z-index: 1; }
.success-rings {
  position: absolute; inset: -12px;
  border-radius: 50%;
  animation: ringPulse 1.6s ease-out infinite;
  background: radial-gradient(circle, rgba(37,211,102,.2) 0%, transparent 70%);
}
@keyframes ringPulse {
  0%   { transform: scale(.8); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}
.success-body h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.success-sub { color: var(--muted); font-size: .9rem; margin-bottom: 24px; }
.success-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; }

/* ─── TRACKING ───────────────────────────────────────────────── */
.search-row { display: flex; gap: 8px; margin-bottom: 16px; }
.search-input {
  flex: 1; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); font-size: .93rem; color: var(--text);
  background: var(--surface2);
}
.search-input:focus { outline: none; border-color: var(--red); background: var(--surface); }
.btn-search {
  padding: 11px 18px; background: var(--red); color: #fff;
  border: none; border-radius: var(--r-sm); font-weight: 700; cursor: pointer;
  transition: background var(--t-fast);
}
.btn-search:hover { background: var(--red-dk); }

.track-card { background: var(--surface2); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.track-card-hdr { padding: 12px 16px; background: linear-gradient(90deg, var(--red-dk), var(--red)); color: #fff; }
.track-card-hdr h3 { font-size: .95rem; font-weight: 700; }
.track-card-hdr p  { font-size: .76rem; opacity: .8; margin-top: 1px; }
.track-card-body { padding: 14px 16px; }
.status-steps { display: flex; flex-direction: column; gap: 10px; }
.s-step { display: flex; align-items: center; gap: 10px; opacity: .28; transition: opacity var(--t-norm); }
.s-step.done, .s-step.active { opacity: 1; }
.s-dot {
  width: 32px; height: 32px; border-radius: 50%; background: var(--border);
  display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0;
}
.s-step.done   .s-dot { background: var(--teal); }
.s-step.active .s-dot { background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse {
  0%,100%{ box-shadow: 0 0 0 0   rgba(230,57,70,.4); }
  60%    { box-shadow: 0 0 0 10px rgba(230,57,70,0);  }
}
.s-label { font-weight: 600; font-size: .86rem; }
.s-sub   { font-size: .72rem; color: var(--muted); }

/* ─── SLICE POPUP ────────────────────────────────────────────── */
.slice-popup {
  background: var(--surface); border-radius: var(--r-lg);
  width: calc(100% - 32px); max-width: 380px;
  box-shadow: var(--shadow-l); overflow: hidden;
  animation: popIn .2s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes popIn { from { transform: scale(.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.popup-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(90deg, var(--red-dk), var(--red)); color: #fff;
  font-size: .9rem; font-weight: 600;
  gap: 10px;
}
.popup-hdr-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.popup-title    { font-size: .9rem; font-weight: 700; }
.popup-flavor-count {
  font-size: .75rem; font-weight: 600;
  background: rgba(255,255,255,.22); color: #fff;
  padding: 1px 8px; border-radius: 20px;
  display: inline-block; width: fit-content;
}
.popup-flavor-count.full {
  background: rgba(255,255,255,.38);
}

.popup-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; padding: 14px 14px 6px;
  max-height: 55vh; overflow-y: auto;
}
@media (min-width: 380px) {
  .popup-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Tabs de categoria no popup ────────────────────────── */
.popup-cat-tabs {
  display: flex; gap: 6px; padding: 10px 14px 0;
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.popup-cat-tabs::-webkit-scrollbar { display: none; }
.popup-cat-tab {
  flex-shrink: 0;
  padding: 6px 16px; border-radius: 20px 20px 0 0;
  border: 1.5px solid var(--border); border-bottom: none;
  background: var(--surface2); color: var(--muted);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
  position: relative; bottom: -1px;
}
.popup-cat-tab:hover { color: var(--text); background: var(--surface); }
.popup-cat-tab.active {
  background: var(--surface); color: var(--red);
  border-color: var(--border); border-bottom-color: var(--surface);
}
.popup-cat-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-size: .6rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  margin-left: 5px; vertical-align: middle;
}
.popup-cat-tab.active .popup-cat-tab-count { background: var(--red); }
.popup-cat-tab:not(.active) .popup-cat-tab-count { background: var(--muted); }

.popup-flavor-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 6px 6px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; background: var(--surface2);
  transition: all var(--t-fast);
  position: relative;
}
.popup-flavor-btn:hover  { border-color: var(--red); transform: scale(1.04); }
.popup-flavor-btn:active { transform: scale(.96); }
.popup-flavor-btn.off    { opacity: .28; cursor: not-allowed; }
.popup-flavor-btn.off:hover { transform: none; border-color: var(--border); }
.popup-flavor-btn.chosen { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, var(--surface2)); }

.pop-slice-ico  { width: 42px; height: 37px; display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,.15)); }
.pop-slice-ico svg { display: block; overflow: visible; }
.pop-flavor-name { font-size: .72rem; font-weight: 600; color: var(--text2); text-align: center; line-height: 1.2; }
.pop-flavor-desc {
  font-size: .63rem; color: var(--muted); text-align: center;
  line-height: 1.3; padding: 0 2px;
  word-break: break-word; white-space: normal;
}
.pop-check {
  position: absolute; top: 3px; right: 4px;
  width: 16px; height: 16px; background: var(--teal); color: #fff;
  border-radius: 50%; font-size: .6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.popup-clear {
  display: block; margin: 8px 14px 14px;
  padding: 9px; border: 1px dashed var(--border); border-radius: var(--r-sm);
  background: none; color: var(--muted); font-size: .84rem; cursor: pointer;
  width: calc(100% - 28px); text-align: center; transition: all var(--t-fast);
}
.popup-clear:hover { background: var(--surface2); color: var(--red); border-color: var(--red); }

/* ─── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 90px; left: 50%; z-index: 500;
  transform: translateX(-50%) translateY(12px);
  background: #1A1614; color: #F5EDE4;
  padding: 10px 20px; border-radius: 30px;
  font-size: .84rem; font-weight: 600; pointer-events: none;
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  white-space: nowrap;
}
.toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--teal); }
.toast.error   { background: var(--red); }

[data-theme="dark"] .toast { background: #F5EDE4; color: #1A1614; }
[data-theme="dark"] .toast.success { background: var(--teal); color: #fff; }
[data-theme="dark"] .toast.error   { background: var(--red); color: #fff; }

/* ─── LOADING ────────────────────────────────────────────────── */
.loading-overlay, #loading {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 300;
  backdrop-filter: blur(2px);
}
.loader {
  width: 44px; height: 44px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVIDADE MOBILE ──────────────────────────────────── */
@media (max-width: 390px) {
  #app-main { padding: 8px 8px 0; gap: 8px; }
  .size-tabs-scroll { padding: 10px 10px 4px; }
  .pizza-area { padding: 0 8px; gap: 6px; }
  .card-title-row { padding: 10px 12px 0; }
  .extras-card { padding: 0 10px 10px; }
  .pizza-card { padding-bottom: 12px; }
  .size-tab { padding: 6px 10px; }
  .pizza-svg-box { width: min(270px, 82vw); }
  .prod-card { width: 110px; }
  .comp-chip { padding: 4px 10px; font-size: .76rem; }
}

@media (max-width: 340px) {
  .pizza-svg-box { width: min(250px, 86vw); }
  .size-tab-name { font-size: .82rem; }
  .size-tab-info { font-size: .62rem; }
  .size-tab-price { font-size: .72rem; }
}

/* Garante que flavor-status não crie espaço vazio quando sem conteúdo */
.flavor-status:empty { min-height: 0; }

/* ─── DARK MODE EXTRAS ───────────────────────────────────────── */
[data-theme="dark"] .pizza-svg-box svg {
  filter: drop-shadow(0 6px 20px rgba(0,0,0,.5));
}
[data-theme="dark"] .overlay {
  background: rgba(0,0,0,.7);
}
[data-theme="dark"] .order-bar {
  background: var(--surface2);
}

/* ── Dark mode — legibilidade ─── */
[data-theme="dark"] .flavor-dot-label   { color: var(--text2); }
[data-theme="dark"] .flavor-item.active .flavor-dot-label { color: var(--text); font-weight: 700; }
[data-theme="dark"] .size-tab           { color: var(--text2); }
[data-theme="dark"] .size-tab.active    { color: #fff; }
[data-theme="dark"] .card-title         { color: var(--muted); }
[data-theme="dark"] .flavor-hint        { color: var(--muted); }
[data-theme="dark"] .tap-label          { color: #1a1a1a; }
[data-theme="dark"] .comp-chip          { color: var(--text2); }
[data-theme="dark"] .comp-chip.on       { color: var(--teal); }
[data-theme="dark"] .prod-name          { color: var(--text); }
[data-theme="dark"] .prod-desc          { color: var(--muted); }
[data-theme="dark"] .bar-desc           { color: var(--muted); }
[data-theme="dark"] .bar-total          { color: var(--text); }
[data-theme="dark"] .saved-item-name    { color: var(--text); }
[data-theme="dark"] .saved-item-detail  { color: var(--muted); }
[data-theme="dark"] .sheet              { background: var(--surface2); }
[data-theme="dark"] .sheet-hdr h2      { color: var(--text); }
[data-theme="dark"] .field label        { color: var(--muted); }
[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea     { color: var(--text); background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .pay-lbl            { color: var(--text2); }
[data-theme="dark"] .sum-row            { color: var(--text2); }
[data-theme="dark"] .s-label            { color: var(--text2); }
[data-theme="dark"] .ctrl-btn           { color: var(--text2); }

/* ─── CLOSED BANNER ─────────────────────────────────────────── */
.closed-banner {
  background: #fef2f2; color: #991b1b;
  border-bottom: 2px solid #fca5a5;
  padding: 12px 16px; text-align: center;
  font-size: .88rem; font-weight: 600;
}
[data-theme="dark"] .closed-banner { background: #1f0505; color: #fca5a5; border-color: #7f1d1d; }

/* ─── FLAVOR NOTES AREA ──────────────────────────────────────── */
.flavor-notes-area { padding: 0 14px 4px; }
.fnotes-list { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 4px; }
.fnote-row {
  display: flex; align-items: center; gap: 8px;
}
.fnote-label {
  font-size: .78rem; font-weight: 600; color: var(--muted);
  white-space: nowrap; min-width: 80px; max-width: 100px; overflow: hidden; text-overflow: ellipsis;
}
.fnote-input {
  flex: 1; padding: 6px 10px; font-size: .8rem;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  transition: border-color .2s;
}
.fnote-input:focus { outline: none; border-color: var(--primary); }
[data-theme="dark"] .fnote-input { background: var(--surface); }

/* ─── FLAVOR IMAGES ──────────────────────────────────────────── */
.flavor-thumb {
  width: 38px; height: 38px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
}
.pop-flavor-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
}

/* ─── OUT-OF-STOCK FLAVOR ────────────────────────────────────── */
.flavor-item.out-of-stock { opacity: .45; cursor: not-allowed; }
.flavor-stock-tag {
  font-size: .62rem; font-weight: 700; color: #ef4444;
  background: #fee2e2; border-radius: 4px; padding: 1px 5px;
  display: block; margin-top: 2px;
}
.flavor-stock-qty {
  font-size: .62rem; font-weight: 600; color: #16a34a;
  background: #dcfce7; border-radius: 4px; padding: 1px 5px;
  display: block; margin-top: 2px;
}
.flavor-stock-qty.low {
  color: #d97706; background: #fef3c7;
}
.popup-flavor-btn.out-of-stock { opacity: .4; }
.pop-stock-tag {
  font-size: .62rem; font-weight: 700; color: #ef4444;
  background: #fee2e2; border-radius: 4px; padding: 1px 5px;
}

/* ── HAMBÚRGUERES ──────────────────────────────────────────────── */
.burger-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.burger-item {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px 16px;
}
.burger-item-hdr {
  margin-bottom: 10px;
}
.burger-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text, #111);
}
.burger-desc {
  font-size: .82rem;
  color: var(--text-muted, #6b7280);
  margin-top: 2px;
}
.burger-price {
  font-weight: 600;
  color: var(--primary, #f97316);
  font-size: .95rem;
  margin-top: 4px;
}
.burger-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.burger-size-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: transparent;
  font-size: .82rem;
  cursor: pointer;
  color: var(--text, #111);
  transition: all .15s;
}
.burger-size-btn.active {
  border-color: var(--primary, #f97316);
  background: var(--primary, #f97316);
  color: #fff;
}
.burger-comps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.burger-comp-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: transparent;
  font-size: .78rem;
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  transition: all .15s;
}
.burger-comp-btn.active, .burger-comp-btn.on {
  border-color: var(--primary, #f97316);
  background: #fff7ed;
  color: var(--primary, #f97316);
}
.burger-add-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.btn-add-burger {
  background: var(--primary, #f97316);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.burger-size-extra, .comp-price {
  font-size: .75rem;
  opacity: .8;
}
.btn-rm-burger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger, #ef4444);
  padding: 2px;
  display: flex;
  align-items: center;
}

/* ── CATEGORY TABS ────────────────────────────────────────── */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 16px 4px;
}
.cat-tab {
  flex: 1;
  padding: 11px 8px;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--text, #111);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .01em;
}
.cat-tab.active {
  border-color: var(--primary, #f97316);
  background: var(--primary, #f97316);
  color: #fff;
  box-shadow: 0 2px 10px rgba(249,115,22,.28);
}

/* ── BURGER VISUAL SECTION ────────────────────────────────── */
#burger-section { padding: 0 0 16px; }
.burger-visual-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 0;
}
.burger-canvas-wrap {
  position: relative;
  width: min(280px, 78vw);
}
.burger-svg-box { width: 100%; }
.burger-tap-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  gap: 6px;
}
.burger-tap-hint .tap-finger { font-size: 28px; animation: tapBounce 1.4s ease-in-out infinite; }
.burger-tap-hint .tap-label {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  text-align: center;
  line-height: 1.4;
  background: rgba(255,255,255,.75);
  padding: 4px 10px;
  border-radius: 8px;
}
.burger-flavor-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary, #f97316);
  text-align: center;
  min-height: 24px;
  letter-spacing: .01em;
}
.burger-controls {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}
.burger-size-btns, .burger-comp-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
/* reuse .burger-size-btn / .burger-comp-btn styles already defined above */
.burger-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.burger-unit-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary, #f97316);
}
.btn-add-burger-visual {
  padding: 12px 26px;
  background: var(--primary, #f97316);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .12s;
  box-shadow: 0 2px 10px rgba(249,115,22,.3);
}
.btn-add-burger-visual:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-add-burger-visual:not(:disabled):active { transform: scale(.96); }

/* ── BURGER FLAVOR POPUP ──────────────────────────────────── */
.burger-flavor-popup { max-height: 72vh; overflow-y: auto; }
.burger-popup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px 4px;
}
.burger-popup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 14px;
  cursor: pointer;
  transition: all .15s;
  background: var(--surface, #fff);
}
.burger-popup-item:hover,
.burger-popup-item.selected {
  border-color: var(--primary, #f97316);
  background: rgba(249,115,22,.06);
}
.bpi-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.bpi-info { flex: 1; min-width: 0; }
.bpi-name { font-size: 14px; font-weight: 700; color: var(--text, #111); }
.bpi-desc { font-size: 12px; color: var(--text-muted, #6b7280); margin-top: 2px; }
.bpi-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary, #f97316);
  white-space: nowrap;
}

/* ── Burger popup 2-step ──────────────────────────────── */
.bfp-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #111);
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 10px;
}
.bfp-back-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--primary, #f97316);
  font-weight: 600;
  padding: 0 0 10px;
  cursor: pointer;
  display: block;
}
.bfp-flavor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.bfp-flavor-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #111);
}
.bfp-flavor-desc {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  margin-bottom: 12px;
  padding-left: 4px;
}
.bfp-sizes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bfp-toggles-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
  padding-left: 2px;
}
.bfp-toggles-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
  max-height: 52vh;
  overflow-y: auto;
}
.bfp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 2px;
  border-top: 1px solid var(--border, #e5e7eb);
  gap: 12px;
}
.bfp-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary, #f97316);
}
.btn-add-burger-popup {
  background: var(--primary, #f97316);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
  flex-shrink: 0;
}
.btn-add-burger-popup:hover { opacity: .88; }

/* ── Burger ingredient toggles ─────────────────────── */
.burger-toggles-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
  padding-left: 2px;
}
.burger-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .13s;
  user-select: none;
}
.burger-toggle-row:hover { background: rgba(0,0,0,.04); }
.btr-icon  { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.btr-name  { flex: 1; font-size: 14px; font-weight: 500; color: var(--text, #111); }
.btr-price { font-size: 12px; color: var(--primary, #f97316); font-weight: 600; }
.btr-tag   { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.btr-tag.removed { background: #fee2e2; color: #dc2626; }
.btr-tag.added   { background: #dcfce7; color: #16a34a; }
.burger-toggle {
  position: relative; width: 42px; height: 24px;
  background: var(--border, #d1d5db); border-radius: 12px;
  flex-shrink: 0; transition: background .2s;
}
.burger-toggle.on { background: var(--primary, #f97316); }
.burger-toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff;
  border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.burger-toggle.on .burger-toggle-knob { transform: translateX(18px); }

/* ── Section complement summary ────────────────────── */
.bsec-comp-summary {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.bsec-comp-tag {
  font-size: 12px; background: var(--surface-2, #f3f4f6);
  padding: 3px 10px; border-radius: 20px; color: var(--text-muted, #6b7280);
}
.burger-edit-hint {
  font-size: 11px; color: var(--primary, #f97316);
  font-weight: 400; margin-left: 6px;
}
