/* ============================================
   CARDÁPIO DIGITAL — DESIGN SYSTEM
   Tema: Warm dark com acentos âmbar
   Mobile-first, sem dependências
   ============================================ */

/* --- Reset & Tokens --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f17;
  --bg-soft: #16161f;
  --surface: #1c1c28;
  --surface-2: #22222f;
  --surface-3: #2a2a38;
  --text: #f4f4f0;
  --text-soft: #c8c8c4;
  --muted: #8a8a90;
  --accent: #f59e0b;
  --accent-soft: #fbbf24;
  --accent-dark: #d97706;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, .15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, .1);
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --max: 900px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --whatsapp: #25D366;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 100px;
}

.container {
  width: min(calc(100% - 2 * var(--gutter)), var(--max));
  margin-inline: auto;
}

img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* --- Demo Banner --- */
.demo-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 10px var(--gutter);
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.demo-banner-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-soft);
}

.demo-banner-inner a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.demo-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: 6px 14px;
  background: var(--accent);
  color: #000 !important;
  text-decoration: none !important;
  border-radius: 999px;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}

.demo-banner-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, .35);
}

/* --- Restaurant Header --- */
.restaurant-header {
  padding: 2rem 0 1.5rem;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
}

.restaurant-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.restaurant-logo {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, .3);
}

.restaurant-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.restaurant-tagline {
  color: var(--muted);
  font-size: .85rem;
  margin-top: .15rem;
}

.restaurant-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem 1.2rem;
  font-size: .82rem;
  color: var(--text-soft);
}

.restaurant-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: 4px 10px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 999px;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* --- Menu Nav (search + categories) --- */
.menu-nav {
  position: sticky;
  top: 38px;
  z-index: 50;
  padding: .8rem 0;
  background: rgba(15, 15, 23, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.search-bar {
  position: relative;
  margin-bottom: .7rem;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  height: 44px;
  padding: 0 1rem 0 2.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.search-bar input::placeholder { color: var(--muted); }
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .15);
}

.category-tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: all .2s ease;
}

.category-tab:hover { border-color: var(--line-strong); color: var(--text); }

.category-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* --- Menu Sections --- */
.menu-section {
  padding: 1.8rem 0 .5rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 1.2rem;
  color: var(--text);
}

.section-icon { font-size: 1.2rem; }

/* --- Featured Grid --- */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
}

/* --- Product Card --- */
.product-card {
  position: relative;
  display: flex;
  gap: .9rem;
  padding: .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.product-card-img {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.product-card:hover .product-card-img img { transform: scale(1.06); }

.product-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-card-name {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.3;
  margin-bottom: .25rem;
}

.product-card-desc {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: auto;
}

.product-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .6rem;
}

.product-card-price {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
}

.product-card-price small {
  font-size: .72rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: .35rem;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  color: #000;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  gap: .35rem;
}

.btn-add:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(245, 158, 11, .35);
}

.btn-add:active { transform: scale(.95); }

.btn-add.in-cart {
  background: var(--surface-3);
  color: var(--text);
  min-width: 110px;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
}

.qty-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }

.qty-value {
  font-weight: 700;
  font-size: .9rem;
  min-width: 18px;
  text-align: center;
}

/* Featured card (larger) */
.product-card.featured {
  flex-direction: column;
  gap: 0;
}

.product-card.featured .product-card-img {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.product-card.featured .product-card-body {
  padding: .8rem;
}

.product-badge {
  position: absolute;
  top: .6rem;
  left: .6rem;
  padding: 3px 8px;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 4px;
  z-index: 2;
}

.product-badge.new { background: var(--green); }

/* --- Menu Items Grid --- */
.menu-items-grid {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { color: var(--text); font-size: 1.2rem; margin-bottom: .5rem; }

/* --- Cart Float Button --- */
.cart-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: .6rem;
  height: 54px;
  padding: 0 1.2rem 0 1rem;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  color: #000;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(245, 158, 11, .45);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: cart-pop .4s cubic-bezier(.175,.885,.32,1.275);
}

.cart-float:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 36px rgba(245, 158, 11, .55);
}

.cart-float:active { transform: scale(.96); }

@keyframes cart-pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cart-float-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: #000;
  color: var(--accent);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}

