/* ============================================================
 * Casa Experta — sistema de diseño "editorial"
 * Reimplementación sin Tailwind (CSS propio, sin dependencias).
 * Tipografías: Playfair Display (títulos) + Plus Jakarta Sans (texto).
 * ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..700&family=Playfair+Display:ital,wght@0,400..800;1,500..700&display=swap');

:root {
  --bg: #fdfdfc;
  --fg: #1a1a1a;
  --zinc: #18181b;
  --emerald: #059669;
  --emerald-700: #047857;
  --emerald-900: #064e3b;
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --rose: #be123c;
  --rose-50: #fff1f2;
  --maxw: 80rem;       /* 1280px contenedor ancho */
  --readw: 48rem;      /* 768px contenido de lectura */
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); line-height: 1.65; font-size: 17px;
  overflow-x: hidden;
}
::selection { background: var(--emerald-100); color: var(--emerald-900); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--emerald-700); text-decoration: none; }
/* iconos inline (glyphs): tamaño por defecto para que no ocupen todo el ancho.
   Las reglas más específicas (.icon-tile svg, .method-point svg) lo sobrescriben. */
svg { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -0.125em; }
.affiliate-banner svg { width: 13px; height: 13px; }
.logo-mark svg { width: 16px; height: 16px; }
.btn svg, .btn-amazon svg, .card-cta svg { width: 16px; height: 16px; }
.footer-social svg, .to-top svg { width: 14px; height: 14px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.serif { font-family: var(--serif); font-weight: 500; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 1.4em 0 .5em; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }

.eyebrow { display: inline-block; font-family: var(--sans); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .2em; color: var(--emerald-700);
  background: var(--emerald-50); border: 1px solid var(--emerald-100);
  padding: 6px 16px; border-radius: 99px; }
.muted { color: var(--stone-500); }

/* ---------- entrada suave (no oculta contenido sin JS) ---------- */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--sans);
  font-weight: 700; padding: 14px 26px; border-radius: 12px; border: 1px solid transparent;
  transition: background .2s, transform .1s, border-color .2s; cursor: pointer; font-size: .95rem; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--emerald); color: #fff; }
