/* ==========================================================================
   CerveShop — Tienda (catálogo, carrito, checkout, cuenta)
   Identidad: marrón oscuro, ámbar #f59e0b, naranja #ff6600, Baloo 2.
   Mobile-first.
   ========================================================================== */

:root {
  --bg: #160c03;
  --bg-2: #1a0f00;
  --surface: #24150a;
  --surface-2: #2d1810;
  --surface-3: #3d2415;
  --border: rgba(245, 158, 11, 0.16);
  --border-strong: rgba(245, 158, 11, 0.4);
  --text: #fbf3e4;
  --muted: #c9b79c;
  --faint: #8f7c62;
  --amber: #f59e0b;
  --amber-2: #fbbf24;
  --orange: #ff6600;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --wa: #25d366;
  --wa-dark: #128c7e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-head: "Baloo 2", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
  --container: 1240px;
}

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

html { -webkit-text-size-adjust: 100%; }

body.shop {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.shop main { flex: 1; }

.shop a { color: var(--amber); text-decoration: none; }
.shop a:hover { color: var(--amber-2); }
.shop img { max-width: 100%; display: block; }
.shop h1, .shop h2, .shop h3, .shop h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.shop h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.shop h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.shop h3 { font-size: 1.15rem; }
.shop p { margin: 0 0 0.75rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.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; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.shop .btn-primary, .btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--orange));
  color: #1a0f00;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.3);
}
.shop .btn-primary:hover { color: #1a0f00; box-shadow: 0 10px 28px rgba(245, 158, 11, 0.45); }
.shop .btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.shop .btn-outline:hover { border-color: var(--amber); color: var(--amber); }
.shop .btn-ghost { background: transparent; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 600; padding-inline: 0.75rem; }
.shop .btn-ghost:hover { color: var(--amber); }
.shop .btn-wa { background: var(--wa); color: #fff; }
.shop .btn-wa:hover { background: var(--wa-dark); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0.35rem 0.9rem; font-size: 0.82rem; }
.btn-lg { min-height: 52px; padding: 0.8rem 1.75rem; font-size: 1.05rem; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(26, 15, 0, 0.35);
  border-top-color: #1a0f00;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-outline.is-loading::after { border-color: rgba(245, 158, 11, 0.3); border-top-color: var(--amber); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 12, 3, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text) !important; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--amber); letter-spacing: 0.01em; }
.header-search { position: relative; max-width: 560px; width: 100%; justify-self: center; }
.header-search input {
  width: 100%;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0 46px 0 18px;
  font-size: 0.95rem;
}
.header-search input::placeholder { color: var(--faint); }
.header-search input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.header-search button {
  position: absolute; right: 4px; top: 4px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--amber); color: #1a0f00; cursor: pointer;
}
.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--text) !important; cursor: pointer; font-size: 1.15rem;
}
.icon-btn:hover { background: var(--amber-soft); color: var(--amber) !important; }
.cart-badge {
  position: absolute; top: 3px; right: 1px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px;
  background: var(--orange); color: #fff;
  font-size: 0.7rem; font-weight: 800; line-height: 19px; text-align: center;
  font-family: var(--font-body);
}
.cart-badge[data-count="0"] { display: none; }
.cart-badge.bump { animation: bump 0.4s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }

.cat-nav { border-top: 1px solid var(--border); }
.cat-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.cat-nav ul::-webkit-scrollbar { display: none; }
.cat-nav > .container > ul > li { position: relative; }
.cat-nav a.cat-link {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600; font-size: 0.9rem; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.cat-nav a.cat-link:hover, .cat-nav a.cat-link.active { color: var(--amber); border-bottom-color: var(--amber); }
.cat-nav a.cat-link i { font-size: 0.85rem; opacity: 0.8; }
.cat-dropdown {
  display: none;
  position: absolute; top: 100%; left: 0; min-width: 230px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
.cat-dropdown a { display: block; padding: 8px 12px; color: var(--text); border-radius: 8px; font-size: 0.9rem; }
.cat-dropdown a:hover { background: var(--amber-soft); color: var(--amber); }
@media (hover: hover) and (min-width: 900px) {
  .cat-nav ul { overflow: visible; }
  .cat-nav > .container > ul > li:hover .cat-dropdown,
  .cat-nav > .container > ul > li:focus-within .cat-dropdown { display: block; }
}

.mobile-search { display: none; padding-bottom: 10px; }
@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .header-main { grid-template-columns: auto 1fr; }
  .header-main .header-search { display: none; }
  .header-actions { justify-self: end; }
  .mobile-search { display: block; }
  .mobile-search .header-search { display: block; max-width: none; }
  .brand img { width: 38px; height: 38px; }
  .brand-name { font-size: 1.2rem; }
  .hide-mobile { display: none !important; }
}

/* ---------- Avisos ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 14px; font-size: 0.93rem;
}
.notice i { margin-top: 3px; }
.notice-success { border-color: rgba(52, 211, 153, 0.35); background: var(--success-soft); }
.notice-success i { color: var(--success); }
.notice-error { border-color: rgba(248, 113, 113, 0.4); background: var(--danger-soft); }
.notice-error i { color: var(--danger); }
.notice-info { border-color: rgba(96, 165, 250, 0.35); background: rgba(96, 165, 250, 0.1); }
.notice-info i { color: var(--info); }
.notice-warning { border-color: var(--border-strong); background: var(--amber-soft); }
.notice-warning i { color: var(--amber); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

/* Toasts (reemplazan alert()) */
.toast-stack {
  position: fixed; z-index: 200;
  left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 0.93rem;
  animation: toast-in 0.25s ease;
}
.toast.success { border-color: rgba(52, 211, 153, 0.5); }
.toast.success i { color: var(--success); }
.toast.error { border-color: rgba(248, 113, 113, 0.6); }
.toast.error i { color: var(--danger); }
.toast.leaving { animation: toast-out 0.25s ease forwards; }
.toast a { font-weight: 700; margin-left: auto; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

/* ---------- Migas y encabezados de página ---------- */
.breadcrumbs { font-size: 0.85rem; color: var(--faint); padding: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { opacity: 0.5; }
.page-head { padding: 6px 0 18px; }
.page-head p { color: var(--muted); max-width: 70ch; }

/* ---------- Catálogo ---------- */
.catalog-layout { display: grid; grid-template-columns: 1fr; gap: 24px; padding-bottom: 48px; }
@media (min-width: 960px) { .catalog-layout { grid-template-columns: 260px 1fr; } }

.filters {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; align-self: start;
}
@media (min-width: 960px) { .filters { position: sticky; top: calc(var(--header-h) + 54px); max-height: calc(100vh - var(--header-h) - 70px); overflow: auto; } }
.filters h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--amber); margin: 14px 0 8px; }
.filters h3:first-child { margin-top: 0; }
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list li a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text); font-size: 0.92rem; }
.filter-list li a:hover { background: var(--amber-soft); }
.filter-list li a.active { background: var(--amber-soft); color: var(--amber); font-weight: 700; }
.filter-list .sub a { padding-left: 22px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; padding: 5px 4px; font-size: 0.92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--amber); }
.brand-filter { max-height: 260px; overflow: auto; }
.filters-toggle { display: none; }
.filters-close { display: none; }
@media (max-width: 959px) {
  .filters-toggle { display: inline-flex; }
  .filters {
    position: fixed; inset: 0 auto 0 0; z-index: 120;
    width: min(340px, 88vw); border-radius: 0; overflow: auto;
    transform: translateX(-105%); transition: transform 0.25s ease;
  }
  .filters.open { transform: none; }
  .filters-close { display: inline-flex; float: right; }
}
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 110; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.backdrop.show { opacity: 1; pointer-events: auto; }

