/* ======================================================
   FBS CONSTRUCCIONES — STYLES
   ====================================================== */

:root {
  --color-primary: #0195E0;
  --color-primary-dark: #0066A1;
  --color-dark: #22211F;
  --color-light: #FFFFFF;
  --color-light-gray: #F4F7FA;
  --color-gray: #6B7280;
  --color-accent-soft: #D6E8F5;

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --container-width: 1240px;
  --radius: 14px;
  --shadow-sm: 0 2px 10px rgba(34,33,31,0.06);
  --shadow-md: 0 12px 30px rgba(34,33,31,0.10);
  --shadow-lg: 0 24px 60px rgba(34,33,31,0.16);
  --transition: 0.35s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; color-scheme: light only; }

body {
  font-family: var(--font-body);
  color: var(--color-dark);
  background: var(--color-light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Fuerza controles de formulario a modo claro explícitamente, evitando que el navegador
   los repinte con su tema oscuro nativo (fondo/texto de inputs, select, etc.) */
input, select, textarea, button {
  color-scheme: light only;
  background-color: var(--color-light);
  color: var(--color-dark);
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { position: relative; }

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-dark); font-weight: 700; line-height: 1.25; }

/* ===== PRELOADER ===== */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--color-dark);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader-logo { width: 70px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity:1; } 50% { transform: scale(1.12); opacity:.7; } }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 28px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn--primary { background: var(--color-primary); color: var(--color-light); box-shadow: 0 8px 20px rgba(1,149,224,0.3); }
.btn--primary:hover { background: var(--color-primary-dark); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(1,149,224,0.4); }
.btn--ghost { border: 1.5px solid rgba(255,255,255,0.5); color: var(--color-light); backdrop-filter: blur(4px); }
.btn--ghost:hover { background: rgba(255,255,255,0.12); border-color: var(--color-light); transform: translateY(-3px); }
.btn--light { background: var(--color-light); color: var(--color-primary-dark); }
.btn--light:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.2); }
.btn--lg { padding: 16px 36px; font-size: 1rem; }
.btn--block { width: 100%; }

/* ===== TYPOGRAPHY HELPERS ===== */
.eyebrow {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 14px;
}
.eyebrow--light { color: var(--color-accent-soft); }
.section-title { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-bottom: 18px; letter-spacing: -0.02em; }
.section-subtitle { color: var(--color-gray); font-size: 1.05rem; max-width: 620px; margin-bottom: 50px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ======================================================
   HEADER / NAV
   ====================================================== */
.header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  padding: 20px 0;
  transition: all var(--transition);
  background: transparent;
}
.header.is-scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 12px 0;
}
.header__inner { display: flex; align-items: center; justify-content: space-between; }
.header__logo { display: block; }
.header__logo-img { height: 42px; transition: height var(--transition); }
.header.is-scrolled .header__logo-img { height: 36px; }
.header__logo-img--scrolled { display: none; }
.header__logo-img--transparent { display: block; }
.header.is-scrolled .header__logo-img--transparent { display: none; }
.header.is-scrolled .header__logo-img--scrolled { display: block; }

.nav { display: flex; align-items: center; gap: 40px; }
.nav__list { display: flex; align-items: center; gap: 32px; }
.nav__link {
  font-weight: 600; font-size: 0.95rem;
  color: var(--color-light);
  transition: color var(--transition);
  position: relative;
  padding: 6px 0;
}
.header.is-scrolled .nav__link { color: var(--color-dark); }
.nav__link::after {
  content: ''; position: absolute; left:0; bottom:0; height:2px; width:0;
  background: var(--color-primary); transition: width var(--transition);
}
.nav__link:hover::after { width: 100%; }
.nav__link:hover { color: var(--color-primary); }

