/* ══════════════════════════════════════════════
   FOOTWEAR AI SUITE — RESPONSIVE CSS
   Shared across all pages
   ══════════════════════════════════════════════ */

/* ── MOBILE MENU BUTTON ── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 400;
}
.menu-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: all 0.3s;
  border-radius: 1px;
}
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ════════════════════════════════════════
   TABLET — max-width: 1024px
   ════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Index page */
  .hero-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .hero-h1 {
    font-size: 38px !important;
  }
  .prod-grid {
    grid-template-columns: 1fr !important;
  }
  .met-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .for-grid {
    grid-template-columns: 1fr !important;
  }
  .integ-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  .eco-flow {
    flex-direction: column !important;
  }
  .eco-arrow {
    width: auto !important;
    height: 28px !important;
    border-right: none !important;
    border-bottom: 1px solid #2a2820 !important;
  }
  .eco-arrow::after {
    content: "↓" !important;
  }

  /* Sub-pages: hero grid */
  .hero {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Architecture grids */
  .arch {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Forecast/Vision tables with many columns */
  .qrow {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
}

/* ════════════════════════════════════════
   MOBILE — max-width: 768px
   ════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Show hamburger */
  .menu-toggle {
    display: block;
  }

  /* ── INDEX PAGE NAV ── */
  .nav {
    padding: 0 16px !important;
    flex-wrap: wrap;
    height: auto !important;
    min-height: 52px;
  }
  .nav-links {
    display: none !important;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 8px 0 16px;
    order: 3;
  }
  .nav-links.open {
    display: flex !important;
  }
  .nav-links .nav-link,
  .nav-links a {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    display: block;
  }
  .nav-cta {
    display: none !important;
  }

  /* Sub-pages nav contract (.nav-r) */
  .nav-r {
    display: none !important;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0 16px;
    order: 3;
  }
  .nav-r.open {
    display: flex !important;
  }

  /* ── HERO ── */
  .hero,
  .hero-inner {
    padding: 32px 16px 28px !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .hero-h1 {
    font-size: 28px !important;
    letter-spacing: -0.5px !important;
  }
  .hero-desc {
    font-size: 14px !important;
  }
  .hero-ey {
    font-size: 14px !important;
  }
  .hs-n {
    font-size: 24px !important;
  }

  /* ── PRODUCTS ── */
  .products {
    padding: 32px 16px !important;
  }
  .section-h2 {
    font-size: 26px !important;
    margin-bottom: 28px !important;
  }
  .prod-grid {
    grid-template-columns: 1fr !important;
  }
  .prod-card {
    padding: 24px 16px 20px !important;
  }
  .prod-cta {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: flex-start !important;
  }

  /* ── ECO FLOW ── */
  .eco-flow {
    flex-direction: column !important;
  }
  .eco-node {
    border-right: none !important;
    border-bottom: 1px solid #2a2820 !important;
  }
  .eco-arrow {
    width: auto !important;
    height: 28px !important;
    border-right: none !important;
    border-bottom: 1px solid #2a2820 !important;
  }
  .eco-arrow::after {
    content: "↓" !important;
  }
  .connect {
    padding: 32px 16px !important;
  }
  .connect-h2 {
    font-size: 22px !important;
  }

  /* ── METRICS ── */
  .metrics {
    padding: 32px 16px 0 !important;
  }
  .met-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── FOR SECTION ── */
  .for-section {
    padding: 0 16px 32px !important;
  }
  .for-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── INTEGRATION ── */
  .integ {
    padding: 32px 16px !important;
  }
  .integ-inner {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* ── FOOTER ── */
  .footer {
    padding: 28px 16px 20px !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
  }

  /* ── SUB-PAGES SHARED ── */
  /* Flow bar */
  .flow {
    padding: 16px 16px 14px !important;
    overflow-x: auto;
  }
  .flow-row {
    min-width: 500px;
  }

  /* Scene headers */
  .sh {
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* Actor chips */
  .actors {
    flex-wrap: wrap !important;
  }
  .actor {
    font-size: 9px !important;
    padding: 5px 10px !important;
  }

  /* Message grid */
  .msg {
    grid-template-columns: 32px 1fr !important;
  }

  /* Analysis rows */
  .ar {
    grid-template-columns: 1fr !important;
  }
  .ar-k {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
  }

  /* Architecture */
  .arch {
    grid-template-columns: 1fr !important;
  }
  .arch-col {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
  }
  .arch-col:last-child {
    border-bottom: none !important;
  }

  /* Section dividers */
  .sdiv {
    padding: 8px 16px !important;
    margin: 24px -16px 20px !important;
  }

  /* Content wrapper */
  .wrap,
  [class*="wrap"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Tables overflow */
  .stbl, .mtbl {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.stbl, table.mtbl {
    min-width: 480px;
  }

  /* Quotation card grids */
  .qrow {
    grid-template-columns: 1fr !important;
  }
  .qsum-row {
    grid-template-columns: 1fr !important;
  }
  .qcard-info {
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* Diff table */
  .dr {
    grid-template-columns: 1fr !important;
  }

  /* Chat interfaces */
  .chat-body {
    max-height: 360px !important;
  }
  .stat-grid {
    grid-template-columns: 1fr !important;
  }

  /* Download rows */
  .dl-row {
    padding: 10px 12px !important;
  }

  /* Hero output stats */
  .hero-outs {
    grid-template-columns: 1fr !important;
  }

  /* Inline grid styles override */
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Forecast specific grids */
  .scenario-grid,
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns:repeat(5"] {
    grid-template-columns: 1fr !important;
  }
}

/* ════════════════════════════════════════
   SMALL MOBILE — max-width: 480px
   ════════════════════════════════════════ */
@media (max-width: 480px) {
  .hero-h1 {
    font-size: 24px !important;
  }
  .section-h2 {
    font-size: 22px !important;
  }
  .connect-h2 {
    font-size: 20px !important;
  }
  .met-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .met-n {
    font-size: 22px !important;
  }
  .hero-outs {
    grid-template-columns: 1fr !important;
  }
  .hero-btns {
    flex-direction: column !important;
  }
  .hero-btns a {
    text-align: center;
  }
  .qcard-hd {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}
