/* ==========================================================================
   be-Keep — Sistema Visual Corporativo V1.4 (Encargo WEB-004)
   - Fondo azul corporativo continuo (#102B3A) en TODAS las páginas.
   - Retícula general ~94% del ancho en escritorio (márgenes ~50% menores).
   - Paneles blancos delimitados exactamente por la retícula (sin franjas
     blancas de ancho completo).
   - Aprovechamiento vertical real para áreas útiles 650/720/780/900 px.
   - Pie de página con los 3 iconos centrados horizontalmente.
   - Ventana flotante Estado A ~1.5x más grande, respetando <= 20% dinámico.
   - Estado B (formulario) conservado íntegro sin modificaciones.
   ========================================================================== */

:root {
  --navy: #102B3A;
  --navy-deep: #0B1F2A;
  --copper: #A87545;
  --copper-hover: #8D5F35;
  --copper-light: #F3E9DF;
  --white: #FFFFFF;
  --gray-light: #E6E6E6;
  --bg-soft: #F7F8F9;
  --text-main: #102B3A;
  --text-body: #243845;
  --text-muted: #506370;
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --success: #067647;
  --success-bg: #ECFDF3;
  --radius-sm: 6px;
  --radius-md: 11px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-panel: 0 12px 32px rgba(6, 18, 26, 0.22);
  --shadow-float: 0 18px 44px rgba(11, 31, 42, 0.28), 0 4px 12px rgba(11, 31, 42, 0.14);
  --shadow-btn: 0 6px 18px rgba(168, 117, 69, 0.30);
  --font-sans: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--navy);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-body);
  background-color: var(--navy);
  line-height: 1.5;
  word-spacing: 0.045em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3 {
  word-spacing: 0.06em;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--copper);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  z-index: 2000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  border-radius: var(--radius-sm);
}

/* Retícula general ~94% del ancho en escritorio (~50% menos margen lateral) */
.container {
  width: min(94vw, 1820px);
  max-width: 1820px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

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

main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  background-color: var(--navy);
}

/* ==========================================================================
   HEADER COMÚN — Extremos alineados a la retícula ~94%
   ========================================================================== */
.site-header {
  background-color: var(--navy);
  color: var(--white);
  border-bottom: 2px solid var(--copper);
  position: relative;
  z-index: 60;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: clamp(64px, 5.2vw, 82px);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.7rem, 0.9vw, 0.95rem);
  flex-shrink: 0;
}

.brand-symbol {
  width: clamp(46px, 3.6vw, 56px);
  height: clamp(46px, 3.6vw, 56px);
  object-fit: contain;
  flex-shrink: 0;
}

.brand-wordmark {
  font-size: clamp(1.8rem, 2.15vw, 2.38rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}

.brand-wordmark .be {
  color: var(--white);
}

.brand-wordmark .keep {
  color: var(--copper);
}

.brand-divider {
  width: 1.5px;
  height: clamp(30px, 2.6vw, 40px);
  background: rgba(255, 255, 255, 0.34);
  display: block;
}

.brand-descriptor {
  font-size: clamp(0.75rem, 0.8vw, 0.88rem);
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  line-height: 1.22;
  color: rgba(255, 255, 255, 0.92);
  max-width: 230px;
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 2.2vw, 2.6rem);
}