.nav__has-sub { position: relative; }
.nav__sub {
  position: absolute; top: calc(100% + 18px); left: 50%; transform: translateX(-50%) translateY(-8px);
  background: var(--color-light); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 240px; padding: 10px; opacity: 0; visibility: hidden;
  transition: all var(--transition);
}
/* Solo por encima del breakpoint móvil. En táctil el :hover queda "pegado" tras
   el toque y, al tener mayor especificidad (0,3,0) que el `transform: none` del
   bloque móvil (0,1,0), desplazaba el submenú media anchura hacia la izquierda,
   sacándolo del panel lateral. Se acota por ancho y no por (hover: hover) para
   no romper el desplegable en tablets táctiles en horizontal. */
@media (min-width: 861px) {
  .nav__has-sub:hover .nav__sub { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
}
.nav__sub li a { display: block; padding: 10px 14px; border-radius: 8px; font-size: 0.9rem; color: var(--color-dark); font-weight: 500; }
.nav__sub li a:hover { background: var(--color-light-gray); color: var(--color-primary); }

.nav__cta { padding: 11px 24px; }

.hamburger { display: none; flex-direction: column; gap: 5px; width: 30px; position: relative; z-index: 1001; }
.hamburger span { display: block; height: 2px; width: 100%; background: var(--color-light); transition: all var(--transition); }
.header.is-scrolled .hamburger span { background: var(--color-dark); }
.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ======================================================
   HERO — imagen de fondo real
   ====================================================== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  position: relative;
  color: var(--color-light);
  overflow: hidden;
  padding-bottom: 60px;
}
.hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  animation: heroZoom 22s ease-in-out infinite alternate;
}
@keyframes heroZoom { from { transform: scale(1.06); } to { transform: scale(1.14); } }
.hero__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(15,20,26,0.88) 10%, rgba(15,20,26,0.55) 55%, rgba(1,149,224,0.35) 100%),
    linear-gradient(0deg, rgba(15,20,26,0.75), rgba(15,20,26,0.2) 45%);
}
.hero__content { position: relative; z-index: 2; max-width: 760px; padding-top: 90px; }
.hero__title { font-size: clamp(2.4rem, 5.5vw, 4.2rem); margin-bottom: 24px; color: var(--color-light); letter-spacing: -0.02em; }
.hero__title span { color: var(--color-accent-soft); }
.hero__subtitle { font-size: 1.15rem; color: rgba(255,255,255,0.85); max-width: 560px; margin-bottom: 40px; }
.hero__actions { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 60px; }

.hero__stats { display: flex; gap: 50px; flex-wrap: wrap; }
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats strong { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; color: var(--color-light); }
.hero__stats span { font-size: 0.82rem; color: rgba(255,255,255,0.7); margin-top: 4px; }

.hero__shape {
  position: absolute; bottom: -2px; left: 0; width: 100%; height: 90px; z-index: 3;
  background: var(--color-light);
  clip-path: polygon(0 100%, 100% 100%, 100% 40%, 0 100%);
}

/* ======================================================
   ABOUT
   ====================================================== */
.about { padding: 130px 0; background: var(--color-light); }
.about__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 70px; align-items: center; }
.about__media { position: relative; height: 520px; }
.about__img { position: absolute; border-radius: var(--radius); background-size: cover; background-position: center; box-shadow: var(--shadow-lg); }
.about__img--1 { width: 78%; height: 78%; top: 0; left: 0; animation: floatImg 6s ease-in-out infinite; }
.about__img--2 {
  width: 58%; height: 55%; bottom: 0; right: 0; border: 6px solid var(--color-light);
  animation: floatImg 5s ease-in-out infinite; animation-delay: -2.5s;
}

