@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;600;700&display=swap');

:root {
  --fuente-texto: "Lato", sans-serif;
  --color-primary: #143D60;
  --color-secondary: #EB5B00;
  font-size: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== PRELOADER ===== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family: var(--fuente-texto);
  font-size: 1.5rem;
  color: var(--color-primary);
}

/* ===== HEADER ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  background-color: rgba(255, 255, 255, 0.95);
  width: 100%;
  padding: 1rem 5%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  border-bottom: 6px solid var(--color-primary);
  min-height: 125px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logoQYM {
  height: auto;
  transform: scale(1.3);
  align-self: center;
}

.titulos-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  margin: 0 2rem;
  align-self: center;
}

.frase_header {
  font-family: var(--fuente-texto);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: #666;
  line-height: 1.4;
  margin: 0;
}

.header__menu {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  position: relative;
  top: 65px;
  margin: 0;
}

.header__menu__link {
  font-family: var(--fuente-texto);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  text-decoration: none;
  padding-bottom: 5px;
  transition: color 0.3s, border-bottom 0.3s;
}

.header__menu__link:hover,
.header__menu__link.active {
  color: var(--color-secondary);
  border-bottom: 2px solid var(--color-secondary);
}

.nav-toggle, .hamburger {
  display: none;
}

/* ===== BODY Y CONTENEDOR ===== */
body {
  font-family: var(--fuente-texto);
  padding-top: 180px;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  background-color: #fff;
  color: #333;
  line-height: 1.6;
}

.contenedor-principal {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

section {
  width: 100%;
  margin-bottom: 80px;
  scroll-margin-top: 140px;
}

/* ===== HERO BANNER (Fotos principales SIEMPRE A COLOR) ===== */
.hero-banner {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: block;
  margin-bottom: 0;
  line-height: 0;
  border-radius: 10px;
}

.hero-img-inicio,
.hero-img-empresa,
.hero-img-servicios,
.hero-img-clientes,
.hero-img-equipo,
.hero-img-contacto {
  width: 100%;
  height: auto;
  display: block;
}

/* Degradé azul en la parte superior */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 180px;
  background: linear-gradient(
    to bottom,
    rgba(20, 61, 96, 0.90) 0%,
    rgba(20, 61, 96, 0.75) 50%,
    rgba(20, 61, 96, 0) 100%
  );
  z-index: 2;
  pointer-events: none;
  border-radius: 10px 10px 0 0;
}

/* ===== CARRUSEL ANIMADO DE FRASES ===== */
.hero-carousel {
  position: absolute;
  top: -30px;
  left: 4%;
  right: 4%;
  width: 92%;
  height: 180px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.hero-slide.exit {
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.hero-slide p {
  font-family: var(--fuente-texto);
  font-size: 1.35rem;
  font-weight: 600;
  font-style: italic;
  color: #ffffff;
  line-height: 1.4;
  margin: 0;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
  padding: 15px 20px;
}

.hero-slide .resaltar {
  color: #FFB347;
  font-weight: 700;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}

/* ===== CONTENIDO FLEX (alineado con foto principal) ===== */
.contenido-flex {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  max-width: 1400px;
  margin: 50px auto 0;
  padding: 0 20px;
  width: 100%;
}

.texto-contenido {
  flex: 1;
  min-width: 0;
}

.texto-contenido .section-title {
  font-family: var(--fuente-texto);
  font-weight: 700;
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 25px;
  text-align: center;
}

.texto-contenido h3 {
  font-family: var(--fuente-texto);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 15px;
}

.texto-contenido p,
.texto-contenido ul {
  font-family: var(--fuente-texto);
  font-weight: 400;
  font-size: 1.15rem;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.6;
}

.texto-contenido ul {
  padding-left: 25px;
}

.texto-contenido ul li {
  margin-bottom: 10px;
}

.resaltar {
  color: var(--color-secondary);
  font-weight: 700;
}

/* ===== FOTOS DE APOYO (AGRANDADAS, 45% del ancho) ===== */
.imagen-apoyo {
  flex: 0 0 45%;
  max-width: 35%;
  display: flex;
  align-items: flex-start;
}

.fotoindex,
.infografia,
.fotoservicios,
.fotoequipo {
  width: 100%;
  height: auto;
  border-radius: 10px;
  filter: grayscale(100%);
  transition: filter 0.5s ease;
  display: block;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.fotoindex:hover,
.infografia:hover,
.fotoservicios:hover,
.fotoequipo:hover {
  filter: grayscale(0%);
}

/* Recuadros Visión/Misión */
.recuadro {
  border: 1px solid var(--color-primary);
  border-radius: 10px;
  padding: 20px;
  max-width: 100%;
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

.recuadro:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.recuadro h3 {
  margin-bottom: 10px;
  text-align: center;
  text-decoration: underline;
  text-decoration-color: #EB5B00;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.recuadro .vym {
  margin-bottom: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .recuadro .corte-vym {
    display: none;
  }
}

/* ===== CLIENTES GRID ===== */
.clientes-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.lista-clientes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.cliente {
  padding: 15px;
  font-family: var(--fuente-texto);
  font-weight: 600;
  font-size: 1rem;
  color: #333;
  border-left: 3px solid var(--color-secondary);
  background-color: #f9f9f9;
  transition: transform 0.3s, box-shadow 0.3s;
}

.cliente:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background-color: #fff;
}

/* ===== FOOTER ===== */
.footer {
  background-color: #fff;
  width: 100%;
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 3px solid var(--color-secondary);
}

.footer__contenedor {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.footer__info p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-primary);
  font-family: var(--fuente-texto);
}

/* ===== ANIMACIONES ===== */
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.slide-out {
  animation: slideOut 0.5s forwards;
}

.slide-in {
  animation: slideIn 0.5s forwards;
}

/* ===== VIÑETAS DECORATIVAS (sección INICIO) ===== */
.vineta-container {
  position: relative;
  width: 100%;
  margin-bottom: 45px;
}

.vineta {
  display: block;
  width: fit-content;
  margin: 0 auto 20px auto;
  font-size: 1.5rem;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 2px;
  text-align: center;
}

.vineta-container p {
  margin-bottom: 0;
}

/* ===== LISTA DE NIVELES EN INICIO (centrada con ◆ alineados) ===== */
#inicio .texto-contenido ul {
  text-align: left;
  list-style: none;
  padding-left: 0;
  margin: 20px auto 30px auto;
  display: inline-block;
  width: auto;
}

#inicio .texto-contenido ul li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
  font-size: 1.15rem;
  color: #333;
  line-height: 1.5;
  font-family: var(--fuente-texto);
  font-weight: 700;
  text-align: left;
}

