/* =====================================================================
   RESPONSIVE — Ajustes mobile y tablet
   Aplica a: index.html (hero + secciones específicas)
   y a la cabecera / pie de página (compartidos en todo el sitio).

   Estrategia:
   - <= 640px  → móvil (iPhone, Android estándar)
   - 641 - 1024px → tablet / iPad
   - > 1024px  → desktop (sin cambios)
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. PADDING LATERAL Y RESPIRO GLOBAL EN MÓVIL
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --px: clamp(1.15rem, 5vw, 1.5rem);
  }
  .w {
    padding-left: clamp(1.15rem, 5vw, 1.5rem);
    padding-right: clamp(1.15rem, 5vw, 1.5rem);
  }
  body {
    overflow-x: hidden;
  }
}

/* ---------------------------------------------------------------------
   2. AGENTE FLOTANTE + NAV
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .fa-widget {
    right: max(.75rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .nav .w {
    height: 58px;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .logo-img {
    height: 22px;
  }
  .nav-r {
    gap: .55rem;
  }
  .nav-r .btn-md {
    display: none;
  }
}

/* ---------------------------------------------------------------------
   3. MENÚ MÓVIL — más legible, jerarquía clara, CTA destacado
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .mobile-menu-panel {
    width: min(90%, 360px);
    padding: 5.5rem 1.5rem 2rem;
    gap: 0;
  }
  .mobile-menu a {
    display: flex;
    align-items: center;
    padding: 1rem .25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bk);
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--g2);
  }
  .mobile-menu a.sub {
    padding: .75rem .25rem .75rem 1.5rem;
    font-size: .92rem;
    font-weight: 400;
    color: var(--g7);
    position: relative;
    border-bottom: 1px solid var(--g2);
  }
  .mobile-menu a.sub::before {
    content: "";
    position: absolute;
    left: .5rem;
    top: 50%;
    width: 6px;
    height: 1.5px;
    background: var(--g4);
    border-radius: 2px;
  }
  .mobile-menu a.active {
    color: var(--p);
    font-weight: 700;
  }
  .mobile-menu .mm-label {
    padding: 1.25rem .25rem .35rem;
    font-size: .68rem;
    font-weight: 700;
    color: var(--g6);
    letter-spacing: .1em;
    text-transform: uppercase;
    border-bottom: none;
  }
  .mobile-menu .mm-cta {
    margin-top: 1.5rem;
    display: block;
    text-align: center;
    padding: 1rem 1.25rem;
    background: var(--bk);
    color: var(--wh);
    border-radius: 14px;
    font-weight: 700;
    border-bottom: none;
    box-shadow: 0 12px 28px -10px rgba(0,0,0,.35);
  }
}

/* ---------------------------------------------------------------------
   4. HERO HOMEPAGE — centrado móvil, imagen visible en tablet
   --------------------------------------------------------------------- */

/* Tablet (641-1024): conservar imagen de fondo, ajustar tipografía */
@media (min-width: 641px) and (max-width: 1024px) {
  .hero {
    background-image: url('../assets/fondohero.jpg');
    background-repeat: no-repeat;
    background-position: right -40px top;
    background-size: cover;
    padding: 5.5rem 0 5rem;
    min-height: 540px;
  }
  .hero::before {
    background: linear-gradient(
      90deg,
      #ffffff 0%,
      rgba(255,255,255,.96) 38%,
      rgba(255,255,255,.7) 62%,
      rgba(255,255,255,0) 92%
    );
  }
  .hero::after {
    opacity: .25;
  }
  .hero h1 {
    font-size: clamp(2rem, 5.2vw, 2.7rem);
    line-height: 1.08;
  }
  .hero-sub {
    font-size: 1rem;
    max-width: 46ch;
    line-height: 1.55;
  }
  .hero-cta {
    gap: .65rem;
  }
  .hero-pillrow {
    gap: .45rem;
  }
}

/* Móvil — todo centrado, CTAs en columna full width
   El padding-top deja espacio bajo el nav flotante (~110px) */
