/* Yatridi · «La estantería» · estilos comunes de la web, la calculadora, la app y lo legal. */
@font-face { font-family: 'Barlow Condensed'; src: url('../fuentes/BarlowCondensed-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('../fuentes/HankenGrotesk.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* taller: pared perforada, acero, contrachapado; color = filamento */
  --pared: #e8e7e3; --pared-2: #dedcd6; --papel: #f6f5f2; --blanco: #fff;
  --tinta: #17181a; --tinta-2: #45464b; --tinta-3: #5b5c62; --linea: rgba(23, 24, 26, .1); --linea-2: rgba(23, 24, 26, .16);
  --rojo: #d8322b; --rojo-texto: #b9231c; --verde: #2f9e5b; --verde-texto: #1d7543; --ambar: #e3a020; --ambar-texto: #8a5a00;
  --madera: #c29b68; --madera-2: #d8bb8f; --acero: #1d1e21;
  --pla-rojo: #d8322b; --pla-naranja: #f2711c; --pla-amarillo: #f4c21b; --pla-verde: #2f9e5b; --pla-cian: #1f9fd0; --pla-azul: #2a4fd6; --pla-rosa: #f06aa0; --pla-gris: #8d9096;
  --titular: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --texto: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --borde: 0 0 0 1px var(--linea);
  --sombra: 0 1px 0 rgba(0, 0, 0, .04), 0 12px 32px -14px rgba(20, 18, 15, .28);
  --radio: 14px; --radio-s: 10px;
  --margen: clamp(20px, 4.4vw, 64px);
  --ancho: 1312px;
  --curva: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-family: var(--texto); color: var(--tinta); background: var(--papel); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
a { color: inherit; }
b, strong { font-weight: 650; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pla-azul); outline-offset: 3px; border-radius: 6px; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--tinta); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 650; }
.saltar:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Tipografía ---------- */
h1, h2, .tit { font-family: var(--titular); font-weight: 800; letter-spacing: -0.004em; text-wrap: balance; }
h1 { font-size: clamp(3.3rem, 6.6vw, 6.6rem); line-height: .9; }
h2 { font-size: clamp(2.6rem, 4.9vw, 4.6rem); line-height: .93; }
h3 { font-size: 1.3rem; font-weight: 720; line-height: 1.22; letter-spacing: -0.012em; text-wrap: balance; }
.entradilla { font-size: clamp(1.08rem, 1.3vw, 1.2rem); line-height: 1.52; color: var(--tinta-2); max-width: 34em; text-wrap: pretty; }
p { text-wrap: pretty; }

/* Etiqueta de balda: el mismo rótulo que llevan los huecos de la estantería */
.balda { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px 0 0; background: var(--blanco); border-radius: 4px; box-shadow: 0 0 0 1px var(--linea), 0 2px 0 rgba(0, 0, 0, .05); font-size: .82rem; font-weight: 700; color: var(--tinta); white-space: nowrap; }
.balda::before { content: ''; align-self: stretch; width: 6px; border-radius: 4px 0 0 4px; background: var(--c, var(--rojo)); }

/* ---------- Botones ---------- */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border: 0; border-radius: var(--radio-s); background: var(--tinta); color: #fff; font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer; transition: transform .16s var(--curva), background-color .16s; -webkit-tap-highlight-color: transparent; }
.boton:hover { background: #000; }
.boton:active { transform: scale(.97); }
.boton-claro { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--linea-2); }
.boton-claro:hover { background: rgba(23, 24, 26, .05); }
.boton-rojo { background: var(--rojo); }
.boton-rojo:hover { background: #c02a23; }
.boton-pequeno { min-height: 42px; padding: 0 16px; font-size: .94rem; }
.enlace { font-weight: 650; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--linea-2); transition: text-decoration-color .16s; }
.enlace:hover { text-decoration-color: currentColor; }
@media (prefers-reduced-motion: reduce) { .boton { transition: none; } }

