/* ==========================================================================
   Sellos Mecánicos Lerma — Encabezado y pie (cuadro de rotulación)
   Se carga en todas las páginas. Tokens con prefijo --l- para no chocar con
   los estilos de las páginas que aún conservan su cuerpo anterior.
   ========================================================================== */

@font-face {
  font-family: 'Sofia Sans Condensed';
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url('/fonts/sofia-sans-condensed-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Sofia Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/sofia-sans-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Red Hat Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/red-hat-mono-500-latin.woff2') format('woff2');
}

:root {
  /* Papel y tinta del manual */
  --l-paper:      #F6F7F9;
  --l-sheet:      #FFFFFF;
  --l-paper-2:    #ECEEF2;
  --l-ink:        #101114;
  --l-ink-2:      #474D57;
  --l-rule:       #C5CAD3;
  --l-rule-soft:  #DDE1E7;
  /* Azul de globos y cotas */
  --l-blue:       #1C56B0;
  --l-blue-deep:  #143F84;
  /* Marcatextos: el amarillo del logo marca la pieza que se necesita */
  --l-marker:     #F8D217;
  --l-marker-ink: #101114;

  --l-f-cond: 'Sofia Sans Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --l-f-sans: 'Sofia Sans', 'Segoe UI', system-ui, sans-serif;
  --l-f-mono: 'Red Hat Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --l-line: 1.5px;
  --l-ease: cubic-bezier(.16, 1, .3, 1);
  --l-bar-h: 64px;
}

/* ── Encabezado ──────────────────────────────────────────────────────────── */
.sh-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--l-sheet);
  border-bottom: var(--l-line) solid var(--l-ink);
  font-family: var(--l-f-sans);
  color: var(--l-ink);
  transition: box-shadow 240ms var(--l-ease);
}
.sh-header.scrolled { box-shadow: 0 6px 18px -12px rgba(16, 17, 20, .45); }

.sh-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: stretch;
  max-width: 1360px;
  height: var(--l-bar-h);
  margin-inline: auto;
}

