/* ==========================================================================
   BetterwholeSMS - Responsive Layout Adaptations
   Optimized for Phones, Tablets, and Small Laptops
   ========================================================================== */

/* Large Tablets & Small Laptops (1024px and below) */
@media (max-width: 1024px) {
  .container {
    padding: 0 24px;
  }

  /* Responsive Grids */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  /* Stats Counter Section */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 40px;
  }

  .section-title {
    font-size: 2.5rem;
  }
}

/* Medium Tablets & iPads (991px and below) */
@media (max-width: 991px) {
  /* Hero Section Split Layout */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-grid .reveal-left {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-grid .section-desc {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

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

  /* Floating Illustration */
  .floating-mockup {
    margin-top: 20px;
    max-width: 560px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile Devices & Small Tablets (768px and below) */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .section {
    padding: 60px 0;
  }

  .section-alt {
    padding: 60px 0;
  }

  .section-title {
    font-size: 2.1rem;
    line-height: 1.3;
  }

  .section-desc {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  /* Layout Grids to Single Column */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Header & Navigation */
  header:not(.scrolled) {
    padding: 12px 0;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  /* Mobile Slide-out Drawer Menu */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--nav-border);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 100px 32px 40px 32px;
    gap: 16px;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    font-size: 1.1rem;
    display: block;
    width: 100%;
    padding: 12px 20px;
    border-radius: 12px;
    background: transparent;
    transition: all 0.25s ease;
  }

  /* High-visibility primary link in mobile menu */
  .nav-links li:last-child a {
    background: var(--gradient-button);
    color: var(--white) !important;
    text-align: center;
    box-shadow: 0 4px 12px rgba(142, 26, 140, 0.2);
    margin-top: 16px;
  }

  .nav-links li:last-child a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(142, 26, 140, 0.3);
  }

  /* Hide the header CTA on mobile devices to prevent layout overlap */
  #header-cta {
    display: none;
  }

  .nav-actions {
    gap: 12px;
  }

  /* Hamburger Toggle Animations */
  .mobile-nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background-color: var(--primary-purple);
  }

  .mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: var(--primary-purple);
  }

  /* Footer Layout adaptation */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* Tabs Navigation on Features Page */
  .feature-tabs {
    gap: 10px;
  }

  .tab-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  /* Interactive CSS Illustration Dashboard Mockup content */
  .floating-mockup .glass-card {
    padding: 16px;
  }

  /* Float Controls */
  .back-to-top {
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
  }

  .whatsapp-float {
    bottom: 84px;
    right: 24px;
    width: 48px;
    height: 48px;
  }
  
  .whatsapp-float svg {
    width: 24px;
    height: 24px;
  }
}

/* Compact Mobile Screens & Portrait Phones (480px and below) */
@media (max-width: 480px) {
  .section-title {
    font-size: 1.8rem;
  }

  .section-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  /* Layout grids and counters */
  .stats-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Hero & general button adjustments */
  .btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .glass-card {
    padding: 20px;
    border-radius: 16px;
  }

  /* Floating Mockup charts scaling on very small screens */
  .floating-mockup div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}
