/* ============================================================
   BRICKENCY — home.css
   Styles de la page d'accueil — portés depuis pages/home-v2.html
   (bloc <style> inline du design). Chargé uniquement sur la front page.
   ============================================================ */

.section { max-width: 1440px; margin: 0 auto; padding: 0 32px; }

/* ===== TICKER ===== */
.ticker {
  background: var(--bg-darker); color: #fff;
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .06em;
}
.ticker-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 32px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 32px;
  height: 36px; align-items: center;
}
.ticker-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-onDark-3);
}
.ticker-label .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .35; }
}
.ticker-items { display: flex; gap: 22px; overflow: hidden; }
.ticker-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ticker-item .lbl { color: var(--ink-onDark-3); }
.ticker-item .val { color: #fff; font-weight: 500; }
.ticker-item .cname { color: var(--ink-onDark-2); text-transform: uppercase; }
.ticker-sw { width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(255,255,255,.28); flex: none; }
.ticker-item .delta-up { color: #4ED27A; }
.ticker-item .delta-dn { color: #E86464; }

/* ===== HERO BAR ===== */
.hero {
  background: var(--bg);
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  max-width: 1440px; margin: 0 auto; padding: 0 32px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 44px; align-items: center;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(46px, 4.4vw, 68px); line-height: .95; letter-spacing: -.02em;
  max-width: none;
}
.hero h1 .or { color: var(--orange); }
.hero h1 .bl { color: var(--blue); }
.hero h1 small {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-mute);
  font-weight: 400;
  margin-bottom: 16px;
}
.hero-stockline {
  margin-top: 36px;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  background: var(--surface-dark);
  border-radius: var(--r-sm);
  color: #fff;
}
.hero-stockline .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange);
  animation: pulse 1.6s infinite;
}
.hero-stockline b {
  font-family: var(--font-display); font-weight: 900;
  font-size: 28px; letter-spacing: -.005em;
  color: var(--orange);
}
.hero-stockline span {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-onDark-2);
}
.hero-meta {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 32px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-2);
}
.hero-meta .k { color: var(--ink-mute); }
.hero-meta b { font-weight: 500; }
.hero-meta .row { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px dashed var(--line-2); }

/* ===== MEGA SEARCH ===== */
.megasearch {
  margin: 0;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(26,26,30,.05);
}
.megasearch-head {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--line);
}
.megasearch-tab {
  padding: 14px 22px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2);
  border-right: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.megasearch-tab.is-on { background: var(--surface-dark); color: #fff; }
.megasearch-tab.is-on .kbd { background: var(--bg-darker); color: #fff; border-color: var(--line-dark); }
.megasearch-tab .kbd {
  font-size: 9px; padding: 2px 6px; background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--r-xs);
  color: var(--ink-3);
}
.megasearch-tab .count { color: var(--orange-2); font-weight: 600; }

.megasearch-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}
.megasearch-input {
  display: flex; align-items: center; gap: 14px;
  height: 64px;
}
.megasearch-input input {
  flex: 1; height: 100%;
  font-family: var(--font-display);
  font-weight: 700; font-size: 28px;
  border: 0; outline: none; background: transparent;
  color: var(--ink);
}
.megasearch-input input::placeholder { color: var(--ink-faint); font-weight: 700; }
.megasearch-input .icon { color: var(--ink-mute); }
.megasearch-btn { display: flex; gap: 8px; }
.megasearch-btn .btn { width: 100%; justify-content: center; }
.megasearch-foot {
  padding: 12px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--ink-mute); text-transform: uppercase;
}
.recent {
  display: flex; align-items: center; gap: 14px;
}
.recent a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.recent a:hover { color: var(--orange); border-color: var(--orange); }

