/* Mobile Responsive Fixes - SOLO PARA EL HEADER */

/* === FOTO SOPHIA CASTAÑEDA - posición desde arriba === */
img[src*="sophia-castaneda"] {
  object-position: center 25% !important;
}

/* === SECCIÓN DE SERVICIOS EN MÓVIL === */
@media (max-width: 768px) {
  section[id="servicios"] h2 {
    font-size: 2.75rem !important;
    line-height: 1.2 !important;
  }
  
  section[id="servicios"] p {
    font-size: 0.95rem !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 480px) {
  section[id="servicios"] h2 {
    font-size: 2.25rem !important;
    line-height: 1.15 !important;
  }
  
  section[id="servicios"] p {
    font-size: 0.85rem !important;
    line-height: 1.1 !important;
  }
}

@media (max-width: 768px) {
  /* === SELECCIONAR EL PRIMER SECTION (HEADER) === */
  section:first-of-type {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  
  section:first-of-type * {
    box-sizing: border-box !important;
  }
  
  /* === TODOS LOS TEXTOS EN EL HEADER - SIN CORTES === */
  section:first-of-type h1,
  section:first-of-type h2,
  section:first-of-type h3,
  section:first-of-type h4,
  section:first-of-type h5,
  section:first-of-type h6,
  section:first-of-type p,
  section:first-of-type small,
  section:first-of-type .text-sm,
  section:first-of-type .text-base,
  section:first-of-type .text-lg {
    /* Permitir envolvimiento de texto */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    
    /* No cortar texto */
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    max-width: 100% !important;
  }
  
  /* === TÍTULOS UNIFORMES Y COMPACTOS - MISMO TAMAÑO PARA MAIN Y HIGHLIGHT === */
  section:first-of-type h1,
  section:first-of-type h2,
  section:first-of-type h3,
  section:first-of-type h4,
  section:first-of-type h5,
  section:first-of-type h6,
  section:first-of-type .text-3xl,
  section:first-of-type .text-4xl,
  section:first-of-type .text-5xl,
  section:first-of-type .text-6xl,
  section:first-of-type .text-7xl,
  section:first-of-type .text-8xl,
  section:first-of-type .font-bold,
  section:first-of-type .font-extrabold {
    font-size: clamp(2.2rem, 8.5vw, 4rem) !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    padding: 0.15rem 0.5rem !important;
    margin: 0 !important;
    letter-spacing: 0 !important;
  }
  
  /* === PÁRRAFOS Y TEXTO PEQUEÑO === */
  section:first-of-type p,
  section:first-of-type .text-base,
  section:first-of-type .text-lg {
    font-size: clamp(1.4rem, 4.5vw, 1.7rem) !important;
    line-height: 1.2 !important;
    padding: 0 !important;
    margin: 0.1rem 0 !important;
  }
  
  section:first-of-type .text-sm,
  section:first-of-type small {
    font-size: clamp(1rem, 3.2vw, 1.2rem) !important;
    line-height: 1.15 !important;
  }

  /* === SUBTÍTULOS MÁS PEQUEÑOS EN MÓVIL === */
  section:first-of-type > div > div > p:last-child,
  section:first-of-type span[className*="text-gray"],
  section:first-of-type > div > p {
    font-size: clamp(1.4rem, 4.8vw, 1.8rem) !important;
    margin: 0.05rem 0 !important;
  }
  
  /* === NO TRUNCAR === */
  section:first-of-type .truncate,
  section:first-of-type .line-clamp-1,
  section:first-of-type .line-clamp-2,
  section:first-of-type .line-clamp-3,
  section:first-of-type .line-clamp-4,
  section:first-of-type .line-clamp-5,
  section:first-of-type .line-clamp-6 {
    overflow: visible !important;
    text-overflow: unset !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
  }
  
  /* === CONTENEDORES === */
  /* === PADDING Y ESPACIADO === */
  section:first-of-type {
    padding: 1rem 0.75rem !important;
  }
}

/* Breakpoint para Tablets (1024px) */
@media (max-width: 1024px) {
  section:first-of-type h1,
  section:first-of-type h2,
  section:first-of-type h3,
  section:first-of-type h4,
  section:first-of-type h5,
  section:first-of-type h6,
  section:first-of-type .text-3xl,
  section:first-of-type .text-4xl,
  section:first-of-type .text-5xl,
  section:first-of-type .text-6xl,
  section:first-of-type .text-7xl,
  section:first-of-type .text-8xl {
    font-size: clamp(2rem, 7.5vw, 3.8rem) !important;
    line-height: 1 !important;
    padding: 0.1rem 0.4rem !important;
  }
  
  section:first-of-type p,
  section:first-of-type .text-base,
  section:first-of-type .text-lg {
    font-size: clamp(1.2rem, 3.5vw, 1.5rem) !important;
    line-height: 1.2 !important;
  }
}

/* Pantallas más pequeñas (640px) */
@media (max-width: 640px) {
  section:first-of-type h1,
  section:first-of-type h2,
  section:first-of-type h3,
  section:first-of-type h4,
  section:first-of-type h5,
  section:first-of-type h6,
  section:first-of-type .text-3xl,
  section:first-of-type .text-4xl,
  section:first-of-type .text-5xl,
  section:first-of-type .text-6xl,
  section:first-of-type .text-7xl,
  section:first-of-type .text-8xl {
    font-size: clamp(2rem, 8vw, 3.5rem) !important;
    line-height: 1 !important;
  }
  
  section:first-of-type p,
  section:first-of-type .text-base {
    font-size: clamp(1.2rem, 3.5vw, 1.5rem) !important;
    line-height: 1.15 !important;
  }
}

/* Pantallas muy pequeñas (480px) */
@media (max-width: 480px) {
  section:first-of-type h1,
  section:first-of-type h2,
  section:first-of-type h3,
  section:first-of-type h4,
  section:first-of-type h5,
  section:first-of-type h6,
  section:first-of-type .text-3xl,
  section:first-of-type .text-4xl,
  section:first-of-type .text-5xl {
    font-size: clamp(1.5rem, 8vw, 2.5rem) !important;
    line-height: 1 !important;
  }
  
  section:first-of-type p,
  section:first-of-type .text-base {
    font-size: clamp(1.2rem, 3.5vw, 1.5rem) !important;
    line-height: 1.15 !important;
  }
}

/* === QUIENES SOMOS: MÁS AIRE LATERAL EN MÓVIL === */
@media (max-width: 768px) {
  section[id="quienes-somos"] > div {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  section[id="quienes-somos"] .space-y-6 > .group {
    margin-left: 0.6rem !important;
    margin-right: 0.6rem !important;
  }

  section[id="quienes-somos"] .space-y-6 > .group > div:first-child {
    left: -0.75rem !important;
  }
}
/* TARJETA GESTIÓN EMPRESARIAL 360° - DISEÑO   */
/* ============================================ */

/* 1. Eliminar forma de picos y crear forma asimétrica premium */
.from-\[\#0a2435\].via-\[\#1e5a7d\] {
  clip-path: none !important;
  border-radius: 2.5rem !important;
  position: relative !important;
  overflow: hidden !important;
}

/* 2. Glow exterior llamativo — diferencia este paquete */
.from-\[\#0a2435\].via-\[\#1e5a7d\] {
  box-shadow:
    0 24px 70px rgba(10, 36, 53, 0.5),
    0 0 0 2px rgba(94, 179, 228, 0.55),
    0 0 55px rgba(94, 179, 228, 0.18) !important;
  transition: box-shadow 0.5s ease, transform 0.5s ease, border-radius 0.45s ease !important;
}

.from-\[\#0a2435\].via-\[\#1e5a7d\]:hover {
  border-radius: 2.5rem !important;
  box-shadow:
    0 40px 90px rgba(12, 98, 145, 0.5),
    0 0 0 3px rgba(94, 179, 228, 0.85),
    0 0 80px rgba(94, 179, 228, 0.35) !important;
}

/* 3. Badge actualizado */
.from-\[\#0a2435\].via-\[\#1e5a7d\]::before {
  content: 'PAQUETE INTEGRADO – GESTIÓN DE PROCESOS' !important;
  position: absolute !important;
  top: 1.2rem !important;
  right: 1.1rem !important;
  z-index: 20 !important;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 55%, #fb923c 100%) !important;
  color: white !important;
  font-size: 0.64rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  padding: 0.42rem 0.95rem !important;
  border-radius: 999px 999px 0.5rem 999px !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5) !important;
  text-transform: uppercase !important;
  font-family: 'Inter', sans-serif !important;
  white-space: normal !important;
  max-width: min(52%, 360px) !important;
  text-align: center !important;
  line-height: 1.25 !important;
  display: none !important;
}

@media (max-width: 900px) {
  .from-\[\#0a2435\].via-\[\#1e5a7d\]::before {
    font-size: 0.55rem !important;
    max-width: 58% !important;
    padding: 0.35rem 0.7rem !important;
    top: 0.9rem !important;
    right: 0.8rem !important;
  }
}

/* 4. Doodles e iconos decorativos alrededor del paquete destacado */
@keyframes cardOrbit {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(4deg) translateY(-2px);
  }
  100% {
    transform: rotate(0deg) translateY(0);
  }
}

.from-\[\#0a2435\].via-\[\#1e5a7d\]::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
  z-index: 8 !important;
  background:
    radial-gradient(circle at 8% 22%, rgba(94, 179, 228, 0.45) 0 4px, transparent 5px),
    radial-gradient(circle at 12% 74%, rgba(255, 255, 255, 0.35) 0 3px, transparent 4px),
    radial-gradient(circle at 86% 30%, rgba(94, 179, 228, 0.4) 0 4px, transparent 5px),
    radial-gradient(circle at 82% 82%, rgba(255, 255, 255, 0.32) 0 3px, transparent 4px),
    linear-gradient(140deg, transparent 0 23%, rgba(94, 179, 228, 0.2) 23% 24%, transparent 24% 100%),
    linear-gradient(45deg, transparent 0 69%, rgba(94, 179, 228, 0.18) 69% 70%, transparent 70% 100%);
  mix-blend-mode: screen !important;
  animation: cardOrbit 6.5s ease-in-out infinite !important;
}

/* Badge "Diagnóstico inicial gratuito" más llamativo en amarillo */
.from-\[\#0a2435\].via-\[\#1e5a7d\] .inline-flex.items-center.gap-2.px-4.py-2.bg-white\/15.backdrop-blur-md.rounded-full.border.border-white\/30 {
  background: linear-gradient(135deg, rgba(255, 196, 63, 0.92), rgba(245, 158, 11, 0.95)) !important;
  border-color: rgba(255, 232, 181, 0.9) !important;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.from-\[\#0a2435\].via-\[\#1e5a7d\] .inline-flex.items-center.gap-2.px-4.py-2.bg-white\/15.backdrop-blur-md.rounded-full.border.border-white\/30 span {
  color: #ffffff !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.22) !important;
  letter-spacing: 0.08em !important;
}

.from-\[\#0a2435\].via-\[\#1e5a7d\] .inline-flex.items-center.gap-2.px-4.py-2.bg-white\/15.backdrop-blur-md.rounded-full.border.border-white\/30 .w-2.h-2.bg-\[\#5eb3e4\].rounded-full.animate-pulse {
  background: #fff9df !important;
  box-shadow: 0 0 0 3px rgba(255, 245, 204, 0.35), 0 0 10px rgba(255, 255, 255, 0.9) !important;
}

/* Badge de Presencia: degradé celeste */
#servicios .relative.group.cursor-pointer[data-svc-top="1"] .inline-flex.items-center.gap-2.px-4.py-2.bg-white\/15.backdrop-blur-md.rounded-full.border.border-white\/30 {
  background: linear-gradient(135deg, rgba(125, 216, 255, 0.95), rgba(58, 159, 212, 0.96)) !important;
  border-color: rgba(205, 240, 255, 0.9) !important;
  box-shadow: 0 8px 22px rgba(58, 159, 212, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
}

#servicios .relative.group.cursor-pointer[data-svc-top="1"] .inline-flex.items-center.gap-2.px-4.py-2.bg-white\/15.backdrop-blur-md.rounded-full.border.border-white\/30 span {
  color: #ffffff !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.22) !important;
  letter-spacing: 0.08em !important;
}

#servicios .relative.group.cursor-pointer[data-svc-top="1"] .inline-flex.items-center.gap-2.px-4.py-2.bg-white\/15.backdrop-blur-md.rounded-full.border.border-white\/30 .w-2.h-2 {
  background: #f0fbff !important;
  box-shadow: 0 0 0 3px rgba(197, 240, 255, 0.35), 0 0 10px rgba(255, 255, 255, 0.8) !important;
}

