* { scroll-behavior: smooth; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

#site-header {
  background: transparent;
}
#site-header[data-scrolled="true"] {
  background: #ffffff;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
#site-header[data-scrolled="true"] .nav-link,
#site-header[data-scrolled="true"] #mobile-menu-btn {
  color: #111;
}
#site-header[data-scrolled="false"] .nav-link {
  color: #fff;
}
#site-header[data-scrolled="false"] #mobile-menu-btn {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

.category-chip {
  white-space: nowrap;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid #eee;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}
.category-chip.active {
  background: #e7191f;
  border-color: #e7191f;
  color: #fff;
}

.product-card {
  border: 1px solid #eee;
  border-radius: 1.25rem;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.product-card:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}
.product-card .img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f3f3f3;
  position: relative;
}
.product-card img { width: 100%; height: 100%; object-fit: cover; }
.badge-special {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #e7191f;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.badge-unavailable {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.order-type-option.selected {
  border-color: #e7191f;
  background: #fff5f5;
  color: #e7191f;
}

.promo-card {
  border-radius: 1.5rem;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/10;
  background: #111;
}
.promo-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.75; }
.promo-card .promo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.1));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.25rem;
  color: #fff;
}

/* POS specific */
.pos-btn {
  transition: all 0.1s;
}
.pos-btn:active {
  transform: scale(0.96);
}

@media (max-width: 767px) {
  .cart-drawer-mobile { width: 100% !important; }
}

/* ============ Responsive system-wide polish ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
img, iframe, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(231, 25, 31, 0.45); outline-offset: 2px; }

/* Public menu, checkout and event forms */
#category-filters { min-width: 0; scrollbar-width: none; }
#category-filters::-webkit-scrollbar { display: none; }
#products-grid { min-width: 0; }
#checkout-modal > div, #product-modal > div { overscroll-behavior: contain; }
#checkout-form input, #checkout-form select, #checkout-form textarea,
#pos-app input, #pos-app select, #pos-app textarea { min-height: 2.75rem; }

/* Staff/admin tables remain readable without forcing the whole page wider. */
.data-table { min-width: 640px; }
.stat-card { min-width: 0; }
.kanban-board { scrollbar-width: thin; }

/* POS: use a two-pane workspace on tablet/desktop and a vertical workspace on phones. */
#pos-products { min-width: 0; }
#pos-cart-items { min-height: 0; }

