/* ═══════════════════════════════════════════════════════
   FERRETERÍA EL YUNQUE — Clean Maximalism
   Anton (display) + Work Sans (body)
   ═══════════════════════════════════════════════════════ */

/* ── Paletas ─────────────────────────────────────────── */
:root,
:root[data-theme="trapo"] {
  --bg: #f3efe6;
  --ink: #17150e;
  --paper: #fffdf6;
  --accent: #ffd400;
  --accent2: #1d4ed8;
  --accent-ink: #17150e;
  --muted: #5d584a;
}
:root[data-theme="ladrillo"] {
  --bg: #f1e9dc;
  --ink: #221a12;
  --paper: #faf5ec;
  --accent: #d94f1e;
  --accent2: #2f5d4a;
  --accent-ink: #faf5ec;
  --muted: #6b5f4e;
}
:root[data-theme="plano"] {
  --bg: #10275e;
  --ink: #f2f5ff;
  --paper: #1a3578;
  --accent: #ff7a1a;
  --accent2: #ffd400;
  --accent-ink: #10275e;
  --muted: #b9c4e6;
}
:root[data-theme="hormigon"] {
  --bg: #e9e9e4;
  --ink: #151515;
  --paper: #f7f7f3;
  --accent: #e0342c;
  --accent2: #57574f;
  --accent-ink: #f7f7f3;
  --muted: #55554f;
}

/* ── Base ────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Work Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  transition: background-color 0.45s ease, color 0.45s ease;
  overflow-x: hidden;
}

h1, h2, h3, .hero__title, .section__title, .services__title, .cta__title,
.nav__logo-text, .footer__word, .product__price strong, .hero__price-tag-value {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.95;
}

a { color: inherit; }
img, svg { display: block; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 3px solid var(--accent2);
  outline-offset: 3px;
}

/* Textura de fondo sutil (puntos de media tinta) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--ink) 1px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.05;
}

main, .topbar, .nav, .footer, .palette { position: relative; z-index: 1; }

/* ── Utilidades ──────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  padding: 0.45rem 0.9rem;
  margin-bottom: 1.4rem;
  transition: background-color 0.45s ease, color 0.45s ease;
}
.eyebrow--light { background: var(--accent); color: var(--accent-ink); }

.btn {
  display: inline-block;
  font-family: "Work Sans", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.95rem 1.7rem;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
              background-color 0.45s ease, color 0.45s ease;
  cursor: pointer;
}
.btn:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: var(--paper); color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--bg); }
.btn--big { font-size: 1.05rem; padding: 1.15rem 2.2rem; }

.stripes {
  background: repeating-linear-gradient(
    -45deg,
    var(--ink) 0 14px,
    var(--accent) 14px 28px
  );
}

/* ── Topbar marquee ──────────────────────────────────── */
.topbar {
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  border-bottom: 3px solid var(--ink);
  transition: background-color 0.45s ease, color 0.45s ease;
}
.topbar__track {
  display: flex;
  gap: 2.2rem;
  padding: 0.55rem 0;
  width: max-content;
  animation: marquee 28s linear infinite;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  white-space: nowrap;
}
.topbar__track .dot { color: var(--accent); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ── Nav ─────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
  background: var(--bg);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.45s ease;
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.nav__logo-mark { width: 42px; height: 42px; flex-shrink: 0; }
.nav__logo-text {
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.04em;
}
.nav__logo-text strong { font-weight: 400; font-size: 1.35rem; }
.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.2rem);
}
.nav__links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0;
  border-bottom: 3px solid transparent;
  transition: border-color 0.2s ease;
}
.nav__links a:hover { border-color: var(--accent); }
.nav__cta { padding: 0.7rem 1.2rem; font-size: 0.82rem; }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.2rem, 4vw, 3rem);
  border-bottom: 3px solid var(--ink);
}
.hero__title {
  font-size: clamp(3.2rem, 8.5vw, 7.5rem);
  margin-bottom: 1.4rem;
}
.hero__title-accent {
  color: transparent;
  -webkit-text-stroke: 3px var(--ink);
  text-stroke: 3px var(--ink);
}
.hero__lead {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  max-width: 34ch;
  margin-bottom: 2rem;
  color: var(--muted);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-bottom: 2.4rem;
}
.hero__stats {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  list-style: none;
  border-top: 3px solid var(--ink);
  padding-top: 1.2rem;
}
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong {
  font-family: "Anton", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}
