/* Tamusabah — Responsive Styles v2 */

/* ============================================
   1280px+ — Desktop (default, no changes needed)
   ============================================ */

/* Sembunyi category pills pada desktop — sidebar dah cukup untuk kategori */
@media (min-width: 769px) {
  .category-pills { display: none; }
}

/* ============================================
   1024px — Small desktop / landscape tablet
   ============================================ */
@media (max-width: 1024px) {
  .browse-layout { grid-template-columns: 200px 1fr; gap: var(--space-lg); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 220px 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   768px — Tablet
   ============================================ */
@media (max-width: 768px) {
  /* Nav */
  .nav-links { display: none; }
  .nav-mobile-actions { display: flex; }
  .hamburger { display: flex; }
  .mobile-menu { display: block; }

  /* Hero */
  .hero { padding-top: calc(64px + var(--space-2xl)); padding-bottom: var(--space-2xl); }
  .hero h1 { font-size: 1.75rem; }
  .hero-subtitle { font-size: var(--text-base); }
  .hero-actions .btn { width: 100%; }

  /* Sections */
  .section { padding: var(--space-2xl) 0; }
  .section-header h2 { font-size: var(--text-2xl); }
  .how-grid { grid-template-columns: 1fr; }
  .how-card { max-width: 400px; margin: 0 auto; }

  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .products-preview-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

  .trust-grid { grid-template-columns: 1fr; }
  .trust-card { max-width: 500px; margin: 0 auto; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
  .stat-number { font-size: var(--text-2xl); }

  .cta-section h2 { font-size: var(--text-2xl); }

  /* Browse */
  .main { padding-bottom: var(--space-3xl); }
  .browse-layout { grid-template-columns: 1fr; }
  .browse-sidebar {
    position: static;
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    padding: var(--space-sm);
    align-items: center;
    scrollbar-width: none;
    border: none;
    background: none;
    margin-bottom: var(--space-md);
  }
  .browse-sidebar::-webkit-scrollbar { display: none; }
  .browse-sidebar h3 { display: none; }
  .browse-sidebar a {
    flex-shrink: 0;
    margin-bottom: 0;
    font-size: var(--text-xs);
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
  }
  .browse-sidebar a.active { border-color: var(--primary); }
  .browse-sidebar .cat-count { display: none; }
  .category-pills { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-sm); }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-brand p { margin: 0 auto; }

  /* Admin */
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-pills { display: flex; }
  .admin-nav a { padding: var(--space-xs) var(--space-md); }

  /* Seller */
  .seller-layout { display: block; }
  .seller-sidebar { display: none; }
  .seller-pills { display: flex; }
  .seller-nav a { padding: var(--space-xs) var(--space-md); }

  /* Tables */
  .table-wrapper { margin: 0 -var(--space-md); border-radius: 0; border-left: none; border-right: none; }

  /* Forms */
  .page-header { flex-direction: column; align-items: flex-start; }
  .form { max-width: 100%; }

  /* Segmented Control — 3 option wrap */
  .segmented-control { display: flex; flex-wrap: wrap; border-radius: 16px; }
  .segmented-option { flex: 1; justify-content: center; padding: 8px 10px; font-size: 0.8rem; gap: 4px; }
  .segmented-option i, .segmented-option svg { width: 13px; height: 13px; }

  /* Breadcrumb */
  .breadcrumb { margin-bottom: var(--space-md); }
  .breadcrumb a,
  .breadcrumb .breadcrumb-current { max-width: 180px; }

  /* Product Gallery — stack vertically */
  .product-detail-layout { flex-direction: column; }
  .product-gallery { flex: none; width: 100%; max-width: 100%; }
  .product-detail-info { flex: none; width: 100%; max-width: 100%; }
  .gallery-thumb { flex: 0 0 60px; width: 60px; height: 45px; }

  /* Orders — card mobile */
  .orders-search { max-width: 100%; }
  .order-card-item { grid-template-columns: 56px 1fr auto; }
  .order-card-thumb { width: 56px; }
  .order-card-total { font-size: 0.938rem; }
  .order-card-footer { flex-direction: column; gap: var(--space-sm); align-items: stretch; }
  .order-card-actions { flex-direction: row; justify-content: space-between; width: 100%; }
  .order-card-meta { flex-wrap: wrap; }
}

/* ============================================
   640px — Large phone
   ============================================ */
@media (max-width: 640px) {
  .main { padding-bottom: var(--space-3xl); }

  .hero { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
  .hero h1 { font-size: 1.5rem; }
  .hero-badge { font-size: 0.625rem; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
  .product-card-body { padding: var(--space-sm); }
  .product-card-actions { padding: 0 var(--space-sm) var(--space-sm); }
  .product-card-name { font-size: var(--text-xs); }
  .product-card-price { font-size: var(--text-sm); }

  /* Gallery — mobile */
  .gallery-nav-btn { opacity: 1; width: 32px; height: 32px; }
  .gallery-nav-btn i { width: 18px; height: 18px; }
  .lightbox-content { max-width: 95vw; }
  .lightbox-nav { width: 36px; height: 36px; }
  .lightbox-nav i { width: 22px; height: 22px; }
  .lightbox-prev { left: var(--space-sm); }
  .lightbox-next { right: var(--space-sm); }

  .footer { padding: var(--space-xl) 0 var(--space-md); }
  .footer-grid { gap: var(--space-lg); }
}

/* ============================================
   480px — Phone
   ============================================ */
@media (max-width: 480px) {
  .container { padding: 0 var(--space-sm); }
  .main { padding-bottom: var(--space-3xl); }

  .hero h1 { font-size: 1.35rem; }
  .hero-subtitle { font-size: var(--text-sm); }

  .btn-large { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
  .stat-number { font-size: var(--text-xl); }

  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }

  .search-bar { padding: 0.25rem 0.25rem 0.25rem var(--space-md); }
  .search-bar input { font-size: var(--text-sm); }

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

  .browse-main { padding: 0; }
  .browse-layout { gap: var(--space-sm); }

  .admin-pills { gap: var(--space-xs); }
  .admin-pills a { font-size: 0.625rem; padding: var(--space-xs) var(--space-sm); }
}
