/* ------------------------------------------------------------------
   QA-Right | Hoja de estilos principal
   Paleta: verde petróleo (calidad / laboratorio) sobre papel claro
   Tipografía: IBM Plex Serif (títulos) + IBM Plex Sans (texto)
------------------------------------------------------------------ */

:root {
  --ink:        #0E2A31;
  --ink-soft:   #38565D;
  --ink-mute:   #6C8288;
  --paper:      #F4F6F3;
  --white:      #FFFFFF;
  --accent:     #14705F;
  --accent-dk:  #0C4E42;
  --rule:       #D3DCD8;
  --rule-soft:  #E6ECE8;

  --wrap: 1120px;
  --gap: 1.5rem;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2rem;
  --fs-2xl: 2.75rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); }

p { margin: 0 0 1em; max-width: 68ch; }

a { color: var(--accent-dk); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.saltar {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.saltar:focus { left: 1rem; top: 1rem; }

/* ---------------------------- Encabezado --------------------------- */

.cabecera {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
}

.cabecera__interior {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 84px;
}

.marca { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.marca img { width: 176px; }
.marca__bajada {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  border-left: 1px solid var(--rule);
  padding-left: 0.9rem;
  max-width: 13ch;
  line-height: 1.3;
}

.menu-boton {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  cursor: pointer;
}

.nav > ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
}

.nav a, .nav__boton {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  background: none;
  border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit;
  cursor: pointer;
}
.nav a:hover, .nav__boton:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.nav__item { position: relative; }
.nav__boton--activo { color: var(--ink); border-bottom: 2px solid var(--accent); }
.nav__boton::after { content: " ▾"; font-size: 0.7em; color: var(--ink-mute); }

.nav .submenu {
  list-style: none;
  margin: 0;
  display: none;
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 250px;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 0.5rem 0;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 12px 24px -18px rgba(14, 42, 49, 0.55);
}
.nav .submenu.abierto { display: flex; }
.nav .submenu li { width: 100%; }
.nav .submenu a {
  display: block;
  padding: 0.5rem 1.1rem;
  border-bottom: 0;
}
.nav .submenu a:hover { background: var(--paper); }

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

.portada {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 4.5rem 0 3.5rem;
}

.portada__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

.portada h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: 1rem; }
.portada p { font-size: var(--fs-md); color: var(--ink-soft); }

.portada__acciones { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }

.boton {
  display: inline-block;
  background: var(--accent-dk);
  color: var(--white);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  font-size: var(--fs-sm);
  border: 1px solid var(--accent-dk);
  border-radius: 2px;
}
.boton:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }

.boton--linea { background: transparent; color: var(--ink); border-color: var(--rule); }
.boton--linea:hover { background: var(--paper); color: var(--ink); border-color: var(--ink-mute); }

/* Índice de normas: el elemento distintivo de la portada */
.normas {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.5rem;
}
.normas__titulo {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  margin: 0 0 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}
.normas ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.normas li {
  background: var(--white);
  padding: 0.7rem 0.8rem;
  font-size: var(--fs-sm);
  line-height: 1.35;
}
.normas li span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
}

/* ------------------------------ Secciones -------------------------- */

