/* ============================================================
   4A CERÁMICA — Base & Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 68px;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-arena);
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; }

/* ── Grain texture overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9998;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--bg-warm); }
::-webkit-scrollbar-thumb:hover { background: var(--terra); }

/* ── Selection ── */
::selection { background: var(--terra); color: var(--text-pale); }

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Section label ── */
.sec-label {
  font-size: clamp(1.36rem, 2vw, 1.56rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--titulo);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

/* ── Fraunces SOFT variation settings — aplica a todos los títulos ── */
h1, h2, h3, h4,
.sec-title,
.prod-card__name,
.set-card__name,
.prod-modal__name,
.cat-intro__title,
.paso__num,
.footer__brand,
.cart-drawer__title,
.cart-total__value,
.testimonios__form-title,
.nav__mobile a {
  font-variation-settings: 'SOFT' 100, 'opsz' 72;
}

/* ── Section title ── */
.sec-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 300;
  line-height: 1.05;
  color: var(--text-pale);
  letter-spacing: -0.01em;
}
.sec-title em { font-style: italic; color: var(--terra-lt); }

/* ── Divider ── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 2rem;
  background: var(--terra);
  color: var(--text-pale);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid var(--terra);
  transition: background var(--dur-mid) var(--ease), color var(--dur-mid) var(--ease);
}
.btn-primary:hover { background: var(--bg-mid); border-color: var(--terra); color: var(--terra-lt); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 2rem;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid rgba(200,169,110,0.5);
  transition: all var(--dur-mid) var(--ease);
}
.btn-outline:hover { background: var(--terra); border-color: var(--terra); color: #fff; }

.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 2.2rem;
  background: var(--terra);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background var(--dur-mid) var(--ease);
}
.btn-wa:hover { background: var(--bg-warm); }

/* ── Reveal on scroll ── */
.js .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1.1s var(--ease-emerger),
              transform 1.1s var(--ease-emerger);
}
.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Latido del contador ── */
@keyframes late {
  0%   { transform: scale(1)   }
  40%  { transform: scale(1.4) }
  100% { transform: scale(1)   }
}
.cart-fab__badge.late { animation: late .5s var(--ease-arcilla); }

/* ── Hilo de progreso ── */
.hilo-progreso {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: var(--c-terracota);
  transform: scaleX(0); transform-origin: left;
  z-index: 9999; pointer-events: none;
  will-change: transform;
}

/* ── Lang toggle ── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border-warm);
}
.lang-btn {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 3px 7px;
  transition: all var(--dur-fast);
}
.lang-btn.active { background: var(--terra); color: #fff; }
.lang-btn:hover:not(.active) { color: var(--text-pale); }

/* ── Modal base ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,10,8,0.92);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-mid) var(--ease);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Flechas navegación entre piezas de categoría */
.modal-cat-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), opacity var(--dur-fast);
  z-index: 1010;
}
.modal-cat-nav--prev { left: 1rem; }
.modal-cat-nav--next { right: 1rem; }
.modal-cat-nav:hover:not(:disabled) {
  background: rgba(255,255,255,0.16);
  color: #fff;
}
.modal-cat-nav:disabled {
  opacity: 0.2;
  cursor: default;
}
@media (max-width: 600px) {
  .modal-cat-nav {
    width: 2rem;
    height: 2rem;
    font-size: 1.4rem;
    top: auto;
    bottom: 1rem;
    transform: none;
  }
  .modal-cat-nav--prev { left: 1rem; }
  .modal-cat-nav--next { right: 1rem; }
}
.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  transition: color var(--dur-fast);
  z-index: 10;
}
.modal-close:hover { color: var(--text-pale); }

@media (max-width: 768px) {
  html { scroll-padding-top: 56px; }
}