.btn-primary:hover { background: var(--emerald-700); }
.btn-dark { background: var(--zinc); color: #fff; }
.btn-dark:hover { background: var(--emerald-700); }
.btn-outline { background: #fff; color: var(--zinc); border-color: var(--stone-200); }
.btn-outline:hover { background: var(--stone-50); }
.btn-amazon { display: inline-flex; align-items: center; gap: 10px; background: var(--emerald); color: #fff;
  font-weight: 700; padding: 14px 26px; border-radius: 12px; }
.btn-amazon::after { content: "↗"; font-weight: 700; }
.btn-amazon:hover { background: var(--emerald-700); }
.btn-secondary { display: inline-flex; align-items: center; background: #fff; color: var(--zinc);
  font-weight: 600; padding: 13px 22px; border-radius: 12px; border: 1px solid var(--stone-200); margin-left: 8px; }
.btn-secondary:hover { background: var(--stone-50); }

/* ---------- banner de afiliados ---------- */
.affiliate-banner { background: var(--stone-100); border-bottom: 1px solid var(--stone-200);
  color: var(--stone-500); font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; text-align: center; padding: 10px 16px; }
.affiliate-banner a { color: var(--stone-600); text-decoration: underline; }

/* ---------- header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px);
  background: rgba(253,253,252,.8); border-bottom: 1px solid var(--stone-100); transition: padding .3s; }
.site-header.shrink { padding: 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; transition: height .3s; }
.site-header.shrink .header-inner { height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--sans);
  font-weight: 800; font-size: 1.25rem; letter-spacing: -.04em; color: var(--zinc); }
.logo .logo-mark { width: 32px; height: 32px; background: var(--emerald); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.logo .accent { color: var(--emerald); }
.header-cta { font-size: .72rem; }
/* segunda línea: barra de categorías */
.cat-bar { border-top: 1px solid var(--stone-100); }
.cat-bar-inner { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 26px; padding: 11px 24px; }
.cat-bar a { color: var(--stone-600); font-weight: 600; font-size: .82rem; white-space: nowrap; }
.cat-bar a:hover { color: var(--emerald); }
/* al hacer scroll, la cabecera se compacta y la barra de categorías se oculta */
.site-header.shrink .cat-bar { display: none; }
@media (max-width: 760px) {
  .cat-bar-inner { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; gap: 20px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .cat-bar-inner::-webkit-scrollbar { display: none; }
}

/* ---------- breadcrumbs ---------- */
.breadcrumbs { padding-top: 18px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0;
  font-size: .78rem; color: var(--stone-400); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; }
.breadcrumbs a { color: var(--stone-400); }
.breadcrumbs a:hover { color: var(--emerald); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.hero h1 { margin: 18px 0 24px; }
.hero h1 .italic { font-style: italic; color: var(--emerald-900); }
.hero .lead { font-size: 1.2rem; color: var(--stone-500); max-width: 36rem; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-media { position: relative; }
.hero-media .frame { aspect-ratio: 4/5; background: var(--stone-200); border-radius: 2rem;
  overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); position: relative; z-index: 2; }
.hero-media .frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-media .blob { position: absolute; border-radius: 50%; filter: blur(64px); opacity: .6; z-index: 1; }
.hero-media .blob.a { width: 160px; height: 160px; background: var(--emerald-100); top: -40px; right: -40px; }
.hero-media .blob.b { width: 240px; height: 240px; background: #fffbeb; bottom: -40px; left: -40px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-media { order: -1; } }

/* ---------- stats ---------- */
.stats { border-top: 1px solid var(--stone-100); border-bottom: 1px solid var(--stone-100); background: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 44px 0; }
.stat { text-align: center; }
.stat .num { display: block; font-family: var(--serif); font-size: 2rem; color: var(--zinc); font-weight: 600; }
.stat .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--stone-400); font-weight: 700; }
.stat:not(:last-child) { border-right: 1px solid var(--stone-100); }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; } }

/* ---------- secciones ---------- */
.section { padding: 96px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px;
  margin-bottom: 64px; flex-wrap: wrap; }
.section-head p { color: var(--stone-500); font-size: 1.1rem; max-width: 42rem; }

/* ---------- rejilla de categorías ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; align-items: flex-start; background: #fff;
  padding: 32px; border-radius: 2rem; border: 1px solid var(--stone-100); box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .4s ease, box-shadow .4s ease; color: inherit; }
.card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px -12px rgba(0,0,0,.12); }
.card.alt { background: var(--stone-50); border-color: transparent; box-shadow: none; }
.icon-tile { width: 56px; height: 56px; border-radius: 1rem; display: flex; align-items: center;
  justify-content: center; margin-bottom: 28px; border: 1px solid var(--stone-100); }
.icon-tile svg { width: 26px; height: 26px; }
.icon-tile.blue { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe80; }
.icon-tile.rose { background: var(--rose-50); color: var(--rose); border-color: #ffe4e680; }
.icon-tile.amber { background: #fffbeb; color: #b45309; border-color: #fef3c780; }
.icon-tile.emerald { background: var(--emerald-50); color: var(--emerald-900); border-color: #d1fae580; }
.icon-tile.sky { background: #f0f9ff; color: #0369a1; border-color: #e0f2fe80; }
.icon-tile.orange { background: #fff7ed; color: #c2410c; border-color: #ffedd580; }
.icon-tile.stone { background: var(--stone-50); color: var(--zinc); }
.card .cat-kicker { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .2em;
  color: var(--stone-400); margin-bottom: 8px; }
.card h3 { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 14px; line-height: 1.2; }
.card p { color: var(--stone-500); font-size: .92rem; margin-bottom: 28px; }
.card .card-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 8px;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--emerald); }
.card .card-cta .arrow { transition: transform .2s; }
.card:hover .card-cta .arrow { transform: translateX(4px); }

/* ---------- metodología ---------- */
.method { background: rgba(245,245,244,.5); }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.method-media { aspect-ratio: 1; background: var(--stone-200); border-radius: 3rem; overflow: hidden;
  transform: rotate(3deg); transition: transform .7s ease; }
.method-media:hover { transform: rotate(0); }
.method-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(20%); }
.method-points { display: flex; flex-direction: column; gap: 36px; margin-top: 16px; }
.method-point { display: flex; gap: 20px; }
.method-point svg { width: 26px; height: 26px; color: var(--emerald); flex: 0 0 auto; }
.method-point h4 { font-family: var(--sans); font-weight: 700; font-size: 1.1rem; margin: 0 0 6px; }
.method-point p { color: var(--stone-500); margin: 0; }
@media (max-width: 860px) { .method-grid { grid-template-columns: 1fr; gap: 40px; } .method-media { order: -1; } }

/* ---------- contenido de lectura (pilar/reseña/artículo/legal) ---------- */
.page { padding: 48px 0 16px; }
.prose { max-width: var(--readw); }
.prose.wide { max-width: 60rem; }
.updated { color: var(--stone-400); font-size: .82rem; margin-top: 4px; }
.criteria { background: var(--stone-50); border: 1px solid var(--stone-100); border-radius: 1.5rem; padding: 8px 28px 20px; }

