/* DIPROCAS — estilos. Todo el CSS vive aquí (sin style="" ni <style>) por la CSP. */
@font-face {
  font-family: "Jakarta";
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* 60 % neutros claros · 30 % azul DIPROCAS · 10 % verde (descuentos y acciones) */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #0f1b2d;
  --ink-2: #44526a;
  --line: #e2e8f0;
  --blue: #0b4a8b;
  --blue-2: #0e5fb3;
  --blue-soft: #e8f1fb;
  --green: #12925f;
  --green-soft: #e4f6ee;
  --ml: #ffe600;
  --ml-ink: #2d3277;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(15 27 45 / 6%), 0 8px 24px rgb(15 27 45 / 6%);
  --shadow-hover: 0 2px 4px rgb(15 27 45 / 8%), 0 16px 36px rgb(15 27 45 / 12%);
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: "Jakarta", "Inter", system-ui, sans-serif; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
p { margin: 0; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 50; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 2px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.3rem; border-radius: 999px;
  font: 600 1rem/1 "Jakarta", "Inter", sans-serif; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-2); }
.btn--ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn--ghost:hover { background: var(--blue-soft); }
.btn--ml { background: var(--ml); color: var(--ml-ink); }
.btn--ml:hover { box-shadow: 0 6px 18px rgb(45 50 119 / 18%); }
.btn--sm { min-height: 40px; padding: .55rem 1rem; font-size: .9rem; }