@keyframes floatImg {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

@media (prefers-reduced-motion: reduce) {
  .about__img--1, .about__img--2 { animation: none; }
}
.about__badge {
  position: absolute; top: 24px; right: -10px; z-index: 3;
  background: var(--color-light); padding: 18px 22px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  text-align: center; min-width: 140px;
}
.about__badge strong { display:block; font-family: var(--font-heading); font-size: 1.8rem; color: var(--color-primary); }
.about__badge span { font-size: 0.78rem; color: var(--color-gray); }

.about__list { margin: 26px 0; display: grid; gap: 12px; }
.about__list li { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--color-dark); }
.icon-check { width: 22px; height: 22px; border-radius: 50%; background: var(--color-accent-soft); position: relative; flex-shrink: 0; }
.icon-check::after {
  content: ''; position: absolute; left: 7px; top: 4px; width: 5px; height: 9px;
  border: solid var(--color-primary-dark); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.about__values { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
.value { background: var(--color-light-gray); padding: 24px; border-radius: var(--radius); border-left: 3px solid var(--color-primary); }
.value h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--color-primary-dark); }
.value p { font-size: 0.9rem; color: var(--color-gray); }

/* ======================================================
   SERVICES — filas alternadas con fotografía
   ====================================================== */
.services { padding: 130px 0; background: var(--color-light); }

.service-row {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 60px; align-items: center;
  margin-bottom: 90px; scroll-margin-top: 120px;
}
.service-row:last-child { margin-bottom: 0; }
.service-row--reverse { direction: rtl; }
.service-row--reverse > * { direction: ltr; }

.service-row__media {
  height: 380px; border-radius: var(--radius); background-size: cover; background-position: center;
  box-shadow: var(--shadow-lg); position: relative;
}
.service-row__media::after {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.35));
}

.services__category-title { display: flex; align-items: center; gap: 14px; font-size: 1.5rem; margin-bottom: 20px; }
.services__category-title span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; background: var(--color-primary); color: var(--color-light);
  font-size: 0.95rem; font-family: var(--font-heading); flex-shrink: 0;
}
.service-row__intro { color: var(--color-gray); font-size: 1.02rem; margin-bottom: 26px; }

.tag-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  background: var(--color-light-gray); color: var(--color-dark); font-weight: 600; font-size: 0.85rem;
  padding: 9px 18px; border-radius: 100px; border: 1px solid transparent; transition: all var(--transition);
}
.tag:hover { background: var(--color-accent-soft); border-color: var(--color-primary); color: var(--color-primary-dark); }

/* ======================================================
   PARALLAX BAND — estadísticas sobre imagen fija
   ====================================================== */
.parallax-band {
  background-attachment: fixed; background-position: center; background-size: cover;
  padding: 100px 0; position: relative;
}
.parallax-band__overlay { position: absolute; inset: 0; background: linear-gradient(120deg, rgba(15,20,26,0.88), rgba(0,102,161,0.72)); }
.parallax-band__grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-top: 30px; }
.parallax-band .stat { color: var(--color-light); }
.parallax-band .stat__number, .parallax-band .stat__suffix { font-family: var(--font-heading); font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 800; color: var(--color-light); }
.parallax-band .stat__label { display: block; font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; color: var(--color-light); margin-bottom: 10px; }
.parallax-band .stat p { color: rgba(255,255,255,0.75); font-size: 0.92rem; line-height: 1.6; }

@media (max-width: 860px) {
  .parallax-band { background-attachment: scroll; }
}

/* ======================================================
   WHY
   ====================================================== */
.why { padding: 130px 0; background: var(--color-light); }
.why__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-top: 30px; }
.why__grid--3 { grid-template-columns: repeat(3, 1fr); }
.why__item { padding: 32px 26px; border-radius: var(--radius); background: var(--color-light-gray); border: 1px solid transparent; transition: all var(--transition); }
.why__item:hover { background: var(--color-accent-soft); border-color: var(--color-primary); transform: translateY(-6px); }
.why__number { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; color: var(--color-primary); margin-bottom: 14px; }
.why__item h4 { color: var(--color-dark); margin-bottom: 10px; font-size: 1.05rem; }
.why__item p { color: var(--color-gray); font-size: 0.9rem; }

