/* =========================================================
   Store SPS — Design System
   ========================================================= */

:root {
  --blue:       #3b82f6;
  --blue-dark:  #1d4ed8;
  --blue-dim:   #1e3a8a;
  --bg:         #060a12;
  --surface:    #0d1424;
  --glass:      rgba(255,255,255,.055);
  --glass-h:    rgba(255,255,255,.09);
  --border:     rgba(255,255,255,.11);
  --text:       #e8edf7;
  --muted:      #8896b0;
  --radius:     .8rem;
  --radius-sm:  .45rem;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: .9375rem;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  margin: 0;
}

/* Fond ambiant */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 50% at 50% -5%, rgba(29,78,216,.38) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 90%, rgba(59,130,246,.12) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ═══════════════════════════════
   NAVBAR — pure CSS, toujours horizontale
   ═══════════════════════════════ */

.store-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: .25rem;
  background: rgba(6,10,18,.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
  white-space: nowrap;
  margin-right: .75rem;
  flex-shrink: 0;
}
.nav-brand strong { color: var(--blue); }
.brand-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--blue-dim), var(--blue));
  border-radius: .4rem;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: #fff;
  flex-shrink: 0;
}

/* Groupe liens centraux */
.nav-links {
  display: flex;
  align-items: center;
  gap: .125rem;
  flex: 1;
}

/* Groupe droit */
.nav-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* Lien de nav */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  font-size: .8375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, background .12s;
  line-height: 1;
}
.nav-link:hover { color: var(--text); background: var(--glass-h); }
.nav-link i { font-size: .8rem; }

/* Dropdown CSS pur */
.nav-drop { position: relative; }

.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: #0e1828;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .3rem;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  z-index: 300;
}
.nav-drop-menu.nav-drop-end { left: auto; right: 0; }

.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu { display: flex; flex-direction: column; }

.nav-drop-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .42rem .7rem;
  font-size: .835rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: .35rem;
  transition: background .1s, color .1s;
  white-space: nowrap;
}
.nav-drop-item:hover { background: var(--glass-h); color: var(--text); }
.nav-drop-danger { color: #f87171; }
.nav-drop-danger:hover { background: rgba(248,113,113,.1); color: #fca5a5; }

.nav-drop-sep { height: 1px; background: var(--border); margin: .3rem 0; }
.nav-drop-label { padding: .3rem .7rem; font-size: .72rem; color: var(--muted); }

/* Avatar utilisateur */
.nav-avatar {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--blue-dim), var(--blue));
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.nav-username { font-size: .8375rem; font-weight: 500; }
.nav-drop-toggle { display: inline-flex; align-items: center; gap: .4rem; }

/* ═══════════════════════════════
   FLASH ALERTS
   ═══════════════════════════════ */

.sps-alert {
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: .5rem;
  border: 1px solid;
}
.sps-alert-danger  { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25);  color: #fca5a5; }
.sps-alert-success { background: rgba(34,197,94,.1);  border-color: rgba(34,197,94,.25);  color: #86efac; }
.sps-alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); color: #fcd34d; }
.sps-alert-info    { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.25); color: #93c5fd; }

/* ═══════════════════════════════
   BOUTON PRINCIPAL
   ═══════════════════════════════ */

.btn-accent {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border: 1px solid rgba(59,130,246,.35);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  box-shadow: 0 3px 12px rgba(59,130,246,.28);
  transition: all .18s;
  border-radius: var(--radius-sm);
  padding: .45rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-accent:hover {
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  color: #fff;
  box-shadow: 0 5px 18px rgba(59,130,246,.42);
  transform: translateY(-1px);
}
.btn-accent:active { transform: translateY(0); }
.text-accent { color: var(--blue) !important; }

/* ═══════════════════════════════
   PAGE HEADER
   ═══════════════════════════════ */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.page-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.025em;
  margin: 0 0 .15rem;
  color: var(--text);
}
.page-header p { color: var(--muted); font-size: .85rem; margin: 0; }

/* ═══════════════════════════════
   GRILLE PRODUITS — CSS Grid compact
   ═══════════════════════════════ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}

.pti-card {
  background: rgba(13,20,36,.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  text-decoration: none;
  color: inherit;
}
.pti-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59,130,246,.45);
  box-shadow: 0 10px 28px rgba(59,130,246,.16), 0 3px 10px rgba(0,0,0,.4);
}
.pti-card-img {
  background: rgba(255,255,255,.035);
  border-bottom: 1px solid var(--border);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pti-card-img img {
  max-height: 120px;
  max-width: 85%;
  object-fit: contain;
  transition: transform .22s;
}
.pti-card:hover .pti-card-img img { transform: scale(1.05); }

.pti-card-body {
  padding: .75rem;
  flex: 1;
}
.pti-card-name {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .25rem;
  line-height: 1.3;
}
.pti-card-desc {
  font-size: .775rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}
.pti-card-footer {
  padding: .6rem .75rem;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════
   SECTIONS DE FORMULAIRE
   ═══════════════════════════════ */

.store-section {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-num {
  width: 19px; height: 19px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* PTI select cards (formulaire commande) */
#pti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .75rem;
}
.pti-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .4rem;
  padding: .7rem .4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
  font-size: .775rem;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
  width: 100%;
}
.pti-select-card:hover { border-color: rgba(59,130,246,.4); background: var(--glass-h); color: var(--text); }
.pti-select-card.selected {
  border-color: var(--blue);
  background: rgba(59,130,246,.1);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
  color: var(--text);
}
.pti-select-card img { width: 56px; height: 56px; object-fit: contain; }

/* Accessoire */
.acc-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.acc-name { flex: 1; font-size: .85rem; font-weight: 500; }
.acc-qty  { width: 70px; text-align: center; }

/* ═══════════════════════════════
   FORMULAIRES
   ═══════════════════════════════ */

.field-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .3rem;
  display: block;
}
.form-control, .form-select, .input-group-text {
  background: rgba(255,255,255,.04) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  font-size: .875rem;
  border-radius: var(--radius-sm) !important;
}
.form-control:focus, .form-select:focus {
  background: rgba(59,130,246,.06) !important;
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.16) !important;
  color: var(--text) !important;
}
.form-control::placeholder { color: rgba(136,150,176,.35); }
.input-group-text { color: var(--muted) !important; }
.form-select option { background: #0e1828; color: var(--text); }
.form-check-input { background-color: rgba(255,255,255,.06); border-color: var(--border); }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }

