/* Rubicknet - ajustes compactos para celular (cargar DESPUES de styles.css) */
@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; line-height: 1.5; overflow-x: hidden; }
  img, svg, video { max-width: 100%; }

  .contenedor { padding-left: 16px !important; padding-right: 16px !important; width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
  .seccion { padding-top: 32px !important; padding-bottom: 32px !important; }
  .seccion.compacta { padding-top: 22px !important; padding-bottom: 22px !important; }

  h1 { font-size: 1.55rem !important; line-height: 1.2 !important; }
  h2 { font-size: 1.3rem !important; line-height: 1.25 !important; }
  h3 { font-size: 1.1rem !important; line-height: 1.3 !important; }
  h4 { font-size: 1rem !important; }
  p, li, dd, dt, label { font-size: .95rem !important; line-height: 1.5; }
  .eyebrow { font-size: .72rem !important; letter-spacing: .08em; }
  .hero-sub, .gancho, .seccion-titulo p { font-size: 1rem !important; }

  .hero-inner, .split, .nosotros-hero, .bloque-incluye, .contacto-grid, .ficha-proyecto,
  .planes-grid, .grid-servicios, .beneficios-grid, .cifras-grid, .grid-proyectos,
  .equipo-grid, .porque-grid, .otras-grid, .mini-proyectos, .fila-2, .mapa-media {
    display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important;
  }
  .cifras-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 24px 12px !important; padding-left: 16px !important; padding-right: 16px !important; }
  .cifra { text-align: center; }
  .cifra strong, .cifra .num { font-size: clamp(1.2rem, 5.4vw, 1.5rem) !important; line-height: 1.15; }
  .cifra span { font-size: .8rem !important; }

  .plan-card, .tarjeta-servicio, .equipo-card, .beneficio, .proyecto, .panel-lateral,
  .contacto-info-card, .form-contacto, .mapa-info, .ficha-datos { padding: 16px !important; box-sizing: border-box; }
  .plan-velocidad { font-size: 1.7rem !important; }
  .plan-precio { font-size: 1.4rem !important; }

  .btn, .btn-primario, .btn-secundario, .btn-ghost, .btn-secundario-purpura, .tab-btn, .filtro {
    min-height: 44px; padding: 10px 16px !important; font-size: .95rem !important;
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
  }
  .btn-bloque, .hero-cta-row .btn { width: 100% !important; box-sizing: border-box; }
  .hero-cta-row { display: flex !important; flex-direction: column; gap: 10px; }

  .hero, .solucion-hero { padding-top: 36px !important; padding-bottom: 32px !important; }
  .hero-grande { min-height: auto !important; }
  .icono-grande svg { width: 44px; height: 44px; }

  input[type="text"], input[type="tel"], input[type="email"], textarea, select {
    width: 100% !important; box-sizing: border-box; min-height: 44px; padding: 9px 12px !important; font-size: 16px !important; /* 16px evita zoom en iPhone */
  }
  .opciones-servicio { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip-check { padding: 8px 12px !important; font-size: .88rem !important; }

  .incluye-item { gap: 10px; align-items: flex-start; }
  .incluye-item svg { width: 20px; height: 20px; flex-shrink: 0; }
  .zonas-chips, .marcas-fila, .equipo-lista-equipos, .filtros-proyectos, .tabs-nav { display: flex; flex-wrap: wrap; gap: 8px; }
  .zonas-chips span, .equipo-lista-equipos span, .marcas-fila span { font-size: .85rem !important; padding: 7px 11px; }
  .tabs-nav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .tabs-nav .tab-btn { white-space: nowrap; flex-shrink: 0; }

  .fila-solucion { display: grid !important; grid-template-columns: auto 1fr auto !important; gap: 12px !important; padding: 14px 0 !important; align-items: center; }
  .fila-solucion .num { display: none; }
  .fila-solucion .icono svg { width: 30px; height: 30px; }
  .fila-solucion h3 { font-size: 1rem !important; margin: 0 0 2px; }
  .fila-solucion p { font-size: .85rem !important; }

  .faq-pregunta { font-size: .98rem !important; padding: 13px 0 !important; min-height: 44px; }
  .faq-respuesta { font-size: .92rem !important; }

  .split-media img, .proyecto-media img, .ficha-galeria img { width: 100%; height: auto; }
  .ficha-galeria { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .mapa-media { height: auto !important; }
  .mapa-panel-google iframe { width: 100% !important; height: 300px !important; }

  table, pre { display: block; overflow-x: auto; }

  .whatsapp-float { width: 52px !important; height: 52px !important; right: 12px !important; bottom: 12px !important; }
  .whatsapp-float svg { width: 28px; height: 28px; }
}

@media (max-width: 380px) {
  h1 { font-size: 1.4rem !important; }
  .cifras-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ficha-galeria { grid-template-columns: 1fr 1fr !important; }
}

/* =========================================================
   Correcciones móviles v1.1
   ========================================================= */
@media (max-width: 768px) {

  /* ---------- Hero ---------- */
  .hero { padding-top: 28px !important; padding-bottom: 36px !important; }
  .hero-inner { min-width: 0; }
  .hero .eyebrow { font-size: .68rem !important; line-height: 1.5; }
  .hero h1 { margin-bottom: 12px; }
  .hero-sub { margin-top: 0; }
  .hero-cta-row { margin-top: 22px !important; align-items: stretch; }
  .hero-cta-row .btn { white-space: normal; text-align: center; line-height: 1.3; }

  /* ---------- Buscador de cobertura ---------- */
  /* Fila: lupa + campo. Debajo: botón a todo el ancho. */
  .buscador-cobertura {
    display: flex !important; flex-direction: row !important; flex-wrap: wrap !important;
    align-items: center !important; gap: 4px 10px !important;
    width: 100%; max-width: 100% !important; box-sizing: border-box;
    margin-top: 20px !important; padding: 6px 12px 12px !important;
  }
  .buscador-cobertura svg { display: block !important; width: 20px; height: 20px; flex: 0 0 20px; }
  .buscador-cobertura input {
    flex: 1 1 0 !important; min-width: 0 !important; width: auto !important;
    min-height: 48px !important; padding: 0 !important; border: 0 !important; background: none !important;
  }
  .buscador-cobertura .btn { flex: 1 1 100% !important; width: 100% !important; margin-top: 4px; }

  /* Fila inyectada por cobertura.js (buscador + "Usar mi ubicación"):
     en celular va en columna y cada pieza ocupa todo el ancho. */
  .cobertura-buscador-fila { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 10px !important; width: 100%; min-width: 0; }
  .cobertura-buscador-fila .buscador-cobertura { flex: 0 0 auto !important; margin-top: 20px !important; }
  .cobertura-buscador-fila .rbk-btn-ubicacion {
    width: 100% !important; min-height: 48px; padding: 12px 20px !important; box-sizing: border-box;
    white-space: normal; justify-content: center; text-align: center;
  }
  .resultado-cobertura { max-width: 100% !important; }

  /* ---------- Pie de página ---------- */
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 24px 16px !important; }
  .footer-grid > div:first-child, .footer-grid > div:last-child { grid-column: 1 / -1; }
  .footer-grid p, .footer-grid a { overflow-wrap: anywhere; word-break: normal !important; }
  .site-footer { padding-bottom: 96px !important; } /* deja espacio al botón flotante */

  /* ---------- Tarjetas de proyecto: no tan altas ---------- */
  .proyecto-media img { aspect-ratio: 4 / 3; object-fit: cover; height: auto; }
  .ficha-galeria img { aspect-ratio: 1 / 1; object-fit: cover; }

  /* ---------- Botones flotantes: un solo botón que se despliega ---------- */
  .rbk-stack-flotante {
    right: 14px !important; bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 10px !important; align-items: flex-end !important;
  }
  .rbk-stack-flotante .whatsapp-float,
  .rbk-stack-flotante .facebook-float,
  .rbk-stack-flotante .rbk-burbuja { width: 48px !important; height: 48px !important; }
  .rbk-stack-flotante .whatsapp-float svg { width: 26px !important; height: 26px !important; }
  .rbk-stack-flotante .facebook-float svg { width: 22px !important; height: 22px !important; }
  .rbk-stack-flotante .rbk-burbuja svg { width: 22px !important; height: 22px !important; }

  .rbk-fab-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; padding: 0;
    background: var(--gradient-diag, linear-gradient(135deg, #0033FF 0%, #977DFF 100%));
    box-shadow: 0 10px 24px -8px rgba(0, 51, 255, .6);
    -webkit-tap-highlight-color: transparent;
  }
  .rbk-fab-toggle svg { width: 24px; height: 24px; }
  .rbk-fab-toggle .ico-cerrar { display: none; }
  .rbk-stack-flotante.fab-abierto .rbk-fab-toggle .ico-abrir { display: none; }
  .rbk-stack-flotante.fab-abierto .rbk-fab-toggle .ico-cerrar { display: block; }
  .rbk-stack-flotante.chat-abierto .rbk-fab-toggle { display: none; }

  /* Plegado: solo se ve el botón principal */
  .rbk-stack-flotante:not(.fab-abierto):not(.chat-abierto) > :not(.rbk-fab-toggle) { display: none !important; }

  /* Panel del chat: casi a todo el ancho, sin salirse de la pantalla */
  .rbk-panel {
    right: 12px !important; left: 12px; width: auto !important; max-width: none !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 768px) {
  body:has(.main-nav.abierto) .rbk-stack-flotante { display: none !important; }
}

@media (min-width: 769px) {
  .rbk-fab-toggle { display: none; }
}
