/* ==========================================================================
   RESPONSIVE BREAKPOINTS — PrintForge3D
   Mobile-first approach
   Breakpoints: 480 | 640 | 768 | 1024 | 1280
   ========================================================================== */

/* ── Large Desktop (1280px+) ─────────────────────────────────────────────── */
@media (min-width: 1280px) {
  :root { --pf-container-pad: 2.5rem; }
}

/* ── Tablet Landscape / Small Desktop (1024px and below) ────────────────── */
@media (max-width: 1024px) {
  :root {
    --pf-header-height: 70px;
    --pf-container-pad: 1.5rem;
  }

  /* Header: hide desktop nav, show hamburger */
  .pf3d-nav { display: none; }
  .pf3d-mobile-toggle { display: flex !important; }

  .pf3d-header__inner {
    grid-template-columns: auto 1fr;
  }

  .pf3d-header__actions {
    justify-self: end;
  }

  /* Footer grid: 2 columns */
  .pf3d-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--pf-space-10);
  }

  .pf3d-footer__brand {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--pf-space-8);
    align-items: start;
  }

  /* Sections */
  .pf-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pf3d-hero__stats { grid-template-columns: repeat(4, 1fr); }
}

/* ── Tablet Portrait (768px and below) ──────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --pf-container-pad: 1.25rem;
    --pf-header-height: 64px;
  }

  /* Typography scale down */
  h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
  h2 { font-size: clamp(1.5rem, 5vw, 2rem); }

  /* Topbar hide on mobile */
  .pf3d-topbar { display: none; }

  /* Sections */
  .pf-section { padding-top: var(--pf-space-12); padding-bottom: var(--pf-space-12); }
  .pf-section--lg { padding-top: var(--pf-space-16); padding-bottom: var(--pf-space-16); }

  /* Grids */
  .pf-grid-2,
  .pf-grid-3,
  .pf-grid-4 { grid-template-columns: 1fr; }

  /* Footer */
  .pf3d-footer__grid { grid-template-columns: 1fr; gap: var(--pf-space-8); }
  .pf3d-footer__brand { grid-column: auto; display: block; }
  .pf3d-footer__bottom-inner { flex-direction: column; align-items: flex-start; }
  .pf3d-footer__payments { order: -1; }

  /* Hero */
  .pf3d-hero__inner { grid-template-columns: 1fr; text-align: center; }
  .pf3d-hero__actions { justify-content: center; }
  .pf3d-hero__image { display: none; }
  .pf3d-hero__stats { grid-template-columns: repeat(2, 1fr); }

  /* Services strip */
  .pf3d-services-strip { grid-template-columns: 1fr; }

  /* Product grid */
  .pf3d-products-grid { grid-template-columns: repeat(2, 1fr); }

  /* Category cards */
  .pf3d-categories-grid { grid-template-columns: 1fr; }

  /* Testimonials */
  .pf3d-testimonials-grid { grid-template-columns: 1fr; }

  /* Single product */
  .pf3d-product-layout { grid-template-columns: 1fr; }

  /* Cart / Checkout table */
  .shop_table thead { display: none; }
  .shop_table tr,
  .shop_table td { display: block; }

  /* Checkout columns */
  .pf3d-checkout-cols { grid-template-columns: 1fr; }
}

/* ── Mobile (640px and below) ────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Product grid 1 col */
  .pf3d-products-grid { grid-template-columns: 1fr; }

  /* Buttons full width in some contexts */
  .pf3d-hero__actions .pf-btn { width: 100%; justify-content: center; }

  /* Stats: 2 across */
  .pf3d-hero__stats { grid-template-columns: repeat(2, 1fr); }

  /* Search overlay */
  .pf3d-search-input { font-size: var(--pf-text-2xl); }

  /* Pricing */
  .pf3d-pricing-grid { grid-template-columns: 1fr; }

  /* Back to top position */
  .pf3d-back-to-top { bottom: var(--pf-space-4); right: var(--pf-space-4); }
}

/* ── Small mobile (480px and below) ─────────────────────────────────────── */
@media (max-width: 480px) {
  :root { --pf-container-pad: 1rem; }

  .pf3d-footer__bottom-links { flex-wrap: wrap; gap: var(--pf-space-3); }
  .pf3d-footer__payments { flex-wrap: wrap; }

  .pf3d-hero__stats { grid-template-columns: 1fr 1fr; gap: var(--pf-space-4); }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  .pf3d-header,
  .pf3d-footer,
  .pf3d-back-to-top,
  .pf3d-mobile-menu,
  .pf3d-search-overlay { display: none !important; }

  body { background: #fff; color: #000; }
  a { color: #000; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── High contrast ───────────────────────────────────────────────────────── */
@media (forced-colors: active) {
  .pf-btn-primary,
  .pf-btn-cyan {
    border: 2px solid ButtonText;
  }
}
