:root {
  --bg: #eef2f7;
  --bg-2: #dfe6f0;
  --ink: #142033;
  --muted: #4d5d73;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(20, 32, 51, 0.12);
  --accent: #1d4f91;
  --accent-2: #2f6fbf;
  --danger: #9b2c2c;
  --ok: #1d4f91;
  --shadow: 0 18px 50px rgba(20, 32, 51, 0.1);
  --radius: 18px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --btn-pad-y: 0.62rem;
  --btn-pad-x: 0.85rem;
  --ctrl-pad-y: 0.62rem;
  --ctrl-pad-x: 0.8rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(47, 111, 191, 0.18), transparent 28%),
    linear-gradient(160deg, #f3f6fb 0%, #e7eef8 45%, #d9e4f2 100%);
}

.bg-glow {
  position: fixed;
  inset: auto -10vw -20vh auto;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(29, 79, 145, 0.16), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: min(920px, calc(100% - 1.5rem));
  margin: 0 auto 2rem;
  position: relative;
  z-index: 1;
}
.container.narrow { width: min(560px, calc(100% - 1.5rem)); }

.topbar {
  width: min(920px, calc(100% - 1.5rem));
  margin: 1rem auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.brand strong, .brand small { display: block; }
.brand strong { font-family: var(--display); font-size: 1.05rem; }
.brand small { color: var(--muted); font-size: 0.82rem; }
.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), #163a6d);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.brand-mark.xl {
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto 0.75rem;
  font-size: 1.4rem;
}
.store-logo {
  width: min(160px, 46vw);
  height: auto;
  max-height: 120px;
  object-fit: contain;
  border-radius: 18px;
  background: white;
  padding: 0.45rem;
  margin: 0 auto 0.75rem;
  display: block;
  box-shadow: var(--shadow);
}
.store-logo.sm {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0.15rem;
  border-radius: 0.9rem;
  object-fit: cover;
}
.category-scroll {
  position: sticky;
  top: 0.2rem;
  z-index: 60;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.55rem;
  margin: 0 0 0.65rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: linear-gradient(180deg, rgba(243, 246, 251, 0.98), rgba(231, 238, 248, 0.94));
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.cat-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
  min-height: 2.1rem;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.cat-chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.voice-dock {
  position: sticky;
  top: 3.15rem;
  z-index: 50;
  margin-bottom: 0.75rem;
}
.voice-panel {
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 0.7rem;
  box-shadow: var(--shadow);
}
.voice-panel-sticky {
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(20, 32, 51, 0.14);
}
.btn.ok {
  background: linear-gradient(145deg, #2f9e6b, #1f6b3a);
  color: #fff;
  white-space: nowrap;
}
.voice-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.voice-field {
  position: relative;
  flex: 1;
  margin: 0;
  min-width: 0;
}
.voice-search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
  opacity: 0.85;
}
.voice-field input {
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.7rem 0.5rem 2.35rem;
  font-size: 0.9rem;
}
.voice-field input[type="search"]::-webkit-search-decoration,
.voice-field input[type="search"]::-webkit-search-cancel-button,
.voice-field input[type="search"]::-webkit-search-results-button {
  -webkit-appearance: none;
}
.mic-btn {
  flex: 0 0 auto;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #16324f;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(22, 50, 79, 0.2);
}
.mic-btn svg {
  width: 18px;
  height: 18px;
}
.mic-btn.listening {
  background: #9b2c2c;
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(155, 44, 44, 0.35); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(155, 44, 44, 0); }
}
.voice-status {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.voice-status[data-kind="ok"] { color: #1f6b3a; }
.voice-status[data-kind="warn"] { color: #9b2c2c; }
.voice-status[data-kind="listening"] { color: #16324f; font-weight: 600; }
.voice-status[data-kind="ask"] { color: #0f4c81; font-weight: 700; }
.voice-choices {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.35rem;
}
.voice-choices-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}
.voice-choice-list {
  display: grid;
  gap: 0.35rem;
}
.voice-choice-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.voice-choice-btn:hover,
.voice-choice-btn:focus-visible {
  border-color: #16324f;
  background: #eef4fb;
}
.product.voice-candidate {
  outline: 2px dashed #0f4c81;
  background: #f3f8fd;
}
.voice-log { display: none; }
.product.voice-hit {
  outline: 2px solid #25d366;
  background: #eefbf3;
  transition: background 0.3s ease, outline-color 0.3s ease;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.scan-box input#barcode-input {
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.last-scan {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: #e5eefb;
  display: grid;
  gap: 0.2rem;
}
.caja-page .hero-card h1 { font-size: 1.55rem; }
.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}
.check-row input { width: auto; }

.nav-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.nav-actions a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--ink);
  color: white !important;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 2rem;
}

.hero-card, .product, .order-card, .stat, .admin-link, .total-box {
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.hero-card {
  border-radius: calc(var(--radius) + 2px);
  padding: 1.15rem;
}
.hero-card.center { text-align: center; }
.hero-card h1, .section-head h1, .order-card h2, .product h2 {
  font-family: var(--display);
  margin: 0.15rem 0 0.4rem;
  line-height: 1.15;
  font-size: 1.15rem;
}
.product h2, .order-card h2 { font-size: 1.05rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
  margin: 0;
}
.lede, .product p, .hint { color: var(--muted); }
.hint { font-size: 0.84rem; }

.stack { display: grid; gap: 0.75rem; }
label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--ctrl-pad-y) var(--ctrl-pad-x);
  font: inherit;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.42;
  font-weight: 400;
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: var(--muted);
  opacity: 0.42;
  font-weight: 400;
}
input::-moz-placeholder,
textarea::-moz-placeholder {
  color: var(--muted);
  opacity: 0.42;
  font-weight: 400;
}
textarea { resize: vertical; }

.site-credit {
  display: flex;
  justify-content: center;
  padding: 1.25rem 1rem 1.75rem;
  margin-top: 0.5rem;
}
.site-credit a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  opacity: 0.72;
}
.site-credit a:hover {
  color: var(--accent);
  opacity: 1;
  text-decoration: underline;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  background: #d7e2f0;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  line-height: 1.2;
  min-height: 2.35rem;
}
.btn.primary {
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: white;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}
.btn.whatsapp {
  background: linear-gradient(145deg, #25d366, #128c7e);
  color: white;
  width: 100%;
}
.btn.danger {
  background: #9b2c2c;
  color: white;
}
.btn.sm {
  min-height: 2rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 10px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}

.product-list, .stack { display: grid; gap: 0.7rem; }
.product, .order-card {
  border-radius: var(--radius);
  padding: 0.85rem;
  display: grid;
  gap: 0.65rem;
}
.product:has(.product-photo) {
  grid-template-columns: auto 1fr;
  align-items: start;
}
.product .inline-form {
  grid-column: 1 / -1;
}
.product-photo {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
}
.product-cell-with-photo {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.product-thumb {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
}
.product-thumb.placeholder {
  display: inline-block;
  background: rgba(20, 32, 51, 0.06);
}
.product-photo-preview {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.product-photo-preview img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.check-inline {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.86rem;
  color: var(--muted);
}
/* Evita que display:grid anule el atributo hidden al filtrar categorías. */
.product[hidden],
.product.is-cat-hidden,
#categoria-vacia[hidden] {
  display: none !important;
}
.meta {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}
.inline-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.inline-form input[type="number"] { width: 4.25rem; padding: 0.45rem 0.5rem; }
.inline-form select { width: auto; min-width: 7.5rem; padding: 0.45rem 0.55rem; font-size: 0.86rem; }

.total-box {
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.total-box.compact { box-shadow: none; }

.alert, .success {
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.alert { background: #fde8e8; color: var(--danger); }
.success { background: #e5eefb; color: var(--ok); }

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.stat {
  border-radius: 14px;
  padding: 0.85rem;
}
.stat span { color: var(--muted); display: block; font-size: 0.8rem; }
.stat strong { font-family: var(--display); font-size: 1.35rem; }

.admin-grid {
  display: grid;
  gap: 0.65rem;
}
.admin-link {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 0.95rem;
}
.admin-actions {
  display: grid;
  gap: 0.45rem;
}
.product-quick-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
}
.product-quick-form input[type="number"] {
  width: 4.8rem;
  min-height: 1.85rem;
  padding: 0.25rem 0.35rem;
  font-size: 0.84rem;
}
.product-quick-form .quick-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.excel-panel summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--display);
  font-size: 1.05rem;
}
.excel-panel[open] summary {
  margin-bottom: 0.55rem;
}
.product-list-panel {
  margin-top: 1rem;
}
.product-search-bar {
  position: sticky;
  top: 0.35rem;
  z-index: 30;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  margin-bottom: 0.55rem;
}
.product-search-field {
  flex: 1;
  margin: 0;
  min-width: 0;
}
.product-search-field input {
  width: 100%;
  margin: 0;
  min-height: 2rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
}
.product-search-meta {
  margin: 0 0 0.45rem;
}
.product-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.82);
  box-shadow: var(--shadow);
}
.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.product-table th,
.product-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
}
.product-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(241, 246, 252, 0.95);
  position: sticky;
  top: 0;
}
.product-table tr:last-child td {
  border-bottom: 0;
}
.product-cell-main {
  min-width: 10rem;
}
.product-cell-main strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.25;
}
.product-cell-main small {
  color: var(--muted);
  font-size: 0.74rem;
}
.product-cell-actions {
  white-space: nowrap;
}
.product-cell-actions .btn,
.product-cell-actions form {
  display: inline-flex;
  margin: 0.1rem 0.1rem 0.1rem 0;
  vertical-align: middle;
}
.product-row.is-hidden {
  opacity: 0.55;
}
.product-row.is-low td:first-child strong::after {
  content: " · bajo mín";
  color: #9b2c2c;
  font-size: 0.72rem;
  font-weight: 700;
}
.stock-min {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}
.order-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.order-items-edit {
  display: grid;
  gap: 0.5rem;
  margin: 0.35rem 0 0.65rem;
}
.order-item-row {
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
}
.order-item-info {
  display: grid;
  gap: 0.08rem;
}
.order-item-info strong {
  font-size: 0.9rem;
  line-height: 1.25;
}
.order-item-info small {
  color: var(--muted);
  font-size: 0.75rem;
}
.order-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-end;
}
.order-item-actions .inline-form,
.order-item-edit-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-end;
  margin: 0;
}
.order-item-actions .field-mini {
  display: grid;
  gap: 0.12rem;
  margin: 0;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}
