/* ============================================================
   SIMEM · base.css
   Tokens, tipografías, reset y componentes usados en todo el sitio.
   (Header y footer tienen su propia hoja: header.css / footer.css)
   ============================================================ */

/* ---------- Tipografías de la marca ---------- */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-SemiBold.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-ExtraBold.woff2") format("woff2");
  font-weight: 800; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Paleta SIMEM */
  --navy:        #0A1F3D;
  --navy-deep:   #071731;
  --navy-soft:   #12294a;
  --blue:        #0057D9;
  --steel:       #2D3F5F;
  --orange:      #FF6A00;
  --orange-dark: #E85F00;
  --amber:       #FF8A2B;
  --gray:        #6B7280;
  --gray-light:  #E6EBF0;

  --paper:       #FFFFFF;
  --paper-soft:  #F5F7FA;
  --ink:         #0A1F3D;
  --text:        #3F4C5F;
  --text-soft:   #647184;
  --line:        #E2E7EF;

  --ff-head: "Manrope", "Segoe UI", system-ui, sans-serif;
  --ff-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  --radius:   14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(10, 31, 61, .06), 0 4px 14px rgba(10, 31, 61, .06);
  --shadow-md: 0 10px 30px rgba(10, 31, 61, .10);
  --shadow-lg: 0 24px 60px rgba(10, 31, 61, .16);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--ff-head);
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}
.section--soft { background: var(--paper-soft); }
.section--navy { background: var(--navy); color: #C9D4E4; }
.section--navy h2, .section--navy h3 { color: #fff; }

/* ---------- Encabezados de sección ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--ff-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
}
/* Línea con punto terminal, como los trazos de "flujo continuo" del logo */
.eyebrow::before {
  content: "";
  width: 34px;
  height: 8px;
  flex: none;
  background:
    radial-gradient(circle 4px at 4px 50%, currentColor 92%, transparent 96%) 0 50% / 8px 8px no-repeat,
    linear-gradient(currentColor, currentColor) 8px 50% / 26px 2px no-repeat;
}
.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}
.section-head h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  margin-top: .9rem;
}
.section-head p {
  margin-top: 1rem;
  font-size: 1.075rem;
  color: var(--text-soft);
}
.section--navy .section-head p { color: #A9B7CC; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--orange);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .95rem 1.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: .97rem;
  letter-spacing: -0.01em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1.5px solid var(--btn-bg);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn--primary { --btn-bg: var(--orange); --btn-fg: #fff; }
.btn--primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn--dark { --btn-bg: var(--navy); --btn-fg: #fff; }
.btn--light { --btn-bg: #fff; --btn-fg: var(--navy); }

/* WhatsApp: siempre verde WhatsApp, en cualquier fondo */
.btn--wa { --btn-bg: #25D366; --btn-fg: #fff; }
.btn--wa:hover { background: #1EBE5D; border-color: #1EBE5D; }
.section--navy .btn--wa,
.btn--wa.is-on-dark { color: #fff; border-color: #25D366; }

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
  position: fixed;
  right: clamp(1rem, 3vw, 1.5rem);
  bottom: clamp(1rem, 3vw, 1.5rem);
  z-index: 900;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  box-shadow: 0 10px 24px rgba(10, 31, 61, .22);
  transition: transform .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.whatsapp-float svg { width: 1.75rem; height: 1.75rem; }
.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  background: #1EBE5D;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 30px rgba(10, 31, 61, .28);
}
.whatsapp-float:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
/* El switch temporal de paleta ocupa la esquina en el home. */
body:has(.palette-fab) .whatsapp-float { bottom: 4.8rem; }
@media (max-width: 520px) {
  .whatsapp-float {
    right: 1rem;
    bottom: 1rem;
    width: 3.15rem;
    height: 3.15rem;
  }
  .whatsapp-float svg { width: 1.55rem; height: 1.55rem; }
  body:has(.palette-fab) .whatsapp-float { bottom: 4.5rem; }
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 28%, transparent);
}
.btn--ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.section--navy .btn--ghost, .btn--ghost.is-on-dark {
  color: #fff;
  border-color: rgba(255, 255, 255, .38);
}
.section--navy .btn--ghost:hover, .btn--ghost.is-on-dark:hover {
  background: rgba(255, 255, 255, .10);
}

/* ---------- Modal compartido de contacto ---------- */
.contact-modal {
  position: fixed;
  inset: 0;
  width: min(680px, calc(100% - 2rem));
  height: fit-content;
  max-height: calc(100vh - 2rem);
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: var(--text);
}
.contact-modal::backdrop {
  background: rgba(7, 23, 49, .72);
  backdrop-filter: blur(3px);
}
.contact-modal__panel {
  position: relative;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 1rem;
  padding: clamp(1.35rem, 4vw, 2.25rem);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.contact-modal__top { padding-right: 2.5rem; }
.contact-modal__top h2 {
  margin-top: .7rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}
.contact-modal__top p { margin-top: .55rem; color: var(--text-soft); }
.contact-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--steel);
  font-size: 1.4rem;
  line-height: 1;
}
.contact-modal__close:hover { color: var(--orange); border-color: var(--orange); }
.contact-modal__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1rem;
}
.contact-modal__field { display: grid; gap: .35rem; }
.contact-modal__field--wide { grid-column: 1 / -1; }
.contact-modal__field label {
  font-family: var(--ff-head);
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink);
}
.contact-modal__field input,
.contact-modal__field select,
.contact-modal__field textarea {
  width: 100%;
  padding: .45rem .8rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: .93rem;
}
.contact-modal__field textarea { min-height: 105px; resize: vertical; }
.contact-modal__field input:focus,
.contact-modal__field select:focus,
.contact-modal__field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}
.contact-modal__field.has-error input,
.contact-modal__field.has-error select,
.contact-modal__field.has-error textarea { border-color: #D93838; }
.contact-modal__note {
  min-height: 1.25em;
  font-size: .88rem;
  color: var(--text-soft);
}
.contact-modal__note.is-ok { color: #1E8E4E; }
.contact-modal__note.is-err { color: #D93838; }
.contact-modal__submit { justify-self: start; }

@media (max-width: 520px) {
  .contact-modal {
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem);
  }
  .contact-modal__panel { max-height: calc(100dvh - 1rem); }
  .contact-modal__fields { grid-template-columns: 1fr; }
  .contact-modal__field--wide { grid-column: auto; }
  .contact-modal__submit { width: 100%; }
}

/* Detalle "flujo continuo" (punto + línea) a la izquierda de un título sin eyebrow.
   Marcador en línea con el texto, en la primera línea. */
.title-flow::before {
  content: "";
  display: inline-block;
  vertical-align: 0.22em;
  width: 34px;
  height: 8px;
  margin-right: .75rem;
  background:
    radial-gradient(circle 4px at 4px 50%, var(--orange) 92%, transparent 96%) 0 50% / 8px 8px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 8px 50% / 26px 2px no-repeat;
}

/* ---------- Utilidades ---------- */
.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;
}

/* Carrusel móvil (estándar del proyecto — ver ESTANDARES.md).
   Añade la clase .m-carousel a una grilla/lista de tarjetas y en móvil
   se convierte en un carrusel deslizable con scroll-snap, sin JavaScript.
   En pantallas grandes no hace nada: mantiene el layout original. */
@media (max-width: 620px) {
  .m-carousel {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: .5rem;
    overscroll-behavior-x: contain;
  }
  .m-carousel::-webkit-scrollbar { display: none; }
  .m-carousel > * {
    scroll-snap-align: start;
    flex: 0 0 80%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}


/* ==================================================================
   TEMP · switch de paleta (2 opciones) — ELIMINAR más adelante
   (este bloque + .palette-fab en index.html + JS en home.js + <script> del <head>)
   ================================================================== */
:root[data-palette="b"] {           /* Opción B — negro en lugar de azul oscuro */
  --navy:        #17171A;
  --navy-deep:   #000000;
  --navy-soft:   #242428;
  --ink:         #141416;
}
:root[data-palette="b"] .hero::after {
  background: linear-gradient(100deg, #000 26%, rgba(0,0,0,.86) 48%, rgba(0,0,0,.45) 78%, rgba(0,0,0,.30) 100%);
}
:root[data-palette="b"] .svc-panel::after {
  background: linear-gradient(175deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.34) 42%, rgba(0,0,0,.86) 100%);
}
:root[data-palette="b"] .svc-panel:hover::after,
:root[data-palette="b"] .svc-panel:focus-within::after {
  background: linear-gradient(175deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.72) 45%, rgba(0,0,0,.95) 100%);
}
:root[data-palette="b"] .maint__badge { background: rgba(0,0,0,.9); }

.palette-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem .95rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-family: var(--ff-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.palette-fab::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent);
}
.palette-fab:hover { transform: translateY(-1px); }
/* ===== fin TEMP switch paleta ===== */