/* ===== TEAM (Equipo clave) ===== */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 30px; }
.team-grid .why__item { text-align: center; padding: 26px 20px; }
.team-grid .why__item h4 { font-size: 0.98rem; }
.team-grid .why__item p { color: var(--color-primary-dark); font-weight: 600; font-size: 0.82rem; }

/* ===== ORGANIGRAMA (Equipo clave) — árbol horizontal ===== */
.orgchart {
  --org-navy: #1F2A44;
  --org-blue: #2E5AAC;
  --org-gray-blue: #8CA3C4;
  --org-amber: #F5A623;
  display: flex;
  align-items: center;
  margin-top: 54px;
}

.org-root-col { display: flex; flex-shrink: 0; }

.org-connector {
  flex-shrink: 0;
  width: 36px;
  height: 2px;
  background: var(--org-gray-blue);
}

.org-col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 20px;
  padding: 6px 0 6px 36px;
  border-left: 2px solid var(--org-gray-blue);
}

.org-branch {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.org-branch__tick {
  position: absolute;
  left: -36px;
  top: 50%;
  width: 36px;
  height: 0;
  border-top: 2px solid var(--org-gray-blue);
}

.org-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 170px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--color-light);
  border: 2px solid var(--org-navy);
  color: var(--org-navy);
  text-align: center;
}

.org-node--root {
  background: var(--org-navy);
  border-color: var(--org-navy);
  color: var(--color-light);
  padding: 18px 26px;
  min-width: 200px;
  max-width: 220px;
}

.org-node--gerencial { border-color: var(--org-blue); min-width: 185px; }
.org-node--gerencial span { color: var(--org-blue); font-weight: 600; }

.org-node--dept {
  border-color: var(--org-gray-blue);
  min-width: 150px;
  padding: 10px 14px;
}
.org-node--dept strong { font-size: 0.86rem; }
.org-node--dept span { color: var(--color-gray); font-size: 0.76rem; }

.org-node strong { color: var(--org-amber); font-weight: 700; font-size: 0.94rem; }
.org-node span { font-size: 0.8rem; color: var(--color-gray); }

.org-node--root strong { font-family: var(--font-heading); font-size: 1rem; letter-spacing: 0.01em; }
.org-node--root span { color: var(--color-accent-soft); font-weight: 600; }

@media (max-width: 900px) {
  /* Árbol indentado: las líneas se dibujan por rama (no por columna),
     así el spine vertical termina exactamente en el último nodo. */
  .orgchart {
    --org-indent: 22px;   /* sangría de cada nivel */
    --org-elbow: 26px;    /* altura del codo, alineado con la 1ª línea del nodo */
    display: block;
    margin-top: 34px;
  }

  .org-root-col { display: block; }

  /* Bajada desde la raíz hasta el spine del primer nivel */
  .org-connector--root {
    width: 2px;
    height: 18px;
    margin-left: var(--org-indent);
  }

  .org-col {
    display: block;
    border-left: 0;
    padding: 0;
    margin-left: var(--org-indent);
  }

  .org-branch {
    display: block;
    position: relative;
    padding-left: var(--org-indent);
    padding-bottom: 16px;
  }
  .org-branch:last-child { padding-bottom: 0; }

  /* Spine vertical de cada rama */
  .org-branch::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--org-gray-blue);
  }
  /* En la última rama el spine se corta en el codo */
  .org-branch:last-child::before {
    bottom: auto;
    height: var(--org-elbow);
  }

  .org-branch__tick {
    left: 0;
    top: var(--org-elbow);
    width: var(--org-indent);
  }

  /* Bajada desde un nodo gerencial hacia sus departamentos */
  .org-branch--parent > .org-connector {
    width: 2px;
    height: 14px;
    margin-left: var(--org-indent);
  }

  /* Nodos: ancho completo y texto alineado a la izquierda */
  .org-node,
  .org-node--root,
  .org-node--gerencial,
  .org-node--dept {
    display: flex;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    max-width: none;
    width: 100%;
    gap: 3px;
  }

  .org-node { padding: 12px 14px; }
  .org-node--root { padding: 16px 18px; }
  .org-node--dept { padding: 10px 14px; }

  .org-node strong { font-size: 0.9rem; line-height: 1.3; }
  .org-node span { font-size: 0.78rem; line-height: 1.35; }
  .org-node--root strong { font-size: 0.95rem; }
  .org-node--dept strong { font-size: 0.85rem; }
  .org-node--dept span { font-size: 0.74rem; }
}