/* ranking (pilar) */
.rank-item { display: flex; gap: 22px; background: #fff; border: 1px solid var(--stone-100);
  border-radius: 1.5rem; padding: 26px; margin: 20px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.rank-badge { flex: 0 0 auto; width: 46px; height: 46px; background: var(--emerald); color: #fff;
  font-family: var(--serif); font-weight: 700; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.rank-body h3 { margin: 0 0 6px; font-size: 1.3rem; }
.rank-tag { display: inline-block; background: var(--emerald-50); color: var(--emerald-900);
  font-weight: 700; font-size: .72rem; padding: 4px 12px; border-radius: 99px; margin-bottom: 8px; }
.rank-actions { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* stars */
.stars { color: #d97706; letter-spacing: 2px; }
.rating-num { color: var(--stone-400); font-size: .82rem; }

/* reseña */
.verdict-box { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; background: var(--stone-50);
  border: 1px solid var(--stone-100); border-radius: 1.5rem; padding: 26px; margin: 24px 0; }
.verdict-text { flex: 1 1 320px; }
.best-for { color: var(--stone-500); font-size: .9rem; }
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
.pros, .cons { border: 1px solid var(--stone-100); border-radius: 1.5rem; padding: 10px 24px 18px; background: #fff; }
.pros h3, .cons h3 { font-family: var(--sans); font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.pros h3 { color: var(--emerald-700); } .cons h3 { color: var(--rose); }
.proscons ul { margin: 0; padding-left: 20px; } .proscons li { margin: 8px 0; }
table.specs { width: 100%; border-collapse: collapse; }
table.specs th, table.specs td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--stone-100); vertical-align: top; }
table.specs th { width: 42%; color: var(--stone-500); font-weight: 600; }
.cta-final { background: var(--emerald-50); border: 1px solid var(--emerald-100); border-radius: 1.5rem;
  padding: 28px; margin: 32px 0; text-align: center; }

/* faq */
.faq details { border: 1px solid var(--stone-100); border-radius: 1rem; padding: 8px 20px; margin: 12px 0; background: #fff; }
.faq summary { cursor: pointer; font-weight: 700; font-family: var(--sans); }

/* guías relacionadas (pilar) */
.guides { background: var(--stone-50); border: 1px solid var(--stone-100); border-radius: 1.5rem; padding: 8px 28px 20px; margin-top: 28px; }
.guide-list { margin: 0; padding-left: 20px; } .guide-list li { margin: 10px 0; } .guide-list a { font-weight: 600; }

/* productos recomendados (artículo) */
.related { border: 1px solid var(--stone-100); border-radius: 1.5rem; padding: 8px 28px 20px; margin: 32px 0; background: var(--stone-50); }
.related-item { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--stone-100); flex-wrap: wrap; }
.related-item:last-child { border-bottom: 0; }
.related-name { font-weight: 700; color: var(--emerald-900); }

/* legal */
.legal { max-width: 44rem; }
figure.identity { margin: 24px 0; }
figure.identity img { border-radius: 12px; border: 1px solid var(--stone-200); }
figure.identity figcaption { color: var(--stone-400); font-size: .78rem; margin-top: 6px; }

/* ---------- footer ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--stone-100); padding: 80px 0 40px; margin-top: 96px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 60px; border-bottom: 1px solid var(--stone-100); }
.footer-brand p { color: var(--stone-500); max-width: 24rem; margin: 22px 0; }
.footer-social { display: flex; gap: 14px; }
.footer-social a { width: 40px; height: 40px; border-radius: 50%; background: var(--stone-50);
  display: flex; align-items: center; justify-content: center; color: var(--stone-400); }
.footer-social a:hover { color: var(--emerald); background: var(--stone-100); }
.footer-col h5 { font-family: var(--sans); font-weight: 700; text-transform: uppercase; font-size: .65rem;
  letter-spacing: .12em; color: var(--zinc); margin: 0 0 22px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.footer-col a { color: var(--stone-500); font-size: .88rem; }
.footer-col a:hover { color: var(--emerald); }
.footer-bottom { padding-top: 36px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-bottom p { color: var(--stone-400); font-size: .72rem; margin: 0; max-width: 60rem; }
.to-top { background: none; border: 0; font-family: var(--sans); font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .12em; color: var(--zinc); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- banner de consentimiento de cookies ---------- */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100;
  background: #fff; border: 1px solid var(--stone-200); border-radius: 1.25rem;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,.25); max-width: 720px; margin: 0 auto; }
.consent[hidden] { display: none; }
.consent-inner { display: flex; align-items: center; gap: 20px; padding: 18px 24px; flex-wrap: wrap; }
.consent-text { margin: 0; font-size: .85rem; color: var(--stone-600); flex: 1 1 320px; }
.consent-actions { display: flex; gap: 12px; flex-shrink: 0; }
.consent-actions .btn { padding: 11px 22px; font-size: .85rem; }
@media (max-width: 560px) { .consent-actions { width: 100%; } .consent-actions .btn { flex: 1; justify-content: center; } }
