/* ============================================================
   Wowseo.ai — Mobile Optimizations
   Breakpoints: 860px (tablet), 640px (small tablet), 480px (phone)
   ============================================================ */

/* ---------- Global ---------- */
@media (max-width: 480px) {
  :root {
    --gut: 18px;
    --r-lg: 14px;
    --r-xl: 18px;
  }

  body { font-size: 15.5px; }

  .h2 { font-size: clamp(23px, 6.5vw, 32px); }
  .h3 { font-size: clamp(18px, 5vw, 22px); }
  .lead { font-size: 16px; }
  .section { padding-block: clamp(40px, 8vw, 72px); }
  .section--tight { padding-block: clamp(28px, 6vw, 48px); }
  .section-head { margin-bottom: clamp(22px, 5vw, 36px); }

  /* Cards — reduce padding */
  .card { padding: 20px; }
}

/* ---------- Header ---------- */
@media (max-width: 480px) {
  .nav { height: 60px; gap: 10px; }

  /* Shrink lang switcher */
  .lang button { padding: 5px 8px; font-size: 12px; }

  /* Theme btn smaller */
  .theme-btn { width: 34px; height: 34px; }

  /* Nav burger smaller */
  .nav-burger { width: 38px; height: 38px; }

  /* Brand text smaller */
  .brand { font-size: 18px; }
  .brand .mk { width: 8px; height: 8px; margin-right: 7px; }
}

/* ---------- Hero ---------- */
@media (max-width: 640px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; padding-block: clamp(36px, 6vw, 64px); }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-trust { gap: 20px; }
  .hero-trust .ht b { font-size: 22px; }
}

/* ---------- CTA band ---------- */
@media (max-width: 480px) {
  .cta-band { padding: clamp(28px, 6vw, 40px) clamp(20px, 5vw, 28px); }
  .cta-band .btn { width: 100%; justify-content: center; }
}

/* ---------- Proof grid (4 stats) ---------- */
@media (max-width: 480px) {
  .proof-grid { grid-template-columns: 1fr 1fr; }
  .proof-cell { padding: 20px 14px; }
  .proof-cell .stat-num { font-size: clamp(28px, 7vw, 38px); }
}

/* ---------- Cols-4 KPI plashki (infographic) ---------- */
@media (max-width: 640px) {
  /* 2 columns on small tablet */
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  /* 1 column on very small phones */
  .cols-4 { grid-template-columns: 1fr; }
}

/* ---------- Cols-3 on mobile ---------- */
@media (max-width: 480px) {
  .cols-3 { grid-template-columns: 1fr; }
}

