/* ==========================================================================
   KMWEBSOFT Landing Page - Responsive Styles (Red Sun Theme)
   ========================================================================== */

/* XL Devices (Desktops, 1200px and down) */
@media (max-width: 1200px) {
  .lp-hero__title {
    font-size: clamp(2rem, 4vw, 3rem);
  }
  
  .lp-pricing__grid {
    gap: 16px;
  }
}

/* Large Devices (Tablets/Laptops, 992px and down) */
@media (max-width: 992px) {
  .lp-hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .lp-hero__subtitle {
    margin: 0 auto 32px;
  }

  .lp-hero__actions {
    justify-content: center;
  }

  .lp-hero__trust {
    justify-content: center;
  }

  .lp-hero__stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
  }

  .lp-hero__visual {
    order: -1; /* Move illustration above text on mobile */
    margin-bottom: 24px;
  }

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

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

  .lp-stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

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

  .lp-compare__table th, 
  .lp-compare__table td {
    padding: 16px;
  }
}

/* Medium Devices (Tablets, 768px and down) */
@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

  .lp-header__nav {
    display: none; /* Hide desktop nav */
  }

  .lp-header__nav.active {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 40px;
    gap: 24px;
    z-index: 999;
  }

  .lp-header__nav.active a {
    font-size: 1.25rem;
    color: #2D3B42;
  }

  .lp-header__mobile-toggle {
    display: flex; /* Show hamburger */
  }

  .lp-header__mobile-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

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

  .lp-header__mobile-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .lp-header__cta {
    display: none; /* Hide header CTA on mobile, use sticky bottom bar instead */
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-input, .form-select {
    padding: 14px 16px;
  }

  .lp-offer__card {
    padding: 32px 20px;
  }

  .lp-offer__countdown {
    flex-wrap: wrap;
  }

  .lp-offer__features {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    padding: 24px;
  }

  .pricing-card--popular {
    transform: scale(1); /* Remove scale on mobile so it doesn't overflow */
    border-width: 1px;
  }

  .testimonial-card {
    min-width: 320px;
    padding: 24px;
  }

  .mobile-cta {
    display: flex;
  }

  /* Add padding to body to account for mobile CTA bar */
  body {
    padding-bottom: 70px;
  }

  .lp-compare__wrapper {
    overflow-x: auto; /* Enable horizontal scroll for table */
    -webkit-overflow-scrolling: touch;
    margin: 0 -24px;
    padding: 0 24px;
  }

  .lp-compare__table {
    min-width: 600px;
  }

  .whatsapp-float {
    bottom: 90px; /* Move up above sticky CTA */
    right: 20px;
  }

  .exit-popup__card {
    padding: 32px 20px;
  }
  
  .exit-popup__form {
    flex-direction: column;
    gap: 16px;
  }
  
  .exit-popup__form .btn {
    width: 100%;
  }
}

/* Small Devices (Phones, 576px and down) */
@media (max-width: 576px) {
  .lp-hero__title {
    font-size: 2.25rem;
  }

  .lp-why__grid {
    grid-template-columns: 1fr;
  }

  .testimonial-card {
    min-width: calc(100vw - 80px); /* Fit exactly on small screens with padding */
    padding: 20px;
  }

  .lp-stats__grid {
    grid-template-columns: 1fr;
  }

  .lp-footer__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .lp-offer__countdown-item {
    min-width: 60px;
    padding: 12px 10px;
  }

  .lp-offer__countdown-value {
    font-size: 1.5rem;
  }

  .purchase-toast {
    bottom: 80px; /* Above mobile CTA */
    left: 20px;
    right: 20px;
    min-width: auto;
    width: auto;
    transform: translateX(120%); /* Update hidden state for full width */
  }

  @keyframes toast-slide-in {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
  }
  
  @keyframes toast-slide-out {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(120%); opacity: 0; }
  }
}

/* ============================================================================
   Touch ergonomics + focus visibility.
   Appended — every rule above is untouched. Measured at 375px before this
   block: testimonial dots, pricing switch, both popup close buttons, the
   mobile toggle and the form input all sat under the 44px minimum.
   ========================================================================== */
@media (max-width: 1080px) {
  .lp-header__mobile-toggle,
  .lp-pricing__switch,
  .offer-ribbon__close,
  .offer-ribbon__link,
  .exit-popup__close,
  .lp-footer a,
  .lp-nav a { min-height: 44px; min-width: 44px;
              display: inline-flex; align-items: center; justify-content: center; }
  .lp-testimonials__dot { min-height: 44px; min-width: 44px; }
  .lp-form input, .lp-form select, .lp-form textarea,
  input[type="text"], input[type="email"], input[type="tel"], select { min-height: 44px; }
  .btn { min-height: 44px; }
}

/* Visible keyboard focus (WCAG 2.4.7) — matches the main site's ring. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important;
    animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