@media (max-width: 640px) {
  .hero {
    padding: 5rem 0 3.25rem;
    min-height: auto;
    text-align: center;
    background-image: linear-gradient(180deg, #ffffff 0%, #faf8ff 55%, #f3edff 100%);
  }
  .hero::before {
    background: none;
  }
  .hero::after {
    opacity: .2;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
    margin-top: 0;
  }
  .hero-badge {
    margin: 0 auto 1rem;
  }
  .hero h1 {
    font-size: clamp(1.9rem, 7.5vw, 2.35rem);
    line-height: 1.1;
    max-width: 18ch;
    margin: 0 auto .75rem;
  }
  .hero h1 .hero-title-line {
    display: inline;
    white-space: normal;
  }
  .hero h1 .hero-title-line + .hero-title-line::before {
    content: " ";
  }
  .hero-sub {
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 auto 1.5rem;
    max-width: 38ch;
    color: var(--g7);
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: .65rem;
    margin: 0 auto 1.5rem;
    max-width: 320px;
  }
  .hero-cta .btn,
  .hero-cta .btn-lg {
    width: 100% !important;
    justify-content: center;
    font-size: .9rem !important;
    padding: .8rem 1.15rem !important;
    font-weight: 700;
    line-height: 1.2;
  }
  .hero-cta .btn svg.arr {
    width: 14px;
    height: 14px;
  }
  .hero-cta .micro {
    margin-top: .35rem;
    justify-content: center;
    text-align: center;
  }
  .hero-pillrow {
    justify-content: center;
    gap: .4rem;
    margin-top: 1.25rem;
  }
  .hero-pill {
    font-size: .72rem;
    padding: .38rem .75rem;
  }
}

/* ---------------------------------------------------------------------
   5. SECCIONES — más respiro y tipografía centrada en móvil
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .sec {
    padding: 3rem 0;
  }
  .sec-head {
    margin-bottom: 2.25rem;
  }
  .sec-head h2 {
    font-size: clamp(1.6rem, 6.5vw, 2rem);
    line-height: 1.1;
  }
  .sec-head p {
    font-size: .98rem;
    line-height: 1.55;
  }

  /* Banda "¿Te suena?" */
  .band {
    padding: 3rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #faf8ff 55%, #f3edff 100%);
  }
  .band::before {
    background: none;
  }
  .band-layout {
    grid-template-columns: 1fr;
  }
  .band-content {
    grid-column: 1;
    gap: 1.5rem;
  }
  .band-intro {
    text-align: center;
  }
  .band-intro h2 {
    font-size: clamp(1.65rem, 7vw, 2.1rem);
    line-height: 1.12;
  }
  .band-lead {
    text-align: center;
    margin: 0 auto;
    max-width: 38ch;
  }
  .band-cards {
    grid-template-columns: 1fr;
    gap: .75rem;
  }
  .band-card {
    min-height: auto;
    padding: 1.1rem 1rem 1.2rem;
    align-items: center;
    text-align: center;
  }
  .band-card h3 {
    font-size: 1rem;
  }
  .band-card p {
    font-size: .85rem;
    line-height: 1.5;
    max-width: 32ch;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------------------------------------------------------------------
   6. BENTO (Soluciones) — móvil
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .bento {
    gap: 1rem;
  }
  .bento-card {
    padding: 1.5rem 1.25rem;
  }
  .bento-hero {
    padding: 1.5rem 1.25rem;
    min-height: auto;
  }
  .bento-hero-content h3 {
    font-size: clamp(1.4rem, 6.5vw, 1.75rem);
  }
  .bento-hero-content p {
    font-size: .95rem;
  }
  .bento-hero-visual {
    height: 240px;
  }
  .bento-tag {
    top: 1rem;
    right: 1rem;
    font-size: .62rem;
  }
}

/* ---------------------------------------------------------------------
   7. ÁREA CLIENTE (mkc) — móvil (versión compacta)
   Quitamos el fondo decorativo (lo deja muy alto), reducimos el padding
   y compactamos las "feature cards" (cada una sólo tiene icono + span).
   Forzamos varias reglas con !important porque la rama global del mkc
   tiene reglas en @media(max-width:980px) muy específicas.
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .dc-sec {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  .mkc {
    padding: 1.85rem 1.1rem 1.6rem !important;
    text-align: center;
    min-height: auto !important;
    background-image: none !important;
    border-radius: 18px;
  }
  .mkc::before {
    background:
      linear-gradient(180deg, rgba(8,5,15,.98) 0%, rgba(20,10,40,.95) 100%),
      radial-gradient(ellipse 80% 60% at 50% 0%, rgba(109,22,223,.22), transparent 70%) !important;
  }
  .mkc::after {
    opacity: .35;
    background:
      radial-gradient(circle at 90% 110%, rgba(168,85,247,.35) 0%, transparent 35%),
      radial-gradient(circle at 10% -10%, rgba(207,255,101,.08) 0%, transparent 30%);
  }
  .mkc-grid {
    min-height: auto !important;
    grid-template-columns: minmax(0, 1fr);
  }
  .mkc-copy {
    align-items: center !important;
    gap: .9rem;
  }
  .mkc h2 {
    font-size: clamp(1.4rem, 6vw, 1.75rem) !important;
    line-height: 1.15;
    margin: 0 auto .5rem !important;
    max-width: 22ch;
  }
  .mkc-title-line {
    white-space: normal !important;
    display: inline !important;
  }
  .mkc-title-line + .mkc-title-line::before {
    content: " ";
  }
  .mkc-copy > p {
    margin: 0 auto 1rem !important;
    text-align: center;
    font-size: .9rem !important;
    line-height: 1.5 !important;
    max-width: 38ch !important;
  }
  .mkc-feat-grid {
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
    margin: 0 auto 1rem !important;
    max-width: 360px !important;
  }
  .mkc-feat-card {
    text-align: left;
    padding: .6rem .75rem !important;
    gap: .6rem !important;
    border-radius: 12px;
    font-size: .78rem !important;
    line-height: 1.3 !important;
  }
  .mkc-feat-card span {
    font-size: .78rem;
    line-height: 1.3;
  }
  .mkc-feat-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
  }
  .mkc-feat-icon svg {
    width: 14px !important;
    height: 14px !important;
  }
  .mkc-feat-wide {
    grid-column: 1;
  }
  .mkc-cta {
    margin: .25rem auto 0 !important;
    width: auto;
    max-width: 280px;
    font-size: .88rem !important;
    padding: .72rem 1.3rem !important;
  }
}

/* ---------------------------------------------------------------------
   8. KIT DIGITAL CARDS — móvil (contenido centrado, botón compacto)
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .kd-head {
    margin-bottom: 1.75rem;
  }
  .kd-head h2 {
    font-size: clamp(1.6rem, 6.5vw, 2rem);
    line-height: 1.1;
  }
  .kd-sub {
    font-size: .94rem;
  }
  .kd-card {
    padding: 1.5rem 1.25rem;
    align-items: center;
    text-align: center;
    gap: .75rem;
  }
  .kd-label {
    align-self: center;
  }
  .kd-card h3 {
    font-size: 1.15rem;
  }
  .kd-card p {
    font-size: .9rem;
    line-height: 1.5;
  }
  .kd-card .btn,
  .kd-card .btn-md {
    align-self: center !important;
    width: auto !important;
    max-width: 100% !important;
    justify-content: center;
    font-size: .85rem !important;
    padding: .65rem 1.15rem !important;
    margin-top: .5rem !important;
    line-height: 1.2;
  }
  .kd-card .btn svg.arr {
    width: 12px;
    height: 12px;
  }
}

/* ---------------------------------------------------------------------
   9. CTA FINAL (fcta) — móvil
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .fcta {
    padding: 2.5rem 1.5rem;
    text-align: center;
  }
  .fcta h2 {
    font-size: clamp(1.7rem, 7.5vw, 2.2rem);
  }
  .fcta p {
    max-width: 40ch;
    margin-left: auto;
    margin-right: auto;
  }
  .fcta-bull {
    gap: .65rem 1.25rem;
    font-size: .78rem;
  }
}

/* ---------------------------------------------------------------------
   10. FOOTER — móvil (centrado total, jerarquía clara)
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  footer {
    padding: 3rem 0 1.75rem;
    margin-top: 3rem;
  }
  .foot-grid {
    grid-template-columns: 1fr !important;
    gap: 2.25rem !important;
    text-align: center;
    padding-bottom: 2rem;
  }
  .foot-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .foot-brand p {
    max-width: 38ch;
    margin-left: auto;
    margin-right: auto;
  }
  .foot-social {
    margin-top: 1.1rem;
    text-align: center;
  }
  .foot-social-label {
    text-align: center;
  }
  .foot-social-list {
    justify-content: center;
  }
  .foot-col h3 {
    margin-bottom: .9rem;
  }
  .foot-col ul {
    align-items: center;
    gap: .65rem;
  }
  .foot-contact {
    align-items: center;
  }
  .foot-contact li {
    justify-content: center;
    gap: .55rem;
    text-align: left;
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
  }
  .foot-bot {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 1rem;
    padding-top: 1.5rem;
  }
  .foot-legal {
    justify-content: center;
    gap: .35rem .9rem;
  }
}

/* ---------------------------------------------------------------------
   11. FOOTER — tablet (3 columnas reorganizadas)
   Row 1: Brand+Síguenos | Soluciones | Contacto
   Row 2: Kit Digital | Empresa | (vacío)
   --------------------------------------------------------------------- */
@media (min-width: 641px) and (max-width: 1024px) {
  .foot-grid {
    grid-template-columns: 1.5fr 1fr 1.15fr;
    grid-template-areas:
      "brand soluc contact"
      "kitd  empr  empr";
    gap: 2.5rem 2rem;
    align-items: start;
  }
  .foot-brand {
    grid-area: brand;
  }
  .foot-grid > .foot-col:nth-child(2) { grid-area: soluc; }   /* Soluciones */
  .foot-grid > .foot-col:nth-child(3) { grid-area: kitd; }    /* Kit Digital */
  .foot-grid > .foot-col:nth-child(4) { grid-area: empr; }    /* Empresa */
  .foot-grid > .foot-col:nth-child(5) { grid-area: contact; } /* Contacto */

  .foot-bot {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 1rem 2rem;
  }
}

/* ---------------------------------------------------------------------
   12. AJUSTES FINOS — pantallas muy pequeñas (<=380px)
   --------------------------------------------------------------------- */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 1.65rem;
  }
  .hero-sub {
    font-size: .95rem;
  }
  .sec-head h2,
  .band-intro h2,
  .kd-head h2 {
    font-size: 1.55rem;
  }
  .hero-badge {
    font-size: .72rem;
  }
  .hero-pill {
    font-size: .68rem;
    padding: .32rem .65rem;
  }
}

