:root {
  --rosso: #7a2430;
  --deep: #4a1c21;
  --cream: #f3ebe3;
  --paper: #fbf7f1;
  --ink: #1f1c1a;
  --mute: #6a5f56;
  --gold: #c4a574;
  --line: #e4d4c4;
}

html {
  overflow-x: clip;
  overflow-anchor: none;
  overscroll-behavior: none;
  width: 100%;
  max-width: 100%;
  height: 100%;
  touch-action: pan-y;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

button,
[type="button"] {
  touch-action: manipulation;
}

body.sheet-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  padding-bottom: 88px;
  overflow-x: clip;
  overscroll-behavior: none;
  width: 100%;
  max-width: 100%;
  touch-action: pan-y;
}

.app {
  width: min(100%, 430px);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0 8px;
}

.eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--rosso);
  margin-bottom: 2px;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1;
}

.lead {
  color: var(--mute);
  margin-top: 10px;
  font-size: 14px;
}

.cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding: 6px 0 10px;
  position: sticky;
  top: 42px;
  background: var(--paper);
  z-index: 2;
  width: 100%;
  max-width: 100%;
}

.tabs {
  display: flex;
  gap: 0;
  padding: 0;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 3;
  width: 100%;
}

.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  padding: 10px 4px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--mute);
}

.tabs button.on {
  color: var(--deep);
  border-bottom-color: var(--deep);
}

.mode {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.mode button {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  font: inherit;
}

.mode button.on {
  background: var(--deep);
  color: var(--cream);
  border-color: var(--deep);
}

.pay-title {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rosso);
  margin: 16px 0 8px;
}

.saved {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.saved-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.saved-row button[data-pick-addr] {
  flex: 1;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.tiny {
  flex: 0 0 44px !important;
  padding: 0 !important;
}

.save-addr {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line) !important;
  background: transparent;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}

.order-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.order-row button {
  margin-top: 8px;
}

.cats button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
}

.cats button.on {
  background: var(--deep);
  color: var(--cream);
  border-color: var(--deep);
}

.card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: start;
  cursor: pointer;
}

.thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--cream);
}

.thumb.empty {
  background: var(--cream);
}

.hero {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 12px;
  background: var(--cream);
}

.card h3 {
  font-size: 15px;
  font-weight: 600;
}

.card p {
  color: var(--mute);
  font-size: 12px;
  margin-top: 2px;
}

.card button {
  margin-top: 8px;
  border: 0;
  background: var(--rosso);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}

.cat-block {
  padding-bottom: 8px;
  scroll-margin-top: 96px;
}

.cat-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 22px;
  padding: 18px 20px 4px;
  color: var(--deep);
}

.card .price {
  font-size: 15px;
  white-space: nowrap;
}

.card.dim {
  opacity: 0.45;
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(31, 28, 26, 0.45);
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
}

.sheet.hidden,
.bar.hidden {
  display: none;
}

.panel {
  background: var(--paper);
  width: min(100%, 430px);
  max-width: 100%;
  max-height: 88vh;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 28px;
  margin: 0 auto;
}

.line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.panel h2 {
  font-family: "Bodoni Moda", serif;
  font-size: 28px;
  margin-bottom: 8px;
}

.group {
  margin: 16px 0;
}

.group h4 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rosso);
  margin-bottom: 8px;
}

.opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  position: relative;
  padding: 10px 0 10px 32px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
  text-align: left;
}

.opt::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  box-sizing: border-box;
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  background: #fff;
}

.opt.on {
  color: var(--deep);
  font-weight: 600;
}

.opt.on::before {
  border-color: var(--rosso);
  background: var(--rosso);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f3ebe3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.2 6.6 11.2 12.5 4.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--mute);
}

.field input,
.field textarea {
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.actions button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 14px;
  font: inherit;
  font-weight: 600;
}

.primary {
  background: var(--rosso);
  color: #fff;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line) !important;
}

.bar {
  position: fixed;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 398px);
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 4;
}

.bar button {
  width: 100%;
  border: 0;
  background: var(--deep);
  color: var(--cream);
  border-radius: 999px;
  padding: 16px;
  font: inherit;
  font-weight: 600;
}

.err {
  color: var(--rosso);
  margin-top: 10px;
  font-size: 14px;
}

.ok {
  font-size: 16px;
  line-height: 1.5;
}

.loyalty {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 14px;
  color: var(--deep);
}

.loyalty p {
  margin: 0 0 8px;
}

.loyalty p:last-child {
  margin-bottom: 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--ink);
  font-size: 15px;
}

.spend {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  min-width: 0;
  max-width: 100%;
}

.spend .field {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.spend button {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 12px;
}

.profile {
  padding: 8px 20px 32px;
}

.pass {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 16px 16px;
  text-align: center;
  margin-bottom: 16px;
}

.qr {
  display: block;
  width: 240px;
  height: 240px;
  margin: 12px auto;
  background: #fff;
}

.card-no {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--deep);
}

.facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.fact span {
  color: var(--mute);
}

.addr {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.profile-actions {
  margin-top: 12px;
}
