/* ============================================================
   RESPONSIVE.CSS – UBWIRU AI
   ============================================================ */

@media (max-width: 1024px) {
    .hero-title { font-size: 42px; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .home-tools-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .blog-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { grid-template-columns: 1fr; gap: 16px; }
    .step-arrow { transform: rotate(90deg); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    /* The header is transparent-with-white-text by default (site-wide),
       only turning solid-white-with-dark-text once scrolled 50px — a
       design that only reads correctly when a dark hero section happens
       to sit behind it. On mobile that's not reliable (login.php's top
       section is light; scroll-bounce flickers the trigger on others),
       so on mobile the header is always solid and always dark-text,
       regardless of scroll position or what's behind it. */
    .header { background: var(--white) !important; box-shadow: 0 2px 20px rgba(0,0,0,0.06); }
    .logo { color: var(--primary-dark) !important; }
    .hamburger span { background: var(--text-dark) !important; }

    /* Site banner needs more room on mobile -- text and button often
       wrap to two lines here instead of sitting on one, so the fixed
       header-offset height (--site-banner-height, used by both the
       banner and body.has-banner's header-shifting rule) grows to
       match, the same "get the real height right up front" fix the
       header/chat bugs earlier in this project needed. */
    :root { --site-banner-height: 76px; }
    .site-banner-inner { padding: 8px 42px 8px 14px; font-size: 13px; flex-direction: column; gap: 4px; }
    .site-banner-close { right: 10px; font-size: 20px; }

    .header-container { flex-wrap: wrap; }
    .navbar { flex-wrap: wrap; justify-content: flex-end; }
    .hamburger { order: -1; }
    .hamburger { display: flex; }
    .nav-menu { display: none; flex-direction: column; width: 100%; padding: 20px 0; gap: 16px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 12px; }
    .nav-menu.open { display: flex; }
    .nav-menu a { color: var(--text-dark) !important; padding: 8px 16px; width: 100%; }
    .nav-menu a.nav-cta { text-align: center; }
    .desktop-cta { display: none; }
    .header.scrolled .nav-menu { background: var(--white); }

    .hero { min-height: auto; padding: 100px 0 60px; }
    .hero-container { grid-template-columns: 1fr; text-align: center; gap: 30px; }
    .hero-title { font-size: 32px; }
    .hero-description { font-size: 16px; margin: 0 auto 20px; }
    .hero-buttons { justify-content: center; flex-direction: column; align-items: center; }
    .hero-stats { flex-wrap: wrap; justify-content: center; gap: 16px; }
    .stat-number { font-size: 24px; }
    .stat-divider { display: none; }
    .hero-illustration img { max-width: 280px; }
    .floating-card { display: none; }
    .hero-wave svg { height: 30px; }

    .section-header h2 { font-size: 28px; }
    .section-header p { font-size: 16px; }
    .services, .testimonials, .faq, .pricing { padding: 50px 0; }
    .how-it-works { padding: 50px 0; }

    .services-grid { grid-template-columns: 1fr; gap: 20px; }
    .testimonials-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .pricing-card.featured { transform: none; }
    .pricing-card.featured:hover { transform: translateY(-5px); }
    .home-tools-grid { grid-template-columns: 1fr !important; max-width: 420px; }
    .blog-grid { grid-template-columns: 1fr !important; }

    .steps-grid { grid-template-columns: 1fr; }
    .step { padding: 24px 20px; }
    .step-arrow { transform: rotate(90deg); }

    .faq-question { font-size: 16px; padding: 12px 0; }

    .cta-section { padding: 60px 0; }
    .cta-content h2 { font-size: 28px; }
    .cta-buttons { flex-direction: column; align-items: center; }

    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-brand p { max-width: 100%; }
    .footer-bottom { font-size: 12px; }

    /* Root cause of the "page slides left / white space on the right"
       bug: this was a vw-based width anchored with a negative right
       offset inside .chat-widget's small fixed-size box (see
       style.css .chat-widget). vw units on mobile Safari can measure
       against a layout width that's wider than what's actually visible,
       and a negative offset pushed it further still — together, wide
       enough on some phones/orientations to make the whole page
       horizontally scrollable. Anchoring directly to the viewport with
       left+right insets (not a width at all) makes that impossible:
       the panel is always exactly "screen width minus 16px each side,"
       full stop, regardless of any vw quirk. */
    .chat-container { position: fixed !important; left: 16px; right: 16px; width: auto; max-height: 75vh; bottom: 80px; }
    .chat-toggle { width: 50px; height: 50px; font-size: 20px; }
}

@media (max-width: 479px) {
    .hero-title { font-size: 26px; }
    .btn { font-size: 14px; padding: 10px 20px; }
    .btn-large { font-size: 16px; padding: 14px 28px; }
    .container { padding: 0 16px; }
    .chat-container { left: 10px; right: 10px; bottom: 74px; }
    .service-card { padding: 24px 20px; }
    .testimonial-card { padding: 20px; }
    .pricing-card { padding: 30px 20px; }
    .pricing-price { font-size: 36px; }
    .stat-number { font-size: 20px; }
    .section-header h2 { font-size: 24px; }
}

/* Fix: about-grid/mission-grid/service-detail-item previously used
   inline grid-template-columns, which no media query could override.
   Now that they're real classes, this actually works on mobile. */
@media (max-width: 767px) {
    .two-col-grid { grid-template-columns: 1fr; gap: 30px; }
    .three-col-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 767px) {
    .four-col-grid { grid-template-columns: 1fr; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .four-col-grid { grid-template-columns: repeat(2, 1fr); }
}