/* --- Cart Drawer --- */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 160;
  width: min(420px, 92vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

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

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.cart-header h2 { font-size: 1.1rem; font-weight: 700; }

.cart-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background .15s ease;
}

.cart-close:hover { background: var(--surface-2); }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  text-align: center;
  padding: 3rem 0;
  color: var(--muted);
}

.cart-empty span { font-size: 2.5rem; display: block; margin-bottom: .8rem; }
.cart-empty small { display: block; margin-top: .3rem; font-size: .8rem; }

.cart-items { display: flex; flex-direction: column; gap: .8rem; }

.cart-item {
  display: flex;
  gap: .8rem;
  padding: .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  animation: slide-in .3s ease;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

.cart-item-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  flex-shrink: 0;
}

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

.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: .88rem; margin-bottom: .2rem; }
.cart-item-price { color: var(--accent); font-weight: 700; font-size: .85rem; }

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .4rem;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: .75rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .15s ease;
}

.cart-item-remove:hover { background: var(--red-soft); }

/* Cart Footer */
.cart-footer {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.cart-subtotal, .cart-delivery-fee {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  color: var(--text-soft);
  margin-bottom: .5rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 800;
  padding-top: .6rem;
  border-top: 1px solid var(--line);
  margin-bottom: 1rem;
}

.btn-checkout {
  width: 100%;
  height: 50px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, .4);
}

.btn-checkout:active { transform: scale(.97); }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  animation: fade-in .2s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(480px, 100%);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: modal-pop .3s cubic-bezier(.175,.885,.32,1.275);
  overflow: hidden;
}

@keyframes modal-pop {
  from { transform: scale(.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 { font-size: 1.1rem; font-weight: 700; }

.modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

/* Checkout summary */
.checkout-summary {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: .85rem;
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  padding: .3rem 0;
  color: var(--text-soft);
}

.checkout-summary-total {
  display: flex;
  justify-content: space-between;
  padding-top: .5rem;
  margin-top: .5rem;
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
}

/* Form */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: .4rem;
  color: var(--text-soft);
}

.form-group input[type="text"],
.form-group input[type="search"],
.form-group textarea {
  width: 100%;
  padding: .7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s ease;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; }

/* Order type */
.order-type-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.order-type-option input { display: none; }

.order-type-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: .88rem;
  transition: border-color .2s ease, background .2s ease;
}

.order-type-option input:checked + .order-type-card {
  border-color: var(--accent);
  background: rgba(245, 158, 11, .08);
}

.order-type-icon { font-size: 1.3rem; }

/* Payment options */
.payment-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.payment-option input { display: none; }

.payment-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .65rem .5rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-weight: 600;
  font-size: .8rem;
  white-space: nowrap;
  transition: border-color .2s ease;
}

.payment-option input:checked + .payment-card {
  border-color: var(--accent);
  background: rgba(245, 158, 11, .08);
}

/* WhatsApp Button */
.btn-whatsapp {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  background: var(--whatsapp);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 211, 102, .4);
}

.btn-whatsapp:active { transform: scale(.97); }

.checkout-note {
  text-align: center;
  color: var(--muted);
  font-size: .75rem;
  margin-top: .7rem;
}

/* Success modal */
.modal-success { text-align: center; }
.success-content { padding: 3rem 2rem; }
.success-icon { font-size: 3.5rem; display: block; margin-bottom: 1rem; }
.success-content h2 { font-size: 1.4rem; margin-bottom: .7rem; }
.success-content p { color: var(--muted); max-width: 320px; margin: 0 auto 1.5rem; font-size: .9rem; }
.success-content .btn-checkout { max-width: 260px; margin: 0 auto; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 640px) {
  .menu-items-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
  }

  .product-card {
    flex-direction: column;
    gap: 0;
  }

  .product-card .product-card-img {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .product-card .product-card-body {
    padding: .8rem;
  }
}

@media (max-width: 480px) {
  .demo-banner-cta { display: none; }
  
  .featured-grid { grid-template-columns: 1fr; }

  .product-card-img {
    width: 85px;
    height: 85px;
  }

  .restaurant-logo {
    width: 46px;
    height: 46px;
    font-size: 1.4rem;
  }

  .cart-float {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    justify-content: center;
  }

  .payment-options { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
