/* ===================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   =================================================================== */
:root {
  --brand: #0b3c5d;
  --brand-2: #15708f;
  --brand-soft: #eaf2f6;
  --accent: #d9822b;
  --ink: #12262f;
  --muted: #5b7280;
  --line: #dfe7ec;
  --bg: #fff;
  --bg-alt: #f5f8fa;
  --radius: 14px;
  --wrap: 1140px;
  --shadow: 0 1px 2px rgba(16, 38, 47, .05), 0 10px 28px rgba(16, 38, 47, .07);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.68;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

a {
  color: var(--brand-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.22;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.25em; }

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  background: #fff;
  padding: 10px 16px;
  z-index: 99;
  border-radius: 8px;
}

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

.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;
}

/* =================================================================
   2. CABECERA Y NAVEGACIÓN
   =================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: 0 0 auto;
  position: relative;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #fff;
  opacity: .92;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong { font-size: 1.02rem; }
.brand-text small { color: var(--muted); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; }

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

.nav a:not(.btn) {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink);
  font-size: .945rem;
  white-space: nowrap;
  transition: background-color .15s ease;
}

.nav a:not(.btn):hover {
  background: var(--brand-soft);
  text-decoration: none;
}

.nav a.active {
  color: var(--brand);
  font-weight: 600;
}

.nav .btn {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.nav .btn:hover {
  background: var(--brand-2);
  color: #fff;
  text-decoration: none;
}

.has-sub { position: relative; }
.has-sub > a { cursor: pointer; }

.caret {
  font-size: .7em;
  margin-left: 5px;
  opacity: .55;
  transition: transform .15s ease;
  display: inline-block;
}

.sub {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 315px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  list-style: none;
  margin: 0;
}

.sub li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.has-sub.open .sub {
  display: flex;
}

@media (min-width: 861px) {
  .has-sub:hover .sub,
  .has-sub:focus-within .sub {
    display: flex;
  }
}

.has-sub.open > a .caret {
  transform: rotate(180deg);
  opacity: 1;
}

.sub a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .93rem;
  color: var(--ink);
}

.sub a:hover {
  background: var(--brand-soft);
  text-decoration: none;
}

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

.nav-btn:focus + .nav-toggle,
.nav-toggle:focus-visible + .nav-btn {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* =================================================================
   3. BOTONES Y COMPONENTES
   =================================================================== */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .94rem;
  border: 1px solid var(--brand);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}

.btn:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
  text-decoration: none;
}

.btn-sm {
  padding: 9px 16px;
  font-size: .88rem;
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--brand-soft);
  color: var(--brand);
  text-decoration: none;
}

/* =================================================================
   4. HERO Y SECCIONES (ESPACIOS AMPLIADOS)
   =================================================================== */
.hero {
  background: linear-gradient(160deg, rgba(11, 58, 79, .86), rgba(13, 74, 99, .72) 45%, rgba(21, 112, 143, .62)),
              url('/images/hero-balsa.webp') center/cover no-repeat #0b3a4f;
  color: #fff;
  padding: 95px 0 105px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 130, 43, .35), transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 770px;
}

.hero h1 { color: #fff; }
.hero p {
  font-size: 1.14rem;
  color: rgba(255, 255, 255, .88);
  max-width: 650px;
}

.eyebrow {
  display: inline-block;
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #f2a960;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero .btn {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
}

.hero .btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.hero .btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .45);
}

.hero .btn-ghost:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

section { padding: 85px 0; }
.section-alt { background: var(--bg-alt); }

.section-head {
  max-width: 730px;
  margin-bottom: 45px;
}

.section-head p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.grid { display: grid; gap: 32px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }


/* ===== CARDS MEJORADAS ===== */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}

.card-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.card-link:hover {
  text-decoration: none;
}

.card h3 {
  margin-bottom: .45em;
  color: var(--brand);
  font-weight: 600;
}

.card-link:hover h3 {
  color: var(--brand-2);
  text-decoration: none;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-soft), #f8fafc);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: transform .2s ease;
}

.card-link:hover .card-icon {
  transform: scale(1.05);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(11, 60, 93, 0.12), 0 2px 8px rgba(11, 60, 93, 0.08);
  border-top-color: var(--accent);
  border-color: #c9d9e2;
}

.card p {
  color: var(--muted);
  font-size: .96rem;
  margin: 0 0 1.2em;
  line-height: 1.6;
}

.card .more {
  font-weight: 600;
  font-size: .88rem;
  color: var(--brand-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .15s ease, color .15s ease;
}

.card-link:hover .more {
  gap: 8px;
  color: var(--brand);
  text-decoration: none;
}

.card .more::after {
  content: "→";
  transition: transform .15s ease;
}

.card-link:hover .more::after {
  transform: translateX(3px);
}

.icon {
  font-weight: 700;
  margin-bottom: 16px;
}

/* =================================================================
   5. PÁGINAS INTERNAS, FORMULARIOS Y ELEMENTOS
   =================================================================== */
.page-head {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 55px 0 55px;
}

.page-head h1 { margin-bottom: .3em; }
.page-head .lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 770px;
  margin: 0;
}

.crumbs {
  font-size: .86rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 7px; opacity: .5; }

.prose { max-width: 790px; }
.prose ul { padding-left: 1.15em; }
.prose li { margin-bottom: .75em; }

.prose h2 {
  margin-top: 2.8rem;
}

.prose h3 {
  margin-top: 2.2rem;
}