.order-item-actions .field-mini input {
  width: 4.4rem;
  min-height: 1.9rem;
  padding: 0.28rem 0.35rem;
  font-size: 0.86rem;
  border-radius: 10px;
}
.order-item-actions .field-mini input[name="price"] {
  width: 5.2rem;
}
.order-item-actions input[type="number"] {
  width: 3.4rem;
  min-height: 1.9rem;
  padding: 0.28rem 0.35rem;
  font-size: 0.86rem;
  border-radius: 10px;
}
.order-item-actions .btn,
.order-cancel .btn {
  min-height: 1.9rem;
  padding: 0.32rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 10px;
  width: auto;
}
.pill.ghost-pill {
  background: transparent;
  color: var(--ink) !important;
  border: 1px solid var(--line);
}

/* Confirmación con nombre de la bodega (no el dominio del servidor). */
body.bodega-confirm-open {
  overflow: hidden;
}
.bodega-confirm {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.bodega-confirm[hidden] {
  display: none !important;
}
.bodega-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 32, 51, 0.45);
}
.bodega-confirm-card {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem 0.95rem;
  display: grid;
  gap: 0.65rem;
}
.bodega-confirm-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}
.bodega-confirm-msg {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--muted);
}
.bodega-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.bodega-confirm-actions .btn {
  min-height: 2.2rem;
  padding: 0.45rem 0.85rem;
}
.order-status-form {
  width: 100%;
}
.order-status-form select {
  flex: 1;
  min-width: 0;
}
.order-cancel {
  margin-top: 0.55rem;
}
.cart-item {
  display: grid;
  gap: 0.6rem;
}
.cart-item-actions {
  display: grid;
  gap: 0.4rem;
}
.qty-form {
  align-items: center;
  flex-wrap: nowrap;
}
.qty-btn {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.25rem 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}
.status {
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #e7ecf2;
  white-space: nowrap;
}
.status-nuevo { background: #fff4d6; }
.status-preparando { background: #ddecff; }
.status-listo { background: #d9e8fb; }
.status-entregado { background: #e8e8e8; }
.status-cancelado { background: #fde8e8; color: var(--danger); }

.qr {
  width: min(240px, 64vw);
  border-radius: 14px;
  margin: 0.85rem 0;
  background: white;
  padding: 0.5rem;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--muted);
}

@media (max-width: 640px) {
  :root {
    --btn-pad-y: 0.48rem;
    --btn-pad-x: 0.7rem;
    --ctrl-pad-y: 0.5rem;
    --ctrl-pad-x: 0.7rem;
    --radius: 14px;
    --shadow: 0 10px 28px rgba(20, 32, 51, 0.08);
  }

  .container,
  .container.narrow,
  .topbar {
    width: min(920px, calc(100% - 1rem));
  }
  .topbar {
    margin: 0.65rem auto;
    gap: 0.55rem;
  }
  .brand { gap: 0.5rem; }
  .brand strong { font-size: 0.95rem; }
  .brand small { font-size: 0.72rem; }
  .brand-mark,
  .store-logo.sm {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.7rem;
  }
  .nav-actions { gap: 0.35rem; }
  .nav-actions a { font-size: 0.8rem; }
  .pill {
    padding: 0.32rem 0.58rem;
    font-size: 0.74rem;
    min-height: 1.85rem;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    margin: 0.25rem 0 0.7rem;
  }
  .section-head h1 { font-size: 1.2rem; margin: 0; }
  .hero-card { padding: 0.95rem; }
  .hero-card h1 { font-size: 1.25rem; }

  .btn {
    min-height: 2.05rem;
    font-size: 0.84rem;
  }
  .btn.whatsapp {
    min-height: 2.2rem;
    font-size: 0.86rem;
  }

  .product,
  .order-card {
    padding: 0.7rem;
    gap: 0.5rem;
  }
  .product .inline-form {
    display: grid;
    grid-template-columns: 4rem 1fr;
    gap: 0.4rem;
    width: 100%;
  }
  .product .inline-form input[type="number"] {
    width: 100%;
  }
  .product .inline-form .btn {
    width: 100%;
  }

  .voice-panel { padding: 0.55rem; }
  .voice-dock { top: 2.9rem; }
  .category-scroll { top: 0.15rem; }
  .voice-row { gap: 0.3rem; flex-wrap: nowrap; }
  .mic-btn {
    width: 2.2rem;
    height: 2.2rem;
  }
  .mic-btn svg {
    width: 15px;
    height: 15px;
  }
  #voice-process,
  #voice-checkout {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.74rem;
    min-height: 2.05rem;
    flex: 0 0 auto;
  }

  .cat-chip {
    padding: 0.32rem 0.58rem;
    font-size: 0.72rem;
    min-height: 1.8rem;
  }

  .order-item-row {
    padding: 0.45rem 0.55rem;
  }
  .order-item-actions {
    flex-wrap: wrap;
  }
  .order-item-actions .inline-form,
  .order-item-edit-form {
    display: inline-flex;
    flex-wrap: wrap;
    width: 100%;
  }
  .order-item-actions input[type="number"],
  .order-item-actions .field-mini input {
    width: 4.6rem;
  }
  .order-item-actions .field-mini input[name="price"] {
    width: 5.4rem;
  }
  .order-item-actions .btn {
    width: auto;
    flex: 0 0 auto;
  }
  .cart-item-actions > form .btn.danger {
    width: auto;
    min-height: 1.9rem;
    font-size: 0.78rem;
  }

  .cart-item-actions .qty-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    width: 100%;
    align-items: center;
  }
  .cart-item-actions .qty-form .inline-form {
    display: flex;
    flex: 1 1 auto;
    min-width: 7rem;
  }
  .cart-item-actions .qty-form .inline-form input[type="number"] {
    flex: 1;
    width: auto;
    min-width: 2.8rem;
  }
  .qty-btn {
    min-width: 1.9rem;
    min-height: 1.9rem;
    padding: 0.2rem 0.35rem;
  }

  .admin-actions .inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
  }
  .admin-actions .inline-form select {
    min-width: 0;
    width: 100%;
  }
  .product-search-bar {
    flex-wrap: wrap;
  }
  .product-search-bar .btn {
    flex: 0 0 auto;
  }
  .product-table th:nth-child(4),
  .product-table td.product-cell-actions {
    min-width: 7.5rem;
  }
  .product-quick-form input[type="number"] {
    width: 4.2rem;
  }
  .admin-link { padding: 0.75rem 0.85rem; font-size: 0.9rem; }
  .two-col { grid-template-columns: 1fr; }
  .inline-form { flex-wrap: wrap; }
  .store-logo {
    width: min(120px, 42vw);
    max-height: 88px;
    padding: 0.35rem;
  }
}

/* Aviso de pedido nuevo */
.new-order-banner {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  z-index: 10000;
  background: #16324f;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: none;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.9rem;
}
.new-order-banner.show { display: inline-flex; }
.new-order-banner a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
}

/* Ticket de pedido */
.ticket-page {
  background: #fff;
  min-height: 100vh;
}
.ticket-toolbar {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}
.ticket {
  width: min(100%, 22rem);
  margin: 1rem auto;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  color: #111;
}
.ticket-head {
  text-align: center;
  margin-bottom: 0.75rem;
}
.ticket-logo {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 0.45rem;
  border-radius: 10px;
}
.ticket-head strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.ticket-head p,
.ticket-customer,
.ticket-meta {
  margin: 0.2rem 0;
}
.ticket-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
}
.ticket-table th,
.ticket-table td {
  text-align: left;
  padding: 0.25rem 0;
  vertical-align: top;
  border-bottom: 1px dashed #ccc;
}
.ticket-table th:last-child,
.ticket-table td:last-child {
  text-align: right;
}
.ticket-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 2px solid #111;
}
.ticket-foot {
  text-align: center;
  margin-top: 1rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #999;
}
.ticket-thanks {
  margin: 0.35rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}
.ticket-qr {
  display: block;
  width: 140px;
  height: 140px;
  margin: 0.55rem auto 0.35rem;
}
.ticket-url {
  font-size: 0.68rem;
  word-break: break-all;
  color: #444;
  margin: 0;
}

@media print {
  .no-print,
  .bg-glow,
  .topbar,
  .new-order-banner {
    display: none !important;
  }
  body.ticket-page {
    background: #fff;
  }
  .ticket {
    margin: 0;
    width: 100%;
    box-shadow: none;
  }
}
