/* ==========================================================================
   Layout — grid, sections, page structure, responsive
   Mobile-first: base styles = mobile, min-width = desktop
   ========================================================================== */

/* ==========================================================================
   Page wrapper
   ========================================================================== */

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1;
}

/* ==========================================================================
   Section defaults
   ========================================================================== */

.section {
  padding: var(--space-2xl) 0;
}

.section-sm {
  padding: var(--space-xl) 0;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-xl);
}

/* ==========================================================================
   Grids
   ========================================================================== */

/* Product grid — 1 col mobile, 2 tablet, 3 desktop */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* Kit cards — 1 col mobile, 2x2 desktop */
.kit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* 3-column content grid (How It Works, Guides) */
.col-3-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* 4-column trust strip */
.col-4-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* ==========================================================================
   Hero section
   ========================================================================== */

.hero {
  background: var(--color-primary);
  padding: var(--space-2xl) 0;
  text-align: center;
}

.hero-headline {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-inverse);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.hero-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

/* ==========================================================================
   System architecture strip
   ========================================================================== */

.system-strip {
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
}

.system-strip-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
}

.system-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-xs);
}

.system-node-icon {
  width: 48px;
  height: 48px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.system-node-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

.system-node-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-accent);
}

.system-arrow {
  color: var(--color-text-muted);
  font-size: 18px;
  padding: 0 var(--space-xs);
}

/* ==========================================================================
   Trust signal strip
   ========================================================================== */

.trust-strip {
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-2xl) 0 var(--space-xl);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-inverse);
  margin-bottom: var(--space-sm);
}

.footer-tagline {
  font-size: 12px;
  font-style: italic;
  color: rgba(255,255,255,0.4);
}

.footer-nav-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--space-md);
}

.footer-nav a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-sm);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-nav a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}

/* ==========================================================================
   Single guide layout
   ========================================================================== */

.guide-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  padding: var(--space-2xl) 0;
}

.guide-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.guide-toc {
  display: none;
}

/* ==========================================================================
   Shop layout (category pages)
   ========================================================================== */

.shop-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  padding: var(--space-2xl) 0;
}

.shop-sidebar {
  order: -1;
}

/* ==========================================================================
   Responsive — tablet (600px+)
   ========================================================================== */

@media (min-width: 600px) {
  h1 { font-size: 36px; }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kit-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .col-3-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .col-4-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-headline {
    font-size: 32px;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-cta-bar {
    display: none !important;
  }
}

/* ==========================================================================
   Responsive — desktop (960px+)
   ========================================================================== */

@media (min-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .col-3-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-headline {
    font-size: 40px;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .guide-layout {
    grid-template-columns: 1fr 260px;
  }

  .guide-toc {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + var(--space-lg));
    max-height: calc(100vh - var(--nav-height) - var(--space-2xl));
    overflow-y: auto;
    align-self: start;
  }

  .shop-layout {
    grid-template-columns: 240px 1fr;
  }

  .shop-sidebar {
    order: 0;
  }

  /* Desktop nav visible, mobile toggle hidden */
  .primary-nav { display: flex; }
  .nav-toggle  { display: none; }
}

/* ==========================================================================
   Responsive — mobile nav
   ========================================================================== */

@media (max-width: 959px) {
  .site-header {
    padding: 0 var(--space-md);
  }

  .primary-nav {
    display: none;
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: var(--color-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg);
    gap: var(--space-md);
    overflow-y: auto;
    z-index: 99;
  }
  .primary-nav.is-open {
    display: flex;
  }

  .nav-link {
    font-size: 16px;
    color: rgba(255,255,255,0.85);
  }

  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    display: block;
  }
  .nav-dropdown a {
    color: rgba(255,255,255,0.7);
    padding: 8px var(--space-sm);
  }
  .nav-dropdown a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-item-dropdown > .nav-link::after {
    display: none;
  }

  .mobile-cta-bar {
    display: block;
  }

  /* Push content above mobile CTA bar */
  .site-content {
    padding-bottom: 64px;
  }
}
