:root {
  --brand: #f9c411;
  --brand-dark: #d3a60e;
  --brand-ink: #2d2d2d;
  --ink: #2d2d2d;
  --muted: #6b6560;
  --bg: #faf7f2;
  --surface: #ffffff;
  --border: #e7e0d6;
  --success: #1e7a34;
  --error: #b3261e;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

a { color: inherit; }

.hint { color: var(--muted); font-size: 0.85rem; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header__brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.site-header__brand span { color: var(--brand); }
.site-header__logo { height: 2.2rem; width: auto; display: block; }
.site-header__location { text-align: center; display: flex; flex-direction: column; }
.location-link { text-decoration: none; }
.location-link::before { content: "📍 "; }
.location-link:hover, .location-link:focus-visible { text-decoration: underline; }
.cart-toggle { position: relative; font-size: 1.3rem; background: none; border: none; cursor: pointer; }
.cart-badge {
  position: absolute; top: -6px; right: -10px;
  background: var(--brand); color: var(--brand-ink); border-radius: 999px;
  font-size: 0.7rem; padding: 2px 6px; font-weight: 700;
}
.cart-badge.is-hidden { display: none; }

/* Demo banner */
.demo-banner {
  background: #fff3cd; color: #7a5b00; padding: 0.6rem 1.5rem;
  font-size: 0.85rem; text-align: center; border-bottom: 1px solid #f0d98c;
}

/* Aviso de "restaurante cerrado" (horario de atencion) */
.closed-banner {
  background: #fbe4e2; color: var(--error); padding: 0.6rem 1.5rem;
  font-size: 0.85rem; text-align: center; border-bottom: 1px solid #f3c6c2;
}

/* Menu */
.menu-container { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.menu-section__title { margin-top: 2rem; margin-bottom: 0.75rem; font-size: 1.3rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }

/* Categorias como tarjetas clicables (ventana -> productos de esa categoria) */
.menu-categories-title { margin: 0 0 1rem; font-size: 1.3rem; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.category-grid[hidden], .menu-products-view[hidden] { display: none; }
.category-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.35rem; cursor: pointer; font-family: inherit; text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.category-tile:hover, .category-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); border-color: var(--brand); }
.category-tile__name { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.category-tile__count { font-size: 0.8rem; color: var(--muted); }

.menu-products-view { margin-top: 0.5rem; }
.category-back { margin-bottom: 0.5rem; }

.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; display: flex; flex-direction: column; gap: 0.4rem;
}
.product-card--unavailable { opacity: 0.6; }
.product-card__badges { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.badge { background: var(--brand); color: var(--brand-ink); font-size: 0.65rem; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.product-card__name { margin: 0; font-size: 1.05rem; }
.product-card__desc { margin: 0; color: var(--muted); font-size: 0.85rem; flex: 1; }
.product-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.product-card__price { font-weight: 700; }
.product-card__status { font-size: 0.8rem; color: var(--error); font-weight: 600; }

/* Buttons */
.btn {
  border: none; border-radius: var(--radius); padding: 0.6rem 1.1rem; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
}
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--primary:disabled { background: #cbb; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn--link { background: none; border: none; color: var(--brand); font-size: 0.8rem; padding: 0; text-decoration: underline; cursor: pointer; }
.btn--icon { background: #f1ece3; border-radius: 999px; width: 2rem; height: 2rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn--block { width: 100%; margin-top: 0.5rem; }

/* Cart drawer */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 25; }
.cart-panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(380px, 90vw);
  background: var(--surface); box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  transform: translateX(100%); transition: transform 0.25s; z-index: 30;
  padding: 1.5rem; overflow-y: auto;
}
body.cart-open .cart-overlay { opacity: 1; pointer-events: auto; }
body.cart-open .cart-panel { transform: translateX(0); }

.cart-drawer__empty { text-align: center; margin-top: 3rem; }
.cart-line { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.cart-line__info { display: flex; flex-direction: column; gap: 0.15rem; }
.cart-line__controls { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.cart-line__price { font-weight: 600; }
.cart-drawer__subtotal { display: flex; justify-content: space-between; margin-top: 1rem; font-size: 1.05rem; }

.qty-stepper { display: flex; align-items: center; gap: 0.5rem; }
.qty-stepper--sm .btn--icon { width: 1.6rem; height: 1.6rem; }
.qty-label { min-width: 1.2rem; text-align: center; }

/* Product modal */
.product-modal { border: none; border-radius: var(--radius); padding: 1.5rem; width: min(520px, 92vw); max-height: 88vh; overflow-y: auto; }
.product-modal::backdrop { background: rgba(0,0,0,0.4); }
.product-modal__header { display: flex; justify-content: space-between; align-items: flex-start; }
.product-modal__desc { color: var(--muted); }
.modifier-list { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0.75rem 0; }
.modifier-list legend { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; padding: 0 0.3rem; }
.required-tag { background: var(--brand); color: var(--brand-ink); font-size: 0.65rem; padding: 1px 6px; border-radius: 999px; }
.modifier-option { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; cursor: pointer; }
.modifier-option--stepper { cursor: default; }
.modifier-option__name { flex: 1; }
.modifier-option__price { color: var(--muted); font-size: 0.85rem; }
.modifier-option__qty { min-width: 1.2rem; text-align: center; font-weight: 600; }
.product-modal__notes { width: 100%; margin-top: 0.5rem; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; }
.product-modal__error { color: var(--error); font-size: 0.85rem; }
.product-modal__footer { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.product-modal__total { font-weight: 700; font-size: 1.1rem; margin-right: auto; }

/* Checkout */
.checkout-container { max-width: 640px; margin: 0 auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.checkout-summary, .checkout-fulfillment, .checkout-actions-section, .totals-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.summary-line { display: flex; justify-content: space-between; padding: 0.3rem 0; }
.summary-line--total { border-top: 1px solid var(--border); margin-top: 0.5rem; padding-top: 0.6rem; font-size: 1.05rem; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer; font-size: 0.85rem; }
.tab-btn--active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.form-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; font-size: 0.85rem; font-weight: 600; }
.form-field input, .form-field textarea { font-family: inherit; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); font-weight: 400; }

.square-card-field { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 0.6rem; margin: 0.75rem 0; background: #fff; min-height: 3rem; }

.google-pay-button { min-height: 2.75rem; margin-top: 0.5rem; }
.apple-pay-button { min-height: 2.75rem; margin-top: 0.5rem; --apple-pay-button-height: 44px; }
.hint--divider { text-align: center; margin: 0.6rem 0; }

.error-text { color: var(--error); font-size: 0.85rem; min-height: 1.2em; }
.status-line { padding: 0.6rem 0.9rem; border-radius: var(--radius); font-size: 0.9rem; margin: 0.5rem 0; }
.status-line--progress { background: #fff3cd; color: #7a5b00; }
.status-line--success { background: #e4f3e6; color: var(--success); }
.status-line--error { background: #fbe4e2; color: var(--error); }
.status-line--neutral { background: #eee; color: var(--ink); }

.confirmation-container { max-width: 560px; margin: 0 auto; padding: 2rem 1.5rem; }

.error-state { text-align: center; padding: 3rem 1rem; color: var(--error); }
