/* ============================================================
   MOTO STORE — Design System
   Thème moderne premium pour accessoires moto
   Couleurs : noir profond, orange énergie, gris anthracite, blanc cassé
   Mobile-first, responsive, animations légères
   ============================================================ */

/* ---------- Tokens / Variables ---------- */
:root {
  /* Couleurs principales (noir profond) */
  --color-black: #050505;
  --color-black-soft: #151515;
  --color-card: #151515;
  --color-card-hover: #1d1d1d;
  --color-border: #292929;
  --color-border-hover: #3d3d3d;
  --color-bg: #050505;
  --color-bg-soft: #151515;

  /* Accent : rouge BORN RIDER, réservé aux petits repères (badges, focus, liens au survol) */
  --color-accent: #e50914;
  --color-accent-hover: #ff3b47;
  --color-accent-dark: #b80000;
  --color-accent-glow: rgba(229, 9, 20, 0.14);

  /* Actions de confirmation (ajouter au panier, valider, enregistrer) */
  --color-confirm: #16a34a;
  --color-confirm-hover: #22c55e;

  /* Rouge énergie secondaire */
  --color-danger: #dc2626;
  --color-danger-hover: #ef4444;

  /* Vert succès */
  --color-success: #22c55e;
  --color-success-hover: #4ade80;

  /* Gris neutres */
  --color-text: #f5f5f5;
  --color-text-soft: #cfcfcf;
  --color-muted: #a1a1aa;
  --color-muted-soft: #6b6b75;
  --color-white: #ffffff;
  --color-white-soft: #e5e7eb;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.35);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.4);
  --shadow-accent: 0 0 20px var(--color-accent-glow);

  --transition: 0.2s ease;
  --transition-fast: 0.1s ease;
}

body {
  background: var(--color-bg);
}

/* ---------- Theme toggle (supprimé : thème unique) ---------- */
.theme-toggle {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  background: var(--color-black-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-card);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--color-accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ---------- Conteneur ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.25;
  margin-top: 0;
}

h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; font-weight: 700; }
p { color: var(--color-text-soft); margin: 0 0 1rem; }

.text-muted { color: var(--color-muted); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.font-bold { font-weight: 800; }
.uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
  transition: all var(--transition);
  touch-action: manipulation;
  white-space: nowrap;
}

.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.btn-sm  { padding: 0.5rem 0.875rem; font-size: 0.85rem; }
.btn     { padding: 0.75rem 1.5rem; }
.btn-lg  { padding: 1rem 2rem; font-size: 1rem; }
.btn-xl  { padding: 1.125rem 2.5rem; font-size: 1.1rem; }

.btn-primary {
  background: var(--color-confirm);
  color: #ffffff;
  box-shadow: none;
}
.btn-primary:hover {
  background: var(--color-confirm-hover);
  transform: translateY(-1px);
  box-shadow: none;
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-border);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.03);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--color-muted);
}
.btn-ghost:hover {
  background: var(--color-black-soft);
  color: var(--color-white);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,0.25);
}
.btn-danger:hover {
  background: var(--color-danger-hover);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--color-confirm);
  color: #ffffff;
}
.btn-success:hover {
  background: var(--color-confirm-hover);
}

.btn-block { width: 100%; }
.btn-icon-only { width: 2.75rem; height: 2.75rem; padding: 0; }
.btn-loading {
  position: relative;
  color: transparent !important;
}

/* ---------- Formulaires ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.field-full { grid-column: 1 / -1; }

.field label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-black-soft);
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input::placeholder { color: var(--color-muted-soft); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-glow);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.field-toggle {
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
}
.field-toggle label {
  margin-bottom: 0;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

.badge-new          { background: #dbeafe; color: #1e40af; }
.badge-waiting      { background: #fef3c7; color: #92400e; }
.badge-confirmed    { background: #d1fae5; color: #14532d; }
.badge-preparing    { background: #dbeafe; color: #1e40af; }
.badge-ready        { background: #bfdbfe; color: #1d4ed8; }
.badge-shipped      { background: #cffafe; color: #115e59; }
.badge-delivered    { background: #d1fae5; color: #14532d; }
.badge-cancelled    { background: #fee2e2; color: #991b1b; }
.badge-returned     { background: #f3e8ff; color: #6b21a8; }
.badge-neutral      { background: #334155; color: #cbd5e1; }

.badge-promo {
  background: var(--color-accent);
  color: #000;
}

.badge-stock {
  background: var(--color-success);
  color: #000;
}

.badge-out {
  background: var(--color-danger);
  color: #fff;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #000;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.card-body { padding: 1rem; }
.card-body-compact { padding: 0.75rem; }

.card-tag {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
  border: 2px solid #000;
}
.card-tag-stock   { background: var(--color-success); }
.card-tag-out     { background: var(--color-danger); }
.card-tag-promo   { background: var(--color-accent); color: #000; }

/* ---------- Alerts / Toasts ---------- */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-success { background: rgba(34,197,94,0.1); color: var(--color-success); border-color: rgba(34,197,94,0.25); }
.alert-error   { background: rgba(239,68,68,0.1); color: var(--color-danger); border-color: rgba(239,68,68,0.25); }
.alert-warning { background: rgba(251,146,60,0.1); color: var(--color-accent); border-color: rgba(251,146,60,0.25); }
.alert-info    { background: rgba(59,130,246,0.1); color: #3b82f6; border-color: rgba(59,130,246,0.25); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--color-black-soft);
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-soft);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--color-black-soft); }
.data-table td.num, .data-table th.num { text-align: right; }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-black-soft);
}
.empty-state h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}
.empty-state p { color: var(--color-muted); margin-bottom: 1.5rem; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.page-link {
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--color-card);
}
.page-link:hover { border-color: var(--color-accent); color: var(--color-accent); background: rgba(251,146,60,0.08); }

/* ---------- Loader / Skeleton ---------- */
.loader {
  width: 3rem; height: 3rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--color-black-soft) 25%, var(--color-border) 50%, var(--color-black-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 0.875rem; margin-bottom: 0.75rem; width: 90%; }
.skeleton-text.last { width: 60%; }
.skeleton-img { height: 12rem; border-radius: var(--radius-lg); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity var(--transition);
}
.modal-overlay.open { display: block; opacity: 1; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(92vw, 720px);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 101;
  display: none;
  opacity: 0;
  transition: all 0.3s ease;
}
.modal.open {
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}
.modal-close {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--color-white); }

.modal-body { padding: 1.5rem; }
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-black-soft);
}

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.font-semibold { font-weight: 700; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none !important; }
.block { display: block !important; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

/* ---------- Responsive utilities ---------- */
@media (max-width: 639px) {
  .hide-mobile { display: none !important; }
  .stack-mobile { flex-direction: column !important; }
  .w-full-mobile { width: 100% !important; }
}
@media (min-width: 640px) {
  .show-mobile { display: none !important; }
}