@media (max-width: 420px) {
  .orgchart { --org-indent: 16px; --org-elbow: 24px; }
  .org-node { padding: 11px 12px; }
  .org-node strong { font-size: 0.86rem; }
  .org-node span { font-size: 0.75rem; }
}

/* ===== CERTIFICACIONES ===== */
.cert-grid { display: grid; gap: 26px; margin-top: 30px; }
.cert-block { background: var(--color-light-gray); border-radius: var(--radius); padding: 34px 36px; }
.cert-block .services__category-title { margin-bottom: 14px; }

/* ======================================================
   PROJECTS — fotografía real
   ====================================================== */
.projects { padding: 130px 0; background: var(--color-light-gray); }
.projects__filter { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 44px; }
.filter-btn {
  padding: 10px 22px; border-radius: 100px; font-weight: 600; font-size: 0.88rem;
  background: var(--color-light); color: var(--color-gray); transition: all var(--transition);
  border: 1px solid #E2E8F0;
}
.filter-btn:hover { background: var(--color-accent-soft); color: var(--color-primary-dark); }
.filter-btn.is-active { background: var(--color-primary); color: var(--color-light); border-color: var(--color-primary); }

.projects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.project { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: all var(--transition); background: var(--color-light); }
.project:hover { box-shadow: var(--shadow-md); transform: translateY(-6px); }
.project:hover .project__img { transform: scale(1.06); }
.project__img { height: 220px; background-size: cover; background-position: center; position: relative; transition: transform 0.6s ease; }
.project__info { padding: 24px; }
.project__tag {
  display: inline-block; background: var(--color-accent-soft); color: var(--color-primary-dark);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 5px 12px; border-radius: 100px; margin-bottom: 12px;
}
.project__info h4 { font-size: 1.05rem; margin-bottom: 8px; }
.project__info p { color: var(--color-gray); font-size: 0.9rem; }
.project.is-hidden { display: none; }

.project--gallery .project__img { cursor: pointer; }
.project__zoom {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(31, 42, 68, 0.55); color: var(--color-light); font-weight: 600; font-size: 0.92rem;
  opacity: 0; transition: opacity var(--transition);
}
.project--gallery .project__img:hover .project__zoom,
.project--gallery .project__img:focus-visible .project__zoom { opacity: 1; }

/* ===== LIGHTBOX ===== */
.lightbox {
  --lb-gutter: 108px;   /* espacio reservado a cada lado para las flechas */
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 18, 28, 0.92); opacity: 0; visibility: hidden; transition: opacity var(--transition);
}
.lightbox.is-open { opacity: 1; visibility: visible; }

/* El stage NO cambia de tamaño con la imagen: ocupa siempre el mismo hueco,
   así las flechas quedan fijas al navegar entre fotos de distinto formato. */
.lightbox__stage {
  position: relative;
  width: min(1100px, calc(100vw - var(--lb-gutter) * 2));
  height: 84vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
}
.lightbox__img {
  max-width: 100%; max-height: calc(84vh - 40px);
  width: auto; height: auto; object-fit: contain;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  user-select: none; -webkit-user-drag: none;
}
.lightbox__counter {
  color: var(--color-light); font-size: 0.85rem; letter-spacing: 0.04em; opacity: 0.8;
  flex-shrink: 0;
}

.lightbox__close {
  position: absolute; top: 18px; right: 18px; z-index: 3;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); border: none; border-radius: 50%; color: var(--color-light);
  font-size: 2rem; line-height: 1; cursor: pointer; opacity: 0.85;
  transition: background var(--transition), opacity var(--transition);
}
.lightbox__close:hover { opacity: 1; background: rgba(255,255,255,0.22); }