#inicio .texto-contenido ul li::before {
  content: "◆";
  color: #EB5B00;
  font-size: 1rem;
  margin-right: 12px;
  min-width: 20px;
  text-align: center;
  display: inline-block;
}

/* ===== SECCIÓN CONTACTO (Alineación centrada) ===== */
#contacto .texto-contenido p {
  text-align: center;           /* Centra el texto debajo del título */
  font-size: 1.25rem;           /* Un poco más grande para que destaque */
  font-weight: 600;             /* Semi-negrita para mayor legibilidad */
  color: var(--color-primary);  /* Usa el azul corporativo de QYMSA */
  margin-bottom: 10px;          /* Espacio justo entre el correo y el teléfono */
}

#contacto .texto-contenido p.cel {
  margin-bottom: 0;             /* Elimina el margen extra al final del teléfono */
}

/* ===== SECCIÓN TQM ===== */
.tqm-header {
  text-align: center;
  margin-bottom: 50px;
  padding: 20px;
}

/* ===== TÍTULO TQM CON EFECTO SOMBRA ===== */
.tqm-title {
  font-family: var(--fuente-texto);
  font-weight: 700;
  font-size: 3.75rem; /* ← AUMENTADO: Antes 2.5rem */
  color: var(--color-primary);
  margin: 0;
  position: relative;
  display: inline-block;
  white-space: nowrap; /* ← CLAVE: Obliga a que el texto azul quede en 1 sola línea */
}

.tqm-subtitle {
  font-family: var(--fuente-texto);
  font-weight: 400;
  font-size: 1.3rem;
  color: #333;
  margin: 15px 0 0 0;
}

.logo-tqm {
  width: 80px;
  height: auto;
  display: block;
  margin: 0 auto 30px auto;
}

.tqm-intro {
  font-family: var(--fuente-texto);
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 10px;
  display: inline-block;
}

.tqm-lista {
  list-style: none;
  padding-left: 0;
  margin-bottom: 30px;
}

.tqm-lista li {
  font-family: var(--fuente-texto);
  font-size: 1.15rem;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.6;
  padding-left: 10px;
  border-left: 3px solid var(--color-secondary);
}

.tqm-lista li strong {
  color: var(--color-primary);
  font-weight: 700;
}

.tqm-cita {
  font-family: var(--fuente-texto);
  font-size: 1.1rem;
  color: #555;
  line-height: 1.7;
  padding: 20px;
  border-left: 4px solid var(--color-primary);
  background-color: #f9f9f9;
  margin-top: 20px;
}

.tqm-diagrama {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  
  /* =========================================
     CONTROLES DE POSICIÓN MANUAL DEL DIAGRAMA
     ========================================= */
  /* El primer valor mueve Horizontal (X), el segundo Vertical (Y) */
  transform: translate(22px, 15px); 
}