/* 5. Botón "Ver más" — más aire y protagonismo */
.group\/btn {
  gap: 1.75rem !important;
  padding-right: 1.75rem !important;
  padding-left: 2.25rem !important;
  border-radius: 999px 999px 999px 0.95rem !important;
  box-shadow: 0 14px 30px rgba(9, 30, 44, 0.28) !important;
}

/* 6. Shimmer animado en el borde del card */
@keyframes ringPulse {
  0%, 100% { box-shadow:
    0 24px 70px rgba(10, 36, 53, 0.5),
    0 0 0 2px rgba(94, 179, 228, 0.4),
    0 0 55px rgba(94, 179, 228, 0.12); }
  50% { box-shadow:
    0 24px 70px rgba(10, 36, 53, 0.5),
    0 0 0 3px rgba(94, 179, 228, 0.75),
    0 0 70px rgba(94, 179, 228, 0.28); }
}

.from-\[\#0a2435\].via-\[\#1e5a7d\]:not(:hover) {
  animation: ringPulse 3s ease-in-out infinite !important;
}

/* 7. Responsive real para la tarjeta destacada en movil */
@media (max-width: 1024px) {
  .from-\[\#0a2435\].via-\[\#1e5a7d\] {
    border-radius: 2rem !important;
    min-height: auto !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 2rem !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .space-y-8 {
    gap: 1.5rem !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .space-y-8 > div:nth-child(2) > h3 {
    font-size: clamp(2.2rem, 8.2vw, 3.3rem) !important;
    line-height: 1.05 !important;
    margin-bottom: 0.75rem !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .space-y-8 p {
    font-size: clamp(1.02rem, 2.9vw, 1.2rem) !important;
    line-height: 1.5 !important;
    max-width: 95% !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .relative.h-\[400px\].lg\:h-full.min-h-\[400px\] {
    min-height: 240px !important;
    height: 280px !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .inline-flex.items-center.gap-2.px-4.py-2.bg-white\/15.backdrop-blur-md.rounded-full.border.border-white\/30 {
    width: fit-content !important;
    max-width: 100% !important;
    padding: 0.5rem 0.95rem !important;
  }
}

@media (max-width: 768px) {
  .from-\[\#0a2435\].via-\[\#1e5a7d\] {
    border-radius: 1.7rem !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .grid {
    padding: 1.35rem !important;
    gap: 1.15rem !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .space-y-8 > div:nth-child(2) > h3 {
    font-size: clamp(1.9rem, 9vw, 2.5rem) !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .space-y-8 p {
    font-size: 1.02rem !important;
    max-width: 100% !important;
  }

  .group\/btn {
    width: 100% !important;
    max-width: 240px !important;
    justify-content: center !important;
    gap: 1.15rem !important;
    padding-left: 1.4rem !important;
    padding-right: 1.4rem !important;
    font-size: 1.02rem !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\]::after {
    opacity: 0.65 !important;
  }
}

@media (max-width: 480px) {
  .from-\[\#0a2435\].via-\[\#1e5a7d\] .grid {
    padding: 1.05rem !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .inline-flex.items-center.gap-2.px-4.py-2.bg-white\/15.backdrop-blur-md.rounded-full.border.border-white\/30 span {
    font-size: 0.76rem !important;
    letter-spacing: 0.05em !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .space-y-8 > div:nth-child(2) > h3 {
    font-size: 1.95rem !important;
    line-height: 1.08 !important;
  }

  .from-\[\#0a2435\].via-\[\#1e5a7d\] .relative.h-\[400px\].lg\:h-full.min-h-\[400px\] {
    min-height: 210px !important;
    height: 220px !important;
  }
}

/* 8. Formulario contacto: color consistente en selector DNI/RUC */
#contacto select[name="docType"] {
  color: #94a3b8 !important;
}

#contacto select[name="docType"] + span {
  color: #94a3b8 !important;
}

#contacto select[name="docType"] option {
  color: #334155 !important;
}

@media (max-width: 640px) {
  #contacto .grid.gap-3.items-center[style*="170px"] {
    grid-template-columns: 110px minmax(0, 1fr) !important;
    gap: 0.6rem !important;
  }

  #contacto select[name="docType"] {
    font-size: 0.95rem !important;
    padding: 0.8rem 2rem 0.8rem 0.8rem !important;
  }

  #contacto input[name="docNumber"] {
    font-size: 0.95rem !important;
    padding: 0.8rem 0.85rem !important;
  }
}

@media (max-width: 420px) {
  #contacto .grid.gap-3.items-center[style*="170px"] {
    grid-template-columns: 98px minmax(0, 1fr) !important;
    gap: 0.5rem !important;
  }

  #contacto select[name="docType"],
  #contacto input[name="docNumber"] {
    font-size: 0.92rem !important;
    padding-top: 0.72rem !important;
    padding-bottom: 0.72rem !important;
  }
}

/* ============================================ */
/* CARGA: 3 PUNTOS CIRCULARES (ESTILO REFERENCIA) */
/* ============================================ */
@keyframes loaderDotsSoft {
  0%, 100% {
    background-size: 22px 22px, 22px 22px, 22px 22px;
    opacity: 0.95;
  }
  50% {
    background-size: 24px 24px, 20px 20px, 22px 22px;
    opacity: 1;
  }
}

.tracking-\[0\.45em\] {
  font-size: 0 !important;
  letter-spacing: 0 !important;
  color: transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 96px !important;
  height: 28px !important;
  overflow: visible !important;
  position: relative !important;
}

.tracking-\[0\.45em\]::before {
  content: '' !important;
  width: 96px !important;
  height: 28px !important;
  display: block !important;
  background-repeat: no-repeat !important;
  background-position: 0px 3px, 35px 3px, 70px 3px !important;
  background-size: 22px 22px, 22px 22px, 22px 22px !important;
  background-image:
    radial-gradient(circle, rgba(236, 247, 255, 0.98) 0 70%, transparent 72%),
    radial-gradient(circle, rgba(170, 210, 232, 0.92) 0 70%, transparent 72%),
    radial-gradient(circle, rgba(123, 172, 201, 0.85) 0 70%, transparent 72%) !important;
  filter: drop-shadow(0 2px 6px rgba(166, 210, 236, 0.22)) !important;
  animation: loaderDotsSoft 1.1s ease-in-out infinite !important;
}

/* Ajuste puntual: bajar ligeramente la foto de David en el marco circular */
img[src*="David%20Alvarez.png"],
img[src*="David Alvarez.png"] {
  object-position: center 18% !important;
}

#equipo img[alt="David Alvarez"] {
  object-position: 50% 18% !important;
}

/* ============================================ */
/* MEJORAS RESPONSIVAS ADICIONALES DEL HEADER */
/* ============================================ */

/* Breakpoint 900px - Tablets medianas */
@media (max-width: 900px) {
  section:first-of-type h1,
  section:first-of-type h2,
  section:first-of-type h3,
  section:first-of-type h4,
  section:first-of-type h5,
  section:first-of-type h6,
  section:first-of-type .text-3xl,
  section:first-of-type .text-4xl,
  section:first-of-type .text-5xl,
  section:first-of-type .text-6xl,
  section:first-of-type .text-7xl,
  section:first-of-type .text-8xl {
    font-size: clamp(2.1rem, 8.2vw, 4rem) !important;
    line-height: 1 !important;
  }
}

/* Breakpoint 600px - Phones en landscape */
@media (max-width: 600px) {
  section:first-of-type h1,
  section:first-of-type h2,
  section:first-of-type h3,
  section:first-of-type h4,
  section:first-of-type h5,
  section:first-of-type h6,
  section:first-of-type .text-3xl,
  section:first-of-type .text-4xl,
  section:first-of-type .text-5xl,
  section:first-of-type .text-6xl {
    font-size: clamp(1.8rem, 8vw, 3rem) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }

  section:first-of-type p,
  section:first-of-type .text-base,
  section:first-of-type .text-lg {
    font-size: clamp(0.95rem, 2.8vw, 1.1rem) !important;
    line-height: 1.3 !important;
  }
}

/* Breakpoint 400px - Teléfonos pequeños */
@media (max-width: 400px) {
  section:first-of-type h1,
  section:first-of-type .text-5xl {
    font-size: 1.65rem !important;
    font-weight: 800 !important;
    padding: 0.1rem 0.5rem !important;
    line-height: 1 !important;
  }
  
  section:first-of-type h2,
  section:first-of-type .text-4xl {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
  }

  section:first-of-type p,
  section:first-of-type .text-base {
    font-size: 1.1rem !important;
    line-height: 1.15 !important;
  }

  section:first-of-type {
    padding: 1.5rem 0.75rem !important;
  }
}

/* ============================================ */
/* HARDENING RESPONSIVO GLOBAL */
/* ============================================ */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

img,
svg {
  max-width: 100%;
}

video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

img {
  max-width: 100%;
}

/* Ajuste puntual: 360x800 (y similares) para mantener la imagen de fondo detrás */
@media (max-width: 380px) and (max-height: 820px) {
  section:first-of-type {
    min-height: 100svh !important;
  }

  section:first-of-type > .absolute.inset-0.z-0 > img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }
}

