:root {
  --red: #db2e48;
  --red-ink: #b3233a;
  --red-pale: #fcecef;
  --ink: #1f2228;
  --body: #4a4e57;
  --muted: #6a6e78;
  --line: #e4e5e8;
  --bg: #fff;
  --bg-soft: #f4f4f5;
  --photo: #eeeeef;
  --d1: #a3a8b2;
  --d2: #636873;
  --d3: #383c45;
  --d4: #e28d9c;
  --d5: var(--red);
  --head: "Poppins", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  --head-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--body); font: 400 1rem/1.6 var(--text); }
img { display: block; max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--head); letter-spacing: -.025em; line-height: 1.08; }
h1, h2 { font-weight: 800; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); }
h3 { font-weight: 700; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
section[id] { scroll-margin-top: calc(var(--head-h) + 16px); }
section.line { scroll-margin-top: calc(var(--head-h) + 110px); }

.wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { display: block; font: 600 .75rem/1.4 var(--text); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.eyebrow--red { color: var(--red-ink); }
.lead { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.55; color: var(--ink); }
.logo { display: block; width: 100%; height: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 40; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: 6px; }
.skip:focus { left: 8px; }

/* Cabecera */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-head__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--head-h); }
.site-head__logo { width: 112px; color: var(--red); flex: none; }
.site-head nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.site-head nav a { padding: 8px 0; white-space: nowrap; font-weight: 500; font-size: .9375rem; color: var(--ink); text-decoration: none; }
.site-head nav a:hover { color: var(--red-ink); }