/* ---------------------------------------------------------------------
   13. ALINEACIÓN DEL AGENTE FLOTANTE — móvil
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .fa-panel {
    width: min(300px, calc(100vw - 1.5rem));
  }
}

/* ---------------------------------------------------------------------
   14. RESEÑAS / CARRUSEL — móvil
   En móvil DESACTIVAMOS el marquee de shared-animations.css y
   habilitamos un carrusel real (botones, dots, swipe) controlado por JS.
   Se usan !important porque shared-animations.css ya los incluye.
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .proof .sec-head {
    margin-bottom: 1.75rem;
  }
  .carousel-wrap {
    overflow: hidden !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    margin: 0;
    padding: 0;
  }
  .carousel {
    animation: none !important;
    width: auto !important;
    gap: .85rem !important;
    transform: translateX(0);
    transition: transform .45s cubic-bezier(.16,1,.3,1);
  }
  .carousel .testi,
  .carousel .testi-clone {
    flex: 0 0 100% !important;
    min-width: 0;
  }
  .testi {
    padding: 1.25rem 1.15rem 1.1rem;
    gap: .9rem;
    border-radius: 16px;
  }
  .testi p {
    font-size: .94rem !important;
    line-height: 1.5 !important;
  }
  .testi .stars {
    font-size: .95rem;
  }
  .testi-by {
    padding-top: .8rem;
    gap: .6rem;
  }
  .testi-av {
    width: 32px;
    height: 32px;
    font-size: .82rem;
  }
  .testi-by .nm {
    font-size: .82rem;
  }
  .testi-by .rl {
    font-size: .72rem;
  }
  .carousel-nav {
    display: flex !important;
    margin-top: 1.25rem;
    gap: .75rem;
  }
  .car-btn {
    width: 38px;
    height: 38px;
  }
  .car-btn svg {
    width: 18px;
    height: 18px;
  }
  .car-dot {
    width: 7px;
    height: 7px;
  }
  .car-dot.active {
    width: 20px;
  }
}

/* Tablet: marquee sigue activo pero ajustamos tamaño de los slides */
@media (min-width: 641px) and (max-width: 1024px) {
  .carousel .testi {
    flex: 0 0 320px !important;
  }
  .testi {
    padding: 1.35rem 1.25rem;
  }
  .testi p {
    font-size: .95rem;
  }
}
