/* Tienda de herramientas — estilos públicos (mobile-first) */

:root {
  --navy-950: #10201b;
  --navy-900: #182c27;
  --navy-800: #244239;
  --navy-700: #34574b;
  --white: #ffffff;
  --warm: #f3f5f2;
  --sand: #e6ebe7;
  --line: #d9e1da;
  --gold: #f3bd29;
  --gold-soft: #ffda6f;
  --gold-ink: #866000;
  --ink: #1c2922;
  --muted: #607068;
  --whatsapp: #1f8f53;
  --whatsapp-dark: #18774a;
  --danger: #a33a2c;

  --serif: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(11 31 58 / 6%), 0 8px 24px rgb(11 31 58 / 8%);
  --header-h: 60px;
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--warm);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: 0.005em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.icon { width: 20px; height: 20px; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px;
  background: var(--gold); color: var(--navy-950); border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-gold { background: var(--gold); color: var(--navy-950); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-ghost { border-color: rgb(255 255 255 / 45%); color: var(--white); }
.btn-ghost:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.btn-outline { border-color: var(--navy-900); color: var(--navy-900); background: transparent; }
.btn-outline:hover { background: var(--navy-900); color: var(--white); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: var(--whatsapp-dark); }
.btn-whatsapp[aria-disabled="true"] { background: #b9c0c9; color: #f4f6f8; cursor: not-allowed; pointer-events: none; }
.btn-block { width: 100%; }
.link-button {
  background: none; border: 0; padding: 8px; color: var(--muted);
  font-size: 0.875rem; text-decoration: underline; text-underline-offset: 3px;
}
.link-button:hover { color: var(--danger); }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: transparent; color: inherit;
}
.icon-button:hover { background: var(--sand); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  background: var(--navy-900);
  color: var(--white);
  border-bottom: 1px solid rgb(200 169 106 / 25%);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.02em; }
.brand-tag { font-size: 0.62rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold-soft); margin-top: 3px; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.header-link, .cart-button {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 18%); border-radius: 999px;
  background: transparent; color: var(--white);
  font-size: 0.875rem; font-weight: 500; text-decoration: none;
}
.header-link:hover, .cart-button:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.cart-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--gold); color: var(--navy-950);
  font-size: 0.72rem; font-weight: 700;
}
.cart-count[hidden] { display: none; }
.hide-sm { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  color: var(--white);
  background:
    linear-gradient(90deg, rgb(16 32 27 / 97%) 0%, rgb(24 44 39 / 88%) 48%, rgb(24 44 39 / 32%) 100%),
    url('../assets/img/hero.svg') center / cover no-repeat,
    var(--navy-900);
}
.hero-inner { padding-top: 56px; padding-bottom: 56px; }
.hero h1 { font-size: clamp(2.4rem, 8vw, 4.4rem); max-width: 15ch; font-weight: 750; letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--gold-soft); font-weight: inherit; }
.hero-lead { max-width: 46ch; margin: 16px 0 28px; color: rgb(255 253 248 / 82%); font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Catálogo ---------- */

.catalog-toolbar {
  position: sticky; top: var(--header-h); z-index: 20;
  background: rgb(243 245 242 / 96%);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0 0;
}
.search {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px;
  background: var(--white); border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(184 146 79 / 18%); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.search input::placeholder { color: #9198a6; }

.chips {
  display: flex; gap: 8px;
  margin: 0 -16px; padding: 12px 16px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  min-height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--navy-800);
  font-size: 0.875rem; font-weight: 500; white-space: nowrap;
}
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }

.catalog-body { padding-top: 16px; padding-bottom: 48px; min-height: 60vh; }
.catalog-meta { margin: 0 0 8px; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.02em; }

.category-group { margin-top: 20px; }
.category-group + .category-group { margin-top: 40px; }
.category-title {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 1.85rem; color: var(--navy-900);
  padding-bottom: 10px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.category-title span { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; color: var(--gold-ink); }

.product-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  grid-template-areas: "image copy actions";
  align-items: center;
  column-gap: 12px; row-gap: 2px;
  padding: 12px 14px;
}
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: #f9fbf8; }
.row-image { grid-area: image; width: 72px; height: 72px; object-fit: contain; background: #f2f4f3; border-radius: 10px; }
.row-copy { grid-area: copy; min-width: 0; }
.row-name { margin: 0; font-family: var(--sans); font-size: 0.92rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.row-price { margin: 4px 0 0; color: var(--navy-900); display: flex; align-items: baseline; gap: 4px; }
.row-price strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; letter-spacing: 0.01em; }
.row-price span { font-size: 0.75rem; color: var(--muted); }
.row-actions { grid-area: actions; width: 118px; }
.row-gallery { margin-top: 6px; font-size: 0.78rem; color: var(--navy-700); }
.row-gallery summary { cursor: pointer; }
.row-gallery div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.row-gallery img { width: 68px; height: 68px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.tag {
  display: inline-block; vertical-align: 2px; margin-left: 4px;
  padding: 2px 7px; border-radius: 999px;
  background: rgb(184 146 79 / 14%); color: var(--gold-ink);
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}

.btn-add {
  width: 100%; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--navy-900); border-radius: 999px;
  background: var(--navy-900); color: var(--white); font-size: 0.875rem;
}
.btn-add:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-add:disabled, .btn-add:disabled:hover {
  border-color: var(--line, #d8d8d8); background: transparent; color: #8a8a8a; cursor: not-allowed;
}
.tag-out { background: rgb(176 48 48 / 12%); color: #8f2424; }
.row { position: relative; }
.row.is-out .row-image { filter: grayscale(1); }
.out-overlay {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  background: rgb(120 124 128 / 50%);
  pointer-events: none;
}
.out-overlay span {
  padding: 6px 16px; border-radius: 999px;
  background: rgb(40 44 48 / 88%); color: var(--white);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.row-price-ask span { font-size: 0.85rem; font-weight: 600; color: var(--navy-700); }

.stepper {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 40px; border: 1px solid var(--gold); border-radius: 999px; background: #fffaf0;
}
.step {
  display: grid; place-items: center; width: 40px; height: 38px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--navy-900); font-size: 1.2rem; font-weight: 500; line-height: 1;
}
.step:hover { background: rgb(184 146 79 / 16%); }
.step-value { font-size: 0.8rem; font-weight: 600; color: var(--navy-900); white-space: nowrap; }

.status { padding: 8px 0; }
.status[hidden] { display: none; }
.skeleton-list { display: grid; gap: 8px; }
.skeleton { height: 56px; border-radius: var(--radius); background: linear-gradient(90deg, var(--sand), #f7f1e5, var(--sand)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.empty-state {
  margin: 24px 0; padding: 32px 20px; text-align: center;
  background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted);
}
.empty-state[hidden] { display: none; }
.empty-title { font-family: var(--serif); font-size: 1.5rem; color: var(--navy-900); margin: 0 0 6px; }
.empty-title strong { color: var(--gold-ink); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }

/* ---------- Información ---------- */

.info { background: var(--navy-900); color: var(--white); padding: 56px 0; }
.info-inner { display: grid; gap: 32px; }
.info h2 { font-size: clamp(1.9rem, 6vw, 2.6rem); max-width: 20ch; }
.steps { counter-reset: step; list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 12px; }
.steps li {
  counter-increment: step; position: relative; padding-left: 44px; color: rgb(255 253 248 / 80%); font-size: 0.95rem;
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid var(--gold); border-radius: 50%;
  font-family: var(--serif); font-weight: 700; color: var(--gold-soft);
}
.steps strong { color: var(--white); font-weight: 600; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: rgb(255 255 255 / 10%); border-radius: var(--radius-sm); overflow: hidden; }
.facts li { padding: 14px 16px; background: var(--navy-900); font-size: 0.875rem; color: rgb(255 253 248 / 72%); }
.facts span { display: block; margin-bottom: 2px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-soft); }
.info-photo { margin: 0; }
.info-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.info-photo figcaption { margin-top: 10px; font-size: 0.8rem; color: rgb(255 253 248 / 60%); }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-950); color: rgb(255 253 248 / 70%); padding: 32px 0 calc(96px + env(safe-area-inset-bottom)); }
.footer-inner { display: grid; gap: 18px; }
.brand-footer { color: var(--white); }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { text-decoration: none; color: var(--gold-soft); font-size: 0.9rem; }
.footer-links a:hover { text-decoration: underline; }
.footer-note { margin: 0; font-size: 0.78rem; }

/* ---------- Carrito flotante ---------- */

.cart-fab {
  position: fixed; z-index: 25;
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 0 20px;
  border: 1px solid rgb(200 169 106 / 50%); border-radius: 999px;
  background: var(--navy-900); color: var(--white);
  box-shadow: 0 10px 30px rgb(6 18 42 / 35%);
  font-size: 0.95rem;
}
.cart-fab[hidden] { display: none; }
.cart-fab-label { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.cart-fab-count { color: var(--gold-soft); }
.cart-fab strong { font-family: var(--serif); font-size: 1.3rem; color: var(--gold-soft); }

/* ---------- Panel del pedido ---------- */

.cart-drawer {
  margin: auto 0 0; padding: 0; border: 0;
  width: 100%; max-width: 100%; max-height: 92dvh; height: 92dvh;
  border-radius: 20px 20px 0 0;
  background: var(--white); color: var(--ink);
}
.cart-drawer::backdrop { background: rgb(6 18 42 / 55%); }
.drawer-inner { display: flex; flex-direction: column; height: 100%; }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line);
}
.drawer-header h2 { font-size: 1.8rem; color: var(--navy-900); }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px; overscroll-behavior: contain; }
.cart-empty { padding: 48px 0; text-align: center; color: var(--muted); }
.cart-empty[hidden] { display: none; }
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-item {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.cart-item-name { margin: 0; font-weight: 500; font-size: 0.95rem; line-height: 1.35; }
.cart-item-price { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); }
.cart-item .remove { align-self: start; width: 34px; height: 34px; color: var(--muted); }
.cart-item .remove .icon { width: 16px; height: 16px; }
.stepper-sm { justify-self: start; }
.qty-field { display: inline-flex; align-items: baseline; gap: 4px; font-size: 0.875rem; font-weight: 600; color: var(--navy-900); }
.qty-field input {
  width: 4.2ch; padding: 4px 2px; border: 0; border-bottom: 1px dashed var(--gold);
  background: transparent; text-align: center; font-weight: 600; color: var(--navy-900);
}
.qty-field input:focus { outline: 0; border-bottom-style: solid; }
.cart-item-subtotal { font-family: var(--serif); font-size: 1.25rem; color: var(--navy-900); justify-self: end; }

