/* compradelsuper.es — estilo compartido
   Paleta: verde de mercado + amarillo/naranja etiqueta de precio + coral oferta
   Tipografía: Baloo 2 (titulares) + Figtree (cuerpo) */

:root {
  --verde: #15a34a;
  --verde-osc: #0c7a37;
  --verde-mas-osc: #064e3b;
  --verde-claro: #dcfce7;
  --verde-suave: #f0fdf4;
  --amarillo: #fbbf24;
  --naranja: #f97316;
  --coral: #f4523f;
  --coral-suave: #fee2e2;
  --tinta: #14332a;
  --gris: #5b6b63;
  --gris-claro: #eef2ef;
  --linea: #e2e8e3;
  --fondo: #f7faf7;
  --blanco: #ffffff;
  --sombra-sm: 0 1px 3px rgba(6, 78, 59, .08);
  --sombra: 0 6px 20px rgba(6, 78, 59, .08);
  --sombra-md: 0 12px 34px rgba(6, 78, 59, .12);
  --radio: 18px;
  --radio-sm: 12px;
  --radio-lg: 26px;
  --cuerpo: 'Figtree', system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: 'Baloo 2', system-ui, "Segoe UI", sans-serif;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--cuerpo);
  color: var(--tinta);
  background: var(--fondo);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--verde-mas-osc);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); letter-spacing: -.5px; }
h2 { font-size: clamp(1.55rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

a { color: var(--verde-osc); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--linea);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.28rem;
  color: var(--verde-mas-osc);
}
.brand:hover { text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.brand b { color: var(--verde); }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--tinta);
  font-weight: 600;
  font-size: .97rem;
}
.nav-links a:hover { background: var(--verde-claro); text-decoration: none; }
.nav-links a.active { background: var(--verde); color: #fff; }

.nav-toggle {
  display: none;
  background: var(--verde-claro);
  border: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--verde-mas-osc);
}
.nav-toggle svg { width: 24px; height: 24px; margin: auto; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: #fff;
    padding: 12px 16px 18px;
    border-bottom: 1px solid var(--linea);
    box-shadow: var(--sombra);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 12px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--verde); color: #fff; box-shadow: var(--sombra); }