.seccion { padding: 4rem 0; }
.seccion--blanca { background: var(--white); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.seccion__cabecera { max-width: 70ch; margin-bottom: 2.2rem; }

.pagina-titulo {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 3rem 0 2.5rem;
}
.pagina-titulo h1 { margin-bottom: 0.4rem; }
.pagina-titulo p { color: var(--ink-soft); margin: 0; }

.miga {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  margin-bottom: 1.2rem;
}
.miga a { color: var(--ink-mute); }

/* Tarjetas de la home */
.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.tarjeta {
  background: var(--white);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}
.tarjeta img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.tarjeta__cuerpo { padding: 1.4rem 1.4rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.tarjeta h3 { margin-bottom: 0.5rem; }
.tarjeta p { font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: 1.2rem; }
.tarjeta ul { font-size: var(--fs-sm); color: var(--ink-soft); padding-left: 1.1rem; margin: 0 0 1.2rem; }
.tarjeta .enlace { margin-top: auto; }

.enlace {
  font-size: var(--fs-sm);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  align-self: flex-start;
}
.enlace:hover { border-bottom-width: 2px; }

/* Grilla de servicios */
.servicios {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.servicios li { display: flex; }
.servicio {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}
.servicio img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.servicio__cuerpo { padding: 1.1rem 1.2rem 1.3rem; }
.servicio h3 { font-size: 1.125rem; margin-bottom: 0.3rem; }
.servicio p { font-size: var(--fs-sm); color: var(--ink-soft); margin: 0; }
.servicio:hover { border-color: var(--accent); }
.servicio:hover h3 { color: var(--accent-dk); }
.servicio[aria-disabled="true"] { pointer-events: none; }

/* Ficha de servicio */
.ficha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 3rem;
  align-items: start;
}
.ficha__imagen { border: 1px solid var(--rule); background: var(--white); padding: 0.75rem; }
.ficha__imagen img { width: 100%; }
.ficha__imagen + .ficha__imagen { margin-top: 1.2rem; }

.lista { list-style: none; padding: 0; margin: 0; }
.lista > li {
  border-top: 1px solid var(--rule);
  padding: 0.85rem 0;
  font-size: var(--fs-base);
}
.lista > li:last-child { border-bottom: 1px solid var(--rule); }
.lista ul {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0 0 0 1.1rem;
  border-left: 2px solid var(--rule-soft);
}
.lista ul li {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  padding: 0.2rem 0;
}
.lista .nota { font-size: var(--fs-sm); color: var(--ink-soft); margin: 0.4rem 0 0; }

/* Otros servicios (navegación entre fichas) */
.otros {
  margin-top: 3rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}
.otros h2 { font-size: var(--fs-md); }
.otros ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.otros a {
  display: inline-block;
  font-size: var(--fs-sm);
  text-decoration: none;
  border: 1px solid var(--rule);
  background: var(--white);
  padding: 0.45rem 0.9rem;
  border-radius: 2px;
  color: var(--ink-soft);
}
.otros a:hover { border-color: var(--accent); color: var(--accent-dk); }

/* Clientes */
.clientes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  list-style: none;
  padding: 0;
  margin: 0;
}
.clientes li {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem 1.2rem;
  min-height: 140px;
}
.clientes img { max-height: 82px; width: auto; object-fit: contain; }

/* Contacto */
.contacto {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.datos { list-style: none; padding: 0; margin: 0; }
.datos li { border-top: 1px solid var(--rule); padding: 1rem 0; }
.datos li:last-child { border-bottom: 1px solid var(--rule); }
.datos dt, .datos .rotulo {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  margin-bottom: 0.2rem;
}
.datos a { text-decoration: none; }
.datos a:hover { text-decoration: underline; }

.formulario { background: var(--white); border: 1px solid var(--rule); padding: 1.8rem; }
.campo { margin-bottom: 1.1rem; }
.campo label { display: block; font-size: var(--fs-sm); margin-bottom: 0.35rem; color: var(--ink-soft); }
.campo input, .campo textarea {
  width: 100%;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.65rem 0.8rem;
}
.campo input:focus, .campo textarea:focus { background: var(--white); border-color: var(--accent); outline: none; }
.campo textarea { min-height: 150px; resize: vertical; }
.formulario .aviso { font-size: var(--fs-xs); color: var(--ink-mute); margin: 0.9rem 0 0; }
.formulario button { font: inherit; cursor: pointer; }
.campo-extra { position: absolute; left: -9999px; top: -9999px; }

/* Franja de cierre */
.cierre {
  background: var(--ink);
  color: var(--paper);
  padding: 3rem 0;
}
.cierre h2 { color: var(--white); }
.cierre p { color: #C3D2D1; }
.cierre .boton { background: var(--white); color: var(--ink); border-color: var(--white); }
.cierre .boton:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }

/* Pie */
.pie {
  background: var(--white);
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.pie__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
}
.pie h3 { font-size: var(--fs-sm); font-family: inherit; font-weight: 600; margin-bottom: 0.7rem; }
.pie ul { list-style: none; padding: 0; margin: 0; }
.pie li { padding: 0.15rem 0; }
.pie a { color: var(--ink-soft); text-decoration: none; }
.pie a:hover { color: var(--accent-dk); text-decoration: underline; }
.pie__legal {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* ------------------------------ Responsive ------------------------- */

@media (max-width: 900px) {
  .portada__grid, .ficha, .contacto { grid-template-columns: minmax(0, 1fr); gap: 2.2rem; }
  .trio, .servicios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pie__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .menu-boton { display: block; }
  .marca__bajada { display: none; }
  .cabecera__interior { flex-wrap: wrap; min-height: 68px; }
  .nav { display: none; width: 100%; border-top: 1px solid var(--rule); padding: 0.5rem 0 1rem; }
  .nav.abierto { display: block; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav > ul > li { border-bottom: 1px solid var(--rule-soft); }
  .nav a, .nav__boton { display: block; width: 100%; text-align: left; padding: 0.7rem 0; border-bottom: 0; }
  .nav a[aria-current="page"] { border-bottom: 0; color: var(--accent-dk); }
  .nav .submenu { position: static; border: 0; box-shadow: none; padding: 0 0 0.6rem 1rem; min-width: 0; }
  .nav .submenu a { padding: 0.45rem 0; }
}

@media (max-width: 560px) {
  .trio, .servicios, .normas ul { grid-template-columns: minmax(0, 1fr); }
  .seccion { padding: 3rem 0; }
  .portada { padding: 3rem 0 2.5rem; }
  .pie__grid { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .cabecera, .cierre, .otros, .formulario { display: none; }
  body { background: #fff; }
}