/* Kitchen: prevent long order content from breaking the grid. */
#orders-grid { min-width: 0; }
.order-card { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 767px) {
  body { font-size: 0.95rem; }

  /* Public header/menu */
  #site-header .nav-link { color: #111; }
  #site-header[data-scrolled="false"] { background: rgba(0,0,0,0.28); }
  #site-header .h-16 { height: 4rem; }
  #menu { scroll-margin-top: 4rem; }
  #category-filters { padding-bottom: 0.25rem; }
  .category-chip { padding: 0.55rem 0.9rem; font-size: 0.72rem; border-width: 1px; }
  .product-card { border-radius: 1rem; }
  .product-card .p-4 { padding: 0.85rem; }
  .product-card h3 { font-size: 0.95rem; }
  .product-card .text-xl { font-size: 1.05rem; }
  #extras-catalog article { align-items: flex-start; gap: 0.75rem; }
  #extras-catalog .extra-add-btn { flex-shrink: 0; padding: 0.55rem 0.8rem; font-size: 0.8rem; }

  /* Full-screen dialogs with safe edge spacing. */
  #product-modal, #checkout-modal, #confirm-modal { padding: 0.65rem; align-items: flex-end; }
  #product-modal > div, #checkout-modal > div, #confirm-modal > div {
    width: 100%; max-height: calc(100dvh - 1.3rem); border-radius: 1.35rem;
  }
  #checkout-modal > div { padding: 1.1rem; }
  #checkout-form .grid-cols-2 { grid-template-columns: 1fr; }
  #checkout-form .order-type-option { padding: 0.75rem 0.45rem; font-size: 0.85rem; }
  #cart-drawer { width: 100vw !important; }
  #cart-items { padding: 1rem; }
  #cart-footer { padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  #track-view .max-w-2xl { padding: 1.25rem; }
  #track-form { flex-direction: column; }
  #track-form button { min-height: 2.75rem; padding: 0.75rem 1.25rem; }

  /* Private events */
  .ev-card { padding: 1.15rem; border-radius: 1.15rem; }
  .ev-card-title { font-size: 0.98rem; }
  .ev-nav-actions { flex-direction: column-reverse; }
  .ev-nav-actions .ev-btn { width: 100%; }
  .ev-grid-3, .ev-grid-6 { grid-template-columns: 1fr; }
  .ev-choice-chip { min-height: 5.25rem; }
  .ev-calendar { padding: 0.8rem; }
  .ev-calendar-day { font-size: 0.78rem; }
  .ev-calendar-legend { gap: 0.55rem; font-size: 0.68rem; }

  /* POS vertical layout for phone portrait. */
  #pos-app > .flex-1 { flex-direction: column; overflow-y: auto; }
  #pos-app > .flex-1 > div:first-child { min-height: 50dvh; flex: 1 1 52%; overflow: hidden; }
  #pos-app > .flex-1 > div:last-child {
    width: 100%; max-width: none; height: 48dvh; flex: 0 0 48dvh;
    border-left: 0; border-top: 1px solid #e5e7eb;
  }
  #pos-app header { padding: 0.65rem 0.75rem; }
  #pos-app header .font-black { font-size: 0.78rem; }
  #pos-app #active-orders-btn { padding: 0.55rem 0.7rem; font-size: 0.7rem; }
  #pos-app #active-orders-btn i { margin-right: 0; }
  #pos-app #pos-logout { padding: 0.6rem 0.7rem; }
  #pos-categories { padding: 0.65rem; }
  #pos-search { padding-top: 0.65rem; padding-bottom: 0.65rem; }
  #pos-products { padding: 0.65rem; gap: 0.55rem; }
  .pos-product-btn { padding: 0.7rem; border-radius: 0.85rem; }
  #pos-app .border-t.p-4 { padding: 0.75rem; }
  #pos-app #pos-submit-btn { padding-top: 0.75rem; padding-bottom: 0.75rem; font-size: 0.95rem; }

  /* Admin tables and controls */
  #admin-app main { padding: 0.85rem; }
  #admin-app .stat-card { padding: 0.9rem; border-radius: 1rem; }
  #admin-app .grid-cols-2 { grid-template-columns: 1fr; }
  #admin-app section > .flex.items-center,
  #admin-app section > .flex.flex-wrap { align-items: stretch; flex-direction: column; }
  #admin-app section > .flex.items-center > button,
  #admin-app section > .flex.flex-wrap > button { width: 100%; }
  #admin-app section > .flex.items-center > h1,
  #admin-app section > .flex.flex-wrap > h1 { margin-bottom: 0.75rem; }
  #admin-app section > .flex.flex-wrap > div { width: 100%; flex-wrap: wrap; }
  #admin-app section > .flex.flex-wrap select,
  #admin-app section > .flex.flex-wrap input { flex: 1 1 100%; width: 100%; }
  #admin-app .data-table { min-width: 620px; font-size: 0.78rem; }
  #admin-app .data-table th { padding: 0.6rem 0.5rem; font-size: 0.65rem; }
  #admin-app .data-table td { padding: 0.65rem 0.5rem; }
  #admin-app .kanban-col { min-width: 235px; }
  #admin-app .modal-box { padding: 1.1rem; border-radius: 1.15rem; max-height: calc(100dvh - 1rem); }

  /* Kitchen */
  #kitchen-app header { padding: 0.75rem; }
  #kitchen-app header .font-black { font-size: 0.85rem; }
  #kitchen-app header .text-lg { font-size: 0.8rem; }
  #kitchen-app header .text-white\/60 { font-size: 0.72rem; }
  #kitchen-app main { padding: 0.65rem; }
  #orders-grid { grid-template-columns: 1fr; gap: 0.65rem; }
  .order-card { padding: 0.85rem; border-width: 2px; border-radius: 1rem; }
  .order-card .text-2xl { font-size: 1.35rem; }
  .order-card .text-lg { font-size: 1rem; }
  .order-card .advance-btn { min-height: 2.75rem; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  /* Tablet touch targets and balanced staff spacing. */
  .category-chip { padding: 0.65rem 1rem; }
  #admin-app main { padding: 1.25rem; }
  #admin-app .stat-card { padding: 1.1rem; }
  #pos-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pos-product-btn { min-height: 5.25rem; }
  #orders-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ Section background images (Japanese/street ambience) ============ */
.section-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}
.section-bg > .section-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.section-bg > .section-bg-content {
  position: relative;
  z-index: 1;
}

/* Promociones: pasillo de toriis rojos, refuerza la identidad de marca */
.section-bg-promos {
  background-image: url('/static/img/bg/torii-tunnel-path.jpg');
}
.section-bg-promos > .section-bg-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.82) 50%, rgba(0,0,0,0.92) 100%);
}

/* Menú: textura abstracta roja totalmente visible; solo un velo mínimo arriba/abajo
   para que el título y el buscador sticky no pierdan contraste, el resto de la
   sección (donde están las tarjetas de producto, ya opacas) queda sin lavado. */
.section-bg-menu {
  background-image: url('/static/img/bg/red-abstract-menu.jpg');
  background-attachment: fixed;
}
.section-bg-menu > .section-bg-overlay {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.03) 15%, rgba(255,255,255,0) 35%, rgba(255,255,255,0) 65%, rgba(255,255,255,0.1) 100%);
}
.section-bg-menu .section-bg-content h2,
.section-bg-menu .section-bg-content > div > div.text-center span {
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Ubicación / contacto: callejón nocturno con letreros neón, ambiente de restaurante */
.section-bg-ubicacion {
  background-image: url('/static/img/bg/ramen-neon-street.jpg');
}
.section-bg-ubicacion > .section-bg-overlay {
  background: linear-gradient(120deg, rgba(249,250,251,0.96) 0%, rgba(249,250,251,0.9) 55%, rgba(20,10,10,0.55) 100%);
}

/* Footer: torii de entrada, cierre visual de la experiencia */
.section-bg-footer {
  background-image: url('/static/img/bg/torii-gate-people.jpg');
  background-position: center 30%;
}
.section-bg-footer > .section-bg-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.93) 100%);
}

/* Hero secundario (no usado por defecto, disponible si se requiere) */
.section-bg-hero-alt {
  background-image: url('/static/img/bg/torii-gate-people.jpg');
}
