:root {
  --brand: #ffbc0d;
  --brand-dark: #db0007;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #198754;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fff8e8 0%, #f6f2ea 100%);
}

.app-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.hero-bar {
  background: linear-gradient(135deg, #252525 0%, #141414 100%);
  color: #fff;
  border-radius: 24px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.hero-title {
  font-size: clamp(1.6rem, 2.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero-image {
  max-width: 400px;
}

.hero-subtitle {
  margin: 6px 0 0;
  color: rgba(255,255,255,0.9);
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pill {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.92rem;
}

.layout-grid {
  display: grid;
  grid-template-columns: 360px minmax(440px, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
  overflow: hidden;
}

.panel-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}

.panel-subtitle {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.product-list-wrap,
.cart-body,
.preview-body {
  padding: 16px;
}

.scroll-top-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  z-index: 20;
}

.scroll-top-btn:hover {
  transform: translateY(-1px);
  background: #fff9e7;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12);
}

.category-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.menu-search {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 16px;
  outline: none;
  font-size: 0.96rem;
}

.menu-search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 188, 13, 0.2);
}

.category-row {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
}

.scroll-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  color: var(--text);
}

.category-slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
  cursor: grab;
  user-select: none;
}

.category-slider.dragging {
  cursor: grabbing;
}

.category-slider::-webkit-scrollbar { display: none; }

.category-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 11px 16px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s ease;
}

.category-btn:hover {
  transform: translateY(-1px);
  background: #fff9e7;
}

.category-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #1a1a1a;
}

.menu-list {
  display: grid;
  gap: 12px;
}

.menu-card {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: 0.18s ease;
  text-align: left;
}

.menu-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.menu-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(255, 188, 13, 0.28);
  background: #fffaf0;
}

.menu-card-image {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 18px;
  flex-shrink: 0;
  display: block;
}

.menu-card-title {
  font-weight: 800;
  line-height: 1.2;
  font-size: 1rem;
}

.cart-panel {
  position: sticky;
  top: 20px;
}

.preview-image-wrap {
  background: #f3f4f6;
  padding: 18px;
}

.preview-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 22px;
  display: block;
}

.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff3cd;
  color: #7a5b00;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
}

.price-amount {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--brand-dark);
  line-height: 1;
}

.product-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.meta-chip {
  background: #f3f4f6;
  color: #374151;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 600;
}

.section-label {
  font-weight: 800;
  margin: 18px 0 12px;
  font-size: 1rem;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #fff;
}

.option-item label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  width: 100%;
  cursor: pointer;
}

.option-item input {
  margin-top: 4px;
  transform: scale(1.15);
}

.option-name {
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 3px;
}

.option-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.option-price {
  white-space: nowrap;
  font-weight: 800;
  color: #111827;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.qty-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border-radius: 16px;
  padding: 8px;
}

.qty-btn {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #111827;
  font-size: 1.2rem;
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  transition: 0.18s ease;
}

.qty-btn:hover,
.action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.qty-display {
  min-width: 40px;
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 14px 18px;
  flex: 1 1 220px;
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  transition: 0.18s ease;
}

.action-primary {
  background: var(--brand-dark);
  color: #fff;
}

.action-secondary {
  background: var(--brand);
  color: #111827;
}

.cart-summary {
  background: linear-gradient(135deg, #fff4d1 0%, #ffe38a 100%);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
}

.summary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.summary-total {
  font-size: 2rem;
  font-weight: 900;
  color: #7a0005;
  line-height: 1;
}

.summary-mini {
  color: #5f4a00;
  font-weight: 600;
  margin: 0;
}

.cart-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.cart-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.cart-item-head,
.line-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.cart-item-title {
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}

.cart-item-meta,
.cart-item-options {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.cart-item-options { margin-top: 5px; }

.remove-link {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.totals {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.totals .strong {
  font-weight: 900;
  font-size: 1.05rem;
}

.cart-links {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.cart-link {
  text-decoration: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 800;
  text-align: center;
  display: block;
}

.cart-link.overview {
  background: #f3f4f6;
  color: #111827;
}

.cart-link.checkout {
  background: var(--success);
  color: #fff;
}

.empty-cart {
  border: 1px dashed #d1d5db;
  border-radius: 18px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  background: #fafafa;
}

.footer-note {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 14px;
}

.status-box {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 0.9rem;
  color: #166534;
}

@media (max-width: 1280px) {
  .layout-grid { grid-template-columns: 1fr; }
  .app-shell {
    padding: 10px;
  }
  .cart-panel {
    position: static;
  }
  .scroll-top-btn {
    position: fixed;
    right: 18px;
    top: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .scroll-top-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 400px) {
  .hero-image {
    max-width: 90%;
  }
}
