:root {
  --bg: #f7f1e8;
  --card: rgba(255, 255, 255, 0.95);
  --text: #22140b;
  --muted: #6f5c4f;
  --line: #e7d6c5;
  --primary: #8b4c00;
  --primary-dark: #5d2f05;
  --accent: #d9a066;
  --success: #23764d;
  --danger: #b53a2d;
  --shadow: 0 18px 40px rgba(50, 24, 7, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 30%),
    linear-gradient(180deg, #f8f1e8 0%, #f3e5d2 100%);
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(247, 241, 232, 0.88);
  border-bottom: 1px solid rgba(122, 86, 53, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
}

.brand-mini {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.top-left-group {
  align-items: center;
}

.right-actions {
  margin-left: auto;
}

.cart-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#cartCountBadge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
}

.top-left-group,
.top-actions,
.menu-switcher,
.toolbar-actions,
.auth-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 48px 20px;
  background-image:
    linear-gradient(rgba(30, 16, 8, 0.52), rgba(30, 16, 8, 0.58)),
    url('https://images.unsplash.com/photo-1579631542720-3a87824fff86?auto=format&fit=crop&w=1600&q=80');
  background-size: cover;
  background-position: center;
}

.hero-content {
  text-align: center;
  color: #fff8f0;
  max-width: 900px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #ffe8ce;
}

.hero h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.95;
}

.hero-tagline {
  margin: 20px auto 0;
  max-width: 720px;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.6;
  color: #fff0dd;
}

.main-grid {
  max-width: 1400px;
  margin: 24px auto 0;
  padding: 0 24px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.single-column-layout {
  max-width: 1200px;
}

.content-area,
.cart-card,
.card,
.menu-section,
.modal-card {
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(122, 86, 53, 0.10);
  border-radius: var(--radius);
}

.content-area {
  padding: 24px;
}

.menu-switcher {
  margin-bottom: 24px;
}

.menu-tab {
  padding: 14px 20px;
  border-radius: 999px;
  background: #f1e5d8;
  color: var(--text);
  font-weight: 700;
}

.menu-tab.active,
.primary-btn {
  background: var(--primary);
  color: white;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.menu-tab:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  background: #f3e6d7;
  color: var(--text);
}

.danger-btn {
  background: var(--danger);
  color: white;
}

.small-btn {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.full-btn {
  width: 100%;
}

.menu-section {
  margin-bottom: 24px;
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0 0 6px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

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

.menu-item-card,
.cart-item,
.order-card,
.history-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdfa 0%, #fff8ef 100%);
}

.menu-item-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  min-height: 150px;
}

.item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #eadccf;
}

.item-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.item-title-row strong {
  font-size: 1.02rem;
}

.price-badge {
  background: #f2dcc2;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
}

.item-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.item-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.item-actions button {
  flex: 1;
}

.cart-card {
  padding: 22px;
}

.cart-modal-card {
  max-width: 460px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.cart-card-modal {
  margin-top: 16px;
}

.auth-chooser-card {
  max-width: 420px;
}

.auth-choice-grid {
  margin-top: 18px;
}

.cart-item,
.order-card,
.history-card {
  padding: 14px;
  margin-bottom: 12px;
}

.cart-item h4,
.order-card h4,
.history-card h4 {
  margin: 0 0 8px;
}

.cart-item p,
.order-card p,
.history-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cart-summary {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

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

.summary-row.total {
  font-size: 1.08rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(23, 12, 6, 0.58);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 20px;
}

.modal.hidden,
.hidden {
  display: none !important;
}

.modal-card {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fffaf3;
  padding: 24px;
  position: relative;
}

.large-modal {
  width: min(1080px, 100%);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f2e0cf;
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.4rem;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dcc8b4;
  background: white;
}

textarea {
  resize: vertical;
}

.editor-grid,
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.checkout-grid {
  align-items: start;
}

.stacked-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.customization-block {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 18px;
  margin-bottom: 16px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.option-pill {
  border: 1px solid #d8b998;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff8ee;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.option-pill input {
  width: auto;
  margin: 0;
}

.tiny-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.order-status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2dcc2;
  color: var(--primary-dark);
  font-size: 0.86rem;
  font-weight: 800;
  margin-top: 6px;
}

.status-accepted { background: #d8f1e3; color: #155936; }
.status-denied { background: #f9d4d1; color: #8b1f13; }
.status-ready { background: #f6e7b8; color: #7c5d00; }
.status-completed { background: #dce8ff; color: #294d8b; }

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.notice-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f9eedb;
  color: var(--primary-dark);
}

.empty-state {
  color: var(--muted);
  padding: 12px 0;
}

.checkout-history-wrap {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.checkout-history-wrap h3 {
  margin: 0 0 10px;
}

.history-card small {
  color: var(--muted);
}

@media (max-width: 1080px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 16px;
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .content-area,
  .cart-card,
  .modal-card {
    padding: 18px;
  }

  .menu-item-card {
    grid-template-columns: 1fr;
  }

  .item-image {
    height: 180px;
  }

  .editor-grid,
  .account-grid {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 680px) {
  .topbar {
    gap: 12px;
    padding: 12px 16px;
  }

  .top-left-group {
    flex-wrap: wrap;
    gap: 8px;
  }

  .cart-toggle-btn {
    padding-inline: 14px;
  }
}
