/* ==========================================================================
   Responsive Design & Ultra-Optimized Mobile Typography
   ========================================================================== */

/* Strict Anti-Overflow Global Safety for Mobile */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

*, *::before, *::after {
  max-width: 100%;
  box-sizing: border-box;
}

/* Tablet & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-content {
    text-align: center;
    align-items: center;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-proof {
    justify-content: center;
  }

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

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .pricing-card.popular {
    transform: none;
  }

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

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

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .container {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .section-header {
    margin-bottom: 1.5rem;
  }

  /* Responsive Headings - Prevent text overflow */
  .section-header h2 {
    font-size: clamp(1.3rem, 5vw, 1.6rem) !important;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .section-header p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* Brand logo inline protection on mobile */
  .brand-logo {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 0.4rem !important;
  }

  .brand-logo-img {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
  }

  .brand-logo > span {
    font-size: 1.15rem !important;
    white-space: nowrap !important;
  }

  .brand-badge {
    font-size: 0.58rem !important;
    padding: 0.15rem 0.4rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Completely hide top bar action buttons in mobile header */
  .nav-actions > .currency-selector-wrap,
  .nav-actions > .btn,
  .nav-actions > a,
  #nav-install-btn,
  .nav-hide-mobile {
    display: none !important;
  }

  /* Solid Mobile Navigation Drawer */
  .mobile-menu-btn {
    display: block !important;
    font-size: 1.8rem !important;
    color: #FFFFFF !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0.5rem 0.75rem !important;
    line-height: 1 !important;
    position: relative !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(41, 234, 211, 0.3) !important;
  }

  .nav-links {
    display: none !important;
    position: fixed !important;
    top: var(--header-height) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    background: #0D1422 !important; /* 100% Solid Dark Background */
    border-bottom: 2px solid var(--brand-secondary) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.95) !important;
    flex-direction: column !important;
    padding: 1.5rem 1rem !important;
    gap: 0.8rem !important;
    align-items: center !important;
    text-align: center !important;
    z-index: 9999 !important;
  }

  .nav-links.open {
    display: flex !important;
  }

  .nav-link {
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    padding: 0.5rem 1rem;
    width: 100%;
    border-radius: var(--radius-sm);
  }

  .nav-link:hover,
  .nav-link:active {
    color: var(--brand-secondary);
    background: rgba(41, 234, 211, 0.08);
  }

  /* Hero Section Typography & Bounds */
  .hero-section {
    padding-top: calc(var(--header-height) + 1.25rem);
    padding-bottom: 2.25rem;
  }

  .hero-title {
    font-size: clamp(1.45rem, 5.8vw, 1.85rem) !important;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .hero-title-br {
    display: block !important;
  }

  .hero-description {
    font-size: clamp(0.8125rem, 3.6vw, 0.9rem) !important;
    line-height: 1.5 !important;
    max-width: 96% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .hero-cta-group {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .hero-cta-group .btn {
    width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: 0.9rem !important;
    padding: 0.75rem 1.1rem !important;
  }

  /* Badges & Tags - Responsive wrapping */
  .badge {
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
    font-size: 0.72rem !important;
    padding: 0.35rem 0.7rem !important;
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Hero Social Proof Mobile Layout */
  .hero-proof {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0.4rem !important;
    margin-top: 1rem !important;
    padding-top: 1.25rem !important;
    max-width: 100% !important;
  }

  .proof-text {
    font-size: 0.8125rem !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  /* Mockup Window Mobile Adjustment */
  .mockup-window {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    border-radius: var(--radius-lg) !important;
  }

  .mockup-body {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }

  .mockup-sidebar {
    display: none !important;
  }

  .mockup-chat-view {
    min-height: 250px !important;
    padding: 0.5rem !important;
  }

  .wa-msg {
    max-width: 90% !important;
    font-size: 0.75rem !important;
    word-break: break-word !important;
  }

  /* Grids & Cards Mobile Bounds */
  .problem-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .problem-card, .solution-card {
    padding: 1.25rem 0.9rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .feature-card {
    padding: 1.25rem 0.9rem;
  }

  .feature-card h3 {
    font-size: 1.1rem;
  }

  /* Comparison Table Component Mobile Bounds */
  .comparison-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border-subtle) !important;
  }

  .comparison-table {
    width: 100% !important;
    min-width: 520px !important;
    border-collapse: collapse !important;
  }

  .comparison-table th, 
  .comparison-table td {
    padding: 0.65rem 0.5rem !important;
    font-size: 0.78rem !important;
    word-break: break-word !important;
  }

  /* Pricing Cards Mobile */
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pricing-card {
    padding: 1.75rem 1.1rem;
  }

  .price-amount {
    font-size: clamp(2rem, 7vw, 2.4rem) !important;
  }

  .price-wrap {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .testimonial-card {
    padding: 1.25rem 0.9rem;
  }

  .final-cta-card {
    padding: 1.75rem 0.9rem;
  }

  .final-cta-card h2 {
    font-size: clamp(1.35rem, 5.2vw, 1.7rem) !important;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .whatsapp-float-btn {
    bottom: 1rem;
    right: 1rem;
    width: 52px;
    height: 52px;
  }

  .whatsapp-float-tooltip {
    display: none;
  }
}

/* Extra Small Screens (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .hero-title {
    font-size: 1.38rem !important;
  }

  .hero-description {
    font-size: 0.8125rem !important;
    line-height: 1.45 !important;
    max-width: 100% !important;
  }

  .section-header h2 {
    font-size: 1.3rem !important;
  }

  .btn {
    font-size: 0.85rem !important;
    padding: 0.65rem 0.9rem !important;
  }

  .pricing-card {
    padding: 1.5rem 0.85rem;
  }

  .price-amount {
    font-size: 1.95rem !important;
  }

  .brand-logo span {
    font-size: 1.1rem;
  }

  .brand-badge {
    font-size: 0.62rem;
    padding: 0.15rem 0.35rem;
  }
}