.nav-link {
  position: relative;
  font-size: clamp(1rem, 1.1vw, 1.2rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  padding: 0.38rem 0.1rem;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.18s ease;
}

.nav-link:hover {
  color: var(--white);
}

.nav-link.is-active,
.nav-link[aria-current="page"] {
  color: var(--white);
  font-weight: 700;
}

.nav-link.is-active::after,
.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 4px;
  border-radius: 3px;
  background-color: var(--copper);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  color: var(--white);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ==========================================================================
   MENÚ SECUNDARIO DE ESPECIALIDADES — Delimitado por la retícula general
   (NO se extiende a los bordes de la pantalla)
   ========================================================================== */
.subnav-bar {
  background: transparent;
  padding-top: clamp(0.95rem, 1.8vh, 1.45rem);
}

.subnav-panel {
  background: var(--white);
  border-radius: 8px;
  padding: 0.45rem 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  font-size: clamp(0.86rem, 0.92vw, 0.96rem);
  box-shadow: 0 4px 14px rgba(6, 18, 26, 0.16);
}

.subnav-label {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.subnav-link {
  color: var(--navy);
  font-weight: 600;
  padding: 0.18rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.subnav-link:hover,
.subnav-link[aria-current="page"] {
  color: var(--copper);
}

.subnav-link[aria-current="page"] {
  border-bottom-color: var(--copper);
}

/* ==========================================================================
   BOTONES Y ACENTOS COBRE
   ========================================================================== */
.btn-copper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background-color: var(--copper);
  color: var(--white);
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(0.98rem, 1.06vw, 1.14rem);
  padding: clamp(0.75rem, 0.95vh, 1rem) clamp(1.6rem, 1.9vw, 2.2rem);
  border-radius: var(--radius-sm);
  border: 2px solid var(--copper);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.btn-copper:hover {
  background-color: var(--copper-hover);
  border-color: var(--copper-hover);
  transform: translateY(-1px);
}

.btn-copper--pill {
  border-radius: var(--radius-pill);
  padding: 0.8rem 2rem;
}

.btn-copper--full {
  width: 100%;
}

.copper-bar {
  display: block;
  width: clamp(56px, 4.5vw, 74px);
  height: 5px;
  border-radius: 4px;
  background-color: var(--copper);
  margin-bottom: clamp(0.85rem, 1.3vh, 1.3rem);
}

/* ==========================================================================
   WEB-01 — PORTADA (Título en EXACTAMENTE 3 líneas en escritorio, foto ampliada)
   ========================================================================== */
.hero-home {
  background-color: var(--navy);
  color: var(--white);
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  padding: clamp(1rem, 2.4vh, 2.2rem) 0;
}

.hero-home-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.86fr) minmax(460px, 1.14fr);
  align-items: center;
  gap: clamp(2rem, 3.2vw, 3.75rem);
}

.hero-home-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-home-copy h1 {
  margin: 0 0 clamp(0.95rem, 1.6vh, 1.45rem);
  font-size: clamp(2.15rem, 3.15vw, 3.85rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--white);
}

.hero-line {
  display: block;
  white-space: nowrap;
}

.hero-home-slogan {
  margin: 0 0 clamp(1.35rem, 2.2vh, 2.15rem);
  font-size: clamp(1.06rem, 1.32vw, 1.42rem);
  color: rgba(255, 255, 255, 0.92);
  max-width: 38ch;
  line-height: 1.46;
}

.hero-home-media {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(168, 117, 69, 0.65);
  border-bottom: 4px solid var(--copper);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.34);
  height: clamp(340px, 64vh, 660px);
  width: 100%;
}

.hero-home-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ==========================================================================
   ENCABEZADO PÁGINAS INTERIORES (V1.5: mayor aire superior, fotos más altas,
   menor separación con panel blanco, equilibrio vertical)
   ========================================================================== */
.page-hero {
  background-color: var(--navy);
  color: var(--white);
  padding: clamp(1.25rem, 2.2vh, 1.95rem) 0 clamp(0.55rem, 0.95vh, 0.85rem);
}

.subnav-bar + .page-hero {
  padding-top: clamp(0.75rem, 1.3vh, 1.15rem);
}

.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(420px, 1.14fr);
  align-items: center;
  gap: clamp(1.75rem, 3vw, 3.5rem);
}

.page-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.page-hero-icon-top {
  width: clamp(44px, 3.5vw, 60px);
  height: clamp(44px, 3.5vw, 60px);
  color: var(--copper);
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}

.page-hero-copy h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.75rem, 2.5vw, 2.7rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--white);
}

.page-hero-lead {
  margin: 0;
  font-size: clamp(0.98rem, 1.15vw, 1.22rem);
  color: rgba(255, 255, 255, 0.92);
  max-width: 46ch;
  line-height: 1.44;
}

