/* ============================================================
   Alfan website — mobile responsive layer
   Single source of truth for all <=768px overrides.
   Approach: never touch desktop layout, only collapse columns,
   tighten paddings/fonts, and stack visuals beneath copy.
   ============================================================ */

/* ---------- Tablet portrait (<=900px): nav collapses ---------- */
@media (max-width: 900px) {
  /* Already wired in Top.jsx — burger menu shows, nav-links + nav-cta hide */
  .nav-mobile-actions { margin-inline-start: auto !important; }
}

/* ---------- General mobile (<=768px) ---------- */
@media (max-width: 768px) {

  /* Container padding */
  body { font-size: 15px; }

  /* ---- NAV ---- */
  nav > div {
    padding: 0 20px !important;
    height: 64px !important;
    gap: 12px !important;
  }
  nav img[alt="alfan"] { height: 22px !important; }
  .nav-mobile { padding: 8px 20px 16px !important; }

  /* ---- HERO ---- */
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding: 32px 20px 56px !important;
  }
  .hero-tag {
    font-size: 11px !important;
    padding: 5px 5px 5px 12px !important;
    margin-bottom: 24px !important;
  }
  .hero-title {
    font-size: clamp(34px, 9vw, 44px) !important;
    line-height: 1.04 !important;
    letter-spacing: -0.025em !important;
  }
  .hero-title + p,
  .hero-grid p {
    font-size: 15px !important;
    margin-top: 16px !important;
  }
  /* Stack CTAs full width */
  .hero-grid button {
    width: 100%;
  }
  .hero-grid > div > div[style*="display: flex"][style*="gap: 12px"] {
    flex-direction: column;
    align-items: stretch;
  }
  /* Trust strip — allow wrap and shrink */
  .hero-trust-strip {
    flex-wrap: wrap !important;
    gap: 10px 14px !important;
    margin-top: 20px !important;
  }
  .hero-trust-strip > div { font-size: 11px !important; }

  /* Trusted-by logos: scroll or wrap */
  .hero-trust {
    margin-top: 32px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }
  .hero-trust > div:last-child {
    flex-wrap: wrap !important;
    gap: 20px !important;
    justify-content: flex-start !important;
  }
  .hero-trust img {
    height: 28px !important;
  }

  /* Hero showcase — shrink to fit */
  .hero-showcase-col {
    height: auto !important;
    padding: 0 !important;
    margin-top: 8px !important;
    min-height: 380px;
  }

  /* ---- STATS BAR ---- */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 16px !important;
  }
  .stats-grid > div {
    border-inline-start: none !important;
    padding: 0 !important;
  }
  .stats-grid > div > div:first-child {
    font-size: 28px !important;
  }
  section[style*="background: \"#21000E\""] {
    /* Tighter stats bar padding */
  }

  /* ---- AUDIENCE TABS ---- */
  section#creators {
    padding: 72px 0 64px !important;
  }
  section#creators > div {
    padding: 0 20px !important;
  }
  section#creators h2 {
    font-size: clamp(28px, 7.5vw, 36px) !important;
  }
  .aud-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .aud-tabs::-webkit-scrollbar { display: none; }
  .aud-tabs button {
    padding: 10px 16px !important;
    font-size: 13px !important;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .aud-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .aud-grid h3 {
    font-size: clamp(26px, 6.8vw, 32px) !important;
  }
  .aud-grid ul {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .aud-grid p { font-size: 15px !important; }
  /* Creator phone scale: was 0.62 → smaller box on mobile */
  .aud-mockup > div:first-child {
    width: 100% !important;
    height: auto !important;
    min-height: 360px;
  }

  /* ---- PRODUCTS GRID ---- */
  section#products {
    padding: 72px 0 80px !important;
  }
  section#products > div {
    padding: 0 20px !important;
  }
  section#products h2 {
    font-size: clamp(34px, 8vw, 44px) !important;
  }
  .prod-row {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: 40px 0 !important;
  }
  .prod-text, .prod-mock {
    padding: 0 !important;
    order: unset !important;
  }
  .prod-spine, .prod-node { display: none !important; }
  .prod-text h3 {
    font-size: clamp(24px, 6.4vw, 32px) !important;
  }
  .prod-text p { font-size: 15px !important; }
  /* Stat block */
  .prod-text > div[style*="border-inline-start: 3px solid"] > div:first-child {
    font-size: 26px !important;
  }

  /* ---- STORIES ---- */
  section[style*="background: \"#21000E\""][style*="120px"] {
    padding: 72px 0 56px !important;
  }
  .stories-videos {
    grid-template-columns: 1fr 1fr !important;
    max-width: 100% !important;
    padding: 0 20px;
    gap: 12px !important;
  }
  .stories-videos > *:nth-child(3) { display: none; }
  .stories-row {
    grid-template-columns: 1fr !important;
  }
  /* Ticker chip width */
  .stories-ticker > div {
    width: 320px !important;
  }

  /* ---- BRAND BAR ---- */
  .brand-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    row-gap: 28px !important;
    column-gap: 28px !important;
  }
  .brand-grid img { height: auto !important; max-height: 32px !important; }

  /* ---- WHY ALFAN ---- */
  section#about {
    padding: 72px 0 !important;
  }
  section#about > div {
    padding: 0 20px !important;
  }
  section#about h2 {
    font-size: clamp(30px, 7vw, 40px) !important;
  }
  .why-head {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 32px !important;
  }
  .why-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  /* Pillar card */
  .why-grid > div:first-child > div {
    grid-template-columns: 1fr !important;
    padding: 24px !important;
    gap: 16px !important;
  }
  .why-grid > div:first-child > div > div:first-child {
    width: 52px !important;
    height: 52px !important;
  }
  .why-grid > div:first-child > div h3 {
    font-size: 22px !important;
  }
  .why-stat {
    display: none !important;
  }
  /* Mini cards: keep 2x2 but tighter */
  .why-grid > div:last-child > div:last-child {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .why-grid > div:last-child > div:last-child > div {
    min-height: 140px !important;
    padding: 16px !important;
  }

  /* ---- NEWS ---- */
  .news-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .news-feature {
    grid-template-columns: 1fr !important;
  }
  .news-feature-text {
    padding: 36px 28px !important;
    order: 2;
  }
  .news-feature > div:last-child {
    min-height: 240px !important;
    order: 1;
  }

  /* ---- FINAL CTA ---- */
  .final-cta {
    padding: 56px 28px !important;
    border-radius: 22px !important;
  }
  .final-cta h2 {
    font-size: clamp(32px, 8vw, 44px) !important;
  }
  .final-cta p {
    font-size: 15px !important;
  }
  .final-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .final-buttons button {
    width: 100%;
  }

  /* ---- FOOTER ---- */
  footer > div {
    padding: 56px 20px 0 !important;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px !important;
    margin-bottom: 40px !important;
  }
  .footer-grid > div:first-child {
    grid-column: 1 / -1 !important;
  }
}

/* ---------- Small mobile (<=480px) ---------- */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .stories-videos {
    grid-template-columns: 1fr !important;
    max-width: 280px !important;
    margin-inline: auto !important;
  }
  .stories-videos > *:nth-child(2),
  .stories-videos > *:nth-child(3) { display: none; }
  .brand-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}