/* Flechas ancladas al viewport, fuera del flujo: nunca se mueven. */
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: rgba(255,255,255,0.1); border: none; color: var(--color-light);
  width: 56px; height: 56px; margin: 0; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lightbox__nav:hover { background: rgba(255,255,255,0.22); }
.lightbox__nav--prev { left: max(20px, calc((100vw - 1100px) / 2 - 76px)); }
.lightbox__nav--next { right: max(20px, calc((100vw - 1100px) / 2 - 76px)); }

@media (max-width: 860px) {
  .lightbox { --lb-gutter: 84px; }
  .lightbox__nav--prev { left: 16px; }
  .lightbox__nav--next { right: 16px; }
}

/* Móvil: los controles bajan a una barra inferior, lejos de los bordes de la
   imagen y al alcance del pulgar. Targets de 56px (mín. recomendado: 44px). */
@media (max-width: 640px) {
  .lightbox { --lb-gutter: 10px; }

  .lightbox__stage { height: auto; max-height: 72vh; margin-bottom: 96px; }
  .lightbox__img { max-height: 66vh; }

  .lightbox__nav {
    top: auto; bottom: 26px; transform: none;
    width: 56px; height: 56px; font-size: 1.15rem;
    background: rgba(255,255,255,0.16);
  }
  .lightbox__nav--prev { left: calc(50% - 92px); right: auto; }
  .lightbox__nav--next { right: calc(50% - 92px); left: auto; }

  /* El contador se coloca entre ambas flechas */
  .lightbox__counter { position: fixed; left: 50%; bottom: 45px; transform: translateX(-50%); }

  .lightbox__close { top: 12px; right: 12px; width: 46px; height: 46px; font-size: 1.8rem; }
}

/* ======================================================
   PROCESS
   ====================================================== */
.process { padding: 130px 0; background: var(--color-light); }
.process__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; position: relative; }
.process__step { text-align: center; padding: 0 10px; }
.process__icon {
  width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-light-gray); color: var(--color-primary); font-family: var(--font-heading); font-weight: 800;
  box-shadow: var(--shadow-sm); border: 2px solid var(--color-accent-soft);
}
.process__step h4 { margin-bottom: 10px; font-size: 1.05rem; }
.process__step p { color: var(--color-gray); font-size: 0.9rem; }

/* ======================================================
   CLIENTS
   ====================================================== */
.clients { padding: 110px 0; background: var(--color-light-gray); border-top: 1px solid #E2E8F0; border-bottom: 1px solid #E2E8F0; }
.clients .section-title { margin-bottom: 0; }
.clients .eyebrow.center { display: block; }
.clients__logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 26px; margin-top: 46px; }
.client-logo {
  background: var(--color-light); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  width: 210px; height: 110px; display: flex; align-items: center; justify-content: center;
  padding: 20px 28px; transition: all var(--transition); border: 1px solid transparent;
}
.client-logo:hover { box-shadow: var(--shadow-md); transform: translateY(-6px); border-color: var(--color-primary); }
.client-logo img { max-height: 64px; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: 0.7; transition: all var(--transition); }
.client-logo:hover img { filter: grayscale(0); opacity: 1; }

/* ======================================================
   CTA — imagen de fondo
   ====================================================== */
.cta { padding: 110px 0; text-align: center; background-size: cover; background-position: center; background-attachment: fixed; }
.cta__overlay { position: absolute; inset: 0; background: linear-gradient(120deg, rgba(1,149,224,0.88), rgba(0,102,161,0.92)); }
.cta__inner { position: relative; z-index: 2; }
.cta__inner h2 { color: var(--color-light); font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin-bottom: 16px; }
.cta__inner p { color: rgba(255,255,255,0.92); margin-bottom: 34px; font-size: 1.05rem; }

@media (max-width: 860px) {
  .cta { background-attachment: scroll; }
}