.page-hero-media {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  border: 1.5px solid rgba(168, 117, 69, 0.6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  height: clamp(172px, 24vh, 268px);
  width: 100%;
}

.page-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ==========================================================================
   PANEL BLANCO INTEGRADO EN FONDO AZUL CONTINUO (sin franja blanca full-width)
   ========================================================================== */
.section-content {
  padding: clamp(0.25rem, 0.55vh, 0.5rem) 0 clamp(0.5rem, 1vh, 0.9rem);
  background: transparent;
  flex: 1 0 auto;
  display: flex;
  align-items: center;
}

.content-panel {
  background: var(--white);
  border-radius: var(--radius-md);
  border-top: 3px solid var(--copper);
  box-shadow: var(--shadow-panel);
  padding: clamp(1.1rem, 2.1vh, 1.95rem) clamp(1.35rem, 2.2vw, 2.35rem);
  width: 100%;
}

/* WEB-02 — Cuadrantes de servicios */
.services-quad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.service-quad-card {
  display: grid;
  grid-template-columns: clamp(175px, 16.5vw, 260px) 1fr 22px;
  align-items: center;
  gap: clamp(0.95rem, 1.4vw, 1.5rem);
  padding: clamp(0.85rem, 1.4vh, 1.35rem) clamp(1rem, 1.5vw, 1.65rem);
  border-bottom: 1px solid var(--gray-light);
  transition: background-color 0.18s ease;
}

.service-quad-card:nth-child(odd) {
  border-right: 1px solid var(--gray-light);
  padding-left: 0;
}

.service-quad-card:nth-child(even) {
  padding-right: 0;
}

.service-quad-card:nth-last-child(-n+2) {
  border-bottom: none;
}

.service-quad-card:hover {
  background-color: var(--bg-soft);
}

.service-quad-photo {
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-right: 3px solid var(--copper);
}

.service-quad-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.service-quad-card:hover .service-quad-photo img {
  transform: scale(1.03);
}

.service-quad-body {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.service-quad-icon {
  width: clamp(40px, 3.2vw, 52px);
  height: clamp(40px, 3.2vw, 52px);
  flex-shrink: 0;
  color: var(--navy);
}

.service-quad-body h2 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.12rem, 1.3vw, 1.42rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.22;
}

.service-quad-body p {
  margin: 0;
  font-size: clamp(0.9rem, 0.98vw, 1.06rem);
  color: var(--text-body);
  line-height: 1.42;
}

.service-quad-arrow {
  color: var(--copper);
  width: 22px;
  height: 22px;
  justify-self: end;
  transition: transform 0.18s ease;
}

.service-quad-card:hover .service-quad-arrow {
  transform: translateX(4px);
}

/* WEB-03 — Plantilla común de las 4 especialidades (3 columnas) */
.service-detail-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.28fr 1fr;
  gap: clamp(1.5rem, 2.6vw, 3rem);
  align-items: start;
}

.detail-col--bordered {
  border-left: 1px solid var(--gray-light);
  padding-left: clamp(1.4rem, 2.2vw, 2.4rem);
}

.detail-col h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.2rem, 1.42vw, 1.56rem);
  font-weight: 700;
  color: var(--navy);
}

.what-we-do-box {
  border-left: 4px solid var(--copper);
  padding-left: 1.1rem;
}

.what-we-do-box p {
  margin: 0;
  font-size: clamp(0.95rem, 1.05vw, 1.14rem);
  line-height: 1.52;
}

.prestaciones-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.42rem, 0.65vh, 0.68rem);
}

.prestaciones-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: clamp(0.92rem, 1.02vw, 1.1rem);
  line-height: 1.38;
}

.check-icon {
  width: 19px;
  height: 19px;
  color: var(--copper);
  flex-shrink: 0;
  margin-top: 2px;
}

