/* ── Variables y reset ───────────────────────────────────────────────────── */
:root {
  --c-accent:      #e8472a;
  --c-accent-dark: #c73a20;
  --c-dark:        #0f1923;
  --c-mid:         #1e2d3d;
  --c-text:        #1a2332;
  --c-muted:       #5a6a7a;
  --c-border:      #e2e8f0;
  --c-bg:          #f8fafc;
  --c-white:       #ffffff;
  --c-card:        #ffffff;

  --font:          'Manrope', system-ui, sans-serif;
  --r-sm:          6px;
  --r-md:          10px;
  --r-lg:          16px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,.10);
  --max-w:         1140px;
  --max-w-art:     760px;
}

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

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

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--c-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--c-accent);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 64px;
}

.logo img { height: 36px; width: auto; }

#nav-principal { margin-left: auto; }

#nav-principal ul {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

#nav-principal a {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  font-weight: 500;
  padding: .5rem .85rem;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}

#nav-principal a:hover,
#nav-principal a:focus-visible {
  background: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}

.nav-destacado {
  background: var(--c-accent) !important;
  color: #fff !important;
}
.nav-destacado:hover { background: var(--c-accent-dark) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  padding: .5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ── Botones ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn-primary  { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: var(--c-accent-dark); text-decoration: none; }
.btn-outline  { background: transparent; border-color: var(--c-accent); color: var(--c-accent); }
.btn-outline:hover { background: var(--c-accent); color: #fff; text-decoration: none; }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }

/* ── Cards de artículo ───────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card:hover { text-decoration: none; }

.card-img { aspect-ratio: 16/9; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.03); }

.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }

.card-cat {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-accent);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.35;
}

.card-excerpt {
  font-size: .875rem;
  color: var(--c-muted);
  line-height: 1.55;
  flex: 1;
}

.card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--c-border);
  font-size: .8rem;
  color: var(--c-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background: var(--c-dark);
  color: #fff;
  padding: 4rem 0 3rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero h1 span { color: var(--c-accent); }
.hero p { font-size: 1.1rem; opacity: .85; max-width: 560px; margin: 0 auto 2rem; }

/* ── Artículo individual ─────────────────────────────────────────────────── */
.article-layout {
  max-width: var(--max-w-art);
  margin-inline: auto;
  padding: 2.5rem 1.25rem;
}

.article-header { margin-bottom: 2rem; }

.article-cat {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-accent);
  display: block;
  margin-bottom: .75rem;
}

.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta {
  font-size: .85rem;
  color: var(--c-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.article-featured-img {
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 2rem;
  aspect-ratio: 16/9;
}
.article-featured-img img { width: 100%; height: 100%; object-fit: cover; }

.article-content { font-size: 1.05rem; line-height: 1.8; }

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--c-dark);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--c-border);
}
.article-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 .75rem;
  color: var(--c-mid);
}
.article-content p { margin-bottom: 1.25rem; }
.article-content ul, .article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  list-style: revert;
}
.article-content li { margin-bottom: .4rem; }
.article-content strong { font-weight: 700; color: var(--c-dark); }
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: .92rem;
}
.article-content th {
  background: var(--c-dark);
  color: #fff;
  padding: .6rem .9rem;
  text-align: left;
  font-weight: 600;
}
.article-content td {
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--c-border);
}
.article-content tr:nth-child(even) td { background: var(--c-bg); }

/* ── Comparador de precios ───────────────────────────────────────────────── */
.comparador {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin: 2rem 0;
}
.comparador h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border: none !important;
  padding: 0 !important;
}
.comparador-fila {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: .75rem;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--c-border);
}
.comparador-fila:last-child { border-bottom: none; }
.comparador-tienda { font-weight: 600; font-size: .95rem; }
.comparador-precio { font-size: 1.1rem; font-weight: 800; color: var(--c-accent); white-space: nowrap; }
.comparador-pvp { font-size: .8rem; color: var(--c-muted); text-decoration: line-through; }
.comparador-stock-ok  { color: #16a34a; font-size: .8rem; font-weight: 600; }
.comparador-stock-no  { color: var(--c-muted); font-size: .8rem; }

/* ── Calculadora ─────────────────────────────────────────────────────────── */
.calculadora-wrap {
  max-width: 640px;
  margin: 0 auto;
}
.calc-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  background: var(--c-border);
  padding: .25rem;
  border-radius: var(--r-sm);
}
.calc-tab {
  flex: 1;
  padding: .55rem;
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  color: var(--c-muted);
  transition: background .15s, color .15s;
  font-family: var(--font);
}
.calc-tab.activo { background: var(--c-white); color: var(--c-accent); box-shadow: var(--shadow-sm); }

