:root {
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #171717;
  --muted: #525252;
  --line: #e5e7eb;
  --accent: #9a3412;
  --nav: #111111;
  --nav-text: #f4efe6;
  --wa: #128c7e;
  --ok: #166534;
  --warn: #a16207;
  --bad: #7f1d1d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main { flex: 1 0 auto; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav);
  color: var(--nav-text);
}
.top-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.logo-word { height: 28px; width: auto; display: block; }
nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
nav a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.88;
}
nav a:hover { opacity: 1; text-decoration: underline; }
.cart-link { position: relative; }
.cart-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
  text-decoration: none;
}

.cart-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
  margin-top: 20px;
}
.cart-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cart-summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.cart-total-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #fafafa 0%, #f4f5f7 100%);
  border-bottom: 1px solid var(--line);
}
.cart-total-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.cart-total-amount {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.cart-total-hint {
  margin: 0;
  padding: 10px 20px 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.cart-pay-note {
  margin: 0;
  padding: 14px 20px 18px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
.cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.cart-row-thumb {
  width: 72px;
  flex: 0 0 72px;
  aspect-ratio: 16 / 9;
  background: #e8eaed;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.cart-row-thumb.empty {
  font-size: 0.65rem;
  color: #a3a3a3;
  text-align: center;
  padding: 4px;
}
.cart-row-info { flex: 1 1 160px; min-width: 0; }
.cart-row .meta { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.cart-row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qty-label { font-size: 0.88rem; }
.qty-label input {
  width: 64px;
  margin-left: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.btn-sm { padding: 8px 12px; margin-top: 0; font-size: 0.88rem; }
.cart-form-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  position: sticky;
  top: 72px;
}
.cart-form-wrap h2 { margin: 0 0 12px; font-size: 1.1rem; }
.cart-form-wrap label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.cart-form-wrap input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.cart-form-wrap .btn.wa { width: 100%; margin-top: 4px; }
.cart-form-wrap .hint.field-hint { margin: -6px 0 12px; font-size: 0.85rem; }
.cart-empty { padding: 24px 0; }

.add-cart {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
  margin: 12px 0;
}
.add-cart label { font-size: 0.92rem; }
.add-cart input[type="number"] {
  width: 72px;
  margin-left: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.cart-toast {
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  background: #ecfdf5;
  border-radius: 8px;
  color: var(--ok);
  font-size: 0.92rem;
}
.cart-toast a { color: var(--accent); }

@media (max-width: 860px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-form-wrap { position: static; }
}

.hero, .shop, .ficha, .crumb, .status {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
.hero { padding-top: 32px; padding-bottom: 8px; }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 8px;
}
h1 { font-size: 1.85rem; line-height: 1.15; margin: 0 0 10px; }
.lede { color: var(--muted); margin: 0 0 8px; max-width: 42rem; }

.shop {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding-top: 20px;
  padding-bottom: 48px;
  align-items: start;
}
.filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 64px;
}
.filters h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}
.filters h2 + .filter-list + h2 { margin-top: 18px; }
.filter-list { display: flex; flex-direction: column; gap: 4px; }
.filter-list button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}
.filter-list button:hover,
.filter-list button.active {
  background: #f3f4f6;
}
.filter-list button.active { font-weight: 650; }

.filters-toggle {
  display: none;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 8px 12px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.status { color: var(--muted); padding-top: 8px; padding-bottom: 8px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.card:hover { border-color: #d1d5db; box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
.card .ph-wrap {
  aspect-ratio: 16 / 9;
  background: #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .ph {
  width: 100%;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}
.card .ph.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a3a3a3;
  font-size: 13px;
}
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { font-size: 1rem; margin: 0; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 0.88rem; margin: 0; }
.card .price { font-weight: 700; margin: 6px 0 0; }
.pill {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  width: fit-content;
}
.pill.stock { background: #dcfce7; color: var(--ok); }
.pill.pedido { background: #ffedd5; color: #9a3412; }
.pill.transito { background: #fef3c7; color: var(--warn); }
.pill.agotado { background: #fee2e2; color: var(--bad); }

.crumb { padding-top: 18px; font-size: 0.92rem; color: var(--muted); }
.crumb a { color: var(--accent); }
.ficha {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  padding-top: 8px;
  padding-bottom: 48px;
}
.gallery-main {
  position: relative;
  background: #e8eaed;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.gallery-stage {
  touch-action: pan-y pinch-zoom;
}
.gallery-main img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: transparent;
  display: block;
  mix-blend-mode: multiply;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-nav[hidden] { display: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs button {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #e8eaed;
}
.thumbs button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}
.thumbs button.active { border-color: var(--accent); }
.buy .sku { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.buy .price { font-size: 1.6rem; font-weight: 700; margin: 0 0 8px; }
.buy .badge { margin: 0 0 12px; }
.buy .resumen { color: var(--muted); }
.detalle { margin-top: 18px; }
.detalle p { margin: 0 0 10px; }
.hint { color: var(--muted); font-size: 0.9rem; }

.btn {
  display: inline-block;
  text-decoration: none;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.btn.wa { background: var(--wa); color: #fff; margin-top: 8px; }
.btn.ghost {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  margin-top: 12px;
}
.viewer {
  margin-top: 10px;
  height: 360px;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

footer {
  background: var(--nav);
  color: var(--nav-text);
  width: 100%;
  padding: 28px clamp(20px, 4vw, 48px);
  margin-top: auto;
  flex-shrink: 0;
}
.footer-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px 32px;
  align-items: center;
}
.footer-logo { height: 24px; width: auto; justify-self: start; }
.footer-tagline {
  margin: 0;
  opacity: 0.8;
  font-size: 0.92rem;
  text-align: center;
  justify-self: center;
}
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-self: end;
  justify-content: flex-end;
}
.footer-social a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 0.92rem;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-social a:hover { opacity: 1; text-decoration: underline; }
.ig-icon { flex-shrink: 0; }

@media (max-width: 860px) {
  .shop { grid-template-columns: 1fr; }
  .filters {
    display: none;
    position: static;
  }
  .filters.open { display: block; }
  .filters-toggle { display: inline-block; }
  .filter-list { flex-direction: row; flex-wrap: wrap; }
  .ficha { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .footer-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }
  .footer-logo,
  .footer-tagline,
  .footer-social {
    justify-self: center;
  }
  .footer-social { justify-content: center; }
}