/* ======================================================
   CONTACT
   ====================================================== */
.contact { padding: 130px 0; background: var(--color-light); }
.contact__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 70px; }

.contact__actions { display: grid; gap: 14px; margin-top: 34px; }
.contact__action {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  border-radius: var(--radius); background: var(--color-light-gray);
  border: 1.5px solid transparent; transition: all var(--transition);
}
.contact__action:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-md); }
.contact__action-icon {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; background: var(--color-light); box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.contact__action:hover .contact__action-icon { transform: scale(1.1) rotate(-6deg); }
.contact__action-text { display: flex; flex-direction: column; gap: 2px; }
.contact__action-text strong { font-size: 0.98rem; color: var(--color-dark); }
.contact__action-text small { font-size: 0.85rem; color: var(--color-gray); }

.contact__action--whatsapp:hover { border-color: #25D366; background: rgba(37,211,102,0.08); }
.contact__action--whatsapp .contact__action-icon { color: #25D366; }
.contact__action--call:hover { border-color: var(--color-primary); background: var(--color-accent-soft); }
.contact__action--call .contact__action-icon { color: var(--color-primary); }
.contact__action--mail:hover { border-color: var(--org-navy, #1F2A44); background: rgba(31,42,68,0.06); }
.contact__action--mail .contact__action-icon { color: #1F2A44; }

.contact__list { margin: 30px 0; display: grid; gap: 22px; }
.contact__list li { display: flex; gap: 16px; align-items: flex-start; }
.contact__icon { font-size: 1.3rem; }
.contact__list strong { display: block; margin-bottom: 2px; }
.contact__list div { font-size: 0.92rem; color: var(--color-gray); }
.contact__list a { color: var(--color-primary-dark); font-weight: 600; }
.contact__list a:hover { text-decoration: underline; }

.contact__form { background: var(--color-light-gray); padding: 44px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--color-dark); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 13px 16px; border-radius: 10px; border: 1.5px solid #E2E8F0;
  background: var(--color-light); transition: border-color var(--transition);
  resize: vertical;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--color-primary);
}
.form-note { text-align: center; margin-top: 16px; font-size: 0.88rem; color: var(--color-primary-dark); font-weight: 600; min-height: 20px; }

.contact__map {
  margin-top: 60px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md); height: 380px; border: 1px solid var(--color-light-gray);
}
.contact__map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.15) contrast(1.02); }

/* ======================================================
   FOOTER
   ====================================================== */
.footer { background: var(--color-dark); color: rgba(255,255,255,0.7); padding-top: 90px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 50px; padding-bottom: 60px; }
.footer__logo { width: 130px; margin-bottom: 20px; }
.footer__brand p { font-size: 0.9rem; margin-bottom: 22px; line-height: 1.7; }
.footer__col h4 { color: var(--color-light); font-size: 1rem; margin-bottom: 22px; }
.footer__col ul { display: grid; gap: 13px; }
.footer__col a { font-size: 0.9rem; transition: color var(--transition); }
.footer__col a:hover { color: var(--color-primary); }
.footer__col li { font-size: 0.9rem; }

.footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 26px 0; }
.footer__bottom-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer__bottom p { font-size: 0.85rem; }
.footer__legal { display: flex; gap: 24px; }
.footer__legal a { font-size: 0.85rem; }
.footer__legal a:hover { color: var(--color-primary); }

/* ======================================================
   BACK TO TOP
   ====================================================== */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-primary); color: var(--color-light); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all var(--transition); z-index: 900;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-primary-dark); transform: translateY(-4px); }