/* ---------- Cabecera ---------- */
.cab { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 36px; height: 72px; padding: 0 var(--margen); transition: background-color .2s, box-shadow .2s; }
.cab.sobre { position: fixed; inset: 0 0 auto 0; }
.cab.con-fondo { background: rgba(246, 245, 242, .9); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); box-shadow: 0 1px 0 var(--linea); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--titular); font-weight: 800; font-size: 1.9rem; letter-spacing: .01em; line-height: 1; text-decoration: none; color: var(--tinta); }
.logo svg { width: 30px; height: 30px; flex: none; }
.cab nav { display: flex; gap: 26px; font-size: .95rem; font-weight: 560; color: var(--tinta-2); }
.cab nav a { text-decoration: none; padding: 6px 0; }
.cab nav a:hover, .cab nav a[aria-current] { color: var(--tinta); }
.cab-acciones { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: .95rem; font-weight: 600; }
.cab-acciones .enlace { text-decoration: none; }
.cab-menu { display: none; position: relative; }
.cab-menu summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; }
.cab-menu summary::-webkit-details-marker { display: none; }
.cab-menu summary svg { width: 24px; height: 24px; }
.cab-menu[open] summary { background: rgba(23, 24, 26, .06); }
.cab-menu .panel { position: absolute; right: 0; top: 52px; width: min(300px, calc(100vw - 32px)); background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra), var(--borde); padding: 8px; display: grid; }
.cab-menu .panel a { padding: 13px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.cab-menu .panel a:hover { background: var(--papel); }
@media (max-width: 1080px) { .cab nav { display: none; } .cab-menu { display: block; } }
@media (max-width: 560px) { .cab { gap: 12px; height: 64px; } .cab-acciones { gap: 6px; } .cab-acciones .boton { min-height: 40px; padding: 0 14px; font-size: .9rem; } .logo { font-size: 1.7rem; } }

/* ---------- Secciones ---------- */
.seccion { padding: clamp(80px, 10vw, 140px) var(--margen); }
.contenedor { max-width: var(--ancho); margin: 0 auto; }
.cabeza { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; margin-bottom: clamp(40px, 5vw, 64px); }
.cabeza .balda { grid-column: 1 / -1; justify-self: start; margin-bottom: 4px; }
.cabeza p { font-size: 1.15rem; color: var(--tinta-2); max-width: 32em; }
@media (max-width: 900px) { .cabeza { grid-template-columns: 1fr; } }

.nota { font-size: .875rem; color: var(--tinta-3); line-height: 1.5; }
.tarjeta { background: var(--blanco); border-radius: var(--radio); box-shadow: var(--borde); }

/* Semáforo con color, icono y palabra */
.semaforo { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 8px; border-radius: 999px; font-size: .88rem; font-weight: 680; white-space: nowrap; }
.semaforo svg { width: 16px; height: 16px; }
.semaforo[data-estado="ok"] { background: #e3f3e9; color: var(--verde-texto); }
.semaforo[data-estado="aviso"] { background: #fbf0d6; color: var(--ambar-texto); }
.semaforo[data-estado="pierde"] { background: #fbe4e2; color: var(--rojo-texto); }

/* Pieza por capas: el precio como una columna impresa, una capa por parte */
.capas { display: flex; flex-direction: column-reverse; border-radius: 6px 6px 4px 4px; overflow: hidden; background: var(--pared-2); position: relative; }
.capas > i { display: block; flex: none; position: relative; transition: height .42s var(--curva); background: var(--c); }
.capas > i::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .16) 0 1px, rgba(0, 0, 0, .07) 1px 3px, transparent 3px 4px); }
@media (prefers-reduced-motion: reduce) { .capas > i { transition: none; } }

/* ---------- Pie ---------- */
.pie { background: var(--acero); color: #c9cacd; padding: 72px var(--margen) 40px; font-size: .95rem; }
.pie a { color: #f1f1ef; }
.pie-rejilla { max-width: var(--ancho); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.pie .logo { color: #fff; margin-bottom: 16px; }
.pie h2 { font-family: var(--texto); font-size: .95rem; font-weight: 700; color: #fff; margin-bottom: 14px; letter-spacing: 0; }
.pie ul { list-style: none; display: grid; gap: 9px; }
.pie ul a { text-decoration: none; }
.pie ul a:hover { text-decoration: underline; }
.pie-legal { max-width: var(--ancho); margin: 56px auto 0; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; flex-wrap: wrap; gap: 8px 28px; color: #a9abaf; font-size: .875rem; }
@media (max-width: 900px) { .pie-rejilla { grid-template-columns: 1fr 1fr; } .pie-rejilla > :first-child { grid-column: 1 / -1; } }

.pie-corto { padding: 28px var(--margen); }
.pie-corto .pie-legal { margin-top: 0; padding-top: 0; border-top: 0; justify-content: space-between; }
