:root {
  --yellow: #ffd000;
  --yellow-soft: #fff4b8;
  --black: #101010;
  --ink: #151515;
  --muted: #666;
  --line: #e7e0bd;
  --green: #04a943;
  --red: #d92828;
  --paper: #fffdf3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f6f6f6;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px clamp(16px, 5vw, 56px);
  background: var(--yellow);
  border-bottom: 3px solid var(--black);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.icon-btn,
.cart-chip,
.back-btn,
.drawer-close {
  border: 0;
  border-radius: 8px;
  background: var(--black);
  color: white;
  min-height: 46px;
  padding: 0 16px;
  font-weight: 800;
}

.icon-btn {
  width: 52px;
  padding: 0;
  font-size: 28px;
}

.location-btn {
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: #078d3c;
  padding: 0;
  font-weight: 800;
  text-align: left;
}

.cart-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.cart-chip span {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--black);
}

main {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 5vw, 44px) 80px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-strip {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 8px;
  background: var(--black);
  color: white;
}

.hero-strip p,
.hero-strip strong {
  margin: 0;
}

.hero-strip strong {
  color: var(--yellow);
  font-size: clamp(22px, 4vw, 34px);
}

.search-box {
  display: grid;
  gap: 8px;
  margin: 22px 0;
  color: var(--muted);
  font-weight: 700;
}

.search-box input,
.checkout-card input,
.checkout-card textarea {
  width: 100%;
  border: 2px solid transparent;
  border-radius: 8px;
  background: white;
  color: var(--black);
  padding: 16px 18px;
  outline: none;
}

.search-box input:focus,
.checkout-card input:focus,
.checkout-card textarea:focus {
  border-color: var(--black);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 18px 0;
}

.section-title h2,
#cartView h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
}

.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.restaurant-card,
.product-card,
.cart-row,
.checkout-card,
.success-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.restaurant-card {
  text-align: left;
  padding: 0;
  border: 0;
}

.restaurant-card img,
.restaurant-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--yellow-soft);
  display: block;
}

.restaurant-card-body {
  padding: 16px;
}

.restaurant-card h3,
.product-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.muted {
  color: var(--muted);
}

.green {
  color: var(--green);
  font-weight: 900;
}

.restaurant-hero {
  margin: 16px 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--black);
  color: white;
}

.restaurant-hero .restaurant-info {
  padding: 18px;
}

.restaurant-hero h2 {
  margin: 0 0 8px;
  color: var(--yellow);
  font-size: clamp(30px, 6vw, 52px);
}

.category-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.category-row button {
  flex: 0 0 auto;
  border: 2px solid var(--black);
  border-radius: 999px;
  background: white;
  color: var(--black);
  padding: 10px 14px;
  font-weight: 800;
}

.category-row button.active {
  background: var(--black);
  color: var(--yellow);
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  padding: 14px;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 0.78;
  object-fit: cover;
  border-radius: 8px;
  background: var(--yellow-soft);
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.primary-btn,
.secondary-btn,
.add-btn {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 900;
}

.secondary-btn {
  background: var(--black);
  color: var(--yellow);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.add-btn {
  background: #0677bd;
}

.add-btn.in-cart {
  background: var(--black);
  color: var(--yellow);
  min-width: 92px;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
  margin-top: 18px;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-row button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 0;
  background: var(--black);
  color: var(--yellow);
  font-weight: 900;
}

.checkout-card {
  position: sticky;
  top: 110px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.checkout-card label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.toggle-row {
  grid-template-columns: 22px 1fr;
  align-items: center;
}

.toggle-row input {
  width: 20px;
  height: 20px;
}

.otp-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--yellow-soft);
  padding: 12px;
}

.otp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.otp-message {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.otp-message.ok {
  color: var(--green);
}

.otp-message.error {
  color: var(--red);
}

.bill {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  display: grid;
  gap: 8px;
}

.bill-row {
  display: flex;
  justify-content: space-between;
}

.rain-fee-row {
  color: #047857;
}

.bill-total {
  font-size: 22px;
  font-weight: 900;
}

.form-message {
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.success-card {
  max-width: 680px;
  margin: 50px auto;
  padding: 26px;
  text-align: center;
}

.success-card h2 {
  font-size: clamp(34px, 7vw, 60px);
  margin: 0 0 12px;
}

.status-box {
  margin: 18px 0;
  border-radius: 8px;
  background: var(--yellow-soft);
  padding: 16px;
  text-align: left;
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: min(320px, 84vw);
  transform: translateX(-105%);
  transition: transform 180ms ease;
  background: var(--black);
  color: white;
  padding: 18px;
}

.drawer.open {
  transform: translateX(0);
}

.drawer h2 {
  color: var(--yellow);
}

.drawer-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #333;
  background: transparent;
  color: white;
  padding: 16px 0;
  text-align: left;
  font-weight: 800;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.45);
  display: none;
}

.scrim.show {
  display: block;
}

.empty {
  padding: 24px;
  border-radius: 8px;
  background: var(--yellow-soft);
  font-weight: 800;
}

body.modal-open {
  overflow: hidden;
}

.option-modal[hidden] {
  display: none;
}

.option-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: end center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}

.option-panel {
  width: min(680px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  border-radius: 16px 16px 8px 8px;
  background: var(--paper);
  color: var(--black);
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
}

.option-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.option-head h2 {
  margin: 0 0 4px;
  font-size: clamp(24px, 5vw, 34px);
}

.plain-btn {
  border: 0;
  background: transparent;
  color: var(--black);
  padding: 8px;
  font-weight: 900;
}

.option-group {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}

.option-group legend {
  margin-bottom: 8px;
  font-weight: 900;
}

.option-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.option-row input {
  width: 18px;
  height: 18px;
}

.option-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 16px 0 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--black);
  font-size: 20px;
  font-weight: 900;
}

#optionForm .primary-btn {
  width: 100%;
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 52px 1fr;
  }

  .cart-chip {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .checkout-card {
    position: static;
  }
}
