/* Articuario — estilos (primero móvil) */
:root {
  --bg: #f6f1e9;
  --paper: #fffdf9;
  --ink: #2b2622;
  --muted: #7a6f65;
  --line: #e4dccf;
  --accent: #a4472f;      /* terracota */
  --accent-2: #86391f;
  --sage: #5f6f55;
  --wa: #1f9d57;
  --gold: #b08a3e;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(60, 40, 20, .08);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .1s, background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 22px; height: 22px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--call { background: var(--ink); color: #fff; }
.btn--danger { background: transparent; border-color: #d9b2a6; color: #a33a1f; }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Cabecera del catálogo ---------- */
.hero { text-align: center; padding: 34px 20px 18px; }
.brand { font-family: var(--serif); font-size: 38px; font-weight: 600; text-decoration: none; letter-spacing: -.01em; color: var(--ink); }
.brand::first-letter { color: var(--accent); }
.brand--small { font-size: 22px; }
.hero__tagline { margin: 2px 0 0; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 17px; }
.hero__intro { max-width: 560px; margin: 12px auto 0; color: var(--muted); font-size: 15px; }

/* ---------- Barra de búsqueda y filtros ---------- */
.toolbar { position: sticky; top: 0; z-index: 10; background: rgba(246, 241, 233, .94); backdrop-filter: blur(10px); padding: 10px 16px 8px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; max-width: 720px; margin: 0 auto; }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 12px 0; outline: none; font-size: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; max-width: 1100px; margin: 0 auto; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; white-space: nowrap; min-height: 38px; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.switch { display: flex; align-items: center; gap: 8px; max-width: 1100px; margin: 6px auto 0; font-size: 14px; color: var(--muted); cursor: pointer; min-height: 32px; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- Rejilla ---------- */
.catalog { max-width: 1100px; margin: 0 auto; padding: 14px 16px 40px; }
.count { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card { display: block; text-decoration: none; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card__img { position: relative; aspect-ratio: 1; background: #ece4d8; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.card__title { font-family: var(--sans); font-size: 14px; font-weight: 500; padding: 10px 12px 0; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__price { margin: 4px 12px 12px; font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--accent); }
.card.is-sold .card__img img { filter: grayscale(.6) opacity(.75); }
.card.is-sold .card__price { color: var(--muted); text-decoration: line-through; }
.badge { position: absolute; top: 8px; left: 8px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.badge--reservado { background: var(--gold); }
.badge--vendido { background: var(--ink); }
.badge--big { top: 14px; left: 14px; font-size: 14px; padding: 6px 14px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.more { text-align: center; margin-top: 24px; }

/* ---------- Pie y botón flotante ---------- */
.footer { text-align: center; padding: 30px 20px calc(100px + var(--safe-b)); color: var(--muted); border-top: 1px solid var(--line); }
.footer p { margin: 4px 0; }
.footer__contact { display: flex; gap: 10px; justify-content: center; margin-top: 12px !important; }
.fab-wa { position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 20; width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(31, 157, 87, .4); }
.fab-wa svg { width: 30px; height: 30px; }

/* ---------- Ficha de artículo ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; height: 56px; padding: 0 8px; background: rgba(246, 241, 233, .95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .brand { text-align: center; }
.back { display: grid; place-items: center; width: 44px; height: 44px; font-size: 34px; line-height: 1; text-decoration: none; color: var(--ink); }
.ref { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; padding-right: 6px; }
.item { max-width: 1100px; margin: 0 auto; padding-bottom: calc(110px + var(--safe-b)); }
.gallery { position: relative; background: #ece4d8; }
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 1; display: grid; place-items: center; background: #ece4d8; }
.gallery__slide img { width: 100%; height: 100%; object-fit: contain; }
.gallery__slide--empty span { color: var(--muted); }
.gallery__dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gallery__dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); box-shadow: 0 0 2px rgba(0,0,0,.4); }
.gallery__dots span.is-on { background: #fff; width: 18px; border-radius: 4px; }
.item__info { padding: 18px 18px 0; }
.item__cat { display: inline-block; font-size: 13px; color: var(--sage); text-decoration: none; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.item__title { font-size: 26px; }
.item__price { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--accent); margin: 8px 0 14px; }
.item__price.is-sold { color: var(--muted); text-decoration: line-through; }
.item__desc { font-size: 16px; }
.item__desc p { margin: 0 0 12px; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 16px 0; }
.specs div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.specs dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.specs dd { margin: 2px 0 0; font-weight: 600; font-size: 17px; }
.item__ref { color: var(--muted); font-size: 14px; }
.contact-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 14px calc(10px + var(--safe-b)); background: rgba(255, 253, 249, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(60,40,20,.06); }
.contact-bar__note { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.empty-page { text-align: center; padding: 60px 20px; }

@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .item { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; padding: 24px 24px 120px; }
  .gallery { border-radius: var(--radius); overflow: hidden; align-self: start; position: sticky; top: 72px; }
  .item__info { padding: 0; }
  .item__title { font-size: 32px; }
  .contact-bar { left: 50%; transform: translateX(-50%); bottom: 16px; width: min(520px, calc(100% - 32px)); border-radius: 999px; border: 1px solid var(--line); padding: 10px; }
}
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }
