/* ============================================
   Joong Hardware — Wholesale Platform Styles
   Brand: Joong Supermarket & Wholesale
   Colors: Purple #2E0854 | Red #CC0000 | Green #00882B | Yellow #FFD700
   Tagline: Variety · Service · Value
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2E0854;
  --primary-dark: #1A0033;
  --primary-light: #4A1A7A;
  --secondary: #CC0000;
  --accent: #FFD700;
  --cta: #00882B;
  --cta-dark: #006B22;
  --bg: #fafafa;
  --card-bg: #fff;
  --card-shadow: 0 2px 8px rgba(46, 8, 84, 0.08);
  --card-shadow-hover: 0 4px 16px rgba(46, 8, 84, 0.14);
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --border: #e0e0e0;
  --success: #00882B;
  --error: #CC0000;
  --info: #2E0854;
  --warning: #FFD700;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --max-width: 1280px;
  --nav-height: 64px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Skip Nav (Accessibility) --- */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-nav:focus {
  top: 0;
  text-decoration: none;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 20px;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 8px 40px 8px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  font-size: 0.9rem;
  font-family: var(--font-family);
  transition: border-color 0.2s;
}

.nav-search input:focus {
  outline: none;
  border-color: var(--primary);
}

.nav-search button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  color: var(--text-light);
}

.nav-search button:hover {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-decoration: none;
}

.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
  display: none;
}

.nav-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  flex: 1;
  padding: 24px 0;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 14px 56px 14px 20px;
  border: none;
  border-radius: 32px;
  font-size: 1.05rem;
  font-family: var(--font-family);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hero-search input:focus {
  outline: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.hero-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.hero-search button:hover {
  background: var(--primary-dark);
}

/* --- Section Headings --- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--secondary);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

/* --- Category Grid --- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary);
  text-decoration: none;
}

.category-card .cat-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
}

.category-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* --- Category Pills / Filters --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  align-items: center;
}

.filter-bar label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-right: 4px;
}

.pill {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--font-family);
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.product-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0f0f0;
}

.product-card-img-placeholder {
  width: 100%;
  height: 200px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
}

.product-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.product-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-card-name a {
  color: inherit;
}

.product-card-name a:hover {
  color: var(--primary);
  text-decoration: none;
}

.product-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.product-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-moq {
  background: #fff3e0;
  color: #2E0854;
}

.badge-case {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-in-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-low-stock {
  background: #fff8e1;
  color: #f57f17;
}

.badge-out-of-stock {
  background: #fce4ec;
  color: #c62828;
}

.product-card-actions {
  margin-top: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  text-align: center;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- How It Works --- */
.how-it-works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin: 48px 0;
  text-align: center;
}

.how-step {
  padding: 20px;
}

.how-step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.how-step h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.how-step p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* --- CTA Banner --- */
.cta-banner {
  background: #fff3e0;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin: 40px 0;
}

.cta-banner h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: var(--secondary);
}

.cta-banner p {
  color: var(--text-light);
  margin-bottom: 16px;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--secondary);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-family);
  transition: border-color 0.2s;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
}

/* --- Auth Card (Login/Register) --- */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 80px);
  padding: 40px 20px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  text-align: center;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.auth-success {
  text-align: center;
  padding: 24px 0;
}

.auth-success .check-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #f5f5f5;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #fafafa;
}

/* --- Status Badges --- */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pending {
  background: #fff3e0;
  color: #2E0854;
}

.status-confirmed {
  background: #e3f2fd;
  color: #1565c0;
}

.status-processing {
  background: #f3e5f5;
  color: #7b1fa2;
}

.status-shipped {
  background: #e0f2f1;
  color: #00695c;
}

.status-delivered {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-cancelled {
  background: #fce4ec;
  color: #c62828;
}

/* --- Cart --- */
.cart-table .cart-product {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-table .cart-product-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}

.cart-table .cart-product-name {
  font-weight: 600;
}

.cart-quantity-input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-family);
  text-align: center;
}

.cart-quantity-input:focus {
  outline: none;
  border-color: var(--primary);
}

.cart-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.2s;
}

.cart-remove-btn:hover {
  color: var(--error);
}

.cart-summary {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-top: 24px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
}

.cart-summary-row.total {
  font-size: 1.15rem;
  font-weight: 700;
  border-top: 2px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

.cart-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* --- Product Detail --- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 24px 0;
}

.product-detail-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #f0f0f0;
}

.product-detail-image img {
  width: 100%;
  height: auto;
  min-height: 300px;
  object-fit: cover;
}

.product-detail-image .placeholder {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 4rem;
}

.product-detail-info h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.product-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 16px 0;
}

.product-detail-description {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 20px;
}

.product-detail-specs {
  margin-bottom: 24px;
}

.product-detail-specs .spec-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.product-detail-specs .spec-label {
  width: 140px;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.quantity-selector label {
  font-weight: 600;
  font-size: 0.9rem;
}

.quantity-selector input {
  width: 100px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-family);
  text-align: center;
}

.quantity-selector input:focus {
  outline: none;
  border-color: var(--primary);
}

/* --- Dashboard --- */
.dashboard-header {
  margin-bottom: 32px;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.dashboard-header p {
  color: var(--text-light);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}

.dashboard-section {
  margin-bottom: 32px;
}

.dashboard-section h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Checkout --- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  margin: 24px 0;
}

.checkout-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.checkout-section h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #f5f5f5;
}

.order-summary-item:last-child {
  border-bottom: none;
}

.order-confirmation {
  text-align: center;
  padding: 60px 20px;
}

.order-confirmation .success-icon {
  font-size: 4rem;
  color: var(--success);
  margin-bottom: 16px;
}

.order-confirmation h1 {
  margin-bottom: 8px;
}

.order-confirmation .order-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 24px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-muted);
  padding: 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 32px 0;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-family);
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 12px 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  max-width: 400px;
  animation: toast-in 0.3s ease;
  border-left: 4px solid var(--border);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-error {
  border-left-color: var(--error);
}

.toast.toast-info {
  border-left-color: var(--info);
}

.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 20px;
}

/* --- Loading --- */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Footer --- */
.footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: auto;
}

.footer a {
  color: var(--text-light);
}

.footer a:hover {
  color: var(--primary);
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .nav-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    height: auto;
    min-height: var(--nav-height);
  }

  .nav-search {
    order: 3;
    max-width: 100%;
    flex-basis: 100%;
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    order: 4;
    flex-basis: 100%;
    gap: 8px;
    padding: 8px 0;
  }

  .nav-menu-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero {
    padding: 40px 16px;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .cart-actions {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 24px;
  }

  .hero-search input {
    padding: 12px 48px 12px 16px;
  }

  .how-it-works {
    gap: 20px;
  }

  .cart-table .cart-product {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .cart-table .cart-product-img {
    width: 48px;
    height: 48px;
  }
}

/* --- Print --- */
@media print {
  .nav,
  .footer,
  .toast-container,
  .skip-nav {
    display: none;
  }

  body {
    background: #fff;
  }

  .main-content {
    padding: 0;
  }
}