.prose > h2:first-child,
.prose > h3:first-child {
  margin-top: 0;
}

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding-left: 32px;
  margin-bottom: .85em;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .52em;
  width: 16px;
  height: 9px;
  border-left: 2.5px solid var(--brand-2);
  border-bottom: 2.5px solid var(--brand-2);
  transform: rotate(-45deg);
}

.split {
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 56px;
  align-items: start;
}

.aside-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.aside-card h3 { margin-top: 0; }

.cta {
  background: var(--brand);
  color: #fff;
  border-radius: 18px;
  padding: 55px;
  text-align: center;
}

.cta h2 { color: #fff; margin-bottom: .35em; }
.cta p {
  color: rgba(255, 255, 255, .87);
  max-width: 630px;
  margin: 0 auto 1.4em;
}

.cta .btn {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
}

.cta .btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.form {
  display: grid;
  gap: 16px;
  max-width: 620px;
}

.field { display: grid; gap: 6px; }
.field label {
  font-size: .9rem;
  font-weight: 600;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: .97rem;
  background: #fff;
  color: var(--ink);
  height: 48px;
}

.field textarea {
  height: auto;
  min-height: 150px;
  resize: vertical;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-2);
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 112, 143, .14);
}

.hint {
  font-size: .83rem;
  color: var(--muted);
}

.hp {
  position: absolute;
  left: -9999px;
}

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.contact-list strong {
  display: block;
  font-size: .79rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose .contact-list + h2 {
  margin-top: 2.5rem;
}

/* =================================================================
   6. COMPONENTES EXTRA Y MIGRACIÓN 2026
   =================================================================== */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 1.4em 0;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.doc-list li {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color .15s ease;
}

.doc-list li:hover { border-color: #c9d9e2; }

.doc-ico {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-weight: 700;
  font-size: .72rem;
}

.doc-meta {
  display: block;
  font-size: .82rem;
  color: var(--muted);
}

.fig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 1.8em 0;
}

.fig-grid img {
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cat {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  padding: 1px 9px;
  border-radius: 7px;
  font-size: .88em;
}

.pill-a {
  background: #fdecea;
  color: #a33;
}

.pill-b {
  background: #fdf3e4;
  color: #a06414;
}

/* =================================================================
   7. FOOTER
   =================================================================== */
.site-footer {
  background: #0b2530;
  color: rgba(255, 255, 255, .76);
  padding: 65px 0 35px;
  font-size: .93rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.site-footer h4 {
  color: #fff;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.site-footer a {
  color: rgba(255, 255, 255, .76);
}

.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 11px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .13);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  font-size: .85rem;
  color: rgba(255, 255, 255, .55);
}

/* =================================================================
   8. MEDIA QUERIES (RESPONSIVO CONSOLIDADO)
   =================================================================== */
@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .nav-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    padding: 0 11px;
    background: #fff;
  }

  .nav-btn span {
    display: block;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 12px 22px 22px;
  }

  .nav-toggle:checked ~ .nav {
    display: block;
  }

  .nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav a:not(.btn) {
    padding: 12px 10px;
    border-radius: 8px;
  }

  .has-sub .sub {
    display: none;
  }

  .has-sub.open .sub {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
    padding: 0 0 0 14px;
    min-width: 0;
    border-left: 2px solid var(--brand-soft);
    margin: 4px 0 8px;
  }

  .hero {
    padding: 65px 0 70px;
  }

  section {
    padding: 65px 0;
  }

  .cta {
    padding: 40px 22px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .client-cols {
    columns: 1;
  }
}

@media print {
  .site-header, .site-footer, .cta {
    display: none;
  }
}

/* ===== REJILLA DE SERVICIOS: 2 + 2 + 3 ===== */
.grid-servicios {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 28px;
}

.grid-servicios > .card:nth-child(-n+4) {
  grid-column: span 3;
}

.grid-servicios > .card:nth-child(n+5) {
  grid-column: span 2;
}

@media (max-width: 1024px) {
  .grid-servicios {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }

  .grid-servicios > .card:nth-child(-n+4),
  .grid-servicios > .card:nth-child(n+5) {
    grid-column: span 1;
  }

  .grid-servicios > .card:nth-child(7) {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .grid-servicios {
    grid-template-columns: 1fr;
  }

  .grid-servicios > .card:nth-child(7) {
    grid-column: span 1;
  }
}

/* ===== CLIENTES: GRID CONTROLADO ===== */
.client-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.client-cols h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.08rem;
  color: var(--brand);
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
}

.client-cols ul {
  margin: 0;
  padding-left: 1.1em;
}

.client-cols li {
  margin-bottom: 8px;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .client-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .client-cols {
    grid-template-columns: 1fr;
  }
}

/* =================================================================
   9. MEJORAS SUSTANCIALES ADICIONALES (FLUIDEZ Y LEGIBILIDAD)
   =================================================================== */

/* Transiciones optimizadas y fluidas en tarjetas */
.card {
  will-change: transform, box-shadow, border-color;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s ease;
}

/* Mejora de legibilidad en listas dentro de bloques de prosa */
.prose ul li {
  line-height: 1.6;
}

/* Efecto sutil de foco e interactividad en los enlaces del menú desplegable */
.sub a {
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.sub a:hover {
  transform: translateX(3px); /* Pequeño desplazamiento lateral elegante al pasar el ratón */
}

/* Sombra más envolvente y limpia para los contenedores flotantes y submenús */
.sub {
  box-shadow: 0 10px 30px -5px rgba(11, 60, 93, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
}