/* =============================================================================
   RESPONSIVE.CSS — All Media Queries / Breakpoints
   ============================================================================= */

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .ai-overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ai-card-main {
    grid-column: span 2;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    margin: 0 auto;
  }

  .hero p {
    margin: 0 auto 32px;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-visual {
    margin-top: 40px;
  }

  .product-inner,
  .product-inner.reversed {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .product-inner.reversed {
    direction: ltr;
  }

  .product-content {
    max-width: 100%;
  }

  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {
  .ai-overview-grid {
    grid-template-columns: 1fr;
  }

  .ai-card-main {
    grid-column: span 1;
  }

  .ai-stat-row {
    flex-wrap: wrap;
  }

  /* Default hidden; shown via .mobile-open class */
  .nav-links {
    display: none;
  }

  /* Hide desktop action buttons — they live inside the hamburger panel */
  .nav-actions {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  /* ── Open hamburger panel ── */
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    padding: 16px 16px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 999;
    gap: 4px;
  }

  /* Direct links inside open panel: full-width, left-aligned */
  .nav-links.mobile-open > a {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    box-sizing: border-box;
  }

  /* Wrappers stretch full width inside hamburger */
  .nav-links.mobile-open .nav-services-wrapper {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links.mobile-open .nav-services-wrapper > a {
    width: 100%;
    padding: 12px 16px;
  }

  /* Dropdowns become in-flow (not absolutely positioned) on mobile */
  .nav-links.mobile-open .services-dropdown,
  .nav-links.mobile-open .products-mega-dropdown {
    position: static !important;
    transform: none !important;
    min-width: unset !important;
    width: 100% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px !important;
    margin-top: 4px !important;
    max-height: 0;
    overflow: hidden;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: max-height 0.35s ease, opacity 0.2s ease !important;
    padding: 6px !important;
  }

  .nav-links.mobile-open .nav-services-wrapper.open .services-dropdown,
  .nav-links.mobile-open .nav-services-wrapper.open .products-mega-dropdown {
    max-height: 65vh !important;
    overflow-y: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Products mega: stack columns vertically */
  .nav-links.mobile-open .products-mega-dropdown {
    flex-direction: column !important;
  }

  .nav-links.mobile-open .mega-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0 !important;
  }

  /* Login / Sign Up buttons injected at bottom of hamburger */
  .mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }

  .mobile-nav-actions .btn {
    display: block;
    text-align: center;
    padding: 14px;
    font-size: 0.95rem;
  }

  /* ── Marquee: keep auto-scroll running on mobile ── */
  .marquee-section {
    overflow: hidden;
  }

  .badges-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cta-stats {
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* ── Small Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .hero-mockup {
    width: 280px;
    height: 480px;
  }

  .float-card {
    display: none;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .cookie-banner {
    flex-direction: column;
    text-align: center;
    margin: 0 16px;
    left: 0;
    right: 0;
    transform: none;
    max-width: calc(100% - 32px);
  }
}

/* ── Product sections & Developer API: mobile fixes (≤ 768px) ── */
@media (max-width: 768px) {

  /* Prevent orb pseudoelements from causing horizontal scroll */
  .product-section {
    overflow-x: hidden;
    padding: 56px 0;
  }

  /* Stack content + visual, drop the rtl trick */
  .product-inner,
  .product-inner.reversed {
    grid-template-columns: 1fr;
    gap: 32px;
    direction: ltr;
  }

  .product-inner.reversed > * {
    direction: ltr;
  }

  /* Visual goes below content on mobile */
  .product-visual {
    order: 2;
  }

  .product-content {
    order: 1;
    max-width: 100%;
  }

  /* Images scale to full width */
  .product-img {
    max-width: 100%;
    border-radius: 16px;
  }

  .product-mockup {
    max-width: 100%;
  }

  /* Analytics KPIs: 3-col → 1-col */
  .analytics-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  /* AI overview grid already handled, but tighten padding */
  .ai-overview-section {
    overflow-x: hidden;
  }

  /* Google AI section: single column already at 960px,
     but fix padding + text overflow for small screens */
  .google-ai-section {
    padding: 60px 0;
    overflow-x: hidden;
  }

  .google-ai-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .google-ai-content > p {
    max-width: 100%;
  }

  /* Products page tile grid */
  .product-tiles {
    grid-template-columns: 1fr;
  }

  .product-tile.featured {
    grid-column: span 1;
  }

  .prod-section-header {
    flex-direction: column;
    gap: 12px;
  }

  /* Features heading padding */
  .features-heading {
    padding: 72px 0 40px;
    overflow-x: hidden;
  }
}
