:root {
  color-scheme: dark;
  --bg: #11100f;
  --panel: #1b1a18;
  --panel-2: #24221f;
  --line: #38342f;
  --text: #fff8ed;
  --muted: #b9afa2;
  --brand: #ff4b18;
  --brand-2: #ffb12b;
  --good: #38c172;
  --danger: #ff6b4a;
  --shadow: 0 16px 40px rgba(0, 0, 0, .32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 75, 24, .18), transparent 28rem),
    linear-gradient(180deg, #171513 0%, #0f0e0d 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 14px 14px 108px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 78px;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, rgba(17, 16, 15, .98), rgba(17, 16, 15, .82));
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-logo {
  display: block;
  width: 104px;
  height: auto;
  flex: 0 0 auto;
}

.brand-copy {
  min-width: 0;
}

.eyebrow,
.section-head p,
.delivery-note,
.status-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 17px;
  line-height: 1.08;
  text-transform: uppercase;
}

h2 {
  font-size: 22px;
}

h3 {
  margin-top: 18px;
  margin-bottom: 10px;
  font-size: 15px;
  color: #f4e4d1;
}

.icon-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
}

.cart-dot {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.tabs {
  position: sticky;
  top: 78px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 12px 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 26, 24, .94);
  backdrop-filter: blur(16px);
}

.tabs button {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.tabs button.is-active {
  background: var(--brand);
  color: white;
}

.app-view[hidden] {
  display: none;
}

.section {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 26, 24, .96);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head p {
  text-align: right;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: #11100f;
  border: 1px solid var(--line);
}

.segmented.two {
  grid-template-columns: repeat(2, 1fr);
}

.segmented button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.is-active {
  background: var(--brand);
  color: white;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  font-weight: 800;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

.flavor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.half-help {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.flavor-btn,
.package-btn,
.cart-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

.flavor-btn {
  position: relative;
  min-height: 54px;
  padding: 9px 10px;
  text-align: left;
}

.pick-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.flavor-btn strong,
.package-btn strong {
  display: block;
  font-size: 14px;
}

.flavor-btn span,
.package-btn span,
.cart-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.flavor-btn.is-active {
  border-color: var(--brand);
  background: rgba(255, 75, 24, .18);
}

.quantity-row {
  position: sticky;
  bottom: 78px;
  z-index: 8;
  display: grid;
  grid-template-columns: 48px 48px 48px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 16, 15, .96);
  box-shadow: var(--shadow);
}

.step-btn,
.primary-btn,
.ghost-btn,
.order-btn,
.cart-remove,
.package-btn {
  min-height: 46px;
  border-radius: 8px;
  cursor: pointer;
}

.step-btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 23px;
  font-weight: 900;
}

#quantityText {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 8px;
  background: var(--panel);
}

.primary-btn,
.order-btn {
  border: 0;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.primary-btn.full {
  width: 100%;
}

.package-list {
  display: grid;
  gap: 10px;
}

.package-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  text-align: left;
}

.package-price {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.cart-list {
  display: grid;
  gap: 10px;
}

.cart-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.cart-item {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.cart-item strong {
  display: block;
  font-size: 15px;
}

.cart-actions {
  display: grid;
  grid-template-columns: 42px 42px 1fr 42px;
  gap: 8px;
}

.cart-step,
.cart-edit,
.cart-remove {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
}

.cart-step,
.cart-edit {
  border: 1px solid var(--line);
  background: #11100f;
  color: var(--text);
}

.cart-edit {
  padding: 0 10px;
}

.cart-remove {
  border: 1px solid rgba(255, 107, 74, .4);
  background: rgba(255, 107, 74, .12);
  color: #ffd8d0;
}

.delivery-box,
.customer-box,
.totals {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11100f;
  color: var(--text);
  padding: 13px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
}

textarea {
  resize: vertical;
}

.ghost-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--brand);
  background: transparent;
  color: #ffd8cc;
  font-weight: 900;
}

.totals {
  display: grid;
  gap: 8px;
}

.totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.totals strong {
  color: var(--text);
}

.total-line {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.order-btn {
  width: 100%;
  min-height: 56px;
  margin-top: 16px;
  font-size: 17px;
}

.status-text {
  min-height: 20px;
  margin-top: 10px;
}

.status-text.is-error {
  color: var(--danger);
}

.status-text.is-ok {
  color: var(--good);
}

.bottom-cart {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 30;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 536px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 26, 24, .98);
  box-shadow: var(--shadow);
}

.bottom-cart span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.bottom-cart strong {
  display: block;
  margin-top: 2px;
}

.bottom-cart button {
  display: grid;
  place-items: center;
  min-height: 44px;
  min-width: 148px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.ticket-dialog {
  width: min(calc(100% - 28px), 520px);
  max-height: min(82vh, 720px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.ticket-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dialog-head button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 24px;
}

pre {
  overflow: auto;
  max-height: 55vh;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0c0b;
  color: #fff4e5;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.followup-panel {
  padding: 6px 0 14px;
}

.followup-panel h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.followup-panel p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.whatsapp-btn {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--good);
  color: #06140b;
  font-weight: 900;
  text-decoration: none;
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 24px;
  }
}