.catalog-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.catalog-toolbar .count { color: var(--muted); font-size: 0.92rem; }
.select, .input, .textarea {
  min-height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 0.55rem 0.8rem; font-size: 0.95rem; font-family: inherit; width: 100%;
}
.select { width: auto; padding-right: 2rem; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.textarea { min-height: 90px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.83rem;
  background: var(--amber-soft); color: var(--amber) !important; border: 1px solid var(--border-strong);
}

.product-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.catalog-layout .product-grid { }
@media (min-width: 960px) and (max-width: 1199px) { .catalog-layout .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.product-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.15s, transform 0.15s;
  min-width: 0;
}
.product-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.product-card .thumb { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .badges { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(22, 12, 3, 0.85); color: var(--text); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-amber { background: var(--amber); color: #1a0f00; border-color: var(--amber); }
.badge-ok { color: var(--success); border-color: rgba(52, 211, 153, 0.4); }
.badge-low { color: var(--amber); border-color: var(--border-strong); }
.badge-out { color: var(--danger); border-color: rgba(248, 113, 113, 0.5); }
.badge-draft { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.product-card .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .brand-line { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 700; }
.product-card h3 { font-size: 1.02rem; margin: 0; }
.product-card h3 a { color: var(--text); }
.product-card h3 a:hover { color: var(--amber); }
.spec-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.spec-pill { font-size: 0.72rem; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.product-card .price { margin-top: auto; font-family: var(--font-head); font-weight: 800; color: var(--amber); font-size: 1.12rem; line-height: 1.2; }
.product-card .price small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.75rem; color: var(--faint); }
.product-card .actions { padding: 0 12px 12px; }
@media (max-width: 400px) {
  .product-grid { gap: 10px; }
  .product-card .body { padding: 10px; }
  .product-card h3 { font-size: 0.95rem; }
}

/* Imagen genérica cuando el producto no tiene foto */
.placeholder-art {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 224, 102, 0.22), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(255, 102, 0, 0.2), transparent 55%),
    linear-gradient(160deg, #3d2415, #24150a);
  color: var(--amber); text-align: center; padding: 10px;
}
.placeholder-art i { font-size: 2.2rem; opacity: 0.9; }
.placeholder-art span { font-family: var(--font-head); font-weight: 800; font-size: 0.95rem; color: var(--text); line-height: 1.1; max-width: 90%; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border); color: var(--text); padding: 0 10px;
}
.pagination .current { background: var(--amber); color: #1a0f00; border-color: var(--amber); font-weight: 800; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state i { font-size: 2.6rem; color: var(--amber); opacity: 0.8; margin-bottom: 12px; }

/* Tarjetas de categoría */
.cat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.cat-card {
  position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text) !important;
}
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.cat-card:hover img { transform: scale(1.05); }
.cat-card .cat-label {
  position: absolute; inset: auto 0 0 0; padding: 30px 12px 12px;
  background: linear-gradient(transparent, rgba(22, 12, 3, 0.92));
  font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; line-height: 1.1;
}
.cat-card .cat-label small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.78rem; color: var(--muted); }

/* ---------- Ficha de producto ---------- */
.product-page { display: grid; grid-template-columns: 1fr; gap: 24px; padding-bottom: 48px; }
@media (min-width: 900px) { .product-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; } }
.gallery-main { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .placeholder-art i { font-size: 4rem; }
.gallery-main .placeholder-art span { font-size: 1.5rem; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs button { flex: 0 0 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: none; cursor: pointer; }
.gallery-thumbs button.active { border-color: var(--amber); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info .brand-line { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--faint); }
.product-info .sku { font-size: 0.8rem; color: var(--faint); }
.product-info .lead { color: var(--muted); font-size: 1rem; }
.price-big { font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--amber); line-height: 1.1; }
.price-big small { font-size: 1rem; color: var(--muted); font-weight: 600; }

.variant-options { display: grid; gap: 8px; margin: 12px 0 16px; }
.variant-option { position: relative; }
.variant-option input { position: absolute; opacity: 0; }
.variant-option label {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
}
.variant-option label .v-name { font-weight: 700; }
.variant-option label .v-sub { display: block; font-size: 0.8rem; color: var(--faint); font-weight: 400; }
.variant-option label .v-price { font-family: var(--font-head); font-weight: 800; color: var(--amber); white-space: nowrap; }
.variant-option input:checked + label { border-color: var(--amber); background: var(--amber-soft); box-shadow: 0 0 0 1px var(--amber) inset; }
.variant-option input:focus-visible + label { outline: 2px solid var(--amber); outline-offset: 2px; }
.variant-option input:disabled + label { opacity: 0.5; cursor: not-allowed; }

.qty-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.qty-stepper {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; background: var(--surface);
  height: 48px;
}
.qty-stepper button { width: 44px; border: 0; background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.qty-stepper button:hover { background: var(--amber-soft); color: var(--amber); }
.qty-stepper input {
  width: 74px; border: 0; background: transparent; color: var(--text); text-align: center;
  font-size: 1.05rem; font-weight: 700; font-family: var(--font-body);
}
.qty-stepper input:focus { outline: none; }
.qty-stepper .unit { display: flex; align-items: center; padding-right: 12px; color: var(--muted); font-size: 0.85rem; }
.qty-stepper.sm { height: 38px; }
.qty-stepper.sm button { width: 34px; }
.qty-stepper.sm input { width: 54px; font-size: 0.95rem; }
.qty-hint { font-size: 0.83rem; color: var(--faint); margin-top: 6px; }
.line-preview { margin-top: 10px; font-size: 0.95rem; color: var(--muted); }
.line-preview strong { color: var(--text); }
.qty-row .btn-primary { flex: 1; min-width: 180px; height: 48px; }

.stock-line { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 600; margin: 4px 0 10px; }
.stock-line.disponible { color: var(--success); }
.stock-line.pocas { color: var(--amber); }
.stock-line.agotado { color: var(--danger); }

.spec-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.spec-table th, .spec-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table th { color: var(--muted); font-weight: 600; width: 46%; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 1.15rem; }
.description { white-space: pre-line; color: var(--muted); }
.help-box { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.9rem; }
.help-box i { font-size: 1.6rem; color: var(--wa); }

/* ---------- Carrito ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr; gap: 20px; padding-bottom: 48px; }
@media (min-width: 960px) { .cart-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.cart-lines { display: flex; flex-direction: column; gap: 10px; }
.cart-line {
  display: grid; grid-template-columns: 72px 1fr; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
}
.cart-line.has-error { border-color: rgba(248, 113, 113, 0.6); }
.cart-line .thumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .thumb .placeholder-art i { font-size: 1.4rem; }
.cart-line .thumb .placeholder-art span { display: none; }
.cart-line .info { min-width: 0; }
.cart-line .name { font-weight: 700; color: var(--text); display: block; }
.cart-line .variant { font-size: 0.85rem; color: var(--muted); }
.cart-line .controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cart-line .line-total { font-family: var(--font-head); font-weight: 800; color: var(--amber); font-size: 1.1rem; }
.cart-line .line-error { color: var(--danger); font-size: 0.85rem; margin-top: 6px; }
.remove-btn { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 0.85rem; padding: 6px; }
.remove-btn:hover { color: var(--danger); }
.summary { position: sticky; top: calc(var(--header-h) + 60px); }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 0.95rem; }
.summary-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; }
.summary-row.total span:last-child { color: var(--amber); }
.summary .note { font-size: 0.83rem; color: var(--faint); margin-top: 8px; }

/* Cajón lateral del carrito */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 130;
  width: min(420px, 100%); background: var(--bg-2); border-left: 1px solid var(--border);
  transform: translateX(105%); transition: transform 0.25s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
.drawer-body { flex: 1; overflow: auto; padding: 12px 16px; }
.drawer-foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); display: grid; gap: 8px; }
.drawer .cart-line { grid-template-columns: 56px 1fr; padding: 10px; }
.drawer .cart-line .thumb { width: 56px; height: 56px; }

/* ---------- Checkout ---------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; }
.field .req { color: var(--orange); }
.field .hint { font-size: 0.8rem; color: var(--faint); margin-top: 4px; }
.field .error { font-size: 0.83rem; color: var(--danger); margin-top: 4px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.field .select { width: 100%; }
.option-cards { display: grid; gap: 8px; }
.option-card { position: relative; }
.option-card input { position: absolute; opacity: 0; }
.option-card label {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer;
}
.option-card label i { color: var(--amber); font-size: 1.2rem; width: 24px; text-align: center; }
.option-card label .t { font-weight: 700; display: block; }
.option-card label .d { font-size: 0.83rem; color: var(--faint); }
.option-card label .c { font-weight: 700; font-size: 0.9rem; color: var(--muted); text-align: right; }
.option-card input:checked + label { border-color: var(--amber); background: var(--amber-soft); box-shadow: 0 0 0 1px var(--amber) inset; }
.option-card input:focus-visible + label { outline: 2px solid var(--amber); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; margin-bottom: 10px; padding: 0; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--amber); color: #1a0f00;
  font-size: 0.9rem; margin-right: 6px;
}
.mini-lines { list-style: none; margin: 0 0 8px; padding: 0; font-size: 0.9rem; }
.mini-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.mini-lines li span:first-child { color: var(--muted); }

/* ---------- Pedido ---------- */
.order-hero { text-align: center; padding: 26px 16px; }
.order-hero .num { font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--amber); letter-spacing: 0.02em; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 700; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
}
.status-pendiente { color: var(--amber); }
.status-confirmado, .status-preparacion, .status-listo_retiro, .status-enviado { color: var(--info); border-color: rgba(96, 165, 250, 0.45); }
.status-entregado { color: var(--success); border-color: rgba(52, 211, 153, 0.45); }
.status-cancelado { color: var(--danger); border-color: rgba(248, 113, 113, 0.45); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 0.9rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--border-strong); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: 0.8rem; color: var(--faint); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; }

