/* ===================================
   Mobile Specific Styles - Fonia Website
   Optimizado para dispositivos móviles ≤1024px
   =================================== */

@media (max-width: 1024px) {
  /* ========== HEADER & NAVIGATION ========== */
  header {
    display: none !important;
  }

  /* ========== MOBILE TOP BAR ========== */
  #mobileTopBar {
    display: flex !important;
  }

  /* Logo del top bar con max-width 60% */
  #mobileTopBar img {
    max-width: 60% !important;
    height: auto !important;
  }

  /* Ajustar body padding para compensar la top bar */
  body {
    padding-top: 60px !important;
  }

  /* ========== FLOATING ICONS ========== */
  .floating-icon {
    display: none !important;
  }

  /* ========== HERO SECTION ========== */
  .hero-section {
    padding-top: 20px !important; /* Reducido porque ya hay padding-top en body */
    padding-bottom: 60px !important;
  }

  /* Contenido principal del hero más arriba en móvil */
  .hero-section .text-center.max-w-3xl {
    padding-top: 40px !important;
    margin-top: 0 !important;
  }

  /* Banner SofIA - 2 líneas en móvil */
  .hero-section .flex.items-center.justify-center.gap-8 {
    flex-direction: column !important;
    gap: 20px !important;
    padding: 24px 20px !important;
  }

  .hero-section .flex.items-center.justify-center.gap-8 > div {
    width: 100% !important;
    text-align: center !important;
  }

  .hero-section .flex.items-center.justify-center.gap-8 .text-left {
    text-align: center !important;
  }

  /* ========== TIPOGRAFÍA GENERAL ========== */
  body {
    font-size: 18px !important;
    line-height: 1.6 !important;
  }

  h1 {
    font-size: 2.5rem !important; /* 40px */
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 2rem !important; /* 32px */
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 1.75rem !important; /* 28px */
    line-height: 1.4 !important;
  }

  h4 {
    font-size: 1.5rem !important; /* 24px */
    line-height: 1.4 !important;
  }

  h5 {
    font-size: 1.25rem !important; /* 20px */
    line-height: 1.5 !important;
  }

  p {
    font-size: 1.125rem !important; /* 18px */
    line-height: 1.6 !important;
  }

  /* Textos pequeños */
  .text-sm,
  small {
    font-size: 1rem !important; /* 16px */
  }

  /* Textos extra pequeños */
  .text-xs {
    font-size: 0.875rem !important; /* 14px */
  }

  /* Textos grandes */
  .text-lg {
    font-size: 1.25rem !important; /* 20px */
  }

  .text-xl {
    font-size: 1.5rem !important; /* 24px */
  }

  .text-2xl {
    font-size: 1.75rem !important; /* 28px */
  }

  /* ========== INPUTS & BUTTONS ========== */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* Evita zoom en iOS */
    padding: 14px 16px !important;
    min-height: 44px !important; /* Accesibilidad táctil */
  }

  button,
  .btn {
    font-size: 16px !important;
    padding: 14px 20px !important;
    min-height: 44px !important;
  }

  /* ========== CARDS & CONTAINERS ========== */
  .product-card {
    padding: 24px 20px !important;
  }

  .flip-card-container {
    height: 300px !important;
  }

  /* ========== GRIDS ========== */
  .grid {
    gap: 24px !important;
  }

  /* Cards de productos/servicios */
  .grid.md\:grid-cols-2,
  .grid.lg\:grid-cols-3,
  .grid.md\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* ========== BADGES & LABELS ========== */
  .badge,
  span[class*="badge"] {
    font-size: 14px !important;
    padding: 8px 16px !important;
  }

  /* ========== LOGOS & IMAGES ========== */
  .logos-scroll-container figure {
    width: 100px !important;
    margin-right: 32px !important;
  }

  /* ========== SECTIONS SPACING ========== */
  section {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  /* Hero section ya tiene padding específico arriba */
  .py-16,
  .py-20,
  .py-24,
  .py-25 {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  /* ========== CONTAINERS ========== */
  .main-container,
  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* ========== STATS & METRICS ========== */
  .space-y-2 h3 {
    font-size: 2.5rem !important; /* Números grandes */
  }

  /* ========== TESTIMONIALS ========== */
  .rounded-xl {
    border-radius: 16px !important;
  }

  /* ========== FORMS ========== */
  form .space-y-4 {
    gap: 16px !important;
  }

  /* Form grids */
  .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* ========== FAQ SECTION ========== */
  .space-y-6 {
    gap: 20px !important;
  }

  /* ========== FOOTER ========== */
  footer .grid {
    grid-template-columns: 1fr !important;
  }

  footer .col-span-12 {
    grid-column: span 1 !important;
  }

  /* ========== MODALS ========== */
  .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    height: auto !important;
    max-height: 90vh !important;
  }

  #sofiaCallModal .modal-content {
    width: 95vw !important;
    height: 85vh !important;
  }

  /* ========== BENEFITS & CTA SECTIONS ========== */
  .max-w-3xl,
  .max-w-4xl,
  .max-w-5xl,
  .max-w-6xl {
    max-width: 100% !important;
  }

  /* ========== ANIMATIONS ========== */
  /* Reducir animaciones en móvil para mejor rendimiento */
  *[data-ns-animate] {
    animation-duration: 0.3s !important;
  }

  /* ========== SPECIFIC ADJUSTMENTS ========== */
  
  /* Ocultar sección "¿En qué te puede ayudar Fonia en tu día a día?" en móvil */
  #fonia-dia-dia {
    display: none !important;
  }

  /* Ocultar stats banner del CTA en móvil */
  #stats-banner-cta {
    display: none !important;
  }
  
  /* Hero CTA específico */
  .hero-section form {
    flex-direction: column !important;
  }

  .hero-section input,
  .hero-section button {
    width: 100% !important;
  }

  /* Product cards badges */
  .product-card .absolute.top-0.right-0,
  .product-card .absolute.top-0.left-0 {
    width: 120px !important;
    height: 120px !important;
  }

  /* Integration icons */
  .flex.justify-between.items-center.gap-2 > div {
    width: 48px !important;
    height: 48px !important;
  }

  /* Stats grid */
  .grid.grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .grid.grid-cols-3 > div {
    border: none !important;
    padding: 12px 0 !important;
  }

  /* Blog cards */
  article img {
    max-height: 200px !important;
    object-fit: cover !important;
  }

  /* SofIA call button */
  #openSofIACall {
    width: 56px !important;
    height: 56px !important;
  }

  /* Contact widget adjustments */
  .contact-widget {
    bottom: 80px !important;
    right: 16px !important;
  }
}