/* ---------- Chart cards ---------- */
@media (max-width: 640px) {
  .chart-card { padding: 14px; }
  .chart-card .chart-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------- Platform progress bars (infographic) ---------- */
@media (max-width: 640px) {
  /* Make label narrower, allow wrap */
  .bar-row-label {
    width: auto !important;
    min-width: 0 !important;
    font-size: 12.5px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
  }
}

/* Inline bar rows in ssylki.html — fix overflow at 390px */
@media (max-width: 640px) {
  /* The bar rows use display:flex;align-items:center;gap:14px with width:130px label */
  /* We override via a more specific selector trick using the bar-fill parent */
  .card .bar-fill {
    min-width: 0;
  }
}

/* ---------- Multi-step form ---------- */
@media (max-width: 640px) {
  /* Step indicator */
  .steps-prog { margin-bottom: 24px; }
  .steps-prog .stp .n { width: 30px; height: 30px; font-size: 13px; }
  .steps-prog .stp .bar { margin: 0 8px; }

  /* Option cards — single column earlier */
  .opt-grid { grid-template-columns: 1fr; }

  /* Input rows — single column earlier */
  .inp-row { grid-template-columns: 1fr; }

  /* Step nav — stack buttons if needed */
  .step-nav { flex-wrap: wrap; }
  .step-nav .btn { flex: 1; justify-content: center; min-width: 120px; }

  /* Field spacing */
  .field { margin-bottom: 18px; }
}

@media (max-width: 480px) {
  /* Form card padding */
  [data-steps] { padding: 20px 16px; }
}

/* ---------- Calculator ---------- */
@media (max-width: 640px) {
  .calc { grid-template-columns: 1fr; }
  .calc-side { padding: clamp(20px, 4vw, 32px); }
}

/* ---------- FAQ ---------- */
@media (max-width: 480px) {
  .faq-q { font-size: 15.5px; padding: 18px 0; gap: 12px; }
  .faq-q .ic { width: 24px; height: 24px; flex: none; }
  .faq-a .inner { font-size: 14.5px; }
}

/* ---------- Footer ---------- */
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .foot-col ul { gap: 9px; font-size: 14px; }
  .foot-brand { font-size: 18px; }
}
@media (max-width: 380px) {
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Mobile menu ---------- */
@media (max-width: 480px) {
  .mmenu { padding: 20px var(--gut); gap: 4px; max-height: calc(100vh - 70px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .mmenu a { font-size: 18px; padding: 12px 6px; }
}

/* ---------- Blog grid ---------- */
@media (max-width: 480px) {
  .rev-track { grid-auto-columns: 100%; }
}

/* ---------- Page hero ---------- */
@media (max-width: 480px) {
  .page-hero { padding-block: clamp(28px, 5vw, 48px) clamp(12px, 2vw, 20px); }
  .crumb { font-size: 11.5px; gap: 6px; }
}

/* ---------- Buttons on mobile ---------- */
@media (max-width: 480px) {
  .btn { font-size: 15px; padding: 13px 20px; }
  .btn--lg { padding: 15px 22px; font-size: 16px; }
}

/* ---------- Infographic: ssylki.html bar rows ---------- */
/* The inline bar rows have hardcoded width:130px labels — fix with fluid override */
@media (max-width: 560px) {
  .wrap .card > div > div:has(.bar-fill) {
    gap: 10px !important;
  }
  .wrap .card > div > div > span:first-child {
    width: 90px !important;
    font-size: 12px !important;
  }
  .wrap .card > div > div > span:last-child {
    width: 38px !important;
    font-size: 13px !important;
  }
}

/* ---------- Tier grid ---------- */
@media (max-width: 640px) {
  .tier-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
  .tier-grid { grid-template-columns: 1fr; }
  .tier-grid--duo { grid-template-columns: 1fr; }
}

/* ---------- PBN build ---------- */
@media (max-width: 640px) {
  .pbn-build { grid-template-columns: 1fr; }
  .pbn-summary { position: static; }
}

/* ---------- Reviews ---------- */
@media (max-width: 480px) {
  .rev-track { gap: 14px; }
  .rev-card { padding: 20px 18px 18px; }
}

/* ---------- Table overflow ---------- */
@media (max-width: 560px) {
  .ptable { font-size: 13.5px; }
  .ptable th, .ptable td { padding: 9px 0; }
  /* Allow table scroll if too wide */
  .ptable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---------- Checker grid ---------- */
@media (max-width: 640px) {
  .checker-grid { grid-template-columns: 1fr; gap: 24px; }
  .term-body { min-height: 200px; }
  /* Score ring block — remove excess bottom space */
  .score-ring svg { max-width: 120px; }
}

/* ---------- Case stats grid ---------- */
@media (max-width: 480px) {
  /* In PBN page, case stats columns get too cramped */
  .case-stats .st b { font-size: 15px; }
  .case-stats .st span { font-size: 11px; }
}
@media (max-width: 380px) {
  .case-stats { grid-template-columns: 1fr; }
  .case-stats .st { border-right: 0; border-bottom: 1px solid var(--line); }
  .case-stats .st:last-child { border-bottom: 0; }
}

/* ---------- Svc feature card ---------- */
@media (max-width: 480px) {
  .svc-feature { grid-column: span 1; grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- Stat numbers in KPI strip (infographic) ---------- */
@media (max-width: 480px) {
  /* .proof-cell already handled above, but the new KPI cards in infographic use inline style */
  /* Force stat-num to be smaller on tiny screens */
  .stat-num { font-size: clamp(28px, 8vw, 48px) !important; }
}

/* ---------- Req band ---------- */
@media (max-width: 640px) {
  .req-band { grid-template-columns: 1fr; }
  .req-info, .req-form { padding: clamp(22px, 4vw, 36px); }
}