.benefits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 1.25vh, 1.25rem);
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.benefit-icon {
  width: clamp(36px, 2.8vw, 44px);
  height: clamp(36px, 2.8vw, 44px);
  color: var(--copper);
  flex-shrink: 0;
}

.benefit-text {
  font-size: clamp(0.94rem, 1.02vw, 1.1rem);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.38;
}

/* WEB-04 — Nosotros (4 columnas, sin recuadro redundante inferior) */
.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.35rem, 2vw, 2.3rem);
}

.about-col {
  border-left: 1px solid var(--gray-light);
  padding-left: clamp(1.1rem, 1.6vw, 1.75rem);
}

.about-col:first-child {
  border-left: 4px solid var(--copper);
  padding-left: 1.1rem;
}

.about-col-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}

.about-icon {
  width: clamp(34px, 2.6vw, 42px);
  height: clamp(34px, 2.6vw, 42px);
  color: var(--copper);
  flex-shrink: 0;
}

.about-col h2 {
  margin: 0;
  font-size: clamp(1.14rem, 1.3vw, 1.42rem);
  font-weight: 700;
  color: var(--navy);
}

.about-col p {
  margin: 0;
  font-size: clamp(0.92rem, 1vw, 1.08rem);
  line-height: 1.5;
}

/* WEB-05 — Nuestro método de trabajo (5 módulos de igual peso gráfico) */
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.9rem, 1.4vw, 1.6rem);
}