.hero__stats span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* Hero poster */
.hero__poster { position: relative; }
.hero__frame {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 12px 12px 0 var(--ink);
  padding: 2rem;
  overflow: hidden;
  transition: background-color 0.45s ease;
}
.hero__stripes {
  position: absolute;
  top: 0; right: 0;
  width: 34%; height: 22%;
  background: repeating-linear-gradient(-45deg, var(--ink) 0 12px, var(--accent) 12px 24px);
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}
.hero__drill {
  width: 100%;
  max-width: 420px;
  margin: 2.5rem auto 0;
  position: relative;
  z-index: 1;
}
.hero__sticker {
  position: absolute;
  top: 8%;
  left: 6%;
  z-index: 2;
  background: var(--accent2);
  color: var(--bg);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 0.7rem 0.9rem;
  border: 3px solid var(--ink);
  transform: rotate(-8deg);
  transition: background-color 0.45s ease;
}
.hero__sticker strong { font-family: "Anton", sans-serif; font-size: 1.25rem; display: block; }
.hero__price-tag {
  position: absolute;
  bottom: 0; right: 0;
  z-index: 2;
  background: var(--accent);
  color: var(--accent-ink);
  border: 3px solid var(--ink);
  border-right: none;
  border-bottom: none;
  padding: 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 60%;
}
.hero__price-tag-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.hero__price-tag-value { font-size: 2.1rem; line-height: 1; }
.hero__price-tag-sub { font-size: 0.8rem; font-weight: 600; }

.hero__badge {
  position: absolute;
  top: -3.2rem;
  right: -1.4rem;
  width: clamp(90px, 10vw, 130px);
  z-index: 3;
  animation: spin 14s linear infinite;
  filter: drop-shadow(5px 5px 0 var(--ink));
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Secciones ───────────────────────────────────────── */
.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.2rem, 4vw, 3rem);
  border-bottom: 3px solid var(--ink);
}
.section--alt { background: var(--paper); transition: background-color 0.45s ease; }
.section__head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section__title {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

/* ── Categorías ──────────────────────────────────────── */
.cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 3px solid var(--ink);
  background: var(--ink);
  gap: 3px;
}
.cat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg);
  padding: 1.6rem 1.5rem 1.4rem;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.cat__num {
  font-family: "Anton", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.cat__icon { width: 44px; height: 44px; color: var(--ink); }
.cat__name {
  font-family: "Anton", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}
.cat__meta {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 26ch;
}
.cat__arrow {
  position: absolute;
  top: 1.4rem; right: 1.4rem;
  font-size: 1.5rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}
.cat:hover { background: var(--accent); color: var(--accent-ink); }
.cat:hover .cat__num, .cat:hover .cat__meta { color: var(--accent-ink); opacity: 0.75; }
.cat:hover .cat__icon { color: var(--accent-ink); }
.cat:hover .cat__arrow { transform: translateX(6px); }

/* ── Productos ───────────────────────────────────────── */
.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
}
.product {
  position: relative;
  background: var(--bg);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.45s ease;
}
.product:hover { transform: translate(-4px, -4px); box-shadow: 12px 12px 0 var(--ink); }
.product__flag {
  position: absolute;
  top: -0.9rem; left: -0.7rem;
  z-index: 2;
  background: var(--accent2);
  color: var(--bg);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 0.35rem 0.7rem;
  border: 3px solid var(--ink);
  transform: rotate(-4deg);
}
.product__flag--alt { background: var(--accent); color: var(--accent-ink); }
.product__visual {
  height: 130px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 10px, rgba(128,128,128,0.08) 10px 20px);
  border: 3px solid var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 0.6rem;
}
.product__visual svg { width: 74px; height: 74px; color: var(--ink); }
.product__name {
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.product__meta { font-size: 0.82rem; color: var(--muted); }
.product__price {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 3px solid var(--ink);
  padding-top: 0.7rem;
}
.product__price strong { font-size: 1.5rem; }
.product__price span { font-size: 0.78rem; font-weight: 600; color: var(--muted); }

/* ── Servicios ───────────────────────────────────────── */
.services {
  background: var(--ink);
  color: var(--bg);
  border-bottom: 3px solid var(--ink);
  transition: background-color 0.45s ease, color 0.45s ease;
}
.services__inner {
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.2rem, 4vw, 3rem);
}
.services__title {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.service {
  border: 3px solid var(--bg);
  padding: 1.8rem 1.6rem;
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.service__num {
  font-family: "Anton", sans-serif;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  display: block;
  margin-bottom: 0.8rem;
}
.service h3 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.service p { font-size: 0.92rem; opacity: 0.85; }
.service:hover { background: var(--accent); color: var(--accent-ink); }
.service:hover .service__num { color: var(--accent-ink); }
.service:hover p { opacity: 1; }

/* ── Visitanos ───────────────────────────────────────── */
.visit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}
.visit__hours {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  transition: background-color 0.45s ease;
}
.visit__hours-title { font-size: 1.8rem; }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td {
  text-align: left;
  padding: 0.7rem 0;
  border-bottom: 3px solid var(--ink);
  font-size: 0.95rem;
}
.hours th { font-weight: 700; }
.hours td { font-family: "Anton", sans-serif; font-size: 1.1rem; letter-spacing: 0.04em; }
.visit__contact { display: flex; flex-direction: column; gap: 0.8rem; font-size: 0.95rem; }
.visit__contact a {
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
}
.visit__map {
  position: relative;
  border: 3px solid var(--ink);
  background: var(--bg);
  display: grid;
  place-items: center;
  min-height: 320px;
  overflow: hidden;
}
.visit__map-stripes {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 60px,
    rgba(128,128,128,0.07) 60px 62px
  );
}
.visit__map-house { width: 55%; max-width: 280px; position: relative; z-index: 1; }
.visit__map-pin {
  position: absolute;
  top: 1.2rem; left: 1.2rem;
  z-index: 2;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "Anton", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.9rem;
  border: 3px solid var(--ink);
  transform: rotate(-5deg);
}