/* ===== Category mega-grid ===== */
.megagrid-band {
  padding: 56px 0 80px;
  border-bottom: 1px solid var(--line);
}
.megagrid-head {
  display: flex; align-items: end; justify-content: space-between;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.megagrid-head h2 {
  font-family: var(--font-display); font-weight: 800; font-size: 32px;
  letter-spacing: -.005em;
}
.megagrid-head .filter-pills { display: flex; gap: 6px; }
.megagrid-head .filter-pills .chip { cursor: pointer; }
.megagrid-head .filter-pills .chip.is-on { background: var(--surface-dark); color: #fff; border-color: var(--surface-dark); }

.megagrid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.megacat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  min-height: 280px;
  position: relative;
  transition: border-color .15s, transform .15s;
}
.megacat:hover { border-color: var(--surface-dark); transform: translateY(-2px); }
.megacat .mc-id {
  display: flex; justify-content: space-between; align-items: start;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--ink-mute); text-transform: uppercase;
}
.megacat .mc-id .ref { color: var(--ink-3); }
.megacat .mc-art {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 0;
  min-height: 136px; /* CLS : réserver la zone photo (120 px + padding) → la tuile ne grandit pas au chargement de l'image */
}
.megacat .mc-name {
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  letter-spacing: -.005em;
}
.megacat .mc-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.megacat .mc-count { color: var(--ink-2); font-weight: 500; }
.megacat .mc-stock { display: flex; align-items: center; gap: 6px; color: var(--ink-mute); }
.megacat .mc-stock .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ED27A; }
.megacat .mc-stock.low .dot { background: #E8B40A; }
.megacat .mc-stock.out .dot { background: #E86464; }

/* ===== Live inventory table ===== */
.inv-band { padding: 56px 0 80px; background: var(--bg); border-bottom: 1px solid var(--line); }
.inv-head {
  display: flex; align-items: end; justify-content: space-between;
  padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 0;
}
.inv-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -.005em; }
.inv-head .key {
  display: flex; align-items: center; gap: 18px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-mute);
}
.inv-head .key .k-item { display: inline-flex; align-items: center; gap: 6px; }
.inv-head .key .dot { width: 8px; height: 8px; border-radius: 50%; }

.inv-table {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  font-family: var(--font-mono); font-size: 12px;
}
.inv-row {
  display: grid;
  grid-template-columns: 60px 56px 110px 1fr 110px 100px 110px 100px 120px;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 64px;
  border-bottom: 1px solid var(--line);
}
.inv-row:last-child { border-bottom: 0; }
.inv-row.head {
  height: 40px;
  background: var(--bg-elev);
  font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.inv-row .art { display: flex; align-items: center; justify-content: center; }
.inv-row .art .px { width: 48px; height: 48px; background: var(--bg); border-radius: var(--r-sm); display:flex; align-items:center; justify-content:center; }
.inv-row .ref { font-weight: 500; }
.inv-row .cat { color: var(--ink-mute); letter-spacing: .14em; text-transform: uppercase; font-size: 10px; }
.inv-row .name { font-family: var(--font-sans); font-size: 14px; color: var(--ink); font-weight: 500; }
.inv-row .name small { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); margin-top: 2px; letter-spacing: .1em; text-transform: uppercase;}
.inv-row .color { display: inline-flex; align-items: center; gap: 8px; }
.inv-row .color .sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); box-shadow: inset 0 -3px 6px rgba(0,0,0,.2); }
.inv-row .stock { display: flex; align-items: center; gap: 8px; }
.inv-row .stock .dot { width: 6px; height: 6px; border-radius: 50%; }
.inv-row .stock.high .dot { background: #4ED27A; }
.inv-row .stock.mid .dot { background: #E8B40A; }
.inv-row .stock.low .dot { background: #E86464; }
.inv-row .price b { font-weight: 600; color: var(--ink); }
.inv-row .delta-up { color: #2E8B47; }
.inv-row .delta-dn { color: #C0271C; }
.inv-row .add { display: flex; gap: 8px; align-items: center; }
.inv-row .qty {
  width: 56px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  font-weight: 500;
}
.inv-row .qty.up { background: var(--orange); color: #fff; border-color: var(--orange); }
.inv-row.head .qty { background: transparent; border: 0; color: var(--ink-mute); }

/* ===== 3-col cards ===== */
.tri-band { padding: 80px 0; }
.tri {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.tri-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 240px;
  position: relative; overflow: hidden;
}
.tri-card.dark { background: var(--surface-dark); color: #fff; border-color: var(--surface-dark); }
.tri-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.1; max-width: 18ch; }
.tri-card p { color: var(--ink-2); line-height: 1.5; }
.tri-card.dark p { color: var(--ink-onDark-2); }
.tri-card .tri-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-mute); display: flex; align-items: center; gap: 10px; }
.tri-card .tri-tag::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.tri-card.dark .tri-tag { color: var(--orange-2); }
.tri-card .tri-art { position: absolute; right: -10px; bottom: -10px; opacity: .12; pointer-events: none; }
.tri-card .tri-foot { margin-top: auto; padding-top: 12px; }