.method-step {
  background: var(--white);
  border-left: 1px solid var(--gray-light);
  padding: 0.45rem clamp(0.85rem, 1.15vw, 1.25rem) 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.method-step:first-child {
  border-left: 4px solid var(--copper);
}

.method-step-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.step-badge {
  width: clamp(30px, 2.3vw, 36px);
  height: clamp(30px, 2.3vw, 36px);
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: clamp(0.9rem, 1vw, 1.05rem);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-icon {
  width: clamp(40px, 3vw, 48px);
  height: clamp(40px, 3vw, 48px);
  color: var(--copper);
  flex-shrink: 0;
}

.method-step h2 {
  margin: 0 0 0.42rem;
  font-size: clamp(1.04rem, 1.18vw, 1.28rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.22;
}

.method-step p {
  margin: 0;
  font-size: clamp(0.88rem, 0.96vw, 1.04rem);
  color: var(--text-body);
  line-height: 1.44;
}

.method-pill-banner {
  margin-top: clamp(1.1rem, 1.8vh, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
}

.method-pill-line {
  flex: 1;
  max-width: 260px;
  height: 2px;
  background: var(--copper);
  opacity: 0.6;
}

.method-pill-text {
  background: var(--copper-light);
  color: var(--navy);
  font-weight: 700;
  font-size: clamp(0.94rem, 1.05vw, 1.12rem);
  padding: 0.48rem 1.65rem;
  border-radius: var(--radius-pill);
  text-align: center;
}

/* ==========================================================================
   FRANJA INFERIOR CTA (integrada en el fondo azul continuo)
   ========================================================================== */
.cta-band {
  background-color: var(--navy);
  color: var(--white);
}

.cta-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: clamp(64px, 7.2vh, 88px);
  padding-top: clamp(0.65rem, 1.1vh, 0.95rem);
  padding-bottom: clamp(0.65rem, 1.1vh, 0.95rem);
}

.cta-band-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.cta-building-icon {
  width: clamp(38px, 3vw, 48px);
  height: clamp(38px, 3vw, 48px);
  color: var(--copper);
  flex-shrink: 0;
}

.cta-sep {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.32);
  flex-shrink: 0;
}

.cta-heading {
  margin: 0;
  font-size: clamp(1.14rem, 1.55vw, 1.6rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.22;
}

/* ==========================================================================
   PIE DE PÁGINA — 3 iconos centrados horizontalmente como conjunto
   ========================================================================== */
.site-footer {
  background: var(--navy-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.52rem;
  padding-bottom: 0.52rem;
}

.footer-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.footer-icon-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.09);
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.15s ease;
}

.footer-icon-link:hover {
  background: var(--copper);
  color: var(--white);
  transform: translateY(-1px);
}

.footer-icon-link svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   WEB-06 — VENTANA FLOTANTE GLOBAL DE CONTACTO
   - Estado A: ~1.5x más grande que V1.3, adaptado dinámicamente <= 20% viewport
   - Estado B: Formulario conservado ÍNTEGRO sin modificaciones
   ========================================================================== */
.contact-float {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 900;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(16, 43, 58, 0.16);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease, box-shadow 0.2s ease;
}

.contact-float[hidden] {
  display: none;
}

/* Estado A ampliado ~1.5x (456px base, adaptado dinámicamente por JS <= 20% área) */
.contact-float.is-state-a {
  width: min(456px, calc(100vw - 24px));
}

.contact-float.is-state-a .cf-header {
  padding: 0.95rem 1.15rem 0.95rem 1.35rem;
}

.contact-float.is-state-a .cf-title {
  font-size: 1.32rem;
}

.contact-float.is-state-a .cf-close-btn {
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
}

.contact-float.is-state-a .cf-body {
  padding: 1.35rem 1.45rem 1.45rem;
}

.contact-float.is-state-a .cf-channels {
  gap: 0.9rem;
  margin-bottom: 1.35rem;
}

.contact-float.is-state-a .cf-channel-link {
  padding: 0.68rem 0.95rem;
  gap: 1.05rem;
  font-size: 1.18rem;
  border-radius: 10px;
}

.contact-float.is-state-a .cf-channel-circle {
  width: 46px;
  height: 46px;
}

.contact-float.is-state-a .cf-channel-circle svg {
  width: 24px;
  height: 24px;
}

.contact-float.is-state-a #cf-to-form-btn {
  font-size: 1.12rem;
  padding: 0.98rem 1.4rem;
}

/* Ajuste compacto automático cuando el área útil es reducida (<= 20% garantizado) */
.contact-float.is-state-a.is-compact-a .cf-header {
  padding: 0.72rem 1rem 0.72rem 1.15rem;
}

.contact-float.is-state-a.is-compact-a .cf-title {
  font-size: 1.14rem;
}

.contact-float.is-state-a.is-compact-a .cf-body {
  padding: 1rem 1.1rem 1.1rem;
}

.contact-float.is-state-a.is-compact-a .cf-channels {
  gap: 0.62rem;
  margin-bottom: 0.95rem;
}

.contact-float.is-state-a.is-compact-a .cf-channel-link {
  padding: 0.5rem 0.75rem;
  gap: 0.85rem;
  font-size: 1.02rem;
}

.contact-float.is-state-a.is-compact-a .cf-channel-circle {
  width: 38px;
  height: 38px;
}

.contact-float.is-state-a.is-compact-a .cf-channel-circle svg {
  width: 20px;
  height: 20px;
}

.contact-float.is-state-a.is-compact-a #cf-to-form-btn {
  font-size: 1rem;
  padding: 0.8rem 1.2rem;
}

/* Estado B: Formulario ampliado ~20% linealmente (596px base, adaptado dinámicamente) */
.contact-float.is-state-b {
  width: min(596px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 28px);
}

.contact-float.is-state-b .cf-header {
  padding: 0.85rem 1.05rem 0.85rem 1.25rem;
}

.contact-float.is-state-b .cf-title {
  font-size: 1.16rem;
  font-weight: 700;
}

.contact-float.is-state-b .cf-body {
  padding: 1.2rem 1.35rem 1.3rem;
}

.contact-float.is-state-b .cf-form-intro {
  font-size: 0.94rem;
  margin-bottom: 1rem;
}

.contact-float.is-state-b .form-grid {
  gap: 0.85rem 1rem;
}

.contact-float.is-state-b .form-label {
  font-size: 0.86rem;
}

.contact-float.is-state-b .form-input,
.contact-float.is-state-b .form-select,
.contact-float.is-state-b .form-textarea {
  font-size: 0.95rem;
  padding: 0.62rem 0.85rem;
}