.sh-brand {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: .75rem;
  align-items: center;
  align-content: center;
  padding-inline: clamp(1rem, 2.5vw, 1.5rem);
  border-right: 1px solid var(--l-rule);
  color: var(--l-ink);
  text-decoration: none;
}
.sh-brand img { grid-row: 1 / 3; width: 44px; height: 44px; }
.sh-brand__name {
  font-family: var(--l-f-cond);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.05;
  letter-spacing: .005em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sh-brand__meta {
  font-size: .8125rem;
  line-height: 1.3;
  color: var(--l-ink-2);
  white-space: nowrap;
}

.sh-nav { display: none; }
.sh-nav a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-inline: 1.05rem;
  border-right: 1px solid var(--l-rule);
  font-family: var(--l-f-cond);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: .01em;
  color: var(--l-ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms var(--l-ease);
}
.sh-nav a:hover { background: var(--l-paper); }
.sh-nav a[aria-current="page"] {
  background: linear-gradient(transparent 22%, var(--l-marker) 22%, var(--l-marker) 80%, transparent 80%) no-repeat;
  background-size: 100% 100%;
}
.sh-pos {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1.25px solid var(--l-blue);
  border-radius: 50%;
  font-family: var(--l-f-mono);
  font-size: .75rem;
  line-height: 1;
  color: var(--l-blue);
  background: var(--l-sheet);
}

.sh-cta {
  display: none;
  align-items: center;
  gap: .6rem;
  padding-inline: 1.25rem;
  background: var(--l-blue);
  color: #fff;
  font-family: var(--l-f-cond);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms var(--l-ease);
}
.sh-cta:hover { background: var(--l-blue-deep); color: #fff; }
.sh-cta svg { width: 20px; height: 20px; flex: none; }
.sh-cta__num { font-family: var(--l-f-mono); font-weight: 500; font-size: .875rem; }

.sh-wa {
  display: grid;
  place-items: center;
  width: var(--l-bar-h);
  border-left: 1px solid var(--l-rule);
  background: var(--l-blue);
  color: #fff;
}
.sh-wa svg { width: 24px; height: 24px; }
.sh-wa:hover { background: var(--l-blue-deep); color: #fff; }

.sh-menu {
  display: grid;
  place-items: center;
  width: var(--l-bar-h);
  border: 0;
  border-left: 1px solid var(--l-rule);
  background: var(--l-sheet);
  color: var(--l-ink);
  cursor: pointer;
}
.sh-menu svg { width: 24px; height: 24px; }
.sh-menu:hover { background: var(--l-paper); }

@media (min-width: 1100px) {
  .sh-bar { grid-template-columns: auto 1fr auto auto; }
  .sh-nav { display: flex; align-items: stretch; }
  .sh-cta { display: flex; }
  .sh-wa  { display: none; }
}
@media (max-width: 479px) {
  .sh-brand__meta { display: none; }
  .sh-brand { grid-template-rows: auto; }
  .sh-brand img { grid-row: auto; width: 40px; height: 40px; }
  .sh-brand__name { font-size: 1.0625rem; white-space: normal; }
}

/* Menú lateral */
.sh-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(16, 17, 20, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--l-ease);
}
.sh-scrim.is-open { opacity: 1; pointer-events: auto; }
.sh-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 120;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--l-sheet);
  border-left: var(--l-line) solid var(--l-ink);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 320ms var(--l-ease), visibility 0s linear 320ms;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sh-drawer.is-open { transform: none; visibility: visible; transition: transform 320ms var(--l-ease); }
html.menu-abierto { overflow: hidden; }
.sh-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--l-bar-h);
  padding-left: 1.25rem;
  border-bottom: 1px solid var(--l-rule);
  font-size: .9375rem;
  color: var(--l-ink-2);
}
.sh-drawer__close {
  display: grid;
  place-items: center;
  width: var(--l-bar-h);
  height: var(--l-bar-h);
  border: 0;
  border-left: 1px solid var(--l-rule);
  background: none;
  color: var(--l-ink);
  cursor: pointer;
}
.sh-drawer__close svg { width: 22px; height: 22px; }
.sh-drawer__lines a {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  align-items: center;
  gap: .25rem .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--l-rule-soft);
  color: var(--l-ink);
  text-decoration: none;
}
.sh-drawer__lines .sh-pos { width: 2rem; height: 2rem; font-size: .875rem; grid-row: 1 / 3; }
.sh-drawer__lines strong {
  font-family: var(--l-f-cond);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.1;
  text-transform: uppercase;
}
.sh-drawer__lines span:last-child { font-size: .9375rem; color: var(--l-ink-2); }
.sh-drawer__lines a:hover { background: var(--l-paper); }
.sh-drawer__more { padding: .75rem 0 1rem; }
.sh-drawer__more a {
  display: block;
  padding: .6rem 1.25rem;
  font-size: 1.0625rem;
  color: var(--l-ink);
  text-decoration: none;
}
.sh-drawer__more a:hover { color: var(--l-blue); }
.sh-drawer__contact {
  margin-top: auto;
  padding: 1.25rem;
  border-top: 1px solid var(--l-rule);
  background: var(--l-paper);
  font-size: .9375rem;
  color: var(--l-ink-2);
}
.sh-drawer__contact a.sh-btn { margin-bottom: .75rem; }

.sh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 48px;
  padding: .7rem 1.25rem;
  background: var(--l-blue);
  color: #fff;
  font-family: var(--l-f-cond);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}