/* ========== TABLET SPECIFIC (768px - 1024px) ========== */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero-section {
    padding-top: 60px !important;
  }

  h1 {
    font-size: 2.5rem !important;
  }

  h2 {
    font-size: 2rem !important;
  }

  .grid.md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  section {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }
}

/* ========== SMALL MOBILE (≤480px) ========== */
@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem !important; /* 28px */
  }

  h2 {
    font-size: 1.5rem !important; /* 24px */
  }

  h3 {
    font-size: 1.25rem !important; /* 20px */
  }

  section {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }

  .container,
  .main-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ========== CONTACT WIDGET MOBILE ========== */
@media (max-width: 1024px) {
  /* Widget centrado en el bottom */
  .contact-widget {
    bottom: 20px !important;
    right: 50% !important;
    transform: translateX(50%) !important;
    left: auto !important;
  }

  /* Asegurar que el bubble sea visible */
  .contact-bubble {
    width: 60px !important;
    height: 60px !important;
  }

  /* Opciones centradas sobre el widget */
  .contact-options {
    right: 50% !important;
    transform: translateX(50%) !important;
    left: auto !important;
  }

  /* Modales centrados */
  .contact-form-modal,
  .contact-calendar-modal {
    right: 50% !important;
    transform: translateX(50%) !important;
    left: auto !important;
    width: calc(100vw - 40px) !important;
    max-width: 400px !important;
  }

  /* Botón de cerrar móvil - Solución simple y directa */
  .contact-form-close,
  .contact-calendar-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 40px !important;
    height: 40px !important;
    background: white !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    font-size: 24px !important;
    font-weight: bold !important;
    color: #333 !important;
    line-height: 1 !important;
    padding: 0 !important;
  }

  .contact-form-close::before,
  .contact-calendar-close::before {
    content: "✕" !important;
    display: block !important;
    color: #333 !important;
    font-size: 24px !important;
  }

  .contact-form-close svg,
  .contact-calendar-close svg {
    display: none !important;
  }

  /* Notificaciones centradas arriba del widget */
  .contact-notification,
  .contact-notification-phone {
    right: 50% !important;
    transform: translateX(50%) translateY(0) !important;
    left: auto !important;
    bottom: 90px !important;
  }

  .contact-notification.show,
  .contact-notification-phone.show {
    transform: translateX(50%) translateY(0) scale(1) !important;
  }

  .contact-notification-phone.show:hover {
    transform: translateX(50%) translateY(-2px) scale(1.02) !important;
  }

  /* Ajustar la flecha de las notificaciones */
  .contact-notification::after,
  .contact-notification-phone::after {
    right: 50% !important;
    transform: translateX(50%) rotate(45deg) !important;
    left: auto !important;
  }

  /* Reducir ancho máximo para móvil */
  .contact-notification {
    max-width: calc(100vw - 60px) !important;
  }

  .contact-notification-phone {
    max-width: calc(100vw - 60px) !important;
  }
}

