/* CablesCat - Responsive */

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .hero-content { margin-left: 5%; }
}

@media (max-width: 768px) {
  .navbar { padding: 0.9rem 1.25rem; }
  .navbar.scrolled { padding: 0.65rem 1.25rem; }

  .menu-toggle { display: flex; }

  .nav-menu {
    position: fixed; top: 0; right: -100%; bottom: 0;
    width: 280px; z-index: 999;
    flex-direction: column; align-items: flex-start;
    background: rgba(6,13,22,0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    padding: 5rem 1.5rem 2rem;
    gap: 0.25rem;
    transition: right 0.35s ease;
  }
  .nav-menu.open { right: 0; }
  .nav-link { width: 100%; padding: 0.75rem 1rem; font-size: 1rem; }

  .hero { height: 85vh; }
  .hero-content { margin-left: 0; padding: 0 1.25rem; }
  .hero-title { font-size: clamp(1.8rem, 7vw, 2.8rem); }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: fit-content; }

  .section { padding: 3.5rem 1.25rem; }
  .section-sm { padding: 2rem 1.25rem; }

  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  .promo-content { padding: 2rem 1.5rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .newsletter-form { flex-direction: column; }

  .shop-layout { flex-direction: column; }
  .shop-sidebar { width: 100%; }

  .breadcrumb-section { padding: 5.5rem 1.25rem 1.5rem; }

  /* ── Cart & Checkout ── */
  /* Stack the cart grid (items + order summary) vertically */
  #cart-summary > div {
    grid-template-columns: 1fr !important;
  }
  /* Order summary no longer sticky on mobile */
  .order-summary {
    position: static !important;
    top: auto !important;
  }
  /* Checkout two-column → single column */
  .checkout-layout {
    grid-template-columns: 1fr !important;
  }
  /* Move order summary to top on mobile so user sees cart first */
  .checkout-layout > div:last-child {
    order: -1;
    border-left: none !important;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 1.75rem; }
  .features-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .product-detail-layout { grid-template-columns: 1fr; }

  /* ── Cart item stacking ── */
  .cart-item {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  /* Image shrinks a little on very small screens */
  .cart-item img {
    width: 64px;
    height: 64px;
  }
  /* Details take full remaining width next to image */
  .cart-item-details {
    flex: 1;
    min-width: 0;
  }
  /* Controls + subtotal + remove push to a new row together */
  .cart-item-controls,
  .cart-item-subtotal,
  .cart-remove {
    flex-shrink: 0;
  }
  /* Inner grids in checkout form collapse */
  #checkout-form [style*="grid-template-columns:1fr 1fr"],
  #checkout-form [style*="grid-template-columns:1fr 1fr 1fr"],
  #billing-form-container [style*="grid-template-columns:1fr 1fr"],
  #billing-form-container [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}
