:root {
  --paper: #f4efe6;
  --card: #fffdf8;
  --ink: #141414;
  --ink-soft: #6a6459;
  --line: #ddd5c6;
  --accent: #e4572e;
  --accent-ink: #fff;
  --ok: #2f6b45;
  --radius: 10px;
  --display: "Georgia", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Portada ---------- */
.hero {
  background: var(--ink);
  color: var(--paper);
  background-size: cover;
  background-position: center;
}
.hero--foto {
  background-image: linear-gradient(rgba(20,20,20,.55), rgba(20,20,20,.75)), var(--portada);
}
.hero__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; }
.brand__name { font-family: var(--display); font-style: italic; font-size: 24px; letter-spacing: .3px; }
.hero__nav { display: flex; gap: 18px; font-size: 14px; }
.hero__nav a { opacity: .8; }
.hero__nav a:hover { opacity: 1; }

.hero__body {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}
.sticker {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  transform: rotate(-3deg);
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(38px, 9vw, 84px);
  line-height: 1;
  margin: 0 0 16px;
  font-weight: 400;
  max-width: 14ch;
}
.hero__intro { font-size: 17px; max-width: 46ch; margin: 0 0 26px; opacity: .85; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}
.btn--dark { background: var(--paper); color: var(--ink); }
.btn--wa { background: #25d366; color: #06301a; }
.btn--ig { background: var(--ink); color: var(--paper); }

/* ---------- Filtros ---------- */
.piezas { padding: 28px 0 56px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}
.chip--active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.search {
  width: 100%;
  max-width: 260px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 600px) { .search { max-width: none; } }

.state { text-align: center; color: var(--ink-soft); padding: 48px 16px; }

/* ---------- Tarjetas ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20,20,20,.12); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card__img-wrap { position: relative; aspect-ratio: 4 / 5; background: #e8e0d0; overflow: hidden; }
.card__img { width: 100%; height: 100%; object-fit: cover; }
.card--vendido .card__img { filter: grayscale(.85); opacity: .7; }
.card__count {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(20,20,20,.7); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
}
.badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.badge--reservado { background: #f2c14e; color: #3a2a00; }
.badge--vendido { background: var(--ink); color: var(--paper); }
.card__body { padding: 12px 14px 14px; }
.card__meta { margin: 0 0 4px; font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; min-height: 1em; }
.card__title { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.2; }
.card__price { margin: 0; font-weight: 700; font-size: 15px; color: var(--accent); }
.card--vendido .card__price { color: var(--ink-soft); }

/* Marcador cuando no hay foto todavía */
.ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, #e8e0d0, #e8e0d0 10px, #efe8da 10px, #efe8da 20px);
  color: #b3a78f;
}
.ph span { font-family: var(--display); font-style: italic; font-size: 64px; }

/* ---------- Taller ---------- */
.taller { background: var(--ink); color: var(--paper); padding: 56px 0; }
.taller__inner { max-width: 760px; }
.taller h2 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 6vw, 44px); margin: 0 0 14px; }
.taller p { font-size: 16.5px; line-height: 1.6; opacity: .88; white-space: pre-line; }
.taller__fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 24px; }
.taller__fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }

/* ---------- Pie ---------- */
.footer { padding: 56px 0 40px; text-align: center; }
.footer__big { font-family: var(--display); font-style: italic; font-size: clamp(26px, 6vw, 40px); margin: 0 0 8px; }
.footer__links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 24px 0 32px; }
.footer__small { color: var(--ink-soft); font-size: 12.5px; margin: 0; }

/* ---------- Detalle ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20,20,20,.6); }
.modal__panel {
  position: relative;
  width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
}
@media (min-width: 820px) {
  .modal { align-items: center; padding: 24px; }
  .modal__panel { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 980px; border-radius: 18px; max-height: 90vh; overflow: hidden; }
  .modal__media, .modal__gallery { height: 100%; max-height: 90vh; }
  .modal__info { overflow-y: auto; }
}
.modal__close {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(255,253,248,.92);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.modal__gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: #e8e0d0;
  aspect-ratio: 4 / 5;
}
.modal__gallery::-webkit-scrollbar { display: none; }
.modal__img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.modal__media { position: relative; }
.modal__dots { position: absolute; display: flex; gap: 6px; left: 0; right: 0; bottom: 12px; justify-content: center; pointer-events: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); }
.dot--on { background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.modal__info { padding: 22px 20px 26px; }
.modal__meta { margin: 0 0 6px; font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .07em; }
.modal__info h3 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 0 0 10px; }
.modal__price { font-size: 22px; font-weight: 700; color: var(--accent); margin: 0 0 16px; }
.modal__specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 14px; }
.modal__specs dt { color: var(--ink-soft); }
.modal__specs dd { margin: 0; }
.modal__desc { font-size: 15px; line-height: 1.55; margin: 0 0 20px; }
.modal__actions { display: flex; flex-direction: column; gap: 10px; }
