/* ============================================================
   TRENOVA — main.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ── */
:root {
  --primary:       #7c3aed;
  --primary-dark:  #5b21b6;
  --primary-light: #a78bfa;
  --green:         #10b981;
  --green-dark:    #059669;
  --orange:        #f97316;
  --orange-dark:   #ea580c;
  --red:           #ef4444;
  --black:         #0a0a0f;
  --dark:          #111118;
  --dark2:         #1a1a24;
  --bg:            #0a0a0f;
  --bg-card:       #13131a;
  --bg-muted:      #1a1a24;
  --border:        #2a2a38;
  --text:          #f0f0f5;
  --text-muted:    #8888aa;
  --gray-300:      #d1d5db;
  --gray-400:      #9ca3af;
  --gray-500:      #6b7280;
  --gray-600:      #4b5563;
  --gray-700:      #374151;
  --gray-800:      #1f2937;
  --gray-900:      #111827;
  --white:         #f0f0f5;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Container ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Typographie ── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.2; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p  { color: var(--text-muted); line-height: 1.7; }
h1 span, h2 span { color: var(--primary-light); }

/* ── Boutons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline  { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); }
.btn-green    { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-orange   { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-orange:hover { background: var(--orange-dark); color: #fff; }
.btn-danger   { background: var(--red); color: #fff; border-color: var(--red); }
.btn-lg       { padding: .8rem 2rem; font-size: 1rem; border-radius: 12px; }
.btn-sm       { padding: .38rem .85rem; font-size: .8rem; border-radius: 8px; }
.btn-icon     { background: none; border: none; cursor: pointer; color: var(--text); font-size: 1.3rem; position: relative; display: inline-flex; align-items: center; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .28rem .85rem;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-primary { background: rgba(124,58,237,.18); color: var(--primary-light); border: 1px solid rgba(124,58,237,.35); }
.badge-accent  { background: rgba(167,139,250,.12); color: var(--primary-light); border: 1px solid rgba(167,139,250,.25); }
.badge-green   { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.badge-red     { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.badge-gray    { background: rgba(255,255,255,.07); color: var(--text-muted); border: 1px solid var(--border); }
.badge-yellow  { background: rgba(234,179,8,.15); color: #fbbf24; border: 1px solid rgba(234,179,8,.3); }
.badge-blue    { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.badge-purple  { background: rgba(168,85,247,.15); color: #c084fc; border: 1px solid rgba(168,85,247,.3); }
.badge-orange  { background: rgba(249,115,22,.15); color: #fb923c; border: 1px solid rgba(249,115,22,.3); }

/* ── Grilles ── */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .grid-3, .grid-4 { grid-template-columns: 1fr; } }
@media (max-width: 600px)  { .grid-2 { grid-template-columns: 1fr; } }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card-hover:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124,58,237,.15);
}

/* ── Sections ── */
.section { padding: 5rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { max-width: 560px; margin: .75rem auto 0; }
.section-header .badge { margin-bottom: .85rem; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.logo span { color: var(--primary-light); }

/* ── Navigation principale (unifié .main-nav + .header-nav) ── */
.main-nav,
.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.main-nav a,
.header-nav a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .9rem;
  transition: color .2s;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active,
.header-nav a:hover, .header-nav a.active {
  color: var(--text);
}

/* ── Actions header ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.cart-badge {
  position: absolute;
  top: -6px; right: -8px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: .65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  position: relative;
}
.cart-btn span {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: .65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: 6rem 0 5rem;
  overflow: hidden;
  background: var(--black);
}
.hero-glow {
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(124,58,237,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { margin-bottom: 1.25rem; }
.hero p   { font-size: 1.1rem; margin-bottom: 2rem; max-width: 520px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { color: var(--text-muted); }

/* ── Formulaires ── */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.form-label { font-size: .82rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-input, .form-select, .form-textarea {
  padding: .65rem .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--bg-card); }

/* ── Alertes ── */
.alert { padding: .85rem 1.1rem; border-radius: 10px; font-size: .88rem; font-weight: 600; margin-bottom: 1.1rem; }
.alert-success { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(16,185,129,.25); }
.alert-error   { background: rgba(239,68,68,.12);  color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.alert-info    { background: rgba(59,130,246,.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,.25); }
.alert-warning { background: rgba(234,179,8,.12);   color: #fbbf24; border: 1px solid rgba(234,179,8,.25); }

/* ── Tables ── */
.table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: .75rem 1rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--bg-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: .85rem 1rem; font-size: .88rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-muted); }

/* ── Pagination ── */
.pagination { display: flex; gap: .4rem; justify-content: center; padding: 2rem 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 9px; font-size: .88rem; font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text); background: var(--bg-card);
  text-decoration: none; transition: all .15s;
}
.pagination a:hover     { border-color: var(--primary); color: var(--primary-light); }
.pagination span.active,
.pagination .pg-active  { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Notif toast ── */
.notif {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--primary); color: #fff;
  padding: .8rem 1.3rem; border-radius: 10px;
  font-weight: 700; font-size: .88rem;
  z-index: 9999; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Footer ── */
.site-footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand .logo { font-size: 1.3rem; margin-bottom: .75rem; display: inline-block; }
.footer-brand p     { font-size: .88rem; color: var(--text-muted); max-width: 260px; }
.footer-col h4      { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.footer-col ul li   { margin-bottom: .55rem; }
.footer-col ul li a { color: var(--text-muted); font-size: .88rem; transition: color .2s; }
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: .5rem;
}
@media (max-width: 900px)  { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px)  { .footer-grid { grid-template-columns: 1fr; } .footer-bottom { flex-direction: column; text-align: center; } }

/* ── Page compte / auth ── */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--black);
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}
.auth-card h1 { font-size: 1.75rem; margin-bottom: .4rem; }
.auth-card p  { margin-bottom: 1.75rem; }

