:root {
  --coffee: #6F4E37;
  --espresso: #3B2418;
  --ivory: #FFFCF7;
  --latte: #F8F0E8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--ivory);
  color: var(--espresso);
}

header {
  position: sticky;
  top: 0;
  background: var(--ivory);
  padding: 14px 18px;
  border-bottom: 1px solid #e9ddd2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
}

.brand {
  font-weight: 800;
  font-size: 20px;
}

.cart {
  position: relative;
  font-size: 28px;
}

.badge {
  position: absolute;
  right: -9px;
  top: -8px;
  background: #b3261e;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  padding: 2px 6px;
}

.wrap {
  max-width: 720px;
  margin: auto;
  padding: 18px;
}

.hero {
  background: var(--latte);
  padding: 20px;
  border-radius: 22px;
  margin-bottom: 18px;
}

.menu {
  display: grid;
  gap: 10px;
}

.menu-status {
  padding: 24px 16px;
  text-align: center;
  background: white;
  border: 1px solid #eadfd7;
  border-radius: 18px;
}

.item {
  background: white;
  border: 1px solid #eadfd7;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.food {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, #f2c48d, #b8743c);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--espresso);
}

.food img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info {
  flex: 1;
  min-width: 0;
}

.info strong {
  display: block;
  color: #111;
  margin-bottom: 4px;
}

.description {
  font-size: 13px;
  line-height: 1.35;
  opacity: 0.75;
  margin-bottom: 6px;
}

.price {
  font-weight: 750;
}

.add {
  border: 0;
  background: var(--coffee);
  color: white;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  white-space: nowrap;
}

.add:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.item-action {
  flex: 0 0 auto;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--coffee);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.quantity-button {
  width: 36px;
  height: 38px;
  border: 0;
  background: var(--coffee);
  color: white;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.quantity-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.quantity-value {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
  color: var(--coffee);
}

.sold-out {
  background: #f4f2f0;
}

.sold-out .food {
  filter: grayscale(1);
  opacity: 0.55;
}

.sold-out .info {
  opacity: 0.65;
}

.fly {
  position: fixed;
  z-index: 99;
  pointer-events: none;
  transition:
    transform .65s cubic-bezier(.2, .8, .2, 1),
    opacity .65s;
}

.pulse {
  animation: pulse .7s ease 2;
}

@keyframes pulse {
  50% {
    transform: scale(1.22);
  }
}

.cart-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 1px solid var(--coffee);
  border-radius: 18px;
}

.cart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-panel-header h2 {
  margin: 0;
  color: var(--espresso);
}

.cart-close {
  width: auto;
  margin: 0;
}

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

.cart-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #eadfd7;
}

.cart-summary-details {
  display: grid;
  gap: 4px;
}

.cart-summary-details span {
  color: var(--muted);
  font-size: 14px;
}

.cart-line-total {
  flex: 0 0 auto;
  color: var(--espresso);
}

.cart-totals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  font-size: 18px;
  color: var(--espresso);
}

.cart-empty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
}

.prefs {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--coffee);
  border-radius: 18px;
}

.install {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--espresso);
  color: white;
  font-weight: 700;
  margin-top: 10px;
}

@media (max-width: 480px) {
  .wrap {
    padding: 12px;
  }

  .item {
    gap: 10px;
  }

  .food {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
  }

  .add {
    padding: 9px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fly {
    display: none;
  }

  .pulse {
    animation: none;
  }
}
[hidden] {
  display: none !important;
}

.auth-panel {
  max-width: 440px;
  margin: 48px auto;
  padding: 24px;
  background: white;
  border: 1px solid #eadfd7;
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(59, 36, 24, 0.08);
}

.auth-panel h1 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 24px;
}

.auth-panel form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.auth-panel label {
  font-weight: 700;
}

.phone-field {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cdbbae;
  border-radius: 12px;
  background: white;
}

.phone-field span {
  padding: 12px 0 12px 14px;
  font-weight: 700;
}

.phone-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 12px;
  font: inherit;
}

.otp-input {
  width: 100%;
  border: 1px solid #cdbbae;
  border-radius: 12px;
  padding: 13px;
  font: inherit;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0.35em;
  text-align: center;
}

.phone-field:focus-within,
.otp-input:focus {
  border-color: var(--coffee);
  box-shadow: 0 0 0 3px rgba(111, 78, 55, 0.14);
}

.primary,
.secondary {
  width: 100%;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.primary {
  border: 0;
  background: var(--coffee);
  color: white;
}

.secondary {
  border: 1px solid var(--coffee);
  background: white;
  color: var(--coffee);
}

.primary:disabled,
.secondary:disabled {
  cursor: wait;
  opacity: 0.7;
}

#checkoutForm {
  display: grid;
  gap: 12px;
}

#checkoutForm > label,
#deliveryAddressField > label {
  font-weight: 700;
  color: var(--espresso);
}

#checkoutForm input[type="text"],
#checkoutForm input[type="tel"],
#checkoutForm textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--coffee);
  border-radius: 12px;
  padding: 12px;
  background: white;
  color: var(--espresso);
  font: inherit;
}

#checkoutForm textarea {
  resize: vertical;
}

#checkoutForm input[type="text"]:focus,
#checkoutForm input[type="tel"]:focus,
#checkoutForm textarea:focus {
  outline: 2px solid var(--coffee);
  outline-offset: 2px;
}

#checkoutForm fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--coffee);
  border-radius: 12px;
}

#checkoutForm legend {
  padding: 0 6px;
  font-weight: 700;
  color: var(--espresso);
}

#checkoutForm fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

#checkoutForm input[type="radio"] {
  accent-color: var(--coffee);
}

#deliveryAddressField {
  display: grid;
  gap: 8px;
}

.form-message {
  min-height: 24px;
  margin-bottom: 0;
  color: #33691e;
  font-weight: 650;
}

.form-message.error {
  color: #b3261e;
}
