/* =============================================
   NEXUS FITNESS — RESPONSIVE STYLES
   responsive.css
   ============================================= */

/* ── XL: 1400px ── */
@media (max-width: 1400px) {
  .hero-stats {
    right: 2%;
  }
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── LG: 1200px ── */
@media (max-width: 1200px) {
  .shop-layout {
    grid-template-columns: 240px 1fr;
  }

  .checkout-wrapper {
    grid-template-columns: 1fr 360px;
  }

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

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

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

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

/* ── MD: 992px ── */
@media (max-width: 992px) {
  /* Hero */
  .hero-stats {
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 3rem;
  }

  .stat-badge {
    min-width: 120px;
  }

  /* Navbar */
  .navbar-collapse {
    background: rgba(8,8,8,0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
  }

  .navbar-nav {
    gap: 0.25rem;
  }

  .navbar-nav .nav-link::after {
    display: none;
  }

  .nav-extras {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
  }

  /* Shop */
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    position: static;
    display: none;
  }

  .shop-sidebar.mobile-open {
    display: block;
  }

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

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

  .order-summary-box {
    position: static;
    margin-top: 2rem;
  }

  /* Cart */
  .cart-table thead th:nth-child(3),
  .cart-table tbody td:nth-child(3) {
    display: none;
  }

  /* Profile */
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    position: static;
  }

  .profile-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .profile-nav li {
    margin-bottom: 0;
  }

  .profile-nav-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
  }

  /* Timeline */
  .timeline::before {
    left: 24px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    flex-direction: column;
    padding-left: 60px;
  }

  .timeline-dot {
    left: 24px;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Cart drawer */
  .cart-drawer .offcanvas {
    width: 100%;
    max-width: 420px;
  }
}

/* ── SM: 768px ── */
@media (max-width: 768px) {
  /* Global */
  .section {
    padding: 4rem 0;
  }

  /* Hero */
  .hero-title {
    font-size: clamp(3rem, 12vw, 6rem);
  }

  .hero-ctas {
    flex-direction: column;
  }

  .hero-ctas .btn-primary-accent,
  .hero-ctas .btn-outline-accent {
    width: 100%;
    justify-content: center;
  }

  /* Auth */
  .auth-card {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }

  .auth-card.wide {
    max-width: 100%;
  }

  /* Products Grid */
  .products-grid {
    grid-template-columns: 1fr;
  }

  .products-grid.list-view .product-card {
    grid-template-columns: 120px 1fr;
  }

  /* Dashboard */
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

  /* Pricing */
  .pricing-card.popular {
    transform: none;
  }

  /* BMI */
  .bmi-card {
    padding: 2rem 1.5rem;
  }

  /* Contact */
  .contact-layout {
    grid-template-columns: 1fr;
  }

  /* Cart Table — simplify */
  .cart-table thead th:nth-child(4),
  .cart-table tbody td:nth-child(4) {
    display: none;
  }

  /* Checkout Progress */
  .checkout-progress-bar {
    gap: 0;
  }

  .progress-connector {
    width: 40px;
  }

  /* Product Detail */
  .product-thumbnails {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Membership table — scroll */
  .membership-table-wrap {
    overflow-x: auto;
  }

  /* Timeline */
  .timeline-item,
  .timeline-item:nth-child(even) {
    flex-direction: column;
    padding-left: 50px;
  }

  /* Footer */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* Orders table — scroll */
  .orders-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── XS: 576px ── */
@media (max-width: 576px) {
  /* Typography */
  h1 { font-size: clamp(2.5rem, 10vw, 4rem); }
  h2 { font-size: clamp(2rem, 8vw, 3rem); }

  /* Hero */
  .hero {
    min-height: 90vh;
  }

  /* Stat Badge */
  .stat-badge {
    min-width: auto;
    padding: 0.75rem 1rem;
  }

  /* Feature Cards — 1 col */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Programs — 1 col */
  .programs-grid {
    grid-template-columns: 1fr;
  }

  /* Stats — 2 col */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Dashboard stats */
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Quick actions */
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Auth card */
  .auth-card {
    padding: 1.75rem 1.25rem;
  }

  /* Product detail price */
  .product-detail-price {
    font-size: 2.5rem;
  }

  /* Cart drawer */
  .cart-drawer .offcanvas {
    width: 100%;
  }

  /* Footer newsletter */
  .footer-newsletter {
    flex-direction: column;
  }

  .footer-newsletter input {
    border-right: 1px solid var(--border);
    border-radius: var(--radius);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .footer-newsletter button {
    border-radius: 0 0 var(--radius) var(--radius);
    width: 100%;
  }

  /* BMI unit toggle */
  .bmi-unit-toggle {
    width: 100%;
  }

  .bmi-unit-btn {
    flex: 1;
    text-align: center;
  }

  /* Auth checkbox row */
  .auth-checkbox-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Checkout progress text */
  .progress-step-label {
    display: none;
  }

  /* Profile layout */
  .profile-avatar-circle {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }

  /* Gender options */
  .gender-options {
    flex-direction: column;
  }

  /* Cart page table */
  .cart-table {
    font-size: 0.8rem;
  }

  .cart-product-thumb {
    width: 48px;
    height: 48px;
  }

  /* 404 */
  .glitch-text {
    font-size: clamp(6rem, 25vw, 12rem);
  }
}

/* ── Print Styles ── */
@media print {
  .navbar,
  .footer,
  .cart-drawer,
  .toast-container-custom,
  #preloader {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}

/* ── High Contrast / Accessibility ── */
@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;
  }
}

/* ── Dark Mode (default but ensure system compatibility) ── */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}