/* ── Dashboard compte ── */
.dashboard-wrap { padding: 2.5rem 0; }
.dashboard-grid { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
.dashboard-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: sticky;
  top: 80px;
}
.dash-nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1.2rem; font-size: .88rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.dash-nav-item:last-child { border-bottom: none; }
.dash-nav-item:hover, .dash-nav-item.active { background: var(--bg-muted); color: var(--text); }
.dash-nav-item.active { color: var(--primary-light); }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } .dashboard-sidebar { position: static; } }

/* ── Produit card ── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(0,0,0,.25);
  border-color: var(--primary);
}
.product-img {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-muted);
  position: relative;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .product-img img { transform: scale(1.05); }
.product-info { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.product-brand { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; }
.product-name  { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.product-price { margin-top: auto; padding-top: .5rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.product-badge { position: absolute; top: .6rem; left: .6rem; z-index: 5; }
.old   { font-size: .85rem; text-decoration: line-through; color: var(--text-muted); }

/* ── Bouton ajouter au panier (catalogue) ── */
.btn-add-cart {
  width: 100%;
  padding: .45rem;
  font-size: .82rem;
  background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.25);
  color: var(--primary-light);
  border-radius: 7px;
  cursor: pointer;
  transition: .2s;
  font-weight: 600;
  margin-top: .5rem;
}
.btn-add-cart:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Wishlist btn (catalogue) ── */
.wishlist-btn {
  position: absolute;
  top: .5rem; right: .5rem;
  background: rgba(10,10,15,.75);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: .2s;
  z-index: 5;
}
.wishlist-btn:hover { background: rgba(239,68,68,.3); border-color: #ef4444; }

/* ── Panier ── */
.cart-wrap  { padding: 2.5rem 0; }
.cart-grid  { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.cart-item  { display: flex; gap: 1.25rem; padding: 1.25rem; border-bottom: 1px solid var(--border); align-items: flex-start; }
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 90px; height: 90px; border-radius: 10px; object-fit: cover; background: var(--bg-muted); flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 700; margin-bottom: .3rem; }
.cart-item-meta { font-size: .82rem; color: var(--text-muted); }
.cart-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  position: sticky;
  top: 80px;
}
.cart-summary h3 { margin-bottom: 1.25rem; }
.summary-line { display: flex; justify-content: space-between; margin-bottom: .7rem; font-size: .9rem; }
.summary-line.total { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: .7rem; margin-top: .7rem; }
@media (max-width: 900px) { .cart-grid { grid-template-columns: 1fr; } .cart-summary { position: static; } }

/* ── Admin ── */
.admin-wrap   { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .logo { padding: .5rem 1.25rem 1.25rem; display: block; }
.admin-nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1.25rem;
  color: var(--text-muted); font-size: .88rem; font-weight: 600;
  text-decoration: none; transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.admin-nav-item:hover { background: var(--bg-muted); color: var(--text); }
.admin-nav-item.active { background: rgba(124,58,237,.1); color: var(--primary-light); border-left-color: var(--primary); }
.admin-nav-sep { height: 1px; background: var(--border); margin: .5rem 1rem; }
.admin-main  { flex: 1; padding: 2rem; overflow-x: hidden; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem; }
.admin-title  { font-size: 1.5rem; font-weight: 800; }
.stats-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card    { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.25rem; }
.stat-number  { font-size: 2rem; font-weight: 800; color: var(--primary-light); }
.stat-label   { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Responsive global ── */
@media (max-width: 1100px) {
  .main-nav a, .header-nav a { font-size: .82rem; }
  .main-nav, .header-nav { gap: 1.25rem; }
}
@media (max-width: 900px) {
  .main-nav, .header-nav { gap: 1rem; }
  .main-nav a, .header-nav a { font-size: .78rem; }
}
@media (max-width: 768px) {
  .main-nav, .header-nav { display: none; }
  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3rem 0; }
  .admin-sidebar { display: none; }
  .admin-main { padding: 1rem; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn-lg { width: 100%; justify-content: center; }
  .auth-card { padding: 1.5rem; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Utilitaires ── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-primary{ color: var(--primary-light); }
.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }.mb-2 { margin-bottom: 1rem; }.mb-3 { margin-bottom: 1.5rem; }
.p-1  { padding: .5rem; }      .p-2  { padding: 1rem; }      .p-3  { padding: 1.5rem; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.w-full { width: 100%; }
.hidden { display: none; }
.rounded { border-radius: 10px; }
.shadow  { box-shadow: 0 4px 20px rgba(0,0,0,.3); }