.calc-form { display: grid; gap: 1rem; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--c-muted); display: block; margin-bottom: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-group input[type="number"] {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 1rem;
  background: var(--c-white);
  transition: border-color .15s;
}
.form-group input[type="number"]:focus { outline: none; border-color: var(--c-accent); }

.calc-resultado {
  background: var(--c-dark);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1rem;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.calc-resultado-valor {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--c-accent);
  letter-spacing: -.02em;
}
.calc-resultado-label { font-size: .85rem; opacity: .75; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--c-dark);
  color: rgba(255,255,255,.7);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 1.5rem;
}

.footer-brand p { font-size: .85rem; margin-top: .75rem; line-height: 1.6; }
.logo-footer img { height: 28px; width: auto; opacity: .9; }

.site-footer h3 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.5);
  margin-bottom: .75rem;
}

.site-footer nav ul { display: flex; flex-direction: column; gap: .4rem; }
.site-footer nav a { color: rgba(255,255,255,.7); font-size: .87rem; }
.site-footer nav a:hover { color: #fff; text-decoration: none; }

.footer-bottom { font-size: .78rem; color: rgba(255,255,255,.45); line-height: 1.6; }

/* ── Cookies banner ──────────────────────────────────────────────────────── */
.cookies-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 520px;
  background: var(--c-dark);
  color: rgba(255,255,255,.85);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
  z-index: 999;
  font-size: .875rem;
}
.cookies-banner[hidden] { display: none; }
.cookies-banner a { color: var(--c-accent); }
.cookies-acciones { display: flex; gap: .5rem; margin-left: auto; }

/* ── Sección ─────────────────────────────────────────────────────────────── */
.seccion { padding: 3rem 0; }
.seccion-titulo {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.seccion-titulo::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--c-border);
}

/* ── Puntuación zapatilla ────────────────────────────────────────────────── */
.puntuacion-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--c-accent);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  padding: .35rem .9rem;
  border-radius: var(--r-sm);
}

/* ── Pros/Contras ────────────────────────────────────────────────────────── */
.pros-contras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.pros, .contras {
  border-radius: var(--r-md);
  padding: 1.25rem;
}
.pros   { background: #f0fdf4; border: 1px solid #bbf7d0; }
.contras { background: #fff1f2; border: 1px solid #fecdd3; }
.pros h3   { color: #15803d; font-size: .9rem; margin-bottom: .75rem; }
.contras h3 { color: #be123c; font-size: .9rem; margin-bottom: .75rem; }
.pros ul, .contras ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.pros li::before   { content: '✓ '; color: #15803d; font-weight: 700; }
.contras li::before { content: '✗ '; color: #be123c; font-weight: 700; }

/* ── 404 ─────────────────────────────────────────────────────────────────── */
.error-404 { text-align: center; padding: 5rem 1rem; }
.error-404 h1 { font-size: 6rem; font-weight: 800; color: var(--c-border); line-height: 1; }
.error-404 h2 { font-size: 1.5rem; margin: 1rem 0; }
.error-404 p  { color: var(--c-muted); margin-bottom: 2rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  #nav-principal {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--c-dark);
    padding: 1rem 1.25rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  #nav-principal.abierto { display: block; }
  #nav-principal ul { flex-direction: column; gap: .25rem; }
  #nav-principal a { display: block; padding: .65rem .9rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .pros-contras { grid-template-columns: 1fr; }
  .comparador-fila { grid-template-columns: 1fr auto auto; }
  .comparador-pvp { display: none; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
}