/* Desktop/Laptop comunes y tablets grandes */
@media (max-width: 1280px) {
  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  section {
    overflow-x: clip;
  }

  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Evita saltos laterales por elementos absolutamente posicionados */
  .group,
  .relative {
    max-width: 100%;
  }
}

/* Móviles */
@media (max-width: 768px) {
  section {
    scroll-margin-top: 5.5rem;
  }

  /* Respeta el notch/island en iOS para que la barra no se pegue arriba */
  .fixed.top-0.left-0.right-0.z-50 {
    padding-top: env(safe-area-inset-top, 0px) !important;
  }

  /* Inputs a 16px para evitar zoom automático en iOS/Android */
  input,
  select,
  textarea,
  button {
    font-size: 16px !important;
  }

  /* Ajuste del botón flotante para que no tape contenido */
  a[aria-label="Contactar por WhatsApp"] {
    right: 0.9rem !important;
    bottom: 0.9rem !important;
  }

  a[aria-label="Contactar por WhatsApp"] > .relative {
    width: 3.2rem !important;
    height: 3.2rem !important;
  }

  a[aria-label="Contactar por WhatsApp"] svg {
    width: 1.55rem !important;
    height: 1.55rem !important;
  }
}

/* Ajuste específico iPhone 11-17 (ancho CSS 390-430 aprox.) */
@media (min-width: 390px) and (max-width: 430px) {
  section:first-of-type h1,
  section:first-of-type h2,
  section:first-of-type .text-5xl,
  section:first-of-type .text-6xl {
    font-size: clamp(2rem, 8vw, 3.2rem) !important;
    line-height: 1.05 !important;
  }

  section:first-of-type p,
  section:first-of-type .text-base,
  section:first-of-type .text-lg {
    font-size: clamp(0.98rem, 2.7vw, 1.08rem) !important;
    line-height: 1.35 !important;
  }
}

