/* ==========================================================================
   AJA FOURNITURES — Design system (site vitrine statique B2B)
   Palette source : logo (bleu #75a7cc, gris #828282)
   Design read : e-commerce B2B (EPI / vêtements de travail) pour acheteurs
   professionnels, langage sobre et orienté confiance, densité "daily app".
   ========================================================================== */

:root {
  /* Palette dérivée du bleu logo #75a7cc (même teinte, paliers de luminosité) */
  --brand-950: #0d1f2b;
  --brand-900: #1c374a;
  --brand-800: #244761;
  --brand-700: #2f5d7f;
  --brand-600: #3d78a4;
  --brand-500: #5794c1;
  --brand-400: #75a7cc; /* couleur exacte du logo */
  --brand-200: #a2c4dd;
  --brand-100: #e5eef5;
  --brand-50: #f4f8fb;

  /* Gris logo (wordmark) + échelle neutre */
  --gray-900: #1f2225;
  --gray-700: #3d4247;
  --gray-600: #565c62;
  --gray-500: #828282; /* couleur exacte du logo */
  --gray-300: #c7cbce;
  --gray-200: #dfe2e4;
  --gray-100: #eef0f1;
  --gray-50: #f7f8f9;

  --success: #2f7d4f;
  --warning: #a86a1f;
  --danger: #b3413a;

  --font-sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(13, 31, 43, 0.06), 0 1px 1px rgba(13, 31, 43, 0.04);
  --shadow-md: 0 6px 16px rgba(13, 31, 43, 0.10);
  --shadow-lg: 0 16px 40px rgba(13, 31, 43, 0.14);

  --container: 1280px;
  --nav-height: 72px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Typography ---------- */
h1, .h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--brand-900); }
h2, .h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; color: var(--brand-900); }
h3, .h3 { font-size: 1.15rem; font-weight: 700; color: var(--brand-900); }
.lede { font-size: 1.05rem; color: var(--gray-700); max-width: 60ch; }
.text-muted { color: var(--gray-600); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-md); font-weight: 700; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-800); }
.btn-secondary { background: #fff; color: var(--brand-800); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--brand-50); border-color: var(--brand-300); }
.btn-ghost { background: transparent; color: var(--brand-800); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 0.85rem; font-weight: 700; color: var(--gray-900); }
.field .hint { font-size: 0.78rem; color: var(--gray-600); }
.field .error { font-size: 0.78rem; color: var(--danger); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 0.95rem; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300); background: #fff; color: var(--gray-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--gray-500); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm);
}

/* ---------- Header / Nav ---------- */
.top-strip {
  background: var(--brand-950); color: #fff; font-size: 0.8rem;
}
.top-strip .container { display: flex; align-items: center; justify-content: space-between; height: 36px; gap: 16px; }
.top-strip a { color: var(--brand-200); }
.top-strip a:hover { color: #fff; }

.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--brand-900);
  box-shadow: var(--shadow-md);
}
.site-header .container {
  display: flex; align-items: center; gap: 24px; height: var(--nav-height);
}
.brand-logo { flex-shrink: 0; display: flex; align-items: center; }
.brand-logo img { height: 52px; width: auto; }

.nav-search { flex: 1; min-width: 0; }
.nav-search form { display: flex; }
.nav-search input {
  flex: 1; min-width: 0; padding: 11px 16px; border-radius: var(--radius-md) 0 0 var(--radius-md);
  border: none; font-size: 0.92rem;
}
.nav-search input:focus { outline: 2px solid var(--brand-400); outline-offset: -2px; }
.nav-search button {
  background: var(--brand-600); color: #fff; border: none; padding: 0 18px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0; cursor: pointer;
}
.nav-search button:hover { background: var(--brand-500); }

