/* ══════════════════════════════════════════════════════
   NUTRILION — Catálogo v2 — Entrega 1
   Mobile-first · DataLayer ready
   ══════════════════════════════════════════════════════ */

:root {
  --g900: #102218;
  --g800: #1a3a2a;
  --g700: #2d5a40;
  --g600: #3d7a56;
  --g500: #52a870;
  --g300: #a8d8b8;
  --g100: #e8f5ed;
  --g50:  #f2faf5;
  --white: #ffffff;
  --text:  #161c18;
  --text2: #4a5550;
  --text3: #8a9e94;
  --line:  #deeae2;
  --wapp:  #25d366;
  --wapp2: #128c4e;
  --red:   #e53e3e;
  --amber: #d97706;
  --r:     10px;
  --r-sm:  6px;
  --r-lg:  16px;
  --sh:    0 2px 12px rgba(16,34,24,.10);
  --sh-lg: 0 8px 32px rgba(16,34,24,.14);
  --header-h: 62px;
  --chips-h:  52px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--g50);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ─────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 300;
  background: var(--g800);
  box-shadow: 0 2px 16px rgba(0,0,0,.22);
  height: var(--header-h);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center;
  height: 100%; padding: 0 14px; gap: 10px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
  cursor: pointer; user-select: none;
}
.logo img {
  height: 38px; width: auto;
  filter: brightness(1.05);
  transition: transform .2s;
}
.logo:active img { transform: scale(.95); }
.logo-tagline {
  display: none;
  font-size: .72rem; color: var(--g300);
  line-height: 1.3; font-weight: 400;
  max-width: 120px;
}
@media(min-width:640px) { .logo-tagline { display: block; } }

.search-wrap {
  flex: 1; position: relative;
  max-width: 480px;
}
.search-wrap input {
  width: 100%;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 30px;
  padding: 9px 16px 9px 40px;
  color: #fff; font-family: inherit;
  font-size: .88rem; outline: none;
  transition: border-color .2s, background .2s;
}
.search-wrap input::placeholder { color: rgba(255,255,255,.38); }
.search-wrap input:focus {
  border-color: var(--g500);
  background: rgba(255,255,255,.18);
}
.search-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.4); pointer-events: none;
  font-size: .95rem;
}
.search-clear {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: rgba(255,255,255,.5); cursor: pointer;
  font-size: 1rem; display: none; padding: 2px;
  line-height: 1;
}
.search-clear.show { display: block; }

.header-actions {
  display: flex; align-items: center;
  gap: 8px; margin-left: auto; flex-shrink: 0;
}
.btn-cart {
  background: var(--wapp); color: #fff;
  border: none; border-radius: 30px;
  padding: 8px 14px 8px 12px;
  font-family: inherit; font-size: .84rem;
  font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn-cart:hover { background: var(--wapp2); }
.btn-cart:active { transform: scale(.97); }
.cart-badge {
  background: #fff; color: var(--wapp2);
  border-radius: 50%; min-width: 18px; height: 18px;
  font-size: .68rem; font-weight: 800;
  display: none; align-items: center;
  justify-content: center; padding: 0 3px;
}
.cart-badge.show { display: flex; }

/* Admin toggle — solo visible en modo admin */
.btn-admin {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 30px; padding: 7px 13px;
  font-family: inherit; font-size: .78rem;
  font-weight: 500; cursor: pointer;
  display: none; align-items: center; gap: 5px;
  transition: background .15s;
}
.btn-admin.show { display: flex; }
.btn-admin.active {
  background: var(--amber); border-color: var(--amber);
  color: #fff;
}

/* ── CHIPS BAR ──────────────────────────────────────── */
.chips-bar {
  position: sticky; top: var(--header-h); z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  height: var(--chips-h);
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips-bar::-webkit-scrollbar { display: none; }
.chips-inner {
  display: flex; align-items: center;
  gap: 6px; padding: 10px 14px;
  width: max-content;
  min-width: 100%;
}
.chip {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 5px;
  background: var(--g50);
  border: 1.5px solid var(--line);
  border-radius: 30px;
  padding: 6px 13px;
  font-family: inherit; font-size: .8rem;
  font-weight: 500; color: var(--text2);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--g500); color: var(--g700); }
.chip.active {
  background: var(--g800); border-color: var(--g800);
  color: #fff;
}
.chip-count {
  background: rgba(0,0,0,.08);
  border-radius: 20px; padding: 0 5px;
  font-size: .68rem; font-weight: 600;
}
.chip.active .chip-count { background: rgba(255,255,255,.2); }

/* ── MAIN LAYOUT ────────────────────────────────────── */
.main-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 16px 12px 80px;
}

