/* ============================================================
   CERADI · Catálogo web
   Paleta y tipografía tomadas del catálogo 2025 (Archivo).
   ============================================================ */

:root {
  --indigo: #332682;
  --indigo-osc: #231a5e;
  --tinta: #231f20;
  --gris: #5f5a80;
  --rosa: #f7b2cd;
  --rosa-suave: #ffedef;
  --cielo: #d8f1ff;
  --agua: #afdbe5;
  --agua-suave: #e4f4f6;
  --linea: rgba(51, 38, 130, 0.16);
  --f: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ancho: 1280px;
  --suave: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.45;
  color: var(--tinta);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

.solo-lectores {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 15px/1 var(--f);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--suave);
}
.btn:active { transform: scale(0.97); }
.btn svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn--indigo { background: var(--indigo); color: #fff; }
.btn--indigo:hover { background: var(--indigo-osc); }
.btn--rosa { background: var(--rosa); color: var(--indigo); }
.btn--rosa:hover { background: #fff; }
.btn--contorno { border-color: rgba(255, 255, 255, 0.55); color: #fff; background: transparent; }
.btn--contorno:hover { border-color: #fff; background: rgba(255, 255, 255, 0.1); }
.btn--contorno-osc { border-color: var(--linea); color: var(--indigo); background: #fff; }
.btn--contorno-osc:hover { border-color: var(--indigo); }

/* ---------- Barra superior ---------- */

.barra {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--linea);
}
.barra__fila {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 10px 20px;
}
.barra__logo { flex: none; }
.barra__logo img { height: 40px; width: auto; }

.buscador {
  position: relative;
  flex: 1;
  max-width: 440px;
  margin-left: auto;
}
.buscador svg {
  position: absolute;
  left: 14px; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--indigo);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.buscador input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1.5px solid var(--linea);
  border-radius: 999px;
  background: #fff;
  font: 500 16px/1 var(--f);
  color: var(--indigo);
}
.buscador input::placeholder { color: var(--gris); opacity: 1; }
.buscador input:focus { outline: none; border-color: var(--indigo); }

.chips {
  display: flex;
  gap: 8px;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 20px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  border: 1.5px solid var(--linea);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--indigo);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.chip b {
  font-size: 11px;
  font-weight: 800;
  font-stretch: 125%;
  opacity: 0.6;
}
.chip:hover { border-color: var(--indigo); }
.chip[aria-current="true"] {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}
.chip[hidden] { display: none; }

/* ---------- Portada ---------- */

.portada {
  position: relative;
  background: var(--indigo);
  color: #fff;
  overflow: hidden;
}
.portada__arriba { position: relative; }
.portada__arriba::before,
.portada__foto {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%);
}
.portada__arriba::before {
  content: "";
  width: calc(48% + 34px);
  background: linear-gradient(180deg, var(--agua), var(--rosa));
}
.portada__foto { width: 48%; }
.portada__foto img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}
.portada__int {
  position: relative;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 20px;
}
.portada__texto {
  width: 54%;
  padding: 72px 0 64px;
  container-type: inline-size;
}
.portada h1 { font-weight: inherit; }
.portada__sobre {
  display: block;
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.portada__anio {
  display: block;
  margin: 10px 0 0 -0.04em;
  font-size: 30cqi;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: var(--rosa);
}
.portada__intro {
  max-width: 34em;
  margin-top: 28px;
  font-size: clamp(16px, 1.4vw, 19px);
  color: rgba(255, 255, 255, 0.86);
  text-wrap: pretty;
}
.portada__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.indice {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 32px;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 8px 20px 44px;
}
.indice a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  text-decoration: none;
}
.indice__num {
  font-size: 12px;
  font-weight: 800;
  font-stretch: 125%;
  color: var(--rosa);
}
.indice__nombre {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  transition: color 0.2s;
}
.indice__n {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.66);
  transition: transform 0.25s var(--suave), color 0.2s;
}
.indice a:hover .indice__nombre { color: var(--rosa); }
.indice a:hover .indice__n { transform: translateX(4px); color: #fff; }

/* ---------- Estado de búsqueda ---------- */

.estado {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 22px 20px 0;
  font-size: 15px;
  color: var(--gris);
}
.estado b { color: var(--indigo); }

.vacio {
  max-width: 520px;
  margin: 0 auto;
  padding: 72px 20px 96px;
  text-align: center;
  color: var(--gris);
}
.vacio__titulo {
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 800;
  font-stretch: 110%;
  line-height: 1.2;
  color: var(--indigo);
  text-wrap: balance;
}
.vacio .btn { margin-top: 22px; }

.buscando .portada { display: none; }
[hidden] { display: none !important; }

/* ---------- Líneas ---------- */

.linea {
  --tono: var(--agua);
  scroll-margin-top: 108px;
}
.linea:nth-of-type(3n + 2) { --tono: #f9c9dc; }
.linea:nth-of-type(3n) { --tono: #c3e6fb; }

.linea__cab {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #fff 0%, var(--tono) 100%);
}
.buscando .linea__cab { background: none; border-bottom: 1px solid var(--linea); }
.linea__foto {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 36%;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
}
.linea__foto img { width: 100%; height: 100%; object-fit: cover; }
.buscando .linea__foto { display: none; }
.linea__cab-int {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 48px calc(36% + 20px) 48px 20px;
}
.buscando .linea__cab-int { padding: 28px 20px 16px; }
.linea__num {
  flex: none;
  font-size: clamp(64px, 9.5vw, 132px);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: var(--indigo);
}
.buscando .linea__num { font-size: 40px; }
.linea h2 {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
  font-stretch: 110%;
  line-height: 1.08;
  color: var(--indigo);
  text-wrap: balance;
}
.buscando .linea h2 { font-size: 22px; }
.linea__desc {
  max-width: 30em;
  margin-top: 8px;
  font-size: 16px;
  color: #3f3a66;
  text-wrap: pretty;
}
.buscando .linea__desc { display: none; }
.linea__cuenta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--indigo);
}
.buscando .linea__cuenta { margin-top: 4px; }
.etiqueta {
  padding: 3px 9px;
  border: 1px dashed var(--indigo);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rejilla {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 20px;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 36px 20px 72px;
}
.buscando .rejilla { padding-bottom: 36px; }

/* ---------- Producto ---------- */

.producto {
  --fondo: var(--rosa-suave);
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.rejilla li:nth-child(3n + 2) .producto { --fondo: var(--cielo); }
.rejilla li:nth-child(3n) .producto { --fondo: var(--agua-suave); }

.producto__img {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1.06;
  border-radius: 22px;
  background: var(--fondo);
  overflow: hidden;
}
.producto__img img {
  position: absolute;
  top: -1%; left: -1%;
  width: 102%; height: 102%;
  max-width: none;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.45s var(--suave);
}
.producto:hover .producto__img img { transform: translateY(-6px) scale(1.05); }
.producto__img--sin img {
  position: static;
  width: 46%; height: auto;
  mix-blend-mode: normal;
  opacity: 0.35;
}
.producto:focus-visible { outline: none; }
.producto:focus-visible .producto__img { outline: 3px solid var(--indigo); outline-offset: 3px; }

.producto__cod {
  position: absolute;
  top: 12px; left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--indigo);
}
.producto__cod span { font-weight: 500; opacity: 0.7; }
.producto__nombre {
  display: block;
  margin-top: 13px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--indigo);
  text-wrap: balance;
}
.producto__meta {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--gris);
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .rejilla li {
      animation: sube linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
  .portada__anio { animation: aparece 0.9s var(--suave) both; }
  .portada__sobre { animation: aparece 0.7s var(--suave) both; }
  .portada__intro, .portada__acciones { animation: aparece 0.9s 0.12s var(--suave) both; }
  .portada__foto { animation: foto 1.1s var(--suave) both; }
}
@keyframes sube {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes aparece {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes foto {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Ficha de producto ---------- */

.ficha {
  --fondo: var(--rosa-suave);
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: #fff;
  color: var(--tinta);
  overflow: auto;
  box-shadow: 0 30px 80px rgba(35, 26, 94, 0.35);
}
.ficha::backdrop {
  background: rgba(35, 26, 94, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ficha[open] { animation: ficha 0.32s var(--suave); }
@keyframes ficha {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.ficha__int {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.ficha__img {
  display: grid;
  place-items: center;
  min-height: 460px;
  background: var(--fondo);
  overflow: hidden;
}
.ficha__img { position: relative; }
.ficha__img img {
  position: absolute;
  top: 50%; left: 50%;
  width: auto; height: 118%;
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
  mix-blend-mode: multiply;
}
.ficha__img--sin img { width: 40%; height: auto; mix-blend-mode: normal; opacity: 0.35; }
.ficha__datos {
  display: flex;
  flex-direction: column;
  padding: 44px 40px 36px;
}
.ficha__linea {
  font-size: 12px;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gris);
}
.ficha__nombre {
  margin-top: 8px;
  padding-right: 28px;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 800;
  font-stretch: 110%;
  line-height: 1.08;
  color: var(--indigo);
  text-wrap: balance;
}
.ficha__desc { margin-top: 12px; color: #3f3a66; }
.ficha__specs { margin-top: 24px; }
.ficha__specs div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--linea);
}
.ficha__specs div:last-child { border-bottom: 1px solid var(--linea); }
.ficha__specs dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gris);
}
.ficha__specs dd {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--indigo);
}
.ficha__specs .es-codigo dd {
  font-size: 24px;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 1;
}
.ficha__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 28px;
}
.ficha__cerrar {
  position: absolute;
  top: 14px; right: 14px;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--indigo);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(35, 26, 94, 0.14);
}
.ficha__cerrar svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* ---------- Pie ---------- */

.pie {
  position: relative;
  background: var(--indigo);
  color: #fff;
}
.pie::before {
  content: "";
  display: block;
  height: 44px;
  background: linear-gradient(90deg, var(--rosa-suave), var(--rosa));
  clip-path: polygon(0 0, 100% 0, 100% 30%, 0 100%);
}
.pie__int {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 48px;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 40px 20px 48px;
}
.pie__logo { height: 64px; width: auto; }
.pie__contacto {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
  margin-right: auto;
  font-size: 16px;
}
.pie__contacto a { color: #fff; font-weight: 600; text-decoration: none; }
.pie__contacto a:hover { color: var(--rosa); }
.pie__contacto li:last-child { flex-basis: 100%; color: rgba(255, 255, 255, 0.7); font-size: 14px; }

/* ---------- Adaptación a pantallas ---------- */

@media (max-width: 1040px) {
  .rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .indice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .barra__fila { padding: 8px 14px; gap: 10px; }
  .barra__logo img { height: 34px; }
  .barra__imprimir { width: 44px; padding: 0; }
  .barra__imprimir span { display: none; }
  .chips { padding: 0 14px 8px; }
  .linea { scroll-margin-top: 100px; }

  .portada__arriba { display: flex; flex-direction: column; }
  .portada__arriba::before { display: none; }
  .portada__int { order: 1; width: 100%; padding: 0 20px; }
  .portada__texto { width: 100%; padding: 40px 0 28px; }
  .portada__anio { font-size: 29cqi; }
  .portada__foto {
    position: relative;
    order: 2;
    width: 100%;
    height: 210px;
    clip-path: polygon(0 26%, 100% 0, 100% 100%, 0 100%);
  }
  .indice { grid-template-columns: 1fr; padding: 4px 20px 28px; }
  .indice li:first-child a { border-top: 0; }
  .indice a { padding: 14px 0; }

  .linea__foto { width: 34%; clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); }
  .linea__cab-int {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 30px calc(34% + 4px) 30px 20px;
  }
  .linea__desc { font-size: 15px; }

  .rejilla {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
    padding: 24px 14px 52px;
  }
  .producto__img { border-radius: 18px; }
  .producto__cod { top: 9px; left: 9px; font-size: 11px; }
  .producto__nombre { font-size: 15px; margin-top: 10px; }
  .producto__meta { font-size: 13px; }

  .ficha {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }
  .ficha[open] { animation-name: ficha-movil; }
  .ficha__int { grid-template-columns: 1fr; }
  .ficha__img { min-height: 0; height: 250px; }
  .ficha__datos { padding: 24px 20px 28px; }
  .ficha__acciones .btn { flex: 1; }

  .pie__int { padding: 28px 20px 40px; }
  .pie__contacto { flex-direction: column; }
}
@keyframes ficha-movil {
  from { transform: translateY(100%); }
  to { transform: none; }
}