/* Consolidación responsive: una sola hoja activa */
:root { --header-h: 125px; }
html { scroll-padding-top: calc(var(--header-h) + 12px); }
body { padding-top: 0; overflow-x: visible; }
.header { position: sticky; top: 0; align-items: center; gap: 12px; min-height: 0; padding: 12px 4%; }
.logoQYM { width: 90px; max-width: 100%; transform: none; }
.titulos-header { margin: 0; min-width: 0; }
.header__menu { top: 0; gap: 8px 18px; }
.header__menu__link { display: block; padding: 8px 3px; font-size: 1rem; border-bottom: 2px solid transparent; }
.header__menu__link[aria-current] { color: var(--color-secondary); border-bottom-color: var(--color-secondary); }
section { scroll-margin-top: 0; }
.tqm-title { white-space: normal; font-size: clamp(1.7rem, 4vw, 3.2rem); line-height: 1.2; text-shadow: 2px 2px #f5c6a7; }
.tqm-diagrama { transform: none; box-shadow: none; }
.imagen-apoyo { min-width: 0; flex: 0 0 40%; max-width: 40%; }
.infografia { filter: none; }
.hero-banner { display: grid; grid-template-areas: 'banner'; line-height: normal; background: var(--color-primary); }
.hero-banner > img, .hero-overlay, .hero-carousel { grid-area: banner; }
.hero-banner > img { height: 100%; object-fit: cover; min-height: 220px; }
.hero-overlay { position: static; height: 100%; background: linear-gradient(to bottom, rgba(20,61,96,.95), rgba(20,61,96,.65) 65%, transparent); }
.hero-carousel { position: relative; inset: auto; width: 100%; height: auto; display: grid; align-content: start; padding: 12px 4% 45px; }
.hero-slide { position: relative; grid-area: 1 / 1; visibility: hidden; }
.hero-slide.active, .hero-slide.exit { visibility: visible; }
.hero-slide[hidden], [hidden] { display: none !important; }
.hero-slide p { font-size: clamp(1rem, 1.7vw, 1.35rem); padding: 12px 0; }
.carousel-toggle { position: absolute; z-index: 4; bottom: 8px; right: 8px; background: #fff; color: #143D60; border: 1px solid #143D60; border-radius: 5px; padding: 8px 12px; cursor: pointer; }
.servicios-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; list-style: none; padding: 0 !important; }
.servicios-grid li { border-left: 3px solid var(--color-secondary); background: #f5f7fa; padding: 14px; }
.servicios-grid li p { font-size: 1rem; margin: 6px 0 0; }
.cta { display: inline-block; background: var(--color-primary); color: white; padding: 12px 18px; border-radius: 6px; text-decoration: none; margin: 12px 0; }
#contacto .texto-contenido { text-align: center; overflow-wrap: anywhere; }
#contacto a:not(.cta) { color: var(--color-primary); }
.skip-link { position: absolute; top: -100px; left: 8px; z-index: 2000; background: white; padding: 10px; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; }
.cliente { overflow-wrap: anywhere; }
@media (max-width: 1100px) {
 .header { flex-wrap: wrap; }
 .header nav { width: 100%; }
 .header__menu { justify-content: center; }
}
@media (max-width: 992px) {
 .header { flex-wrap: nowrap; display: grid; grid-template-columns: 64px minmax(0,1fr) auto; padding: 10px 3%; }
 .logoQYM { width: 64px; }
 .frase_header { font-size: clamp(.75rem, 2.3vw, 1rem); }
 .header nav { width: auto; }
 .hamburger { display: block; border: 1px solid var(--color-primary); border-radius: 5px; background: white; color: var(--color-primary); padding: 10px; cursor: pointer; }
 .header__menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; padding: 12px; box-shadow: 0 4px 10px #0002; max-height: 65vh; overflow: auto; }
 .header__menu.is-open { display: flex; flex-direction: column; align-items: stretch; }
 .contenido-flex { flex-direction: column; gap: 24px; padding: 0; margin-top: 24px; }
 .texto-contenido { width: 100%; }
 .imagen-apoyo { width: 100%; max-width: 520px; flex: none; margin: auto; }
 .lista-clientes { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .tqm-header { padding: 8px; margin-bottom: 20px; }
 section { margin-bottom: 45px; }
}
@media (max-width: 600px) {
 .contenedor-principal { padding: 14px; }
 .hero-banner { display: flex; flex-direction: column; }
 .hero-banner > img { height: auto; min-height: 0; object-fit: contain; }
 .hero-overlay { display: none; }
 .hero-carousel { background: var(--color-primary); padding: 12px 14px 50px; }
 .texto-contenido .section-title { font-size: 1.5rem; }
 .texto-contenido p, .texto-contenido ul, .tqm-lista li { font-size: 1rem; }
 .lista-clientes, .servicios-grid { grid-template-columns: 1fr; }
 .vineta-container { margin-bottom: 18px; }
 .vineta { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Ocultación visual de elementos accesibles */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
