:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --ink: #1d1b26;
  --ink-2: #4a4757;
  --muted: #7a7686;
  --line: #ebe4da;
  --accent: #e8573d;
  --accent-soft: #fde6df;
  --gold: #f4b63f;
  --wa: #1a9e4f;
  --wa-dark: #15853f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 27, 38, .05), 0 6px 20px rgba(29, 27, 38, .06);
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico-wa, .fab-wa svg { fill: currentColor; stroke: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover:not(:disabled) { background: #36323f; }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-dark); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--lg { min-height: 54px; font-size: 1.05rem; }
.btn--block { display: flex; width: 100%; }
.btn--grow { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg);
  font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--line); }
.link-btn { background: none; border: 0; padding: 8px; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .9rem; }
.link-btn:hover { color: var(--ink); }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 247, 242, .88); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.35rem var(--font-display); letter-spacing: -.02em; }
.brand img { height: 38px; width: auto; }
.brand__mark { width: 34px; height: 34px; }
.topbar__nav { display: none; gap: 24px; margin-left: auto; }
.topbar__nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.topbar__nav a:hover { color: var(--ink); }
@media (min-width: 720px) { .topbar__nav { display: flex; } }
.cart-btn {
  margin-left: auto; position: relative; display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--ink); color: #fff;
  font-weight: 600; cursor: pointer;
}
@media (min-width: 720px) { .cart-btn { margin-left: 8px; } }
.cart-btn__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent);
  font-size: .78rem; display: grid; place-items: center;
}
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 36px; }
.hero__in { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 72px 0 60px; } .hero__in { grid-template-columns: 1.25fr 1fr; gap: 56px; } }
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: #b8391f; font-weight: 600; font-size: .85rem;
}
.hero h1 { font-size: clamp(2.6rem, 9vw, 4.6rem); font-weight: 800; }
.hero h1 span { color: var(--accent); }
.hero__desc { font-size: 1.08rem; color: var(--ink-2); max-width: 54ch; margin: 18px 0 26px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.steps { list-style: none; margin: 0; padding: 22px; display: grid; gap: 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps b {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); font: 800 1rem var(--font-display);
}
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: .93rem; }