/* ======================================================
   SCROLL REVEAL
   ====================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 1080px) {
  .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .about__media { height: 400px; margin-bottom: 20px; }
  .service-row, .service-row--reverse { grid-template-columns: 1fr; direction: ltr; }
  .service-row__media { height: 300px; }
  .why__grid, .process__grid, .team-grid { grid-template-columns: repeat(2, 1fr); }
  .why__grid--3 { grid-template-columns: repeat(2, 1fr); }
  .parallax-band__grid { grid-template-columns: repeat(2, 1fr); gap: 40px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

.nav-overlay {
  position: fixed; inset: 0; background: rgba(15,20,26,0.55); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity var(--transition), visibility var(--transition);
  z-index: 999;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }
.nav__mobile-head { display: none; }

@media (max-width: 860px) {
  .nav {
    position: fixed; top: 0; right: -100%; height: 100vh; width: min(360px, 84vw);
    background: var(--color-light); flex-direction: column; justify-content: flex-start;
    align-items: stretch; padding: 0 0 40px; gap: 0; box-shadow: -12px 0 40px rgba(15,20,26,0.25);
    transition: right 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1000; overflow-y: auto;
  }
  .nav.is-open { right: 0; }

  .nav__mobile-head {
    display: flex; align-items: center; padding: 22px 20px; margin-bottom: 12px;
    background: var(--color-dark); border-bottom: 3px solid var(--color-primary);
  }
  .nav__mobile-logo { height: 32px; }

  .nav__list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; padding: 0 20px; }
  .nav__list > li { border-bottom: 1px solid var(--color-light-gray); }
  .nav__list > li:last-child { border-bottom: none; }
  .nav__link {
    color: var(--color-dark); font-size: 1.02rem; display: flex; align-items: center;
    justify-content: space-between; padding: 16px 8px; width: 100%;
  }
  .nav__link::after { display: none; }
  .nav__link:hover { color: var(--color-primary); }

  .nav__has-sub { width: 100%; }
  .nav__has-sub > .nav__link::before {
    content: '+'; margin-left: 10px; font-size: 1.2rem; color: var(--color-gray);
    transition: transform var(--transition); order: 2;
  }
  .nav__has-sub.is-open > .nav__link::before { transform: rotate(45deg); color: var(--color-primary); }
  .nav__sub {
    position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none;
    display: none; max-height: 0; overflow: hidden; padding: 0 0 0 14px; min-width: 0;
    border-left: 2px solid var(--color-accent-soft); margin: 0 0 12px 8px;
  }
  .nav__has-sub.is-open .nav__sub { display: block; max-height: 300px; }
  .nav__sub li a { padding: 10px 12px; font-size: 0.88rem; }

  .nav__cta { width: calc(100% - 40px); text-align: center; margin: 22px 20px 0; }
  .hamburger { display: flex; }
  .header.is-scrolled .hamburger span, .hamburger span { background: var(--color-dark); }
  .header:not(.is-scrolled) .hamburger span { background: var(--color-light); }
  #hamburger.is-active span { background: var(--color-light); }
}

@media (max-width: 720px) {
  .why__grid, .why__grid--3, .process__grid, .form-row, .projects__grid, .parallax-band__grid, .team-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 36px; }
  .about__values { grid-template-columns: 1fr; }
  .hero__content { padding-top: 70px; }
  .hero__stats { gap: 30px; }
  .hero__bg { background-position: left center; }
}

/* ===== TEXTOS Y ESPACIADOS — MÓVIL ===== */
@media (max-width: 640px) {
  .about, .services, .why, .projects, .process, .contact { padding: 80px 0; }
  .clients, .cta { padding: 70px 0; }

  .eyebrow { font-size: 0.78rem; }
  .section-subtitle { font-size: 0.94rem; margin-bottom: 34px; }

  .hero__subtitle { font-size: 1rem; margin-bottom: 30px; }
  .hero__actions { margin-bottom: 40px; }

  .about__content p,
  .service-row__intro,
  .value p,
  .about__list li,
  .footer__brand p { font-size: 0.88rem; line-height: 1.6; }

  .why__item p,
  .process__step p,
  .project__info p,
  .contact__list div { font-size: 0.85rem; }

  .value { padding: 20px; }
  .value h3 { font-size: 0.98rem; }
}