/* ---------- Cuenta ---------- */
.auth-box { max-width: 460px; margin: 24px auto 56px; }
.account-layout { display: grid; gap: 20px; padding-bottom: 48px; }
@media (min-width: 900px) { .account-layout { grid-template-columns: 240px 1fr; align-items: start; } }
.account-nav { display: flex; flex-direction: column; gap: 2px; }
.account-nav a { padding: 10px 12px; border-radius: 10px; color: var(--text); display: flex; gap: 10px; align-items: center; }
.account-nav a.active, .account-nav a:hover { background: var(--amber-soft); color: var(--amber); }
@media (max-width: 899px) { .account-nav { flex-direction: row; overflow-x: auto; } .account-nav a { white-space: nowrap; } }

/* ---------- Pie y WhatsApp flotante ---------- */
.site-footer { background: #0f0802; border-top: 1px solid var(--border); padding: 36px 0 24px; margin-top: 24px; font-size: 0.92rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h4 { font-size: 1rem; color: var(--amber); margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--amber); }
.footer-hours { white-space: pre-line; color: var(--muted); }
.social { display: flex; gap: 8px; margin-top: 10px; }
.social a { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--amber); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; color: var(--faint); font-size: 0.83rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

.wa-float {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wa); color: #fff !important; font-size: 1.9rem;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: transform 0.15s;
}
.wa-float:hover { transform: scale(1.07); }
body.has-sticky-bar .wa-float { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
/* Carrito, compra y pedido ya tienen su propio botón de WhatsApp: el flotante tapaba totales */
@media (max-width: 959px) { body.page-cart .wa-float, body.page-checkout .wa-float, body.page-order .wa-float { display: none; } }

/* Barra fija inferior en móvil (ficha de producto / carrito) */
.sticky-bar { display: none; }
@media (max-width: 760px) {
  .sticky-bar {
    display: flex; gap: 10px; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(22, 12, 3, 0.97); border-top: 1px solid var(--border);
  }
  .sticky-bar .sb-total { font-family: var(--font-head); font-weight: 800; color: var(--amber); font-size: 1.15rem; line-height: 1.1; }
  .sticky-bar .sb-total small { display: block; font-family: var(--font-body); font-size: 0.72rem; color: var(--faint); font-weight: 500; }
  .sticky-bar .btn { flex: 1; }
  body.has-sticky-bar main { padding-bottom: 76px; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Los hijos de grillas no deben ensancharse por su contenido (tablas, textos largos) */
.catalog-layout > *, .cart-layout > *, .product-page > *, .account-layout > *, .footer-grid > * { min-width: 0; }
@media (max-width: 560px) {
  .data-table .col-price { display: none; }
  .data-table th, .data-table td { padding: 8px 6px; }
}

/* Mapa de ubicación de entrega (checkout) */
.delivery-map { height: 320px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); overflow: hidden; z-index: 0; }
@media (max-width: 760px) { .delivery-map { height: 280px; } }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.map-tools .btn-ghost { text-transform: none; }
.map-status { font-size: 0.85rem; color: var(--faint); margin-top: 8px; }
.map-status.ok { color: var(--success); }
.map-status.error { color: var(--danger); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-container a { color: #0078a8; }

/* Pedido: etapas que ve el cliente */
.order-steps { list-style: none; display: flex; justify-content: center; gap: 0; margin: 16px auto 10px; padding: 0; max-width: 520px; counter-reset: step; }
.order-steps li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--faint); min-width: 0; }
.order-steps li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 3px; background: var(--border-strong); z-index: 0; }
.order-steps li:first-child::before { display: none; }
.order-steps li.is-done::before, .order-steps li.is-current::before { background: var(--success); }
.order-steps .dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--border-strong); color: #0b1f17; font-size: 0.75rem; }
.order-steps .is-done .dot { background: var(--success); border-color: var(--success); }
.order-steps .is-current .dot { border-color: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); background: var(--amber); }
.order-steps .is-current .lbl { color: var(--text); font-weight: 700; }
.order-steps .is-done .lbl { color: var(--muted); }
.order-steps .lbl { text-align: center; line-height: 1.2; }
.order-msg { max-width: 52ch; margin: 6px auto 14px; color: var(--text); }

/* Ficha: cantidades rápidas (productos por peso) */
.qty-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.qty-presets[hidden] { display: none; }
.qty-presets .chip { cursor: pointer; padding: 7px 14px; font-size: 0.9rem; font-weight: 600; font-family: inherit; }
.qty-presets .chip:hover { border-color: var(--amber); }
.qty-presets .chip.is-active { background: var(--amber); color: #1a0f05 !important; border-color: var(--amber); }

/* Descripción de categoría: 2 líneas en el celular, "Ver más" para el resto */
@media (max-width: 759px) {
  [data-clamp].is-clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.link-more { background: none; border: 0; padding: 2px 0; color: var(--amber); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.link-more[hidden] { display: none; }

/* Catálogo en el celular: "Filtros" y "Ordenar" en la misma fila; el conteo debajo */
@media (max-width: 959px) {
  .catalog-toolbar { gap: 8px; }
  .catalog-toolbar form { order: 2; margin-left: auto; }
  .catalog-toolbar .select { padding-block: 0.45rem; font-size: 0.9rem; }
  .catalog-toolbar .count { order: 3; width: 100%; font-size: 0.85rem; }
}
