/*
Theme Name: NutriWeb
Author: Juan Manuel Echeverria
Description: Landing de venta de una sola página para productos digitales de nutrición. Theme clásico con Customizer nativo, demo interactiva client-side y hardening de seguridad (CSP con nonce, throttling, honeypots, CPT de leads bloqueado).
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nutriweb
*/

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --nw-bg: #ffffff;
  --nw-ink: #10312a;
  --nw-ink-soft: #47605a;
  --nw-green-950: #0b2e23;
  --nw-green-900: #0f3d2e;
  --nw-green-800: #14532d;
  --nw-green-700: #1b4332;
  --nw-green: #16a34a;
  --nw-green-600: #15803d;
  --nw-green-bright: #22c55e;
  --nw-tint: #e8f5e9;
  --nw-tint-soft: #f3faf4;
  --nw-cream: #f6f3ea;
  --nw-red: #c0392b;
  --nw-red-dark: #a93226;
  --nw-amber: #fbbf24;
  --nw-danger-bg: #fdecea;
  --nw-line: #e3ede5;

  --nw-radius-sm: 10px;
  --nw-radius: 18px;
  --nw-radius-lg: 26px;
  --nw-shadow: 0 10px 30px rgba(16, 49, 42, 0.08);
  --nw-shadow-lg: 0 24px 60px rgba(16, 49, 42, 0.16);

  --nw-font-display: "Archivo", system-ui, -apple-system, sans-serif;
  --nw-font-body: "Inter", system-ui, -apple-system, sans-serif;

  --nw-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --nw-t: 220ms;
  --nw-t-fast: 140ms;

  --nw-container: 1120px;
  --nw-container-narrow: 760px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--nw-bg);
  color: var(--nw-ink);
  font-family: var(--nw-font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: var(--nw-green-600); }
a:hover { color: var(--nw-green-800); }

h1, h2, h3, h4 {
  font-family: var(--nw-font-display);
  color: var(--nw-green-700);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-weight: 800;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5.4vw, 4rem); font-weight: 900; text-transform: uppercase; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 900; text-transform: uppercase; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.hl { color: var(--nw-green); }

/* ============================================================
   Layout helpers
   ============================================================ */
.nw-container {
  max-width: var(--nw-container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.nw-container--narrow { max-width: var(--nw-container-narrow); }

.nw-section { padding-block: clamp(4rem, 9vw, 7rem); }

.nw-section--tint { background: var(--nw-tint-soft); }

.nw-section--dark {
  background: var(--nw-green-900);
  color: var(--nw-cream);
}

.nw-section--dark h2,
.nw-section--dark h3 { color: #ffffff; }

.nw-section--dark .hl { color: var(--nw-green-bright); }

.nw-section__head {
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.nw-kicker {
  display: inline-block;
  font-family: var(--nw-font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nw-green-600);
  margin-bottom: 0.85rem;
}

.nw-section--dark .nw-kicker { color: var(--nw-green-bright); }

.nw-lead {
  font-size: 1.125rem;
  color: var(--nw-ink-soft);
  max-width: 640px;
  margin-inline: auto;
}

.nw-section--dark .nw-lead { color: rgba(246, 243, 234, 0.85); }

/* ============================================================
   Buttons
   ============================================================ */
.nw-btn {
  display: inline-block;
  font-family: var(--nw-font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(180deg, var(--nw-green-bright) 0%, var(--nw-green-600) 100%);
  border: 0;
  border-radius: 999px;
  padding: 1.1rem 2.4rem;
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.35);
  cursor: pointer;
  transition: transform var(--nw-t) var(--nw-ease), box-shadow var(--nw-t) var(--nw-ease), filter var(--nw-t) var(--nw-ease);
}

.nw-btn:hover {
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(22, 163, 74, 0.45);
  filter: brightness(1.04);
}

.nw-btn:active { transform: translateY(0); }

.nw-btn:focus-visible,
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--nw-green);
  outline-offset: 3px;
}

.nw-btn--big { font-size: 1.1875rem; padding: 1.3rem 3rem; }

.nw-btn--block { display: block; width: 100%; }

.nw-btn-note {
  font-size: 0.9375rem;
  color: var(--nw-ink-soft);
  text-align: center;
  margin-top: 0.9rem;
}

.nw-section--dark .nw-btn-note { color: rgba(246, 243, 234, 0.8); }

.nw-cta-row { text-align: center; margin-top: clamp(2rem, 4vw, 3rem); }

/* ============================================================
   Cards
   ============================================================ */
.nw-card {
  background: #ffffff;
  border: 1px solid var(--nw-line);
  border-radius: var(--nw-radius);
  box-shadow: var(--nw-shadow);
  padding: 1.75rem;
}

/* ============================================================
   Pills / badges
   ============================================================ */
.nw-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--nw-tint);
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: var(--nw-green-700);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
}

.nw-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nw-green);
  flex: none;
}

/* ============================================================
   Top bar (non-front pages) + footer
   ============================================================ */
.nw-topbar {
  background: var(--nw-green-900);
  padding: 0.9rem 0;
}

.nw-topbar a {
  color: #ffffff;
  font-family: var(--nw-font-display);
  font-weight: 800;
  font-size: 1.125rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nw-footer {
  background: var(--nw-green-950);
  color: rgba(246, 243, 234, 0.8);
  padding: 3rem 0 2.5rem;
  font-size: 0.9375rem;
  text-align: center;
}

.nw-footer__brand { color: #ffffff; font-weight: 600; }

.nw-footer__disclaimer {
  max-width: 620px;
  margin: 0.75rem auto 1.5rem;
  font-size: 0.875rem;
  color: rgba(246, 243, 234, 0.6);
}

.nw-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

.nw-footer__legal a {
  color: rgba(246, 243, 234, 0.85);
  text-decoration: none;
}

.nw-footer__legal a:hover { color: #ffffff; text-decoration: underline; }

/* ============================================================
   Accessibility
   ============================================================ */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 9999;
  width: auto;
  height: auto;
  clip-path: none;
  background: var(--nw-green-900);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields) */
.nw-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  height: 1px;
  overflow: hidden;
}

/* ============================================================
   Reveal-on-scroll (JS adds .is-visible; no-JS stays visible)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .js .nw-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s var(--nw-ease), transform 0.6s var(--nw-ease);
  }

  .js .nw-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Shared form fields + secondary button + chips
   ============================================================ */
.nw-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--nw-ink-soft);
  margin-bottom: 0.3rem;
}

.nw-field input,
.nw-field select,
.nw-field textarea {
  width: 100%;
  border: 1.5px solid var(--nw-line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  background: #ffffff;
  color: var(--nw-ink);
  transition: border-color var(--nw-t-fast) ease;
}

.nw-field input:focus,
.nw-field select:focus,
.nw-field textarea:focus {
  border-color: var(--nw-green);
  outline: none;
}

.nw-btn--ghost {
  background: #ffffff;
  color: var(--nw-green-700);
  border: 2px solid var(--nw-green-600);
  box-shadow: none;
}

.nw-btn--ghost:hover {
  color: var(--nw-green-800);
  box-shadow: var(--nw-shadow);
}

.nw-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.nw-chip {
  display: inline-block;
  font-family: var(--nw-font-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.nw-chip.is-free { background: var(--nw-green); color: #ffffff; }
.nw-chip.is-included { background: var(--nw-amber); color: #4a3200; }
.nw-chip.is-never { background: var(--nw-red); color: #ffffff; }
.nw-chip.is-lifetime { background: #ffffff; color: var(--nw-green-800); }
.nw-chip.is-neutral { background: var(--nw-tint); color: var(--nw-green-800); }