/* ========== FOOTER SIMPLIFICADO MOBILE ========== */
@media (max-width: 1024px) {
  /* Ocultar el grid completo que contiene todos los enlaces */
  footer .main-container > div > .col-span-12.grid.grid-cols-12 {
    display: none !important;
  }

  /* Ocultar también por clases específicas */
  footer .col-span-12.xl\\:col-span-8,
  footer .col-span-12.md\\:col-span-4 {
    display: none !important;
  }

  /* Ocultar todos los elementos con space-y-8 dentro del footer */
  footer .space-y-8 {
    display: none !important;
  }

  /* Centrar la columna principal del footer */
  footer .grid.grid-cols-12 {
    justify-content: center !important;
    grid-template-columns: 1fr !important;
  }

  footer .col-span-12.xl\\:col-span-4 {
    max-width: 100% !important;
    text-align: center !important;
  }

  /* Centrar el logo y texto */
  footer .col-span-12.xl\\:col-span-4 .max-w-\\[306px\\] {
    max-width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
  }

  /* Centrar elementos internos */
  footer .col-span-12.xl\\:col-span-4 figure,
  footer .col-span-12.xl\\:col-span-4 p,
  footer .col-span-12.xl\\:col-span-4 .flex {
    text-align: center !important;
    justify-content: center !important;
  }

  /* Reducir padding del footer */
  footer .main-container > div {
    padding-top: 32px !important;
    padding-bottom: 24px !important;
  }

  /* ========== PRICING EN CARDS DE PRODUCTOS ========== */
  /* Centralita Virtual - 20€ */
  .grid.grdi-cols-1 article:nth-child(1) .space-y-2::after {
    content: "Desde 20€ al mes";
    display: block;
    margin-top: 16px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #40C6C3 0%, #33a3a0 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 20px;
    text-align: center;
  }

  /* Telefonía Móvil - 13€ */
  .grid.grdi-cols-1 article:nth-child(2) .space-y-2::after {
    content: "Desde 13€ al mes";
    display: block;
    margin-top: 16px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #40C6C3 0%, #33a3a0 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 20px;
    text-align: center;
  }

  /* SmartSIM - 45€ */
  .grid.grdi-cols-1 article:nth-child(3) .space-y-2::after {
    content: "Desde 45€ al mes";
    display: block;
    margin-top: 16px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #40C6C3 0%, #33a3a0 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 20px;
    text-align: center;
  }

  /* Numeración Internacional - 25€ */
  .grid.grdi-cols-1 article:nth-child(4) .space-y-2::after {
    content: "Desde 25€ al mes";
    display: block;
    margin-top: 16px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #40C6C3 0%, #33a3a0 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 20px;
    text-align: center;
  }

  /* Omnicanal - 149€ */
  .grid.grdi-cols-1 article:nth-child(5) .space-y-2::after {
    content: "Desde 149€ al mes";
    display: block;
    margin-top: 16px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #40C6C3 0%, #33a3a0 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 20px;
    text-align: center;
  }

  /* IA y Automatización - 149€ */
  .grid.grdi-cols-1 article:nth-child(6) .space-y-2::after {
    content: "Desde 149€ al mes";
    display: block;
    margin-top: 16px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #40C6C3 0%, #33a3a0 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 20px;
    text-align: center;
  }
}