/* ── CTA final ───────────────────────────────────────── */
.cta {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom: 3px solid var(--ink);
  position: relative;
  overflow: hidden;
  transition: background-color 0.45s ease, color 0.45s ease;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 40px, rgba(0,0,0,0.05) 40px 80px);
  pointer-events: none;
}
.cta__inner {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.2rem, 4vw, 3rem);
  text-align: center;
}
.cta__title { font-size: clamp(2.6rem, 7vw, 5.5rem); margin-bottom: 1rem; }
.cta__lead { font-size: 1.1rem; font-weight: 500; margin-bottom: 2.2rem; }
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 3rem clamp(1.2rem, 4vw, 3rem) 1.5rem;
  overflow: hidden;
  transition: background-color 0.45s ease, color 0.45s ease;
}
.footer__word {
  font-size: clamp(4rem, 14vw, 13rem);
  line-height: 0.9;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 2px var(--bg);
  opacity: 0.35;
  margin-bottom: 2.5rem;
  white-space: nowrap;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--bg);
}
.footer h4 {
  font-family: "Anton", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  color: var(--accent);
}
.footer p { font-size: 0.9rem; opacity: 0.85; }
.footer a { text-decoration: none; border-bottom: 1px solid var(--accent); }
.footer__legal {
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.6;
  padding-top: 1.2rem;
}

/* ── Selector de paleta ──────────────────────────────── */
.palette {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 0.55rem 0.8rem;
  transition: background-color 0.45s ease;
}
.palette__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-right: 0.2rem;
}
.palette__swatch {
  width: 30px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.palette__swatch:hover { transform: scale(1.15); }
.palette__swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink);
  transform: scale(1.05);
}
.palette__swatch--trapo { background: linear-gradient(135deg, #ffd400 50%, #1d4ed8 50%); }
.palette__swatch--ladrillo { background: linear-gradient(135deg, #d94f1e 50%, #2f5d4a 50%); }
.palette__swatch--plano { background: linear-gradient(135deg, #ff7a1a 50%, #10275e 50%); }
.palette__swatch--hormigon { background: linear-gradient(135deg, #e0342c 50%, #57574f 50%); }

/* ── Reveals ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .topbar__track, .hero__badge { animation: none; }
  html { scroll-behavior: auto; }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1000px) {
  .products { grid-template-columns: repeat(2, 1fr); }
  .cats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero__poster { max-width: 520px; }
  .visit { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: 1fr; }
  .nav__links { display: none; }
  .footer__grid { grid-template-columns: 1fr; gap: 1.4rem; }
}
@media (max-width: 520px) {
  .products { grid-template-columns: 1fr; }
  .cats { grid-template-columns: 1fr; }
  .hero__stats { flex-wrap: wrap; }
  .hero__badge { right: 0.2rem; top: -2.6rem; }
  .palette { bottom: 0.8rem; right: 0.8rem; padding: 0.45rem 0.6rem; }
  .palette__swatch { width: 26px; height: 26px; }
}