.drawer-footer {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--warm);
  display: grid; gap: 12px;
}
.notice {
  margin: 0; padding: 10px 12px;
  border-left: 3px solid var(--gold); border-radius: 6px;
  background: #fff7e6; color: #5b4a26; font-size: 0.82rem; line-height: 1.4;
}
.cart-total { display: flex; align-items: baseline; justify-content: space-between; }
.cart-total span { color: var(--muted); font-size: 0.9rem; }
.cart-total strong { font-family: var(--serif); font-size: 1.9rem; color: var(--navy-900); }
.drawer-footer .link-button { justify-self: center; }
.drawer-footer .link-button[hidden] { display: none; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 16px;
  border-radius: 999px; background: var(--navy-950); color: var(--white);
  font-size: 0.85rem; box-shadow: var(--shadow); text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- Pantallas medianas y grandes ---------- */

@media (min-width: 600px) {
  .container { padding: 0 24px; }
  .chips { margin: 0 -24px; padding: 12px 24px; }
  .hide-sm { display: inline; }
  .row { padding: 12px 18px; }
  .row-actions { width: 132px; }
  .facts { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  :root { --header-h: 68px; }
  .hero-inner { padding-top: 96px; padding-bottom: 96px; }
  .catalog-toolbar .container { display: flex; align-items: center; gap: 16px; }
  .search { flex: 0 0 340px; }
  .chips { flex: 1; margin: 0; padding: 12px 0; }
  .catalog-toolbar { padding: 0; }
  .row {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    grid-template-areas: "image copy actions";
    column-gap: 24px; padding: 10px 20px;
  }
  .row-image { width: 88px; height: 88px; }
  .row-name { font-size: 0.95rem; }
  .info { padding: 88px 0; }
  .info-inner { grid-template-columns: 1.4fr 1fr; align-items: center; gap: 64px; }
  .footer-inner { grid-template-columns: auto 1fr; align-items: center; }
  .footer-links { justify-content: flex-end; }
  .footer-note { grid-column: 1 / -1; }
  .site-footer { padding-bottom: 32px; }

  .cart-fab { left: auto; right: 24px; bottom: 24px; min-width: 320px; }
  .toast { bottom: 100px; }

  .cart-drawer {
    margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: 440px;
    border-radius: 0;
  }
}
