/* ============================================================
   Catálogo de muebles · Estilos
   Estética: cálida, marfil/beige, minimalista, tipo galería.
   ============================================================ */

:root {
  --marfil: #f7f1e7;
  --marfil-2: #efe7d8;
  --crema: #fffdf8;
  --tinta: #2e2a24;
  --tinta-suave: #5d564b;
  --terracota: #a4633f;
  --terracota-osc: #8a5132;
  --verde-wa: #25a06a;
  --verde-wa-osc: #1f8a5b;
  --borde: #e3d8c5;
  --sombra: 0 10px 30px rgba(74, 58, 36, 0.10);
  --sombra-suave: 0 4px 14px rgba(74, 58, 36, 0.08);
  --radio: 16px;
  --radio-sm: 10px;
  --ancho: 1180px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Nunito Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--tinta);
  background: var(--marfil);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--ancho);
  margin: 0 auto;
  padding-inline: 22px;
}

/* ===================== BOTONES ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.2s ease,
    color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  line-height: 1.1;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--terracota);
  color: #fff;
  box-shadow: var(--sombra-suave);
}
.btn--primary:hover { background: var(--terracota-osc); }

.btn--outline {
  background: transparent;
  color: var(--tinta);
  border-color: var(--borde);
}
.btn--outline:hover { background: var(--marfil-2); }

.btn--whatsapp {
  background: var(--verde-wa);
  color: #fff;
  box-shadow: var(--sombra-suave);
}
.btn--whatsapp:hover { background: var(--verde-wa-osc); }

.btn--block { width: 100%; }
.btn--sm { padding: 10px 16px; font-size: 0.9rem; }

/* ===================== CABECERA ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 241, 231, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borde);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand__mark { color: var(--terracota); }
.site-nav { display: flex; gap: 26px; }
.site-nav a {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--tinta-suave);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover { color: var(--terracota); border-color: var(--terracota); }

/* ===================== HERO ===================== */
.hero {
  background:
    radial-gradient(120% 120% at 50% -10%, var(--crema) 0%, var(--marfil) 55%, var(--marfil-2) 100%);
  text-align: center;
  padding: clamp(56px, 11vw, 120px) 0 clamp(48px, 9vw, 96px);
  border-bottom: 1px solid var(--borde);
}
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--terracota);
  margin: 0 0 18px;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.04;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}
.hero__subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  color: var(--tinta-suave);
  margin: 0 auto 30px;
  max-width: 640px;
}
.hero__cta { font-size: 1.05rem; padding: 14px 34px; }
.hero__note {
  margin: 26px auto 0;
  max-width: 540px;
  font-size: 0.96rem;
  color: var(--tinta-suave);
}
.hero__note strong { color: var(--tinta); }

/* ===================== SECCION CATALOGO ===================== */
.catalogo { padding: clamp(48px, 8vw, 86px) 0; }
.section-head { text-align: center; margin-bottom: clamp(30px, 5vw, 52px); }
.section-head__title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 600;
  margin: 0 0 10px;
}
.section-head__subtitle {
  color: var(--tinta-suave);
  max-width: 560px;
  margin: 0 auto;
}

/* ===================== GRID DE TARJETAS ===================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(20px, 3vw, 32px);
}

.card {
  background: var(--crema);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sombra-suave);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sombra); }

.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--marfil-2);
  overflow: hidden;
  cursor: pointer;
}
.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.card:hover .card__img { transform: scale(1.05); }
.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(46, 42, 36, 0.78);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.card__body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.card__title {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}
.card__price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--terracota);
}
.card__desc {
  color: var(--tinta-suave);
  font-size: 0.94rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__actions {
  margin-top: auto;
  padding-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===================== FOOTER / CONTACTO ===================== */
.site-footer {
  background: var(--tinta);
  color: #ece4d6;
  padding-top: clamp(46px, 7vw, 72px);
  margin-top: 20px;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 36px;
}
.site-footer__col { flex: 1 1 320px; }
.site-footer__title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  margin: 0 0 10px;
  color: #fff;
}
.site-footer__col p { color: #c8bfae; margin: 0; max-width: 460px; }
.site-footer__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  flex: 0 1 auto;
}
.site-footer__actions .btn--outline { color: #fff; border-color: rgba(255,255,255,0.3); }
.site-footer__actions .btn--outline:hover { background: rgba(255,255,255,0.08); }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 20px 22px 28px;
  text-align: center;
}
.site-footer__bottom p { margin: 0; font-size: 0.86rem; color: #a89e8c; }

/* ===================== MODAL ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 25, 18, 0.62);
  backdrop-filter: blur(3px);
}
.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  max-height: 92vh;
  background: var(--crema);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--tinta);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--sombra-suave);
  transition: background 0.2s, transform 0.12s;
}
.modal__close:hover { background: #fff; transform: rotate(90deg); }

.modal__body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  max-height: 92vh;
}

/* --- Galeria --- */
.galeria {
  background: #1c1813;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.galeria__main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  overflow: hidden;
}
.galeria__img {
  width: 100%;
  height: 100%;
  max-height: 64vh;
  object-fit: contain;
}
.galeria__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--tinta);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sombra-suave);
  transition: background 0.2s, transform 0.12s;
}
.galeria__nav:hover { background: #fff; }
.galeria__nav:active { transform: translateY(-50%) scale(0.92); }
.galeria__nav--prev { left: 14px; }
.galeria__nav--next { right: 14px; }
.galeria__contador {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(28, 24, 19, 0.72);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}
.galeria__thumbs {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  background: #15110d;
  scrollbar-width: thin;
}
.galeria__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}
.galeria__thumb:hover { opacity: 0.85; }
.galeria__thumb.is-active { opacity: 1; border-color: var(--terracota); }

/* --- Detalle --- */
.detalle {
  padding: clamp(22px, 3vw, 34px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.detalle__titulo {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 4px 40px 8px 0;
}
.detalle__precio {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--terracota);
  margin: 0 0 16px;
}
.detalle__desc {
  color: var(--tinta-suave);
  font-size: 0.98rem;
  line-height: 1.7;
  white-space: pre-line;
  margin-bottom: 22px;
}
.detalle__acciones {
  margin-top: auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.detalle__acciones .btn { flex: 1 1 auto; }
.detalle__wallapop {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--tinta-suave);
  text-decoration: underline;
  align-self: flex-start;
}
.detalle__wallapop:hover { color: var(--terracota); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 820px) {
  .modal__body { grid-template-columns: 1fr; overflow-y: auto; }
  .galeria__img { max-height: 48vh; }
  .galeria__main { min-height: 260px; }
}

@media (max-width: 560px) {
  .site-nav { gap: 16px; }
  .brand__name { font-size: 1.25rem; }
  .grid { grid-template-columns: 1fr; }
  .card__actions { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal__dialog { max-width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
  .modal__body { max-height: 100vh; }
  .site-footer__actions { width: 100%; }
  .site-footer__actions .btn { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .galeria__nav { width: 40px; height: 40px; }
}