/* ── TOOLBAR ────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px; gap: 10px;
  flex-wrap: wrap;
}
.results-info {
  font-size: .84rem; color: var(--text2);
  font-weight: 500;
}
.results-info strong { color: var(--g700); }
.toolbar-actions {
  display: flex; align-items: center; gap: 8px;
}
.btn-sm {
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 12px;
  font-family: inherit; font-size: .8rem;
  font-weight: 500; color: var(--text2);
  cursor: pointer; transition: border-color .15s, color .15s;
  display: flex; align-items: center; gap: 5px;
}
.btn-sm:hover { border-color: var(--g500); color: var(--g700); }
.btn-add-product {
  background: var(--g700); color: #fff;
  border-color: var(--g700);
  display: none;
}
.btn-add-product.show { display: flex; }
.btn-add-product:hover { background: var(--g800); border-color: var(--g800); color: #fff; }

/* ── PRODUCTS GRID ──────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media(min-width:480px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media(min-width:700px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media(min-width:1000px) {
  .products-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
@media(min-width:1200px) {
  .products-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
}

/* ── PRODUCT CARD ───────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .15s;
  position: relative;
}
.card:hover {
  box-shadow: var(--sh-lg);
  transform: translateY(-2px);
}
.card.out-of-stock { opacity: .65; }

.card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--g100);
}
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.card-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--g100) 0%, var(--g50) 100%);
  gap: 6px;
}
.card-placeholder .ph-emoji {
  font-size: 2.4rem; line-height: 1;
  filter: grayscale(.15);
}
.card-placeholder .ph-brand {
  font-size: .62rem; font-weight: 600;
  color: var(--g600); text-transform: uppercase;
  letter-spacing: .06em; padding: 0 6px;
  text-align: center; max-width: 90%;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}

.card-badge-wrap {
  position: absolute; top: 7px; left: 7px;
  display: flex; flex-direction: column; gap: 4px;
}
.badge {
  font-size: .63rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  line-height: 1.5; letter-spacing: .02em;
}
.badge-new   { background: var(--g700); color: #fff; }
.badge-sale  { background: #e53e3e; color: #fff; }
.badge-out   { background: rgba(0,0,0,.55); color: #fff; }
.badge-low   { background: var(--amber); color: #fff; }

.card-body {
  padding: 10px 11px 12px;
  display: flex; flex-direction: column;
  flex: 1; gap: 6px;
}
.card-brand {
  font-size: .65rem; font-weight: 600;
  color: var(--g600); text-transform: uppercase;
  letter-spacing: .06em;
}
.card-name {
  font-size: .82rem; font-weight: 500;
  color: var(--text); line-height: 1.35;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price-row {
  display: flex; align-items: baseline; gap: 6px;
  margin-top: auto; padding-top: 4px;
}
.card-price {
  font-size: 1rem; font-weight: 700; color: var(--g800);
}
.card-old-price {
  font-size: .75rem; color: var(--text3);
  text-decoration: line-through;
}
.card-discount {
  font-size: .68rem; font-weight: 700;
  color: #e53e3e; margin-left: auto;
}

/* Add to cart controls */
.card-action {
  padding: 0 11px 11px;
}
.btn-add {
  width: 100%;
  background: var(--g800); color: #fff;
  border: none; border-radius: var(--r-sm);
  padding: 9px 10px;
  font-family: inherit; font-size: .83rem;
  font-weight: 600; cursor: pointer;
  display: flex; align-items: center;
  justify-content: center; gap: 6px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-add:hover { background: var(--g700); }
.btn-add:disabled {
  background: var(--text3); cursor: not-allowed;
}
.qty-ctrl {
  display: flex; align-items: center;
  border: 1.5px solid var(--g800);
  border-radius: var(--r-sm); overflow: hidden;
}
.qty-btn {
  background: none; border: none;
  width: 34px; height: 34px;
  display: flex; align-items: center;
  justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  color: var(--g800); cursor: pointer;
  transition: background .1s;
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:hover { background: var(--g100); }
.qty-num {
  flex: 1; text-align: center;
  font-size: .88rem; font-weight: 700;
  color: var(--g800); min-width: 28px;
}

/* Admin edit mode on card */
.card-edit-bar {
  display: none;
  padding: 0 11px 10px;
  gap: 6px;
}
.card-edit-bar.show { display: flex; }
.btn-edit-card {
  flex: 1; background: var(--g50);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px; font-family: inherit;
  font-size: .75rem; font-weight: 500;
  color: var(--text2); cursor: pointer;
  text-align: center; transition: background .15s;
}
.btn-edit-card:hover { background: var(--g100); color: var(--g800); }

/* ── EMPTY STATE ────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
}
.empty-icon { font-size: 3rem; margin-bottom: 14px; }
.empty-title {
  font-size: 1.1rem; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
}
.empty-msg {
  font-size: .9rem; color: var(--text2);
  max-width: 320px; margin: 0 auto 20px;
  line-height: 1.6;
}
.btn-whatsapp-empty {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--wapp); color: #fff;
  text-decoration: none; border-radius: 30px;
  padding: 10px 20px; font-size: .88rem; font-weight: 600;
  transition: background .15s;
}
.btn-whatsapp-empty:hover { background: var(--wapp2); }

/* ── PAGINATION ─────────────────────────────────────── */
.pagination {
  display: flex; align-items: center;
  justify-content: center; gap: 8px;
  margin-top: 28px; flex-wrap: wrap;
}
.page-btn {
  min-width: 38px; height: 38px;
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit; font-size: .84rem;
  font-weight: 500; color: var(--text2);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  padding: 0 10px;
  transition: border-color .15s, background .15s, color .15s;
}
.page-btn:hover { border-color: var(--g500); color: var(--g700); }
.page-btn.active {
  background: var(--g800); border-color: var(--g800);
  color: #fff; font-weight: 700;
}
.page-btn:disabled {
  opacity: .4; cursor: not-allowed;
  border-color: var(--line);
}

/* ── CART DRAWER ────────────────────────────────────── */
.cart-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.cart-overlay.show {
  opacity: 1; pointer-events: all;
}
.cart-drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  z-index: 401;
  width: min(420px, 100vw);
  background: var(--white);
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22,.6,.36,1);
}
.cart-drawer.open { transform: translateX(0); }
.cart-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.cart-title {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text); flex: 1;
}
.btn-close-cart {
  background: var(--g50); border: none;
  border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  font-size: 1rem; color: var(--text2);
  transition: background .15s;
}
.btn-close-cart:hover { background: var(--g100); }
.cart-items {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.cart-item {
  display: flex; gap: 12px;
  align-items: flex-start;
}
.cart-item-img {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  overflow: hidden; flex-shrink: 0;
  background: var(--g100);
  display: flex; align-items: center;
  justify-content: center; font-size: 1.5rem;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: .82rem; font-weight: 500;
  color: var(--text); line-height: 1.3;
  margin-bottom: 4px;
}
.cart-item-price {
  font-size: .78rem; color: var(--text2);
}
.cart-item-controls {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
}
.cart-item-subtotal {
  font-size: .84rem; font-weight: 700;
  color: var(--g800); margin-left: auto;
}
.cart-item-remove {
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  font-size: .85rem; padding: 2px;
  transition: color .15s;
}
.cart-item-remove:hover { color: var(--red); }
.cart-empty {
  text-align: center; padding: 50px 20px;
  color: var(--text2);
}
.cart-empty .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* Cart form */
.cart-form {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-label {
  font-size: .75rem; font-weight: 600;
  color: var(--text2); text-transform: uppercase;
  letter-spacing: .04em;
}
.form-input, .form-select, .form-textarea {
  background: var(--g50);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-family: inherit; font-size: .88rem;
  color: var(--text); outline: none;
  transition: border-color .2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--g500);
}
.form-textarea { resize: vertical; min-height: 60px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.cart-total-bar {
  padding: 12px 16px 0;
  display: flex; align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.cart-total-label {
  font-size: .9rem; font-weight: 600; color: var(--text2);
}
.cart-total-amount {
  font-size: 1.2rem; font-weight: 800; color: var(--g800);
}

.btn-whatsapp {
  width: 100%; margin: 12px 16px;
  width: calc(100% - 32px);
  background: var(--wapp); color: #fff;
  border: none; border-radius: var(--r);
  padding: 13px;
  font-family: inherit; font-size: .95rem;
  font-weight: 700; cursor: pointer;
  display: flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-whatsapp:hover { background: var(--wapp2); }
.btn-whatsapp:disabled {
  background: var(--text3); cursor: not-allowed;
}

/* ── PASSWORD MODAL ─────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.5);
  display: none; align-items: center;
  justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  width: 100%; max-width: 340px;
  box-shadow: var(--sh-lg);
}
.modal-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}
.modal-subtitle {
  font-size: .84rem; color: var(--text2);
  margin-bottom: 18px; line-height: 1.5;
}
.pw-row {
  position: relative; margin-bottom: 14px;
}
.pw-row input {
  width: 100%; padding: 10px 40px 10px 14px;
  background: var(--g50);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit; font-size: .9rem;
  outline: none; transition: border-color .2s;
}
.pw-row input:focus { border-color: var(--g500); }
.pw-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  font-size: .9rem;
}
.modal-actions { display: flex; gap: 8px; }
.btn-cancel {
  flex: 1; background: var(--g50);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px; font-family: inherit;
  font-size: .88rem; font-weight: 500;
  color: var(--text2); cursor: pointer;
}
.btn-confirm {
  flex: 1; background: var(--g800); color: #fff;
  border: none; border-radius: var(--r-sm);
  padding: 10px; font-family: inherit;
  font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-confirm:hover { background: var(--g700); }

/* ── ADMIN PANEL OVERLAY ────────────────────────────── */
.admin-panel {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 350;
  background: var(--g900);
  border-top: 2px solid var(--g600);
  padding: 12px 16px;
  flex-wrap: wrap; gap: 8px; align-items: center;
}
.admin-panel.show { display: flex; }
.admin-label {
  font-size: .78rem; font-weight: 700;
  color: var(--g300); text-transform: uppercase;
  letter-spacing: .08em; flex: 0 0 100%;
  margin-bottom: 2px;
}
.btn-admin-action {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-sm);
  padding: 7px 13px;
  font-family: inherit; font-size: .78rem;
  font-weight: 500; color: rgba(255,255,255,.85);
  cursor: pointer; transition: background .15s;
  display: flex; align-items: center; gap: 5px;
}
.btn-admin-action:hover { background: rgba(255,255,255,.18); }
.btn-admin-exit {
  margin-left: auto;
  background: rgba(229,62,62,.25);
  border-color: rgba(229,62,62,.4);
  color: #fca5a5;
}
.btn-admin-exit:hover { background: rgba(229,62,62,.4); }

/* ── TOAST ──────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 999; display: flex;
  flex-direction: column-reverse; gap: 8px;
  align-items: center; pointer-events: none;
  width: 90%; max-width: 360px;
}
.toast {
  background: var(--g900); color: #fff;
  padding: 10px 18px; border-radius: 30px;
  font-size: .85rem; font-weight: 500;
  box-shadow: var(--sh-lg);
  animation: toast-in .3s ease, toast-out .3s ease 2.2s forwards;
  display: flex; align-items: center; gap: 8px;
  pointer-events: none; width: 100%;
  justify-content: center;
}
.toast.success { background: var(--wapp2); }
.toast.error   { background: var(--red); }
@keyframes toast-in  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; } }

/* ── ADD PRODUCT MODAL ──────────────────────────────── */
.add-product-modal {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.5);
  align-items: flex-end; justify-content: center;
  padding: 0;
}
@media(min-width:640px) {
  .add-product-modal { align-items: center; padding: 20px; }
}
.add-product-modal.show { display: flex; }
.add-product-box {
  background: var(--white);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 24px 20px 32px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
@media(min-width:640px) {
  .add-product-box { border-radius: var(--r-lg); }
}
.add-product-title {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text); margin-bottom: 18px;
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 12px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ── RESPONSIVE ADJUSTMENTS ─────────────────────────── */
@media(max-width:480px) {
  .card-placeholder .ph-emoji { font-size: 2rem; }
  .card-name { font-size: .78rem; }
  .card-price { font-size: .92rem; }
}

/* Reduced motion */
@media(prefers-reduced-motion: reduce) {
  *, .chip, .card, .cart-drawer { transition: none !important; animation: none !important; }
}
/* Presentaciones: selector funcional de prueba, valores desde Supabase */
.nutri-variants { padding:0 11px 10px; display:grid; gap:6px; }
.nutri-variants-head { color:var(--g700); font-weight:700; font-size:.76rem; }
.nutri-variants-chips { display:flex; flex-wrap:wrap; gap:5px; }
.nutri-variant-chip { background:#f4f4f4; border:1px solid var(--line); border-radius:5px; padding:4px 6px; font-size:.69rem; color:var(--text2); }
.nutri-variant-ready { background:var(--g100); border-color:var(--g300); color:var(--g800); }
.nutri-variants small { font-size:.69rem; color:var(--text3); }
.nutri-variant-chip {cursor:pointer;font-family:inherit;}
.nutri-variant-chip:disabled {opacity:.45;cursor:not-allowed;}
.nutri-variant-chip.selected {background:var(--g800);border-color:var(--g800);color:#fff;font-weight:700;}
.nutri-variant-chip:focus-visible {outline:3px solid var(--g500);outline-offset:2px;}
.nutri-stock-note {font-size:.71rem;color:#8b5100;background:#fff4da;border:1px solid #f5dba4;padding:6px 7px;border-radius:6px;line-height:1.35;}
.nutri-stock-cart-note {font-size:.75rem;color:#8b5100;font-weight:700;margin-bottom:4px;}

/* Navegación y pedido — noviembre 2026 */
[hidden] { display: none !important; }
/* The hosting badge stays on the catalog, away from the active order/menu. */
body:has(.cart-drawer.open) #nl-badge-frame,
body:has(.categories-panel.open) #nl-badge-frame { visibility:hidden !important; pointer-events:none !important; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible { outline: 3px solid var(--g500); outline-offset: 3px; }
.chips-bar { overflow: visible; height: auto; min-height: var(--chips-h); }
.category-toolbar { max-width:1280px; margin:auto; padding:8px 12px; display:flex; align-items:center; gap:12px; }
.categories-toggle, .cart-back { font:inherit; font-weight:700; color:var(--g800); border:1px solid var(--line); background:var(--g50); border-radius:8px; padding:10px 14px; cursor:pointer; min-height:44px; }
.categories-toggle { flex-shrink:0; }
.active-category { min-width:0; font-size:.85rem; color:var(--text2); overflow-wrap:anywhere; }
.clear-category { border:0; background:none; color:var(--g700); text-decoration:underline; font:inherit; font-size:.8rem; cursor:pointer; padding:8px; margin-left:auto; }
.catalog-layout { max-width:1280px; margin:0 auto; }
.categories-panel { position:fixed; left:0; top:0; bottom:0; width:min(360px,92vw); z-index:351; background:var(--white); box-shadow:var(--sh-lg); display:flex; flex-direction:column; transform:translateX(-110%); visibility:hidden; transition:transform .2s,visibility .2s; }
.categories-panel.open { transform:translateX(0); visibility:visible; }
.categories-heading { display:flex; align-items:center; justify-content:space-between; padding:16px; border-bottom:1px solid var(--line); flex-shrink:0; }
.categories-heading h2 { font-size:1.05rem; }
.category-search-wrap { padding:12px 16px; flex-shrink:0; }
.category-search-wrap input { min-height:44px; font-size:16px; }
.category-list { padding:0 12px 20px; overflow:auto; overscroll-behavior:contain; flex:1; min-height:0; }
.category-section-label { font-size:.72rem; color:var(--text2); text-transform:uppercase; letter-spacing:.06em; padding:18px 8px 8px; }
.category-choice, .category-group summary { display:flex; align-items:center; gap:9px; width:100%; text-align:left; font:inherit; font-size:.88rem; line-height:1.4; color:var(--text); background:transparent; border:0; border-radius:8px; padding:12px 10px; min-height:46px; cursor:pointer; overflow-wrap:anywhere; }
.category-choice:hover, .category-group summary:hover { background:var(--g50); }
.category-choice.active { background:var(--g800); color:white; font-weight:700; }
.category-label { flex:1; min-width:0; }
.category-count { font-size:.75rem; opacity:.75; flex-shrink:0; }
.category-group { border-bottom:1px solid var(--line); }
.category-group summary { list-style:none; font-weight:600; }
.category-group summary::-webkit-details-marker { display:none; }
.category-group summary::after { content:'+'; margin-left:auto; font-size:1.15rem; }
.category-group[open] summary::after { content:'−'; }
.category-children { padding:0 0 8px 18px; }
.category-empty { padding:18px 10px; color:var(--text2); }
.categories-overlay { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:350; }
.cart-drawer { width:min(480px,100vw); height:100dvh; bottom:auto; }
.cart-header { padding:14px 16px; }
.btn-close-cart { min-width:44px; min-height:44px; }
.cart-heading-wrap { flex:1; }
.cart-progress { display:flex; gap:14px; color:var(--text2); font-size:.76rem; margin-top:6px; }
.cart-progress [aria-current="step"] { color:var(--g700); font-weight:700; }
.cart-content { flex:1; min-height:0; display:flex; overflow:hidden; }
.cart-items { min-height:0; overscroll-behavior:contain; gap:0; }
.cart-item { padding:14px 0; border-bottom:1px solid var(--line); }
.cart-item:first-child { padding-top:0; }
.cart-item-name { font-size:.9rem; line-height:1.4; overflow-wrap:anywhere; }
.cart-item-controls { flex-wrap:wrap; }
.cart-item-remove { min-width:44px; min-height:44px; font-size:1rem; }
.cart-item-controls .qty-btn { min-width:40px; min-height:40px; }
.cart-details { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:16px; }
.cart-details-title { font-size:1rem; margin-bottom:8px; }
.cart-form { border:0; padding:10px 0; gap:16px; }
.form-input, .form-select, .form-textarea { font-size:16px; min-height:46px; }
.cart-notes summary { font-size:.85rem; cursor:pointer; min-height:44px; padding:12px 0; color:var(--text2); }
.cart-notes textarea { margin-top:6px; }
.cart-footer { flex-shrink:0; border-top:1px solid var(--line); padding:12px 16px max(16px,env(safe-area-inset-bottom)); background:var(--white); }
.cart-total-bar { padding:0; gap:12px; }
.cart-footer .btn-whatsapp, .btn-continue { width:100%; margin:12px 0 0; min-height:48px; }
.btn-continue { border:0; border-radius:var(--r); background:var(--g800); color:white; font:inherit; font-weight:700; cursor:pointer; padding:13px; }
.cart-back { margin:0 0 14px; }
.cart-drawer[data-step="review"] .cart-details,
.cart-drawer[data-step="review"] .btn-whatsapp,
.cart-drawer[data-step="details"] .cart-items,
.cart-drawer[data-step="details"] .btn-continue { display:none; }
.cart-drawer.is-empty .cart-details, .cart-drawer.is-empty .cart-progress { display:none; }
.cart-drawer.is-empty .cart-items { display:flex; }
@media (max-width:359px) {
  .cart-item-img { width:38px; height:38px; }
  .cart-item { gap:8px; }
  .cart-items { padding:12px; }
}
@media (min-width:960px) {
  .catalog-layout { display:grid; grid-template-columns:270px minmax(0,1fr); gap:20px; padding:16px 16px 0; align-items:start; }
  .main-wrap { width:100%; min-width:0; padding:0 0 80px; }
  .catalog-layout .products-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .categories-toggle { display:none; }
  .categories-panel, .categories-panel.open { position:sticky; top:calc(var(--header-h) + var(--chips-h) + 16px); width:auto; height:calc(100dvh - var(--header-h) - var(--chips-h) - 32px); z-index:1; transform:none; visibility:visible; box-shadow:none; border:1px solid var(--line); border-radius:var(--r); }
  .categories-close { display:none; }
  .categories-overlay { display:none; }
  .cart-drawer { width:min(960px,96vw); }
  .cart-content { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); }
  .cart-drawer[data-step] .cart-items { display:flex; }
  .cart-drawer[data-step] .cart-details { display:block; border-left:1px solid var(--line); }
  .cart-drawer[data-step] .btn-whatsapp { display:flex; }
  .cart-drawer[data-step] .btn-continue, .cart-progress, .cart-back { display:none; }
  .cart-footer { display:flex; align-items:center; gap:24px; }
  .cart-total-bar { flex:1; }
  .cart-footer .btn-whatsapp { width:43%; margin:0; }
  .cart-drawer.is-empty .cart-content { display:flex; }
  .cart-drawer.is-empty[data-step] .cart-details { display:none; }
}
@media (prefers-reduced-motion:reduce) { .categories-panel { transition:none; } }


/* Cabecera aprobada: marca original blanca/lima sobre verde. */
:root { --header-h:210px; }
.header { background:var(--g800); }
.header-inner {
  display:grid; grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:126px 48px; gap:10px 16px;
  padding:12px 16px 14px;
}
.logo { grid-column:1; grid-row:1; align-self:center; justify-self:start; min-width:0; }
.brand-logo { display:block; width:121px; height:126px; flex-shrink:0; }
.header-actions { grid-column:2; grid-row:1; margin-left:0; justify-self:end; align-self:center; }
.search-wrap { grid-column:1/-1; grid-row:2; width:100%; max-width:none; min-width:0; }
.search-wrap input {
  height:48px; padding:11px 44px 11px 46px; border-radius:14px;
  background:#fffdf5; color:var(--g800); border:1.5px solid #fffdf5;
  font-size:16px; box-shadow:none;
}
.search-wrap input::placeholder { color:#59665e; opacity:1; }
.search-wrap input:focus { background:#fffdf5; border-color:#bdde00; box-shadow:0 0 0 3px rgba(189,222,0,.25); }
.search-icon { left:15px; color:var(--g800); display:flex; align-items:center; }
.search-clear { right:4px; color:var(--g700); width:40px; height:44px; padding:10px; }
.btn-cart {
  position:relative; min-height:48px; padding:12px 15px; gap:9px;
  background:#fffdf5; color:var(--g800); border-radius:14px;
  font-size:16px; font-weight:700;
}
.btn-cart:hover { background:#edf4dd; }
.cart-icon { flex-shrink:0; }
.cart-badge {
  position:absolute; top:-9px; right:-5px; min-width:25px; height:25px;
  background:#bdde00; color:var(--g800); font-size:12px; border:2px solid var(--g800);
}
@media(min-width:960px) {
  :root { --header-h:136px; }
  .header-inner { grid-template-columns:132px minmax(240px,1fr) auto; grid-template-rows:1fr; gap:24px; padding:12px 24px; }
  .brand-logo { width:108px; height:112px; }
  .search-wrap { grid-column:2; grid-row:1; max-width:680px; }
  .header-actions { grid-column:3; grid-row:1; }
}
@media(max-width:959px) and (max-height:600px) {
  :root { --header-h:174px; }
  .header-inner { grid-template-rows:90px 48px; }
  .brand-logo { width:86px; height:90px; }
}


/* Productos destacados: usa la misma ficha y sus controles de compra. */
.catalog-divider { grid-column:1/-1; padding:15px 2px 3px; }
.catalog-divider h2 { margin:0; color:var(--g800); font-size:1.16rem; font-weight:700; line-height:1.35; }
.featured-divider { padding:12px 14px; border:1px solid var(--line); border-radius:var(--r); background:var(--white); }
.featured-divider h2 { color:var(--g700); }
.badge-featured { background:#d9f29c; color:var(--g900); }


/* Product photographs and a compact buying flow for the selected products. */
.featured-divider{padding:4px 0 2px;background:transparent;border:0;border-radius:0}
.featured-eyebrow{display:block;font-size:.65rem;letter-spacing:.12em;font-weight:700;color:var(--g600);margin-bottom:5px}
.featured-divider h2{font-size:clamp(1.35rem,2.5vw,1.8rem);line-height:1.15;color:var(--g900);letter-spacing:-.025em}
.card--photo{border-color:#d8e2da;background:#fff;box-shadow:0 3px 14px #173c2808}
.card--photo .featured-photo{aspect-ratio:1/1;background:#f2eeeb}
.card--photo .featured-photo img{object-fit:contain;width:100%;height:100%}
.card-img-wrap img[src*="assets/products/"]{object-fit:contain;background:#f2eeeb}
.featured-fallback{width:100%;height:100%}
.featured-fallback[hidden]{display:none}
.card--photo .featured-body{padding:13px 14px 10px;gap:8px;flex:0}
.card--photo .card-name{font-size:1rem;font-weight:650;line-height:1.28;min-height:2.56em;-webkit-line-clamp:2;color:var(--g900)}
.featured-price-line{display:flex;align-items:baseline;flex-wrap:wrap;gap:5px;min-height:1.5em;line-height:1.4}
.featured-portion{color:var(--text2);font-size:.8rem;font-weight:500}
.featured-price-dot{color:var(--text3)}
.card--photo .card-price{font-size:1.15rem;font-weight:750;color:var(--g900)}
.card--photo .featured-variants{padding:0 14px 10px;margin:0;border:0;background:none}
.featured-variants label{display:block;font-size:.73rem;font-weight:600;color:var(--text2);margin-bottom:5px}
.featured-variants select{width:100%;min-height:42px;border:1px solid #cbd9ce;border-radius:9px;background:var(--g50);color:var(--g900);font:inherit;font-size:.84rem;font-weight:600;padding:8px;cursor:pointer}
.featured-variants select:focus-visible{outline:3px solid #a6c97b;outline-offset:2px}
.featured-stock-note{font-size:.72rem;line-height:1.35;color:#80530d;padding:0 14px 10px}
.card--photo .card-action{padding:0 14px 14px;margin-top:auto}
.card--photo .btn-add,.card--photo .qty-ctrl{min-height:42px}
.card--photo .qty-btn{height:42px;width:42px}
@media(max-width:599px){
 .card--photo .featured-body{padding:10px 10px 8px;gap:6px}
 .card--photo .card-name{font-size:.88rem}
 .card--photo .card-price{font-size:1.04rem}
 .featured-portion{font-size:.72rem}
 .card--photo .featured-variants{padding:0 10px 8px}
 .featured-variants select{font-size:.78rem;padding:7px}
 .card--photo .card-action{padding:0 10px 10px}
 .card--photo .btn-add{font-size:.78rem;padding:8px 5px}
 .featured-stock-note{padding:0 10px 8px;font-size:.68rem}
}


/* Inicio: distinguir carga, error de conexión y búsqueda sin resultados. */
.catalog-loading{grid-column:1/-1;display:flex;align-items:center;gap:12px;padding:18px 0;color:var(--text2);font-size:1rem}
.catalog-spinner{width:22px;height:22px;border:3px solid var(--line);border-top-color:var(--g600);border-radius:50%;animation:nutri-spin .9s linear infinite;flex:none}
.catalog-skeleton{border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden;background:var(--white)}
.skeleton-photo{aspect-ratio:2/3;background:var(--g100);animation:nutri-pulse 1.5s ease-in-out infinite}
.skeleton-lines{padding:16px;display:grid;gap:12px}
.skeleton-lines span{height:14px;width:85%;background:var(--g100);border-radius:5px}
.skeleton-lines span:nth-child(2){width:65%}.skeleton-lines span:last-child{width:40%;height:20px}
.categories-toggle:disabled,#searchInput:disabled{cursor:wait;opacity:.75}
@keyframes nutri-spin{to{transform:rotate(360deg)}}
@keyframes nutri-pulse{50%{opacity:.55}}
@media(prefers-reduced-motion:reduce){.catalog-spinner,.skeleton-photo{animation:none}}

/* ── SEO local: H1 discreto y bloque de datos del local ───────── */
.page-title { font-size:1rem; font-weight:700; line-height:1.3; color:var(--g800); margin:0 0 10px; }
@media(min-width:960px) { .page-title { font-size:1.1rem; margin-bottom:12px; } }
.local-info { background:var(--g800); color:#e8f5ed; margin-top:8px; padding:28px 16px calc(28px + env(safe-area-inset-bottom)); }
.local-info-inner { max-width:1280px; margin:0 auto; }
.local-info-title { font-size:1.1rem; line-height:1.3; color:#fff; margin-bottom:6px; }
.local-info-intro { font-size:.9rem; line-height:1.55; color:var(--g300); max-width:70ch; margin-bottom:18px; }
.local-info-grid { display:grid; grid-template-columns:1fr; gap:18px; }
@media(min-width:640px) { .local-info-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(min-width:960px) { .local-info-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
.local-info h3 { font-size:.74rem; text-transform:uppercase; letter-spacing:.07em; color:var(--g300); margin-bottom:6px; }
.local-info address { font-style:normal; }
.local-info p, .local-info li, .local-info address { font-size:.9rem; line-height:1.55; }
.local-info ul { list-style:none; }
.local-info a { color:#bdde00; text-underline-offset:3px; display:inline-block; padding:4px 0; }
.local-info a:focus-visible { outline:3px solid #bdde00; outline-offset:2px; }


/* ── Etapa 2: enlaces, páginas de categoría y de ficha ───────── */
.local-info-nav { font-size:.9rem; margin:-8px 0 18px; }
.card-name .card-link { color:inherit; text-decoration:none; }
.card-name .card-link:hover, .card-name .card-link:focus-visible { text-decoration:underline; }
.sub-nav { grid-column:1/-1; grid-row:2; display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }
.sub-nav a { display:inline-flex; align-items:center; min-height:44px; padding:0 14px; border-radius:14px; background:#fffdf5; color:var(--g800); font-weight:700; font-size:.9rem; text-decoration:none; }
.sub-nav a:hover { background:#edf4dd; }
.sub-nav a:focus-visible { outline:3px solid #bdde00; outline-offset:2px; }
@media(min-width:960px) { .sub-nav { grid-column:2; grid-row:1; } }
.sub-main { max-width:1280px; margin:0 auto; padding:16px 16px 40px; }
.breadcrumb ol { list-style:none; display:flex; flex-wrap:wrap; gap:2px 6px; font-size:.82rem; color:var(--text2); margin-bottom:10px; }
.breadcrumb li { display:inline-flex; align-items:center; }
.breadcrumb [aria-current] { padding:8px 0; }
.breadcrumb li + li::before { content:'›'; margin-right:6px; color:var(--text3); }
.breadcrumb a { color:var(--g700); text-underline-offset:3px; display:inline-block; padding:8px 0; }
.sub-title { font-size:1.5rem; line-height:1.2; color:var(--g800); margin-bottom:10px; }
.sub-lead, .sub-text { font-size:.95rem; line-height:1.6; color:var(--text2); max-width:70ch; }
.sub-main h2.sub-h2 { font-size:1.1rem; line-height:1.3; color:var(--g800); margin:24px 0 10px; }
.sub-main a.text-link { color:var(--g700); text-underline-offset:3px; }
.cat-fichas { list-style:none; display:grid; grid-template-columns:1fr; gap:8px; }
.cat-fichas a { display:flex; align-items:center; min-height:48px; padding:10px 14px; background:#fff; border:1px solid var(--line); border-radius:var(--r); color:var(--g800); font-weight:600; text-decoration:none; }
.cat-fichas a:hover, .cat-fichas a:focus-visible { border-color:var(--g500); background:var(--g50); }
@media(min-width:640px) { .cat-fichas { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(min-width:960px) { .cat-fichas { grid-template-columns:repeat(3,minmax(0,1fr)); } }
.sub-main .toolbar { margin-top:8px; }
.sub-foot-links { margin-top:24px; display:flex; flex-wrap:wrap; gap:8px 20px; }
.ficha { display:grid; grid-template-columns:minmax(0,1fr); grid-template-areas:"head" "buy" "info"; gap:4px 32px; }
.ficha-head { grid-area:head; }
.ficha-buy { grid-area:buy; max-width:380px; width:100%; margin:12px 0; }
.ficha-info { grid-area:info; }
.ficha-buy .products-grid { display:block; }
.ficha-buy .card-name { display:none; }
.ficha-static img { display:block; width:100%; height:auto; border-radius:var(--r); background:#f2eeeb; }
.ficha-static p { margin-top:8px; font-size:.88rem; color:var(--text2); }
@media(min-width:960px) {
  .ficha { grid-template-columns:minmax(0,1fr) 380px; grid-template-areas:"head buy" "info buy"; grid-template-rows:auto 1fr; align-items:start; }
  .ficha-buy { margin:0; }
}
.ficha-datos { display:grid; gap:10px; margin:0; }
.ficha-datos div { background:#fff; border:1px solid var(--line); border-radius:var(--r); padding:10px 14px; }
.ficha-datos dt { font-size:.74rem; text-transform:uppercase; letter-spacing:.07em; color:var(--g700); font-weight:700; margin-bottom:2px; }
.ficha-datos dd { font-size:.92rem; line-height:1.5; color:var(--text); margin:0; }
.page-ficha .search-wrap input, .page-categoria .search-wrap input { padding-right:128px; }
.page-ficha .search-clear, .page-categoria .search-clear { right:84px; }
.search-go { position:absolute; right:5px; top:50%; transform:translateY(-50%); height:40px; min-width:76px; padding:0 14px; border:0; border-radius:10px; background:var(--g800); color:#fff; font:inherit; font-weight:700; font-size:.9rem; cursor:pointer; }
.search-go:hover { background:var(--g700); }
.search-go:focus-visible { outline:3px solid #bdde00; outline-offset:2px; }
.page-404 .sub-main { text-align:center; padding-top:48px; padding-bottom:64px; }
.page-404 .sub-lead { margin:0 auto 18px; }