.btn-primary:hover { background: var(--verde-osc); }
.btn-ghost { background: #fff; color: var(--verde-mas-osc); border: 2px solid var(--verde-claro); }
.btn-ghost:hover { border-color: var(--verde); }
.btn-coral { background: var(--coral); color: #fff; }

/* ---------- Chips / etiquetas de precio ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: .8rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--verde-claro);
  color: var(--verde-mas-osc);
}
.tag-precio {
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-weight: 700;
  background: var(--amarillo);
  color: #4a2e00;
  padding: 4px 12px 4px 10px;
  border-radius: 6px 12px 12px 6px;
  position: relative;
  box-shadow: var(--sombra-sm);
}
.tag-precio::before {
  content: "";
  width: 7px; height: 7px;
  background: #fff;
  border-radius: 50%;
  margin-right: 7px;
  box-shadow: inset 0 0 0 2px #4a2e00;
}
.tag-oferta { background: var(--coral); color: #fff; }
.tag-oferta::before { box-shadow: inset 0 0 0 2px #fff; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1000px 460px at 88% -18%, var(--verde-claro), transparent 60%),
    radial-gradient(720px 380px at -10% 12%, #fff7e0, transparent 62%),
    var(--fondo);
  padding: 44px 0 30px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--verde-osc);
  background: #fff;
  border: 1px solid var(--verde-claro);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .9rem;
  box-shadow: var(--sombra-sm);
}
.hero-copy h1 { margin-top: 16px; }
.hero-copy .lead { font-size: 1.15rem; color: var(--gris); max-width: 34ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-copy .lead { max-width: none; }
}

/* ---------- Herramienta lista de la compra ---------- */
.tool-card {
  background: #fff;
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra-md);
  border: 1px solid var(--linea);
  overflow: hidden;
}
.tool-head {
  background: linear-gradient(135deg, var(--verde), var(--verde-osc));
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tool-head h2 { color: #fff; margin: 0; font-size: 1.3rem; }
.tool-head .sub { font-size: .85rem; opacity: .92; margin: 0; }
.tool-stats { display: flex; gap: 8px; flex-shrink: 0; }
.stat-pill {
  background: rgba(255,255,255,.18);
  border-radius: 12px;
  padding: 6px 12px;
  text-align: center;
  min-width: 62px;
  line-height: 1.1;
}
.stat-pill b { display: block; font-family: var(--display); font-size: 1.15rem; }
.stat-pill span { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }

.tool-body { padding: 18px 20px 22px; }

.add-row { display: flex; gap: 8px; margin-bottom: 6px; }
.add-row input[type="text"] {
  flex: 1;
  font-family: var(--cuerpo);
  font-size: 1.02rem;
  padding: 13px 16px;
  border: 2px solid var(--linea);
  border-radius: 14px;
  background: var(--verde-suave);
  color: var(--tinta);
  min-width: 0;
}
.add-row input[type="text"]:focus { border-color: var(--verde); background: #fff; outline: none; }
.add-row .btn { padding: 12px 18px; }

.price-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--gris);
  margin: 4px 2px 14px;
  cursor: pointer;
  user-select: none;
}
.price-toggle input { width: 18px; height: 18px; accent-color: var(--verde); }

.cat-group { margin-bottom: 16px; }
.cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--verde-mas-osc);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px dashed var(--linea);
}
.cat-title .emoji { font-size: 1.1rem; }
.cat-title .count { margin-left: auto; font-size: .78rem; color: var(--gris); font-family: var(--cuerpo); font-weight: 600; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--verde-suave);
  border: 1px solid var(--linea);
  border-radius: 14px;
  padding: 10px 12px;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.item .check {
  appearance: none;
  -webkit-appearance: none;
  width: 26px; height: 26px;
  flex-shrink: 0;
  border: 2.5px solid var(--verde);
  border-radius: 9px;
  cursor: pointer;
  position: relative;
  background: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.item .check:checked { background: var(--verde); border-color: var(--verde); }
.item .check:checked::after {
  content: "";
  position: absolute;
  left: 8px; top: 3px;
  width: 6px; height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.item .name {
  flex: 1;
  font-weight: 600;
  transition: opacity .2s ease;
  word-break: break-word;
}
.item.done .name { text-decoration: line-through; opacity: .5; }
.item.done { background: #f3f6f4; }

.item .price-input {
  width: 74px;
  font-family: var(--cuerpo);
  font-size: .92rem;
  padding: 6px 8px;
  border: 1.5px solid var(--linea);
  border-radius: 9px;
  text-align: right;
  background: #fff;
}
.item .price-input:focus { border-color: var(--verde); outline: none; }
.item .eur { font-size: .85rem; color: var(--gris); font-weight: 700; }

.item .del {
  background: none;
  border: none;
  color: var(--gris);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
}
.item .del:hover { background: var(--coral-suave); color: var(--coral); }

.tool-empty {
  text-align: center;
  color: var(--gris);
  padding: 26px 10px;
}
.tool-empty .big { font-size: 2.4rem; margin-bottom: 6px; }

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--linea);
}
.total-box {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--verde-mas-osc);
}
.total-box b { color: var(--naranja); font-size: 1.25rem; }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--gris); font-weight: 600; font-family: var(--cuerpo);
  font-size: .9rem; padding: 8px 10px; border-radius: 10px;
}
.link-btn:hover { background: var(--gris-claro); color: var(--coral); }
.hint { font-size: .82rem; color: var(--gris); margin: 12px 2px 0; }

/* ---------- Secciones ---------- */
.section { padding: 54px 0; }
.section-alt { background: var(--verde-suave); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 34px; }
.section-head p { color: var(--gris); font-size: 1.08rem; }