/* ---------- Catálogo ---------- */
.catalog { padding: 28px 0 56px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .catalog { padding: 48px 0 72px; } }
.catalog__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 18px; }
.catalog__head p { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted);
}
.search:focus-within { border-color: var(--ink); background: #fff; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); height: 100%; }
.toolbar select {
  flex: 0 1 auto; height: 48px; padding: 0 38px 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7686' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
  appearance: none; cursor: pointer; max-width: 100%;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .chips { flex-wrap: wrap; overflow: visible; padding: 2px 0 12px; margin: 0 0 10px; } }
.chip {
  flex-shrink: 0; height: 38px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 500; font-size: .92rem; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip small { opacity: .6; margin-left: 4px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }

.card {
  position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__open { all: unset; cursor: pointer; display: flex; flex-direction: column; flex: 1; }
.card__open:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.card__img { position: relative; aspect-ratio: 1; background: var(--bg); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card__img img { transform: scale(1.04); }
.card__badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.badge--hot { background: var(--accent); color: #fff; }
.badge--out { background: var(--ink); color: #fff; }
.badge--photos { position: absolute; right: 8px; bottom: 8px; background: rgba(29,27,38,.72); color: #fff; box-shadow: none; }
.card__body { padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card__code { font-size: .72rem; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.card__name {
  font-weight: 600; font-size: .95rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__price { margin-top: auto; padding-top: 6px; font: 800 1.2rem var(--font-display); }
.card__add {
  margin: 6px 12px 12px; height: 40px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: #fff; font-weight: 600; font-size: .9rem; cursor: pointer; transition: background-color .15s, color .15s;
}
.card__add:hover:not(:disabled) { background: var(--ink); color: #fff; }
.card__add.is-in { background: var(--ink); color: #fff; }
.card__add:disabled { border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.card.is-out .card__img img, .card.is-out .ph { opacity: .5; filter: grayscale(.6); }

/* Imagen de relleno cuando aún no hay foto */
.ph { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--ph-ink); background: var(--ph-bg); text-align: center; padding: 12px; }
.ph svg { width: 44%; height: auto; max-width: 110px; stroke-width: 1.4; }
.ph span { font-size: .78rem; font-weight: 600; opacity: .8; }

.empty { text-align: center; padding: 48px 16px; }
.empty p { margin: 0 0 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- Contacto ---------- */
.contact { padding: 56px 0; }
.contact__in { display: grid; gap: 32px; }
@media (min-width: 820px) { .contact__in { grid-template-columns: 1fr 1fr; align-items: center; } }
.contact p { margin: 10px 0 22px; }
.contact__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact__list li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.contact__list li > svg { color: var(--accent); }
.contact__list a { text-decoration: none; font-weight: 600; }
.contact__list a:hover { text-decoration: underline; }
.contact__list small { display: block; color: var(--muted); font-size: .8rem; }

.footer { padding: 24px 0 96px; border-top: 1px solid var(--line); font-size: .88rem; }
.footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

.fab-wa {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(26, 158, 79, .4);
  transition: transform .15s;
}
.fab-wa:hover { transform: scale(1.06); }
.fab-wa svg { width: 30px; height: 30px; }

/* ---------- Modal de producto ---------- */
dialog { padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: rgba(29, 27, 38, .55); backdrop-filter: blur(2px); }
.modal {
  width: min(960px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border-radius: 20px; overflow: auto;
  background: #fff; overscroll-behavior: contain;
}
.modal[open] { animation: pop .22s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal__close { position: absolute; top: 10px; right: 10px; z-index: 3; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.modal__body { display: grid; }
@media (min-width: 800px) { .modal__body { grid-template-columns: 1.05fr 1fr; } }
.gallery { background: #fff; min-width: 0; }
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track > * { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1; }
.gallery__track img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.gallery__thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery__thumbs:empty { display: none; }
.gallery__thumbs button { flex: 0 0 58px; height: 58px; padding: 0; border-radius: 8px; border: 2px solid transparent; overflow: hidden; cursor: pointer; background: #fff; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--ink); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail { padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (min-width: 800px) { .detail { padding: 36px 32px 28px; } }
.detail__meta { display: flex; align-items: center; gap: 10px; margin: 0; flex-wrap: wrap; }
.tag { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: #b8391f; font-size: .8rem; font-weight: 600; }
.code { font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.detail h3 { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 800; padding-right: 36px; }
.detail__price { margin: 0; font: 800 2rem var(--font-display); }
.detail__stock { margin: 0; font-size: .9rem; font-weight: 600; color: var(--wa-dark); }
.detail__stock.is-low { color: #b8391f; }
.detail__stock.is-out { color: var(--muted); }
.detail__stock:empty { display: none; }
.detail__desc { margin: 0; color: var(--ink-2); white-space: pre-line; }
.detail__desc:empty { display: none; }
.detail__specs { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .92rem; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail__specs:empty { display: none; }
.detail__specs dt { color: var(--muted); }
.detail__specs dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.detail__actions { display: flex; gap: 10px; margin-top: 6px; }
.detail .link-btn { align-self: center; }
.qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; height: 46px; }
.qty button { width: 40px; height: 100%; border: 0; background: none; font-size: 1.3rem; cursor: pointer; border-radius: 999px; }
.qty button:disabled { opacity: .3; cursor: default; }
.qty output { min-width: 26px; text-align: center; font-weight: 700; }
.qty--sm { height: 36px; }
.qty--sm button { width: 32px; font-size: 1.1rem; }

/* ---------- Carrito ---------- */
.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100%); max-width: 100%;
  background: #fff; display: none; flex-direction: column;
}
.drawer[open] { display: flex; animation: slide .25s ease; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h3 { font-size: 1.4rem; }
.drawer__items { flex: 1; overflow-y: auto; padding: 8px 20px; overscroll-behavior: contain; }
.drawer__empty { flex: 1; padding: 40px 24px; text-align: center; }
.drawer__empty p { margin: 0 0 6px; }
.drawer__empty .btn { margin-top: 16px; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line:last-child { border-bottom: 0; }
.line__img { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--bg); cursor: pointer; border: 0; padding: 0; }
.line__img img { width: 100%; height: 100%; object-fit: cover; }
.line__img .ph svg { width: 60%; }
.line__img .ph span { display: none; }
.line__name { font-weight: 600; font-size: .92rem; line-height: 1.3; margin: 0 0 2px; }
.line__code { font-size: .75rem; color: var(--muted); font-weight: 600; }
.line__controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.line__price { font-weight: 700; text-align: right; white-space: nowrap; }
.line__remove { background: none; border: 0; color: var(--muted); font-size: .8rem; text-decoration: underline; cursor: pointer; padding: 4px; }
.drawer__foot { border-top: 1px solid var(--line); padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; background: var(--bg); }
.drawer__foot .link-btn { justify-self: center; padding: 2px; }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.total strong { font: 800 1.6rem var(--font-display); }
.field { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font-weight: 400; font-size: 16px; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--ink); }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed; inset: auto auto calc(88px + env(safe-area-inset-bottom)) 50%; margin: 0; border: 0; overflow: visible; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 500; font-size: .92rem;
  box-shadow: var(--shadow); transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* En celular los pasos se muestran compactos para llegar rápido al catálogo */
@media (max-width: 599px) {
  .hero { padding: 28px 0 24px; }
  .hero__desc { font-size: 1rem; margin: 14px 0 20px; }
  .steps { padding: 14px; gap: 10px; grid-template-columns: repeat(3, 1fr); }
  .steps li { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .steps b { width: 30px; height: 30px; font-size: .9rem; }
  .steps strong { font-size: .82rem; line-height: 1.25; }
  .steps span { display: none; }
}

/* ---------- Ajustes ---------- */
[hidden] { display: none !important; }
.btn--tiktok { background: #000; color: #fff; }
.btn--tiktok:hover { background: #222; }
.btn--tiktok img { width: 22px; height: 22px; border-radius: 5px; }
.contact__list .ico-img { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; }