/* Barra superior y header */
.topbar { background: var(--ink); color: #dfe7f3; font-size: .85rem; text-align: center; padding: .45rem 1rem; }
.topbar strong { color: var(--ml); font-weight: 600; }
.header { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / 92%); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header__in { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand__logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--blue-soft); }
.brand__name { font: 800 1.25rem/1 "Jakarta", sans-serif; letter-spacing: .02em; color: var(--blue); }
.nav { display: flex; gap: 1.5rem; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; color: var(--ink-2); }
.nav a:hover { color: var(--blue); }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, #d9e9fb 0%, transparent 60%), linear-gradient(180deg, #fff 0%, var(--bg) 100%); }
.hero__in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; padding-block: 4.5rem 3.5rem; }
.eyebrow { display: inline-block; font-weight: 600; font-size: .85rem; color: var(--green); background: var(--green-soft); padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.8rem); font-weight: 800; }
.hero h1 span { color: var(--blue); }
.hero__lead { font-size: 1.12rem; color: var(--ink-2); margin-top: 1.2rem; max-width: 36rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.stats { list-style: none; padding: 0; margin: 2.2rem 0 0; display: flex; gap: 2rem; flex-wrap: wrap; }
.stats li { display: flex; flex-direction: column; }
.stats strong { font: 800 1.6rem/1.1 "Jakarta", sans-serif; color: var(--ink); }
.stats span { font-size: .85rem; color: var(--ink-2); }
.mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.mosaic__item { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; aspect-ratio: 1; }
.mosaic__item:nth-child(2) { transform: translateY(1.5rem); }
.mosaic__item:nth-child(4) { transform: translateY(1.5rem); }
.mosaic__item img { width: 100%; height: 100%; object-fit: contain; }

/* Tiles de categorías */
.cats-strip { padding-block: 1rem 1.5rem; }
.cat-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: .75rem; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: .5rem; width: 100%; padding: .9rem .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--ink); text-align: center; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cat-tile:hover { border-color: var(--blue-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-tile img { width: 64px; height: 64px; object-fit: contain; }
.cat-tile span { font-size: .82rem; font-weight: 600; line-height: 1.2; }

/* Catálogo */
.catalog { padding-block: 2.5rem 4rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.section-head .muted { font-size: .9rem; }
.toolbar { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 320px; display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 1rem; min-height: 50px; color: var(--ink-2); }
.search:focus-within { border-color: var(--blue-2); box-shadow: 0 0 0 4px var(--blue-soft); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); width: 100%; min-height: 48px; }
.sort { display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--ink-2); }
.sort select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .7rem 1rem; min-height: 50px; cursor: pointer; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.chip { font: 500 .9rem/1 "Inter", sans-serif; padding: .65rem 1rem; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--blue-2); color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip small { opacity: .75; margin-left: .25rem; }
.result-count { margin: 1.2rem 0 .8rem; font-size: .9rem; color: var(--ink-2); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.card { height: 100%; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card__media { position: relative; display: block; aspect-ratio: 1; background: #fff; padding: 1rem; border-bottom: 1px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: contain; }
.badge { position: absolute; bottom: .7rem; left: .7rem; background: var(--green); color: #fff; font: 700 .78rem/1 "Jakarta", sans-serif; padding: .4rem .55rem; border-radius: 8px; }
.card__body { display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1rem 1.1rem; flex: 1; }
.card__cat { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--blue-2); }
.card__title { font: 600 .98rem/1.35 "Inter", sans-serif; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.95em; }
.card__prices { margin-top: auto; display: flex; flex-direction: column; }
.price-old { font-size: .82rem; color: var(--ink-2); text-decoration: line-through; }
.price { font: 800 1.45rem/1.2 "Jakarta", sans-serif; color: var(--ink); }
.price-row { display: flex; align-items: baseline; gap: .5rem; }
.price-off { font-size: .85rem; font-weight: 700; color: var(--green); }
.card .btn { width: 100%; margin-top: .6rem; font-size: .92rem; min-height: 44px; }
.empty { text-align: center; color: var(--ink-2); padding: 3rem 1rem; }
.more { display: flex; justify-content: center; margin-top: 2rem; }

/* Por qué */
.why { background: var(--surface); padding-block: 4rem; border-block: 1px solid var(--line); }
.why__grid { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.why__grid li { padding: 1.5rem; border-radius: var(--radius); background: var(--bg); }
.why__grid svg { color: var(--blue); }
.why__grid h3 { font-size: 1.1rem; margin: .8rem 0 .4rem; }
.why__grid p { color: var(--ink-2); font-size: .95rem; }

/* Cómo comprar */
.how { padding-block: 4rem; }
.how__in { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.steps { margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 1rem; }
.steps li { counter-increment: s; position: relative; padding-left: 3.2rem; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -.1rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font: 700 1rem/1 "Jakarta", sans-serif; }
.steps strong { color: var(--ink); }
.how__card { background: var(--blue); color: #e8f1fb; border-radius: calc(var(--radius) + 6px); padding: 2rem; display: grid; gap: 1rem; box-shadow: var(--shadow-hover); }
.how__kicker { font: 700 1.3rem/1.25 "Jakarta", sans-serif; color: #fff; }
.how__card .btn { justify-self: start; }

/* Footer */
.footer { background: var(--ink); color: #c9d3e1; padding-block: 2.5rem; }
.footer__in { display: grid; gap: .7rem; }
.footer .muted { color: #9fb0c7; }
.brand--footer .brand__name { color: #fff; }
.brand--footer .brand__logo { width: 32px; height: 32px; }
.footer__bottom { width: min(100% - 2.5rem, calc(var(--wrap) + 7rem)); margin: 2.5rem auto 0; border-top: 1px solid rgb(255 255 255 / 16%); }
.footer__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem; padding-block: 1.6rem .4rem; font: 400 .95rem/1.4 "Jost", "Inter", sans-serif; color: #b8c2cf; }
.footer__bar p { justify-self: start; }
.footer__links { display: flex; gap: 1.5rem; }
.footer__bar a { color: #b8c2cf; text-decoration: none; transition: color .15s; }
.footer__bar a:hover { color: #fff; }
.footer__credit { justify-self: end; }
@media (max-width: 720px) {
  .footer__bar { grid-template-columns: 1fr; gap: .7rem; }
  .footer__credit { justify-self: start; }
  .footer__bottom { width: min(100% - 1.5rem, var(--wrap)); }
  .footer__bottom .footer__bar { width: 100%; }
}


/* Foto que no cargó: fondo neutro en vez de imagen rota */
.img-fail { visibility: hidden; }
.has-img-fail { background: linear-gradient(135deg, #eef3f9, #e3ebf5); }
.brand__logo.img-fail { display: none; }
.brand.has-img-fail { background: none; }

/* Responsive (mobile-first en la práctica: lo de abajo ajusta pantallas chicas) */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cat-tiles { grid-template-columns: repeat(4, 1fr); }
  .why__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav { display: none; }
  .header__in { justify-content: space-between; }
  .hero__in { grid-template-columns: 1fr; padding-block: 2.5rem 2rem; gap: 2rem; }
  .hero__art { order: -1; }
  .mosaic { grid-template-columns: repeat(4, 1fr); gap: .6rem; }
  .mosaic__item { padding: .4rem; }
  .mosaic__item:nth-child(2), .mosaic__item:nth-child(4) { transform: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .how__in { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { width: min(100% - 1.5rem, var(--wrap)); }
  .cat-tiles { grid-template-columns: repeat(4, 1fr); gap: .5rem; }
  .cat-tile { padding: .6rem .3rem; }
  .cat-tile img { width: 44px; height: 44px; }
  .cat-tile span { font-size: .72rem; }
  .why__grid { grid-template-columns: 1fr; }
  .card__body { padding: .8rem; }
  .card__title { font-size: .88rem; }
  .price { font-size: 1.2rem; }
  .card .btn { font-size: .82rem; padding-inline: .5rem; }
  .btn--sm { font-size: .8rem; padding-inline: .8rem; }
  .sort { width: 100%; }
  .sort select { flex: 1; }
  .stats { gap: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