.contact-float.is-state-b .form-textarea {
  min-height: 88px;
}

.contact-float.is-state-b .form-consent {
  font-size: 0.83rem;
}

.contact-float.is-dragging {
  transition: none;
  user-select: none;
  box-shadow: 0 22px 54px rgba(11, 31, 42, 0.34);
}

.cf-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 3px solid var(--copper);
  padding: 0.72rem 0.9rem 0.72rem 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  cursor: grab;
  touch-action: none;
}

.contact-float.is-dragging .cf-header {
  cursor: grabbing;
}

.cf-header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.cf-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}

.cf-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 0.24rem 0.55rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.cf-back-btn:hover {
  background: var(--copper);
  border-color: var(--copper);
}

.cf-back-btn[hidden] {
  display: none;
}

.cf-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.cf-close-btn:hover {
  background: var(--copper);
  border-color: var(--copper);
}

.cf-body {
  padding: 1rem 1.1rem 1.1rem;
  overflow-y: auto;
}

.cf-channels {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cf-channel-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--gray-light);
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 700;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.cf-channel-link:hover {
  border-color: var(--copper);
  background: var(--copper-light);
  transform: translateX(2px);
}

.cf-channel-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--copper);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cf-channel-circle svg {
  width: 18px;
  height: 18px;
}

.cf-form-intro {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
}

.form-label .req {
  color: var(--copper);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid #CFD8DF;
  border-radius: 7px;
  padding: 0.52rem 0.72rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(168, 117, 69, 0.18);
  outline: none;
}

.form-input[aria-invalid="true"],
.form-select[aria-invalid="true"],
.form-textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.form-textarea {
  min-height: 76px;
  resize: vertical;
}

.field-error {
  font-size: 0.76rem;
  color: var(--danger);
  font-weight: 600;
  min-height: 0.9em;
}

.form-consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--copper);
  flex-shrink: 0;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
}

.form-status {
  grid-column: 1 / -1;
  border-radius: 7px;
  padding: 0.72rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #FECDCA;
}

.form-status.is-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #ABEFC6;
}

/* ==========================================================================
   RESPONSIVIDAD FLUIDA (Tablet y Móvil)
   ========================================================================== */
@media (max-width: 1180px) {
  .methodology-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
  }

  .about-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.35rem;
  }
}

@media (max-width: 980px) {
  .container {
    width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .brand-divider,
  .brand-descriptor {
    display: none;
  }

  .hero-line {
    display: inline;
    white-space: normal;
  }

  .hero-home-grid,
  .page-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .hero-home-media {
    height: auto;
    max-height: 360px;
  }

  .page-hero-media {
    height: 210px;
  }

  .section-content {
    align-items: flex-start;
    padding: 0.5rem 0 1rem;
  }

  .services-quad-grid {
    grid-template-columns: 1fr;
  }

  .service-quad-card {
    border-right: none !important;
    padding: 1rem 0 !important;
    border-bottom: 1px solid var(--gray-light) !important;
  }

  .service-quad-card:last-child {
    border-bottom: none !important;
  }

  .service-detail-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .detail-col--bordered {
    border-left: none;
    border-top: 1px solid var(--gray-light);
    padding-left: 0;
    padding-top: 1.2rem;
  }

  .cta-band-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-deep);
    border-bottom: 3px solid var(--copper);
    padding: 1rem 1.25rem 1.25rem;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  }

  .main-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .nav-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0;
    font-size: 1.05rem;
  }

  .methodology-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .service-quad-card {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .service-quad-arrow {
    display: none;
  }

  .cta-sep {
    display: none;
  }
}

@media (max-width: 600px) {
  .container {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .methodology-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .btn-copper {
    width: 100%;
  }

  .contact-float.is-state-a,
  .contact-float.is-state-b {
    left: 10px !important;
    right: 10px !important;
    top: 12px !important;
    width: auto !important;
    max-width: none;
    max-height: calc(100dvh - 24px);
  }
}
