/* =========================================================
   DESIGN TOKENS — Neveras Portátiles
   Fuente: agency_data skill 06 (creative-director-elite)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Paleta */
  --color-primary: #1B4D3E;       /* verde bosque profundo */
  --color-primary-light: #2C6B57;
  --color-secondary: #F4A300;     /* ámbar — solo acento/badge, nunca texto sobre claro */
  --color-accent: #E8542C;        /* terracota — CTAs secundarios */
  --color-text: #1A1A1A;
  --color-bg: #F7F5F0;
  --color-bg-alt: #FFFFFF;
  --color-border: #D8D3C8;
  --color-muted: #6B6558;

  /* Tipografía */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Escala tipográfica */
  --fs-h1: clamp(2rem, 4vw + 1rem, 3.25rem);
  --fs-h2: clamp(1.5rem, 2vw + 1rem, 2.25rem);
  --fs-h3: 1.25rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  /* Espaciado */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  /* Layout */
  --content-max: 1180px;
  --radius: 10px;
  --radius-sm: 6px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { font-size: var(--fs-body); color: var(--color-text); }

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

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

.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

/* Foco visible — accesibilidad */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =========================================================
   COMPONENTES COMPARTIDOS
   ========================================================= */

.site-header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-2);
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: contain;
}
.main-nav {
  display: none;
  gap: var(--space-3);
  font-size: var(--fs-small);
  font-weight: 500;
}
.main-nav a:hover { color: var(--color-primary); }
@media (min-width: 860px) {
  .main-nav { display: flex; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-small);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(232,84,44,0.3); }
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary); color: #fff; }
.btn[target="_blank"]::after {
  content: " ↗";
  font-size: 0.8em;
}

.badge {
  display: inline-block;
  background: var(--color-secondary);
  color: var(--color-text);
  font-size: var(--fs-small);
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

section { padding-block: var(--space-5); }
@media (max-width: 600px) {
  section { padding-block: var(--space-4); }
}

.site-footer {
  background: var(--color-primary);
  color: #fff;
  padding-block: var(--space-4);
  margin-top: var(--space-5);
}
.site-footer a { color: #E8E4D8; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.footer-grid h4 {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-secondary);
  margin-bottom: var(--space-1);
}
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; font-size: var(--fs-small); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  font-size: var(--fs-small);
  color: #C9C2B0;
}

.disclaimer {
  font-size: var(--fs-small);
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-2);
  margin-top: var(--space-3);
}

/* Tabla comparativa accesible */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: var(--fs-small);
}
.compare-table th, .compare-table td {
  padding: var(--space-2);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.compare-table th {
  font-family: var(--font-display);
  font-weight: 600;
  background: var(--color-bg);
  color: var(--color-primary);
}
.compare-table tr:last-child td { border-bottom: none; }

/* Tarjetas de producto (mobile-first: stacked) */
.product-cards {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .product-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .product-cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .product-cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .product-cards:has(> .product-card:only-child) { grid-template-columns: minmax(0, 380px); }
}
.product-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  box-shadow: 0 1px 2px rgba(26,26,26,0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.product-card:hover {
  box-shadow: 0 12px 28px rgba(27,77,62,0.12);
  transform: translateY(-3px);
  border-color: var(--color-primary-light);
}
.product-card-img {
  width: 100%;
  max-height: 220px;
  aspect-ratio: auto;
  object-fit: contain;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
  padding: var(--space-1);
  box-sizing: border-box;
}
.product-card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-border) 100%);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: var(--fs-small);
}
.product-card h3 { font-size: 1.1rem; }
.product-card .spec-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-small);
  color: var(--color-muted);
  border-top: 1px dashed var(--color-border);
  padding-top: 0.4rem;
  margin-top: 0.2rem;
}
.product-card .spec-line span { flex-shrink: 0; }
.product-card .spec-line strong { text-align: right; }
.product-card .spec-line strong { color: var(--color-text); }

/* Compare table -> stacks on small screens via data-label pattern */
@media (max-width: 700px) {
  .compare-table thead { display: none; }
  .compare-table, .compare-table tbody, .compare-table tr, .compare-table td { display: block; width: 100%; }
  .compare-table tr {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: var(--space-2);
    overflow: hidden;
  }
  .compare-table td {
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-block: 0.6rem;
  }
  .compare-table td:last-child { border-bottom: none; padding-top: var(--space-1); }
  .compare-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: var(--fs-small);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
  }
  .compare-table td:empty::before,
  .compare-table td[data-label=""]::before {
    content: none;
  }
}