.nav-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.nav-actions a { color: #fff; font-size: 0.8rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nav-actions a:hover { color: var(--brand-200); }
.nav-actions .icon { font-size: 1.25rem; }
.cart-badge {
  position: relative;
}
.cart-badge .count {
  position: absolute; top: -6px; right: -10px; background: var(--brand-400); color: var(--brand-950);
  font-size: 0.65rem; font-weight: 800; min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.nav-categories { background: #fff; border-bottom: 1px solid var(--gray-200); }
.nav-categories ul { display: flex; gap: 4px; height: 46px; align-items: center; overflow-x: auto; }
.nav-categories a {
  padding: 8px 14px; font-size: 0.85rem; font-weight: 700; color: var(--gray-700); border-radius: var(--radius-sm);
  white-space: nowrap;
}
.nav-categories a:hover { background: var(--brand-50); color: var(--brand-800); }

.mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }

@media (max-width: 860px) {
  .nav-search { order: 3; flex-basis: 100%; margin-top: 10px; }
  .site-header .container { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; }
  .nav-categories { display: none; }
  .mobile-menu-btn { display: block; }
}

/* ---------- Trust strip ---------- */
.trust-strip { background: var(--brand-50); border-bottom: 1px solid var(--gray-200); }
.trust-strip ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 18px 0; }
.trust-strip li { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--brand-900); font-weight: 700; }
.trust-strip .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--brand-400); flex-shrink: 0; }
@media (max-width: 860px) { .trust-strip ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .trust-strip ul { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero { background: var(--brand-900); color: #fff; padding: 56px 0 64px; }
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; }
.hero p.lede { color: var(--brand-100); }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-figure { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } .hero-figure { order: -1; } }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head .lede { margin-top: 6px; }

/* ---------- Category / product grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.category-tile {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4/3;
  background: var(--brand-100); display: flex; align-items: flex-end; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.category-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.category-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.category-tile .label {
  position: relative; z-index: 1; width: 100%; padding: 16px; font-weight: 800; color: #fff;
  background: linear-gradient(0deg, rgba(13,31,43,0.75), rgba(13,31,43,0));
}

.product-card {
  border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; background: #fff;
  display: flex; flex-direction: column; transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card .thumb { aspect-ratio: 1/1; background: var(--gray-50); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .ref { font-size: 0.72rem; color: var(--gray-500); font-family: var(--font-mono); }
.product-card .name { font-weight: 700; font-size: 0.95rem; color: var(--gray-900); }
.product-card .price { margin-top: auto; display: flex; align-items: baseline; gap: 6px; }
.product-card .price .amount { font-weight: 800; color: var(--brand-800); font-size: 1.1rem; }
.product-card .price .unit { font-size: 0.75rem; color: var(--gray-500); }
.product-card .tier-hint { font-size: 0.72rem; color: var(--success); font-weight: 700; }

/* ---------- Skeleton loading ---------- */
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%); background-size: 400% 100%; animation: skeleton-wave 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-wave { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Empty / error states ---------- */
.empty-state, .error-state { text-align: center; padding: 56px 24px; color: var(--gray-600); }
.empty-state .icon, .error-state .icon { font-size: 2.2rem; margin-bottom: 12px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.badge-brand { background: var(--brand-100); color: var(--brand-800); }
.badge-success { background: #e4f2e8; color: var(--success); }
.badge-warning { background: #f7ecd9; color: var(--warning); }
.badge-danger { background: #f7e4e2; color: var(--danger); }
.badge-neutral { background: var(--gray-100); color: var(--gray-700); }

/* ---------- Testimonials / logos ---------- */
.logo-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding: 8px 0; opacity: 0.85; }
.logo-row img { height: 34px; width: auto; filter: grayscale(1); opacity: 0.75; }

/* ---------- Footer ---------- */
.site-footer { background: var(--gray-50); border-top: 1px solid var(--gray-200); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px; padding: 48px 0 32px; }
.footer-grid h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand-800); margin-bottom: 14px; }
.footer-grid ul { display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { font-size: 0.88rem; color: var(--gray-700); }
.footer-grid a:hover { color: var(--brand-700); }
.footer-bottom { border-top: 1px solid var(--gray-200); padding: 18px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--gray-600); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.82rem; color: var(--gray-600); padding: 16px 0; }
.breadcrumb a:hover { color: var(--brand-700); }
.breadcrumb .sep { margin: 0 6px; color: var(--gray-300); }

/* ---------- Tables (orders, invoices) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th { text-align: left; background: var(--gray-50); padding: 12px 16px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gray-600); }
table.data td { padding: 14px 16px; border-top: 1px solid var(--gray-200); }

/* ---------- Account layout ---------- */
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.account-nav { display: flex; flex-direction: column; gap: 4px; }
.account-nav a { padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem; color: var(--gray-700); }
.account-nav a:hover { background: var(--brand-50); color: var(--brand-800); }
.account-nav a.active { background: var(--brand-100); color: var(--brand-900); }
@media (max-width: 780px) { .account-layout { grid-template-columns: 1fr; } }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 460px; margin: 48px auto; }
.auth-wrap .card { padding: 32px; }
.auth-toggle { display: flex; gap: 8px; background: var(--gray-100); padding: 4px; border-radius: var(--radius-md); margin-bottom: 24px; }
.auth-toggle button { flex: 1; padding: 10px; border: none; background: transparent; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; color: var(--gray-600); }
.auth-toggle button.active { background: #fff; color: var(--brand-800); box-shadow: var(--shadow-sm); }

/* ---------- Utility spacing ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: 16px; }
