:root {
  --bg: #fff7f1;
  --surface: #ffffff;
  --text: #1e1a17;
  --muted: #736a64;
  --primary: #ff5a2c;
  --primary-strong: #e5471b;
  --line: #f1d8cd;
  --accent: #ffd9b8;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(255, 90, 44, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -200px, #ffd9c4 0%, transparent 50%),
    linear-gradient(180deg, #fff4ec 0%, var(--bg) 38%, #fffefc 100%);
}

.app-shell {
  width: min(100%, 860px);
  margin-inline: auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff7d57, #ff4b1f);
  color: #fff;
  box-shadow: var(--shadow);
}

.brand-mark span {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.restaurant-logo {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
}


.search {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.install-prompt {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff4ec, #fffdf8);
  padding: 12px;
}

.install-copy h3 {
  margin: 0;
  font-size: 0.95rem;
}

.install-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

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

.install-main-btn,
.install-secondary-btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  font-weight: 700;
}

.install-main-btn {
  background: var(--primary);
  color: #fff;
}

.install-secondary-btn {
  background: #fff2eb;
  color: #9a3c1f;
}

.search input {
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 0.95rem;
  background: transparent;
}

.hero {
  margin-top: 14px;
  overflow: hidden;
  border-radius: var(--radius);
}

.deal-card {
  min-height: 170px;
  background: linear-gradient(135deg, #ff5a2c, #ff865f);
  border-radius: var(--radius);
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.deal-card .chip {
  width: fit-content;
  margin: 0 0 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
}

.deal-card h2 {
  margin: 0;
  font-size: 1.12rem;
}

.deal-card .subtitle {
  margin: 8px 0 0;
  font-size: 0.82rem;
  opacity: 0.95;
}

.swiper-pagination {
  position: static !important;
  margin-top: 8px;
}

.swiper-pagination-bullet-active {
  background: var(--primary) !important;
}

.categories-section {
  margin-top: 12px;
}

.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  white-space: nowrap;
  font-weight: 600;
}

.category-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.section-head {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.text-btn {
  border: 0;
  background: none;
  color: var(--primary-strong);
  font-weight: 700;
}

.restaurant-list {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.restaurant-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px;
  box-shadow: 0 8px 20px rgba(38, 23, 15, 0.04);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.36s ease, transform 0.36s ease;
}

.restaurant-card.in {
  opacity: 1;
  transform: translateY(0);
}

.restaurant-banner {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  display: grid;
  align-content: end;
  padding: 8px;
}

.restaurant-content {
  min-width: 0;
}

.restaurant-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.restaurant-title-row h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.item-category {
  width: fit-content;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.84);
  color: #8b371d;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
}

.price {
  margin: 0;
  color: var(--primary-strong);
  font-weight: 800;
  font-size: 1.03rem;
}

.fav-btn {
  border: 0;
  background: #fff2ec;
  color: var(--primary);
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.cart-btn {
  border: 0;
  background: var(--primary);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.badges {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.badges::-webkit-scrollbar {
  display: none;
}

.allergen-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.allergen-pill {
  border-radius: 8px;
  background: #fff8d8;
  color: #7e6400;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
}

.badge {
  border-radius: 99px;
  background: #fff2ec;
  color: #9b3d20;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.product-bottom {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, 860px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.7rem;
  display: grid;
  place-items: center;
  gap: 3px;
  position: relative;
}

.bottom-nav button.active {
  color: var(--primary);
  font-weight: 700;
}

.cart-bump {
  animation: cart-bump 360ms ease;
}

.empty-state {
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.cart-count {
  position: absolute;
  top: 0;
  right: 26%;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.cart-view {
  margin-top: 14px;
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
}

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

.cart-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px;
}

.cart-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.cart-item-name {
  margin: 0;
  font-weight: 700;
}

.cart-item-price {
  margin: 4px 0 0;
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 0.9rem;
}

.qty-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-note-wrap {
  margin-top: 10px;
  display: grid;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.cart-note {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  resize: vertical;
  min-height: 56px;
  font: inherit;
}

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

.qty-btn {
  border: 1px solid var(--line);
  background: #fff7f3;
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.qty-value {
  min-width: 16px;
  text-align: center;
  font-weight: 700;
}

.remove-btn {
  border: 0;
  background: none;
  color: #a64d33;
  font-weight: 700;
  font-size: 0.8rem;
}

.cart-summary {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  position: sticky;
  bottom: calc(70px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255, 247, 241, 0), #fff7f1 18%);
  z-index: 2;
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.checkout-btn {
  width: 100%;
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  font-weight: 800;
}

.flying-cart-dot {
  position: fixed;
  z-index: 1200;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(255, 90, 44, 0.4);
  pointer-events: none;
  transition:
    transform 480ms cubic-bezier(0.22, 0.95, 0.3, 1),
    opacity 480ms ease;
}

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
}

.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 16, 12, 0.44);
}

.checkout-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 14px;
  max-height: 86vh;
  overflow: auto;
}

.checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.checkout-head h3 {
  margin: 0;
  font-size: 1rem;
}

.close-checkout-btn {
  border: 1px solid var(--line);
  background: #fff7f2;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.checkout-form {
  margin-top: 12px;
  display: grid;
  gap: 9px;
}

.checkout-form label {
  display: grid;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.checkout-form small {
  color: var(--muted);
  font-size: 0.74rem;
}

.checkout-form input {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  font: inherit;
}

.checkout-submit-btn {
  margin-top: 4px;
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  font-weight: 800;
}

.checkout-submit-btn:disabled {
  opacity: 0.7;
}

.checkout-error {
  margin: 2px 0 0;
  color: #b63e1d;
  font-size: 0.82rem;
  font-weight: 700;
}

@keyframes cart-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.09);
  }
  100% {
    transform: scale(1);
  }
}

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

  .restaurant-list {
    grid-template-columns: 1fr;
  }

  .checkout-sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(460px, calc(100% - 28px));
    transform: translate(-50%, -50%);
    border-radius: 16px;
  }

}

@media (min-width: 960px) {
  .restaurant-list {
    grid-template-columns: 1fr 1fr;
  }
}