/* Portada */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--red); color: #fff; }
.hero__text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; padding: clamp(48px, 8vw, 112px) var(--gutter); }
.hero .eyebrow { color: #fff; }
.hero h1 { color: #fff; font-size: clamp(2.75rem, 6.6vw, 6rem); line-height: 1; letter-spacing: -.035em; }
.hero p { margin: 0; max-width: 36em; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); font-weight: 500; line-height: 1.5; }
.hero__img { position: relative; min-height: 340px; }
.hero__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.btn { display: inline-block; margin-top: 8px; padding: 14px 26px; background: #fff; color: var(--red-ink); border-radius: 999px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.btn:hover { background: var(--ink); color: #fff; }
.hero .btn:focus-visible { outline-color: #fff; }

/* Bienvenida */
.welcome { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(40px, 7vw, 112px); padding-block: clamp(64px, 9vw, 128px); }
.welcome h2 { margin: 12px 0 24px; }
.welcome .lead { margin: 0; }
.pillars li { padding-block: 22px 26px; border-top: 2px solid var(--red); }
.pillars h3 { font-size: 1.3125rem; }
.pillars p { margin: 8px 0 0; }

/* Catálogo */
.catalog { background: var(--bg-soft); padding-block: clamp(56px, 8vw, 104px); }
.catalog__intro h2 { margin-top: 12px; }
.filters { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--head-h)); z-index: 10; margin-top: 28px; padding-block: 12px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.filters__in { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 10px 16px; align-items: center; }
.search input { width: 100%; height: 42px; padding: 0 16px; border: 1px solid #c9cbd1; border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 1rem; }
.search input:focus { outline: 3px solid var(--ink); outline-offset: 1px; }
.search input::placeholder { color: var(--muted); }
.chips { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 6px 14px; border: 1px solid transparent; border-radius: 999px; background: #fff; color: var(--ink); font: 500 .875rem var(--text); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.chip b { color: var(--red-ink); font-weight: 600; }
.chip:hover { border-color: var(--red); }
.chip[aria-pressed="true"] { background: var(--red-ink); color: #fff; }
.chip[aria-pressed="true"] b { color: #fff; }
.filters__count { grid-column: 1; grid-row: 2; margin: 0; font-size: .8125rem; color: var(--muted); }

.line { padding-top: clamp(40px, 5vw, 72px); }
.line__head { display: flex; align-items: flex-end; gap: clamp(14px, 2vw, 28px); margin-bottom: 28px; }
.line__num { flex: none; font: 800 clamp(3.5rem, 7vw, 6rem)/.85 var(--head); letter-spacing: -.05em; color: var(--red); }
.line__head h2 { font-size: clamp(1.625rem, 2.8vw, 2.5rem); }
.line__head p { margin: 6px 0 0; max-width: 44em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: clamp(16px, 2vw, 28px); }
.card a { display: block; height: 100%; background: #fff; border-radius: 14px; overflow: hidden; text-decoration: none; transition: box-shadow .2s; }
.card a:hover { box-shadow: 0 10px 28px rgba(31, 34, 40, .1); }
.card__img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--photo); }
.card__img img { width: 100%; height: 100%; object-fit: cover; object-position: 80% 50%; transition: transform .35s ease; }
.card a:hover img { transform: scale(1.04); }
.card h3 { padding: 18px 20px 0; font-size: 1.125rem; line-height: 1.25; letter-spacing: -.015em; }
.card a:hover h3 { color: var(--red-ink); }
.card p { margin: 8px 0 0; padding: 0 20px 20px; font-size: .9375rem; line-height: 1.5; }
.empty { padding-block: 56px; text-align: center; color: var(--ink); }
.empty button { border: 0; padding: 0; background: none; color: var(--red-ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Quiénes somos */
.group { padding-block: clamp(64px, 9vw, 128px); }
.group__head { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); margin-bottom: clamp(40px, 5vw, 64px); }
.group__head h2 { margin: 12px 0 18px; font-size: clamp(2.5rem, 5vw, 4rem); }
.group__head .lead { margin: 0; }
.group__vm { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.group__vm > div { padding-top: 18px; border-top: 2px solid var(--red); }
.group__vm p { margin: 8px 0 0; }
.divs { display: grid; gap: 10px; }
.div { display: grid; grid-template-columns: clamp(104px, 24vw, 320px) 1fr; align-items: center; gap: clamp(16px, 3vw, 40px); }
.div__num { display: flex; align-items: center; justify-content: flex-end; min-height: 96px; height: 100%; padding-right: clamp(36px, 5vw, 64px); background: var(--tone); color: #fff; font: 800 clamp(1.75rem, 3.5vw, 2.75rem)/1 var(--head); clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 50%, calc(100% - 30px) 100%, 0 100%); }
.div:nth-child(4) .div__num { color: var(--ink); }
.div h3 { font-size: clamp(1.25rem, 2vw, 1.625rem); }
.div h3 small { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--red-ink); color: #fff; font: 600 .75rem/1.6 var(--text); letter-spacing: 0; vertical-align: middle; }
.div .eyebrow { margin-top: 4px; }
.div p { margin: 2px 0 0; }
.div--current h3 { color: var(--red-ink); }
.div--current .eyebrow { color: var(--red-ink); }

/* Pie */
.site-foot { background: var(--ink); color: #c9cbd1; padding-block: 56px 40px; }
.site-foot__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid #454a54; }
.site-foot__logo { display: block; width: 148px; color: #fff; }
.site-foot__top p { margin: 10px 0 0; color: #fff; font: 600 1.0625rem var(--head); }
.site-foot__tag strong { display: block; color: #fff; font: 800 1.25rem var(--head); letter-spacing: -.02em; }
.site-foot__tag .eyebrow { margin-top: 4px; color: #c9cbd1; }
.site-foot__legal { margin: 24px 0 0; max-width: 80em; font-size: .8125rem; line-height: 1.6; }

/* Producto: portada */
.p-hero { position: relative; background: var(--photo); }
.p-hero__img { width: 100%; aspect-ratio: 16 / 9; max-height: 82vh; object-fit: cover; object-position: 100% 50%; }
.p-hero__in { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; }
.p-hero__text { max-width: min(42%, 560px); pointer-events: auto; }
.p-hero__crumb { text-decoration: none; }
.p-hero__crumb:hover { text-decoration: underline; }
.p-hero h1 { margin-top: 14px; font-size: clamp(2.125rem, 4.4vw, 4rem); }
.p-hero h1::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 24px; background: var(--red); }
.p-hero p { margin: 22px 0 0; font-size: clamp(1.0625rem, 1.5vw, 1.3125rem); line-height: 1.5; color: #3a3e47; }

/* Producto: detalle */
.p-detail { display: grid; grid-template-columns: 1.2fr 1fr; }
.p-detail__img { position: relative; min-height: 360px; background: var(--photo); }
.p-detail__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-detail__text { padding: clamp(40px, 6vw, 88px) var(--gutter); }
.p-detail .lead { margin: 0 0 8px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.p-detail h2.eyebrow { margin-top: 28px; margin-bottom: 12px; }
.features li { position: relative; padding: 5px 0 5px 22px; color: var(--ink); }
.features li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.tags, .certs { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 6px 14px; border-radius: 999px; background: var(--red-pale); color: var(--red-ink); font-size: .9375rem; font-weight: 500; }
.certs li { padding: 4px 12px; border: 1px solid #b9bcc3; border-radius: 7px; color: var(--ink); font-size: .8125rem; font-weight: 600; }

.related { padding-block: clamp(56px, 7vw, 96px); }
.related h2 { margin-bottom: 28px; font-size: clamp(1.5rem, 2.8vw, 2.25rem); }
.related .card a { background: var(--bg-soft); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(40px, 5vw, 64px); padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { font: 700 clamp(.9375rem, 1.6vw, 1.125rem)/1.3 var(--head); color: var(--ink); text-decoration: none; }
.pager a:hover { color: var(--red-ink); }
.pager a .eyebrow { margin-bottom: 4px; }
.pager a:last-child { text-align: right; }

@media (max-width: 860px) {
  :root { --head-h: 60px; }
  /* La búsqueda se va con el scroll y solo quedan anclados los filtros. */
  .filters { top: calc(env(safe-area-inset-top, 0px) + var(--head-h) - 58px); }
  .hero, .welcome, .group__head, .p-detail { grid-template-columns: 1fr; }
  .hero__img { aspect-ratio: 4 / 3; min-height: 0; }
  .hero__img img { object-position: 50% 25%; }
  .filters__in { grid-template-columns: 1fr; }
  .chips { grid-column: auto; grid-row: auto; flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .filters__count { display: none; }
  .p-hero__img { aspect-ratio: 4 / 3; max-height: none; object-position: 82% 50%; }
  .p-hero__in { position: static; display: block; padding-block: 28px 36px; }
  .p-hero__text { max-width: none; }
  .p-detail__img { aspect-ratio: 4 / 3; min-height: 0; }
  .p-detail__img img { object-position: 50% 30%; }
}

@media (max-width: 560px) {
  .group__vm { grid-template-columns: 1fr; }
  .div { grid-template-columns: 84px 1fr; align-items: stretch; }
  .div > div { padding-block: 6px; }
  .div__num { padding-right: 24px; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); }
}

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

/* Foto de producto con fondo oscuro */
.p-hero--dark { background: #0d0d0f; }
.p-hero--dark h1 { color: #fff; }
.p-hero--dark p { color: #d9dade; }
.p-hero--dark .eyebrow--red { color: #f39aa8; }

@media (max-width: 560px) {
  .line__head { align-items: center; }
}

@media (max-width: 420px) {
  .site-head__logo { width: 84px; }
  .site-head nav { gap: 10px; }
  .site-head nav a { font-size: .875rem; }
}
@media (max-width: 359px) {
  .site-head__logo { width: 92px; }
  .site-head nav a[href$="#niomed"] { display: none; }
}

/* Botón de subir */
.to-top { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 15; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--red-ink); color: #fff; box-shadow: 0 6px 18px rgba(31, 34, 40, .28); transition: opacity .2s, visibility .2s, background .15s; }
.to-top:hover { background: var(--ink); }
.to-top svg { width: 22px; height: 22px; }
.to-top--hidden { opacity: 0; visibility: hidden; }