/* ---------- Tarjetas de guías ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 22px;
  box-shadow: var(--sombra-sm);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sombra-md); text-decoration: none; }
.card .ic {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
  background: var(--verde-claro);
}
.card h3 { color: var(--verde-mas-osc); margin-bottom: 6px; }
.card p { color: var(--gris); font-size: .96rem; margin-bottom: 14px; }
.card .go { margin-top: auto; font-weight: 700; color: var(--verde-osc); font-family: var(--display); }

/* colorines rotatorios en iconos */
.card:nth-child(2) .ic { background: #fff2d6; }
.card:nth-child(3) .ic { background: var(--coral-suave); }
.card:nth-child(4) .ic { background: #e0f2fe; }

/* ---------- Bloque tips ---------- */
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tip {
  background: #fff;
  border: 1px solid var(--linea);
  border-left: 5px solid var(--verde);
  border-radius: var(--radio-sm);
  padding: 18px 18px 18px 16px;
  box-shadow: var(--sombra-sm);
}
.tip:nth-child(2n) { border-left-color: var(--naranja); }
.tip:nth-child(3n) { border-left-color: var(--coral); }
.tip h3 { font-size: 1.05rem; margin-bottom: 4px; }
.tip p { font-size: .93rem; color: var(--gris); margin: 0; }

/* ---------- Artículo / contenido ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article .kicker { color: var(--naranja); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; }
.article p, .article li { color: #2c3d35; }
.article h2 { margin-top: 1.8em; }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin-bottom: .5em; }
.article .lead { font-size: 1.15rem; color: var(--gris); }
.callout {
  background: var(--verde-suave);
  border: 1px solid var(--verde-claro);
  border-radius: var(--radio);
  padding: 18px 20px;
  margin: 26px 0;
}
.callout strong { color: var(--verde-mas-osc); }

/* tabla comparativa */
.tbl-wrap { overflow-x: auto; margin: 22px 0; border-radius: var(--radio); border: 1px solid var(--linea); }
table.cmp { width: 100%; border-collapse: collapse; min-width: 560px; background: #fff; }
table.cmp th, table.cmp td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--linea); font-size: .95rem; }
table.cmp th { background: var(--verde); color: #fff; font-family: var(--display); font-weight: 700; }
table.cmp tr:nth-child(even) td { background: var(--verde-suave); }
table.cmp td:first-child { font-weight: 700; color: var(--verde-mas-osc); }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radio-sm);
  padding: 4px 18px;
  margin-bottom: 12px;
  box-shadow: var(--sombra-sm);
}
.faq summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  color: var(--verde-mas-osc);
  padding: 14px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--verde); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 14px; margin: 0; color: var(--gris); }

/* ---------- adslot ---------- */
.adslot {
  border: 2px dashed var(--linea);
  border-radius: var(--radio-sm);
  background: repeating-linear-gradient(45deg, #fbfdfb, #fbfdfb 12px, #f4f8f4 12px, #f4f8f4 24px);
  color: #aab6ae;
  text-align: center;
  padding: 20px;
  margin: 30px auto;
  font-size: .82rem;
  letter-spacing: .04em;
  max-width: 760px;
}

/* ---------- CTA banda ---------- */
.band {
  background: linear-gradient(135deg, var(--verde), var(--verde-osc));
  color: #fff;
  border-radius: var(--radio-lg);
  padding: 40px 34px;
  text-align: center;
  box-shadow: var(--sombra-md);
}
.band h2 { color: #fff; }
.band p { opacity: .94; max-width: 52ch; margin: 0 auto 20px; }
.band .btn-primary { background: #fff; color: var(--verde-osc); }
.band .btn-primary:hover { background: var(--amarillo); color: #4a2e00; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--verde-mas-osc);
  color: #cbe8d6;
  padding: 46px 0 26px;
  margin-top: 50px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 26px;
}
.site-footer .brand { color: #fff; }
.site-footer .brand b { color: var(--amarillo); }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #cbe8d6; font-size: .95rem; }
.site-footer a:hover { color: #fff; }
.footer-note {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 18px;
  font-size: .82rem;
  color: #9dc4ac;
  line-height: 1.6;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Cookies ---------- */
.cookie-bar {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra-md);
  padding: 18px 20px;
  z-index: 80;
  display: none;
}
.cookie-bar.show { display: block; }
.cookie-bar p { font-size: .9rem; margin: 0 0 12px; color: var(--gris); }
.cookie-bar .row { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-bar .btn { padding: 9px 18px; font-size: .92rem; }

/* utilidades */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.breadcrumb { font-size: .85rem; color: var(--gris); margin-bottom: 18px; }
.breadcrumb a { color: var(--gris); }
