/* ============================================================
   PAYFLY — RESPONSIVE.CSS  (Complete Rewrite)
   Breakpoints: 2560 / 1440 / 1280 / 1024 / 840 / 768 / 480 / 375 / 320
   ============================================================ */

/* ── 2K / 4K ── */
@media (min-width: 2560px) {
  :root { --sp-sec: 10rem; }
  .container { max-width: 1800px; }
  .hero-title { font-size: 5rem; }
  .dashboard-mockup { max-width: 620px; margin: 0 auto; }
}

/* ── LARGE DESKTOP ── */
@media (min-width: 1441px) and (max-width: 2559px) {
  .container { max-width: 1440px; }
}

@media (max-width: 1440px) {
  .container { max-width: 1200px; }
}

@media (max-width: 1366px) {
  :root { --sp-sec: 6rem; }
  .container { max-width: 1140px; }
}

@media (max-width: 1280px) {
  .container { max-width: 960px; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .why-features-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.4fr; }
}

/* ── TABLET LANDSCAPE (1024px) ── */
@media (max-width: 1024px) {

  /* === CONTAINER === */
  .container { max-width: 100%; padding-left: 1.5rem; padding-right: 1.5rem; }

  /* === NAVBAR === */
  .nav-menu, .nav-actions { display: none; }
  .menu-toggle { display: flex; }

  /* === HERO === */
  .hero-section { padding-top: calc(64px + 3rem); padding-bottom: 3rem; }
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .hero-content { align-items: center; }
  .hero-title { font-size: clamp(2rem, 5vw, 3rem); }
  .hero-subtitle { max-width: 600px; margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; flex-wrap: wrap; }
  .hero-illustration {
    max-width: 520px;
    margin: 0 auto;
    padding-bottom: 2.5rem;
  }

  /* === ABOUT US === */
  .about-stats-row { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-story { padding-right: 0; }

  /* === WHY PAYFLY === */
  .why-features-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .why-container { grid-template-columns: 1fr; gap: 3rem; }

  /* === SERVICES === */
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* === STATS === */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* === HOW IT WORKS === */
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .step-arrow { display: none; }

  /* === FAQ === */
  .faq-container { max-width: 100%; }

  /* === CTA + CONTACT === */
  .cta-contact-container { grid-template-columns: 1fr; gap: 2rem; }
  .cta-banner-side { min-height: auto; padding: 3rem 2.5rem; }

  /* === FOOTER === */
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .footer-brand { grid-column: span 2; }
  .footer-newsletter { grid-column: span 2; max-width: 480px; }

  /* === DEV SECTION === */
  .dev-container { grid-template-columns: 1fr; gap: 2rem; }

  /* === PRODUCTS === */
  .products-grid { grid-template-columns: repeat(2, 1fr); }

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

  /* === TESTIMONIALS === */
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid .testimonial-card:last-child { grid-column: span 2; }

  /* === TIMELINE === */
  .timeline-line { left: 20px; }
  .timeline-step { width: 100%; justify-content: flex-start !important; padding-left: 50px; margin-left: 0 !important; }
  .timeline-circle { left: 20px !important; transform: translateX(-50%); }
  .timeline-content { width: 100%; }
}

/* ── iPAD / LARGE PHONES (840px) ── */
@media (max-width: 840px) {
  .container { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero-illustration { max-width: 440px; }
}

/* ── TABLET PORTRAIT (768px) ── */
@media (max-width: 768px) {
  :root { --sp-sec: 4.5rem; }

  /* === TYPOGRAPHY === */
  h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
  h3 { font-size: clamp(1.3rem, 4vw, 1.7rem); }

  /* === HERO === */
  .hero-title { font-size: clamp(1.9rem, 6vw, 2.8rem); }
  .hero-subtitle { font-size: 1rem; }
  .hero-illustration { max-width: 380px; padding-bottom: 2rem; }
  .hero-buttons { gap: 0.75rem; }

  /* === ABOUT US === */
  .about-stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .about-stat-card { padding: 1.25rem 1rem; }
  .about-stat-number { font-size: 1.6rem; }
  .about-stat-label { font-size: 0.7rem; }
  .about-cards { gap: 0.75rem; }
  .about-trust-badges { gap: 0.5rem; }
  .about-trust-badge { font-size: 0.7rem; padding: 0.35rem 0.8rem; }

  /* === WHY PAYFLY === */
  .why-features-grid { grid-template-columns: 1fr; gap: 1rem; }
  .why-feature-card { padding: 1.5rem; flex-direction: row; align-items: flex-start; gap: 1.25rem; }
  .why-feature-icon { flex-shrink: 0; width: 48px; height: 48px; }
  .why-feature-num { font-size: 2.5rem; top: 0.75rem; right: 1rem; }
  .why-feature-title { font-size: 1rem; }

  /* === SERVICES === */
  .services-grid { grid-template-columns: 1fr; gap: 0.75rem; }

  /* === FINTECH CARDS === */
  .fintech-cards-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .why-grid { grid-template-columns: 1fr; }
  .why-illustration { order: -1; margin-bottom: 2rem; }

  /* === STATS === */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-item { padding: 1.5rem 1rem; }

  /* === HOW IT WORKS === */
  .steps-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .step-arrow { display: none; }
  .step-card { padding: 1.5rem; text-align: left; display: flex; align-items: flex-start; gap: 1rem; }
  .step-number-wrap { flex-shrink: 0; }
  .step-icon-wrap { display: none; }
  .step-card .step-title { margin-bottom: 0.25rem; }

  /* === FAQ === */
  .accordion-header { padding: 1rem 1.25rem; font-size: 0.9rem; }
  .accordion-body { padding: 0 1.25rem 1rem; }

  /* === CTA + CONTACT === */
  .cta-contact-container { grid-template-columns: 1fr; }
  .cta-banner-side { padding: 2.5rem 2rem; border-radius: 20px; }
  .cta-title { font-size: 1.6rem; }
  .cta-perks li { font-size: 0.85rem; }
  .cta-buttons { flex-direction: column; gap: 0.75rem; }
  .cta-buttons .btn { width: 100%; justify-content: center; }
  .contact-form-card { padding: 2rem 1.5rem; border-radius: 20px; }
  .form-title { font-size: 1.4rem; }
  .form-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .newsletter-form { flex-direction: column; gap: 0.5rem; }

  /* === FOOTER === */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-brand { grid-column: span 2; }
  .footer-newsletter { grid-column: span 2; max-width: 100%; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding: 1.25rem 0;
  }
  .legal-links { justify-content: center; flex-wrap: wrap; gap: 1rem; }

  /* === SECTION HEADER === */
  .section-header { margin-bottom: 2.5rem; }
  .section-subtitle { font-size: 1rem; }

  /* === LEGAL POLICIES & OTHERS === */
  .policy-hero { padding: 80px 0 40px !important; }
  .policy-hero h1 { font-size: 2rem !important; }
  .policy-content-wrapper { padding: 40px 0 !important; }
  .policy-content-card { padding: 1.5rem !important; font-size: 0.95rem !important; border-radius: 16px !important; }
  .features-cards-grid { grid-template-columns: 1fr !important; gap: 1rem; padding: 1rem 0; }
  .feature-detail-card { padding: 1.5rem !important; }
  /* === HERO FLOATING CARDS (moved from 480px) === */
  .hero-float-card {
    transform: scale(0.75) !important;
    animation: none !important;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  .float-qr-widget { display: none !important; }
  .float-api { display: none !important; }
  .float-dynamic-qr { right: -5px; top: 70px; transform-origin: right top; }
  .float-tx-notification { right: 50%; bottom: -10px; transform: translateX(50%) scale(0.75) !important; transform-origin: bottom center; }
}

/* ── LARGE PHONES (480px) ── */
@media (max-width: 480px) {
  :root { --sp-sec: 3.5rem; }

  /* === HERO === */
  .hero-section { padding-top: calc(60px + 2rem); padding-bottom: 2rem; }
  .hero-title { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .hero-subtitle { font-size: 0.92rem; }
  .hero-buttons { flex-direction: column; width: 100%; gap: 0.65rem; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .hero-illustration { max-width: 320px; padding-bottom: 1.5rem; }

  /* Odometer */
  .odometer-value { height: 1.7rem; line-height: 1.7rem; font-size: 1.7rem; }
  .od-digit-container { width: 1.05rem; }
  .od-digit-strip span { height: 1.7rem; }
  .currency-symbol { font-size: 1.2rem; }
  .balance-card { padding: 0.9rem; }

  /* === ABOUT US === */
  .about-stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .about-stat-card { padding: 1rem 0.75rem; border-radius: 14px; }
  .about-stat-icon { width: 40px; height: 40px; border-radius: 10px; margin-bottom: 0.75rem; }
  .about-stat-number { font-size: 1.35rem; }
  .about-stat-label { font-size: 0.65rem; }
  .about-grid { gap: 1.75rem; }
  .about-story-title { font-size: 1.25rem; }
  .about-trust-badges { gap: 0.4rem; }

  /* === WHY PAYFLY === */
  .why-feature-card { padding: 1.25rem; gap: 1rem; }
  .why-feature-icon { width: 42px; height: 42px; border-radius: 12px; }
  .why-feature-icon svg { width: 20px; height: 20px; }
  .why-feature-title { font-size: 0.95rem; }
  .why-feature-desc { font-size: 0.82rem; }
  .why-feature-num { font-size: 1.8rem; top: 0.75rem; right: 0.75rem; }

  /* === SERVICES === */
  .service-card { padding: 1.25rem; }
  .service-icon { width: 42px; height: 42px; }

  /* === STATS === */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .stat-item { padding: 1.25rem 0.75rem; border-radius: 14px; }
  .stat-number { font-size: 1.75rem; }
  .stat-label { font-size: 0.75rem; }

  /* === HOW IT WORKS === */
  .step-card { padding: 1.25rem; border-radius: 16px; }
  .step-number-wrap { width: 30px; height: 30px; }
  .step-title { font-size: 0.95rem; }
  .step-desc { font-size: 0.8rem; }

  /* === FAQ === */
  .accordion-header { padding: 0.9rem 1rem; gap: 0.75rem; }
  .accordion-body { padding: 0 1rem 0.9rem; }
  .accordion-body p { font-size: 0.85rem; }
  .accordion-icon { width: 20px; height: 20px; }

  /* === CTA + CONTACT === */
  .cta-banner-side { padding: 2rem 1.5rem; border-radius: 18px; }
  .cta-title { font-size: 1.4rem; }
  .cta-desc { font-size: 0.88rem; }
  .cta-perks { gap: 0.5rem; }
  .contact-form-card { padding: 1.75rem 1.25rem; border-radius: 18px; }
  .form-title { font-size: 1.25rem; }
  .form-subtitle { font-size: 0.85rem; }
  .form-input { padding: 0.7rem 0.9rem; font-size: 0.88rem; }
  .form-group label { font-size: 0.65rem; }

  /* === FOOTER === */
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-brand { grid-column: span 1; }
  .footer-newsletter { grid-column: span 1; }
  .footer-bottom { flex-direction: column; gap: 0.75rem; }
  .legal-links { justify-content: center; }

  /* === SECTION HEADER === */
  .section-header { margin-bottom: 2rem; }
  .badge { font-size: 0.65rem; padding: 0.35rem 0.85rem; }
}

/* ── SMALL PHONES (375px) ── */
@media (max-width: 375px) {
  :root { --sp-sec: 3rem; }

  .hero-title { font-size: 1.6rem; }
  .about-stats-row { grid-template-columns: repeat(2, 1fr); }
  .about-stat-number { font-size: 1.2rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-number { font-size: 1.5rem; }
  .why-feature-card { flex-direction: column; }
  .footer-bottom { padding: 1rem 0; }
}

/* ── TINY (320px) ── */
@media (max-width: 320px) {
  :root { --sp-sec: 2.75rem; }

  .hero-title { font-size: 1.5rem; }
  .logo-text { font-size: 1.2rem; }
  .badge { padding: 0.3rem 0.7rem; font-size: 0.62rem; }
  .dashboard-mockup { aspect-ratio: 1.1; }
  .balance-value { font-size: 1.25rem; }
  .about-stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .about-stat-number { font-size: 1.1rem; }
}

/* ── GLOBAL OVERFLOW PREVENTION ── */
body, html {
  max-width: 100%;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; }

/* ── TOUCH DEVICE IMPROVEMENTS ── */
@media (hover: none) and (pointer: coarse) {
  .hero-float-card:hover { transform: none !important; }
  .service-card:hover { transform: none; }
  .step-card:hover { transform: none; }
  .stat-item:hover { transform: none; }
  .why-feature-card:hover { transform: none; }
  .about-stat-card:hover { transform: none; }
  .about-card:hover { transform: none; }
  .btn:hover { transform: none; }
  .btn-primary:hover { transform: none; }
}

/* ── PRINT ── */
@media print {
  .navbar-header, .hero-float-card, .menu-toggle, .footer-section { display: none; }
  body { background: #fff; color: #000; }
  .hero-section { padding-top: 1rem; }
}