/* Teléfonos pequeños */
@media (max-width: 480px) {
  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  a[aria-label="Contactar por WhatsApp"] {
    right: 0.7rem !important;
    bottom: 0.7rem !important;
  }
}

/* Tablets 768x1024: 3 columnas y Sophia centrada */
@media (min-width: 768px) and (max-width: 1024px) {
  #equipo .grid.grid-cols-1.sm\:grid-cols-2.gap-6.xl\:hidden {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
  }

  #equipo .grid.grid-cols-1.sm\:grid-cols-2.gap-6.xl\:hidden > div:first-child {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
  }

  #equipo .grid.grid-cols-1.sm\:grid-cols-2.gap-6.xl\:hidden > div:nth-child(2) {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  #equipo .grid.grid-cols-1.sm\:grid-cols-2.gap-6.xl\:hidden > div:nth-child(3) {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  #equipo .grid.grid-cols-1.sm\:grid-cols-2.gap-6.xl\:hidden > div:nth-child(4) {
    grid-column: 3 / 4 !important;
    grid-row: 2 !important;
  }

  #equipo .grid.grid-cols-1.sm\:grid-cols-2.gap-6.xl\:hidden > div:nth-child(5) {
    grid-column: 1 / 2 !important;
    grid-row: 3 !important;
  }

  #equipo .grid.grid-cols-1.sm\:grid-cols-2.gap-6.xl\:hidden > div:nth-child(6) {
    grid-column: 2 / 3 !important;
    grid-row: 3 !important;
  }

  #equipo .grid.grid-cols-1.sm\:grid-cols-2.gap-6.xl\:hidden > div:nth-child(7) {
    grid-column: 3 / 4 !important;
    grid-row: 3 !important;
  }
}

/* ============================================ */
/* FOOTER CENTRADO EN MOVIL */
/* ============================================ */
@media (max-width: 768px) {
  footer {
    text-align: center !important;
  }

  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }

  footer .flex.items-center {
    justify-content: center !important;
  }

  footer ul,
  footer li,
  footer p,
  footer a,
  footer h3,
  footer h4 {
    text-align: center !important;
  }
}