/* ═══════════════════════════════
   TABLEAUX
   ═══════════════════════════════ */

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(59,130,246,.05);
  --bs-table-border-color: var(--border);
  color: var(--text);
  font-size: .8375rem;
  margin-bottom: 0;
}
.table thead th {
  font-size: .67rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: .6rem .5rem;
  background: transparent;
}
.table tbody td {
  border-color: var(--border);
  vertical-align: middle;
  padding: .65rem .5rem;
}
.table-wrapper {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ═══════════════════════════════
   STAT CARDS
   ═══════════════════════════════ */

.stat-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  transition: border-color .15s;
}
.stat-card:hover { border-color: rgba(59,130,246,.3); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: .65rem;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat-label { font-size: .73rem; color: var(--muted); margin-top: .15rem; }

/* ═══════════════════════════════
   BADGES
   ═══════════════════════════════ */

.badge { font-weight: 600; font-size: .67rem; padding: .28em .55em; border-radius: .3rem; letter-spacing: .02em; }

/* ═══════════════════════════════
   BREADCRUMB
   ═══════════════════════════════ */

.breadcrumb { background: transparent; margin: 0; font-size: .8rem; }
.breadcrumb-item a { color: var(--blue); text-decoration: none; }
.breadcrumb-item.active { color: var(--muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--muted); }

/* ═══════════════════════════════
   PAGE DE LOGIN
   ═══════════════════════════════ */

.login-page {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(29,78,216,.35) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 90% 100%, rgba(59,130,246,.12) 0%, transparent 55%);
}
.login-card {
  background: rgba(10,16,30,.9);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--blue-dim), var(--blue));
  border-radius: .9rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  box-shadow: 0 6px 20px rgba(59,130,246,.38);
}
.login-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.025em; }
.login-subtitle { color: var(--muted); font-size: .85rem; }

/* ═══════════════════════════════
   FOOTER
   ═══════════════════════════════ */

.store-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}

/* ═══════════════════════════════
   EMPTY STATE
   ═══════════════════════════════ */

.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.2rem; opacity: .35; display: block; margin-bottom: .9rem; }

/* ═══════════════════════════════
   UTILITAIRES
   ═══════════════════════════════ */

a { color: inherit; }
.font-monospace { font-family: 'SF Mono', ui-monospace, monospace; letter-spacing: .02em; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* Bootstrap card reset */
.card { background: transparent; border: none; }

/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */

@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
  .store-section { padding: 1rem; }
  .stat-card { padding: 1rem; }
  .nav-username { display: none; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
