:root {
  --tomato: #c0392b;
  --tomato-dark: #962e21;
  --basil: #4b6043;
  --crust: #e3a857;
  --crust-dark: #c8863a;
  --ink: #2b211a;
  --ink-2: #3a2c22;
  --cream: #fdf6ea;
  --gray: #8a7c6c;
  --radius: 16px;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
}

header.site {
  position: relative;
  background: radial-gradient(120% 160% at 15% -10%, #e0552f 0%, var(--tomato) 45%, var(--tomato-dark) 100%);
  color: #fff;
  padding: 26px 16px 32px;
  text-align: center;
  overflow: hidden;
}

header.site::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 14px;
  background-image: radial-gradient(circle at 10px 0, transparent 9px, var(--cream) 10px);
  background-size: 20px 20px;
  background-repeat: repeat-x;
}

header.site > * {
  position: relative;
  z-index: 1;
}

header.site h1 {
  margin: 0 0 6px;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

header.site .tag {
  color: #ffe1c9;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

header.site .info {
  font-size: 0.85rem;
  color: #ffd9c2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

header.site .info span { white-space: nowrap; }

.status-pill {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--basil);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 12px 120px;
}

.popular-section {
  margin: 4px 0 32px;
}

.popular-section h2 {
  color: var(--ink);
  font-size: 1.3rem;
  margin: 0 0 4px;
}

.popular-section .sub {
  color: var(--gray);
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.popular-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.popular-card {
  flex: 0 0 auto;
  width: 168px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(43,33,26,0.1);
  display: flex;
  flex-direction: column;
  border: 1px solid #f1e2c8;
}

.popular-card .thumb-wrap {
  position: relative;
  width: 100%;
  height: 110px;
  background: radial-gradient(120% 140% at 20% 0%, var(--crust) 0%, var(--tomato) 75%);
}

.popular-card .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.popular-card .thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.popular-card .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(43,33,26,0.85);
  color: var(--crust);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.popular-card .body {
  padding: 9px 10px 10px;
}

.popular-card .pname {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 2.5em;
}

.popular-card .pprice {
  color: var(--tomato-dark);
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 4px;
}

.popular-card .btn-add-mini {
  margin-top: 8px;
  width: 100%;
  background: var(--tomato);
  color: #fff;
  border-radius: 8px;
  padding: 7px;
  font-size: 0.8rem;
  font-weight: 600;
}

.category {
  margin-bottom: 30px;
}

.category h2 {
  color: var(--tomato-dark);
  border-bottom: 3px solid var(--crust);
  padding-bottom: 7px;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}

.category h2 .cat-icon {
  font-size: 1.15rem;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px dashed #e6d6b8;
}

.item .name {
  font-size: 0.96rem;
  line-height: 1.35;
}

.item .price {
  color: var(--tomato-dark);
  font-weight: 600;
  font-size: 0.88rem;
  display: block;
  margin-top: 2px;
}

.item .controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.btn-add {
  background: var(--tomato);
  color: #fff;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  line-height: 1;
}

.btn-add:active { background: var(--tomato-dark); }

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f5e9d3;
  border-radius: 999px;
  padding: 2px 4px;
}

.qty-controls button {
  background: transparent;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  color: var(--tomato-dark);
  font-weight: bold;
}

.qty-controls .qty { min-width: 18px; text-align: center; font-weight: 600; }

.btn-add-full {
  width: 100%;
  background: var(--tomato);
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 600;
}

.item-modal-price {
  color: var(--tomato-dark);
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: -6px;
}

.sauce-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.sauce-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--tomato);
  background: #fff;
  color: var(--tomato-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.sauce-chip.selected {
  background: var(--tomato);
  color: #fff;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-weight: 600;
  color: var(--ink-2);
}

.sauce-tag {
  font-size: 0.82rem;
  color: var(--basil);
  font-weight: 600;
}

.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.25);
  z-index: 40;
}

.cart-bar.hidden { display: none; }

.cart-bar .cart-info { font-size: 0.95rem; }
.cart-bar .cart-total { font-weight: 700; color: var(--crust); }

.cart-bar button.btn-primary {
  background: var(--tomato);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43,33,26,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  padding: 22px 18px 28px;
}

.modal h3 { margin-top: 0; color: var(--ink); }

.cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1e2c8;
  gap: 8px;
}

.cart-line .name { flex: 1; font-size: 0.92rem; }
.cart-line .line-total { font-weight: 600; }

.cart-line button.remove {
  background: transparent;
  color: var(--tomato-dark);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0 6px;
}

.cart-line-block {
  border-bottom: 1px solid #f1e2c8;
  padding: 8px 0;
}
.cart-line-block .cart-line {
  border-bottom: none;
  padding: 0 0 4px;
}
.cart-line-block .line-note {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e6d6b8;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: inherit;
  background: #fdf9f0;
}

#itemModal label {
  display: block;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--gray);
  font-weight: 600;
}

#itemModal input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e6d6b8;
  border-radius: 10px;
  font-size: 0.95rem;
  margin-top: 4px;
  font-family: inherit;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 2px solid var(--ink);
}

form.checkout label {
  display: block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--gray);
  font-weight: 600;
}

form.checkout input, form.checkout textarea, form.checkout select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e6d6b8;
  border-radius: 10px;
  font-size: 0.95rem;
  margin-top: 4px;
  font-family: inherit;
}

.btn-full {
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  background: var(--tomato);
  color: #fff;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
}

.btn-full:disabled { background: #ccc; }

.btn-secondary {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  background: transparent;
  color: var(--gray);
  border-radius: 999px;
  font-size: 0.9rem;
}

.error-box {
  background: #fbe2dd;
  color: var(--tomato-dark);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  margin-top: 12px;
  display: none;
}
.error-box.show { display: block; }

.hint {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 4px;
}

footer.site {
  text-align: center;
  color: var(--gray);
  font-size: 0.8rem;
  padding: 26px 16px 100px;
}

.status-link {
  display: block;
  text-align: center;
  color: #ffd9c2;
  font-size: 0.85rem;
  margin-top: 12px;
  text-decoration: underline;
}
