/* ==========================================================
   Caja de Resistencia · IES Vega del Jarama
   Mobile first. Sin dependencias.
   ========================================================== */

:root {
  --bg: #f7f6f1;
  --surface: #ffffff;
  --surface-2: #efeee7;
  --ink: #12261a;
  --muted: #56655b;
  --line: #e2e3da;
  --green: #1a7a3e;
  --green-ink: #0f3d24;
  --lime: #c3f07a;

  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --maxw: 1120px;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); /* espacio para la CTA fija */
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 2px solid var(--green-ink);
  background: var(--green-ink); color: #fff;
  font: 600 1rem/1 var(--font-body); text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { background: var(--green); border-color: var(--green); }
.btn:active { transform: scale(.98); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9375rem; }
.btn-ghost { background: transparent; color: var(--green-ink); }
.btn-ghost:hover { background: var(--green-ink); color: #fff; border-color: var(--green-ink); }
.btn-light { background: var(--lime); border-color: var(--lime); color: var(--green-ink); }
.btn-light:hover { background: #fff; border-color: #fff; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 246, 241, .9);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--green-ink); color: #fff; font: 800 1.25rem/1 var(--font-display);
}
.brand-text { font: 800 1rem/1.1 var(--font-display); letter-spacing: -0.01em; }
.brand-text small { display: block; font: 500 .75rem/1.3 var(--font-body); color: var(--muted); letter-spacing: 0; }

.nav { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 40px; }
.hero-grid { display: grid; gap: 28px; }
.eyebrow {
  display: inline-block; margin-bottom: 14px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green);
}
.hero h1 { font-size: clamp(2.4rem, 10vw, 4.4rem); font-weight: 800; }
.hero h1 span { display: block; color: var(--green); }
.lead { margin-top: 18px; font-size: 1.125rem; color: var(--muted); max-width: 34ch; }
.lead strong { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cta-row .btn { flex: 1 1 180px; }
.perks { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: .875rem; color: var(--muted); }
.perks li { display: flex; align-items: center; gap: 8px; }
.perks li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.hero-media { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Intro ---------- */
.intro { padding: 36px 0; background: var(--surface); border-block: 1px solid var(--line); }
.h-sm { font-size: 1.375rem; margin-bottom: 10px; }
.intro p { color: var(--muted); font-size: 1.0625rem; }
.intro strong { color: var(--ink); }

/* ---------- Secciones ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.9rem, 7vw, 2.75rem); font-weight: 800; }
.section-head p { margin-top: 8px; color: var(--muted); }
.note { margin-top: 18px; font-size: .875rem; color: var(--muted); }

/* ---------- Productos ---------- */
.grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.section-alt .card { background: var(--bg); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; }
.card-body { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 14px; flex: 1; }
.card h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.card p { font-size: .8125rem; color: var(--muted); }
.price {
  align-self: flex-start; margin-top: auto; padding-top: 10px;
  font: 800 1.25rem/1 var(--font-display); color: var(--green-ink);
}

/* ---------- Pasos ---------- */
.section-dark { background: var(--green-ink); color: #fff; }
.section-dark .section-head p { color: #cfe3d5; }
.steps { list-style: none; counter-reset: s; display: grid; gap: 12px; margin-bottom: 28px; }
.steps li {
  counter-increment: s; display: flex; gap: 14px; align-items: baseline;
  padding: 16px; border-radius: var(--radius-sm); background: rgba(255,255,255,.07);
  color: #e3efe6;
}
.steps li::before {
  content: counter(s); flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--lime); color: var(--green-ink); font: 800 1rem/1 var(--font-display);
  transform: translateY(-2px);
}
.steps strong { color: #fff; }

/* ---------- Tallas ---------- */
.sizes { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 10px; }
.sizes > .note { margin: 0 16px 16px; }
summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 16px; font-weight: 600; min-height: 56px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; flex: none; width: 10px; height: 10px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s ease;
}
details[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

.table-scroll { overflow-x: auto; padding: 0 16px 16px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: .9375rem; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { font-weight: 600; color: var(--green-ink); background: var(--surface-2); }
thead th:first-child { border-radius: 8px 0 0 8px; }
thead th:last-child { border-radius: 0 8px 8px 0; }
tbody th { text-align: left; font-weight: 600; color: var(--muted); }
tbody tr:last-child > * { border-bottom: 0; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { padding-inline: 0; }
.faq details p { padding: 0 0 18px; color: var(--muted); }

/* ---------- Pie ---------- */
.site-footer { padding: 40px 0; font-size: .875rem; color: var(--muted); }
.footer-row { display: grid; gap: 6px; }
.footer-claim { font: 800 1.25rem/1.2 var(--font-display); color: var(--green-ink); }

/* ---------- CTA fija (móvil) ---------- */
.sticky-cta {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(247, 246, 241, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.sticky-cta .btn { width: 100%; }

/* ==========================================================
   Tablet
   ========================================================== */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .card-body { padding: 16px; }
  .card h3 { font-size: 1.125rem; }
  .card p { font-size: .875rem; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { flex-direction: column; gap: 12px; padding: 20px; }
  .cta-row .btn { flex: 0 0 auto; }
}

/* ==========================================================
   Escritorio
   ========================================================== */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .sticky-cta { display: none; }

  .nav { display: flex; gap: 4px; }
  .nav a {
    padding: 8px 12px; border-radius: 999px; text-decoration: none;
    font-size: .9375rem; font-weight: 500; color: var(--muted);
  }
  .nav a:hover { color: var(--ink); background: var(--surface-2); }

  .hero { padding: 64px 0 80px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 56px; }
  .lead { font-size: 1.25rem; }

  .section { padding: 88px 0; }
  .section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 32px; }
  .section-head p { margin: 0; max-width: 40ch; text-align: right; }
  .narrow .section-head { display: block; }
  .narrow .section-head p { margin-top: 8px; text-align: left; }

  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
  .card { transition: transform .2s ease, box-shadow .2s ease; }
  .card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -18px rgba(15, 61, 36, .35); }

  .intro { padding: 48px 0; }
}