.sh-btn svg { width: 20px; height: 20px; }
.sh-btn:hover { background: var(--l-blue-deep); color: #fff; }

/* ── Pie: cuadro de rotulación ───────────────────────────────────────────── */
.sh-footer {
  background: var(--l-sheet);
  color: var(--l-ink);
  font-family: var(--l-f-sans);
  font-size: .9375rem;
  line-height: 1.55;
  border-top: var(--l-line) solid var(--l-ink);
}
.sh-footer a { color: inherit; text-decoration: none; }
.sh-footer a:hover { color: var(--l-blue); text-decoration: underline; text-underline-offset: .2em; }
.sh-tb {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  max-width: 1360px;
  margin-inline: auto;
  border-left: 1px solid var(--l-rule);
}
.sh-tb__cell {
  grid-column: span 12;
  padding: 1.25rem clamp(1rem, 2.5vw, 1.5rem) 1.5rem;
  border-right: 1px solid var(--l-rule);
  border-bottom: 1px solid var(--l-rule);
}
.sh-tb__label {
  display: block;
  margin-bottom: .6rem;
  font-family: var(--l-f-mono);
  font-size: .6875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--l-ink-2);
}
.sh-tb__cell ul { list-style: none; margin: 0; padding: 0; }
.sh-tb__cell li + li { margin-top: .3rem; }
.sh-tb__brand { display: flex; gap: .9rem; align-items: flex-start; }
.sh-tb__brand img { width: 56px; height: 56px; flex: none; }
.sh-tb__brand strong {
  display: block;
  font-family: var(--l-f-cond);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.05;
  text-transform: uppercase;
}
.sh-tb__brand p { margin: .35rem 0 0; color: var(--l-ink-2); }
.sh-tb__lines a { display: inline-flex; align-items: center; gap: .5rem; }
.sh-tb__lines .sh-pos { width: 1.625rem; height: 1.625rem; font-size: .625rem; }
.sh-tb__contact p { margin: 0 0 .3rem; overflow-wrap: anywhere; }
.sh-tb__contact .mono, .sh-tb__rev .mono { font-family: var(--l-f-mono); font-size: .875rem; }
.sh-tb__legal { color: var(--l-ink-2); font-size: .8125rem; }
.sh-tb__legal p { margin: 0 0 .5rem; max-width: 58ch; }
.sh-tb__dirs a { white-space: nowrap; }
.sh-tb__rev { font-family: var(--l-f-mono); font-size: .75rem; color: var(--l-ink-2); }

@media (min-width: 720px) {
  .sh-tb__brand-cell   { grid-column: span 12; }
  .sh-tb__lines-cell   { grid-column: span 6; }
  .sh-tb__svc-cell     { grid-column: span 6; }
  .sh-tb__brands-cell  { grid-column: span 6; }
  .sh-tb__contact-cell { grid-column: span 6; }
  .sh-tb__legal-cell   { grid-column: span 9; }
  .sh-tb__rev-cell     { grid-column: span 3; }
}
@media (min-width: 1100px) {
  .sh-tb__brand-cell   { grid-column: span 3; }
  .sh-tb__lines-cell   { grid-column: span 2; }
  .sh-tb__svc-cell     { grid-column: span 2; }
  .sh-tb__brands-cell  { grid-column: span 2; }
  .sh-tb__contact-cell { grid-column: span 3; }
  .sh-tb__legal-cell   { grid-column: span 10; }
  .sh-tb__rev-cell     { grid-column: span 2; }
}

/* ── Botón flotante de WhatsApp (lo crea js/main.js) ─────────────────────── */
.whatsapp-float {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #128C4B;
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(16, 17, 20, .55);
  transition: transform 200ms var(--l-ease), background-color 200ms var(--l-ease);
}
.whatsapp-float:hover { background: #0E6F3B; transform: translateY(-2px); }
.whatsapp-float svg { width: 28px; height: 28px; }

/* Foco visible del sistema del manual */
.sh-header :focus-visible,
.sh-drawer :focus-visible,
.sh-footer :focus-visible,
.whatsapp-float:focus-visible {
  outline: 2.5px solid var(--l-blue);
  outline-offset: 2px;
}
.sh-cta:focus-visible, .sh-wa:focus-visible, .sh-btn:focus-visible { outline-color: var(--l-ink); }

@media (prefers-reduced-motion: reduce) {
  .sh-drawer, .sh-scrim, .sh-header, .whatsapp-float { transition-duration: 1ms; }
}
