/* ==========================================================================
   TPM — Tout Pour la Moto
   Système visuel « route » : béton clair / bitume, jaune signalisation,
   typographie condensée façon panneaux routiers. Clair et sombre à la volée.
   ========================================================================== */

/* ---------- Polices (embarquées, disponibles hors ligne) ---------- */
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../vendor/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url("../vendor/fonts/barlow-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("../vendor/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }

/* ---------- Jetons ---------- */
:root, [data-bs-theme="light"] {
  --tpm-bg: #E6E8EB;          /* béton */
  --tpm-surface: #FFFFFF;
  --tpm-surface-2: #F1F3F5;
  --tpm-ink: #1C1F24;         /* bitume */
  --tpm-muted: #5D646E;
  --tpm-line: #D3D8DE;
  --tpm-yellow: #FFC21A;      /* jaune signalisation */
  --tpm-yellow-deep: #E5A800;
  --tpm-on-yellow: #1C1F24;
  --tpm-red: #D33A2C;         /* feu stop */
  --tpm-green: #1E8F50;
  --tpm-asphalt: #1C1F24;     /* le bitume reste du bitume dans les deux thèmes */
  --tpm-asphalt-2: #262A30;
  --tpm-shadow: 0 1px 2px rgba(28, 31, 36, .06), 0 8px 24px -12px rgba(28, 31, 36, .18);
  --tpm-radius-lg: 22px;
  --tpm-radius: 16px;
  --tpm-radius-sm: 10px;
  --tpm-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --tpm-text: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tpm-bottomnav-h: 64px;

  --bs-body-bg: var(--tpm-bg);
  --bs-body-color: var(--tpm-ink);
  --bs-border-color: var(--tpm-line);
  --bs-secondary-color: var(--tpm-muted);
  --bs-tertiary-bg: var(--tpm-surface-2);
  --bs-link-color-rgb: 28, 31, 36;
  --bs-link-hover-color-rgb: 0, 0, 0;
  --bs-body-font-family: var(--tpm-text);
  --bs-focus-ring-color: rgba(255, 194, 26, .45);
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --tpm-bg: #15171A;
  --tpm-surface: #1F2226;
  --tpm-surface-2: #292D32;
  --tpm-ink: #ECEEF1;
  --tpm-muted: #9CA3AD;
  --tpm-line: #343940;
  --tpm-red: #F0614F;
  --tpm-green: #3FBF78;
  --tpm-asphalt: #24282E;
  --tpm-asphalt-2: #2C3137;
  --tpm-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);

  --bs-body-bg: var(--tpm-bg);
  --bs-body-color: var(--tpm-ink);
  --bs-border-color: var(--tpm-line);
  --bs-secondary-color: var(--tpm-muted);
  --bs-tertiary-bg: var(--tpm-surface-2);
  --bs-link-color-rgb: 236, 238, 241;
  --bs-link-hover-color-rgb: 255, 255, 255;
  color-scheme: dark;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--tpm-text);
  font-size: 1rem;
  line-height: 1.55;
  background: var(--tpm-bg);
  color: var(--tpm-ink);
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4, .display-font {
  font-family: var(--tpm-display);
  font-weight: 700;
  letter-spacing: .005em;
  line-height: 1.05;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.05rem); }
h2 { font-size: clamp(1.55rem, 1.25rem + 1.2vw, 1.95rem); }
h3 { font-size: 1.25rem; }
a { color: inherit; text-underline-offset: 3px; }
.text-muted, .text-body-secondary { color: var(--tpm-muted) !important; }
::selection { background: var(--tpm-yellow); color: var(--tpm-on-yellow); }
:focus-visible { outline: 3px solid var(--tpm-yellow); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }
.measure { max-width: 62ch; }

/* ---------- Boutons ---------- */
.btn { font-weight: 600; border-radius: 999px; padding: .62rem 1.25rem; transition: transform .12s ease, background-color .15s ease, color .15s ease; }
.btn:active { transform: scale(.97); }
.btn-sm { padding: .38rem .9rem; font-size: .875rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.05rem; }
.btn-go {               /* action principale : jaune signalisation */
  background: var(--tpm-yellow); color: var(--tpm-on-yellow); border: 0;
}
.btn-go:hover, .btn-go:focus-visible { background: var(--tpm-yellow-deep); color: var(--tpm-on-yellow); }
.btn-ink {              /* contraste fort, s'inverse avec le thème */
  background: var(--tpm-ink); color: var(--tpm-surface); border: 0;
}
.btn-ink:hover, .btn-ink:focus-visible { background: var(--tpm-ink); color: var(--tpm-surface); opacity: .88; }
.btn-ghost { background: transparent; border: 1.5px solid var(--tpm-line); color: var(--tpm-ink); }
.btn-ghost:hover { border-color: var(--tpm-ink); color: var(--tpm-ink); background: transparent; }
.btn-wa { background: #1FAF54; color: #fff; border: 0; }
.btn-wa:hover, .btn-wa:focus-visible { background: #178F44; color: #fff; }
.btn-icon {
  width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center;
  border-radius: 50%; border: 0; background: var(--tpm-surface); color: var(--tpm-ink);
  position: relative;
}
.btn-icon:hover { background: var(--tpm-surface-2); color: var(--tpm-ink); }
.btn-icon .bi { font-size: 1.15rem; }
.btn:disabled, .btn.disabled { opacity: .45; }

/* ---------- Formulaires ---------- */
.form-control, .form-select {
  background-color: var(--tpm-surface); border: 1.5px solid var(--tpm-line);
  border-radius: var(--tpm-radius-sm); color: var(--tpm-ink); padding: .62rem .85rem;
}
.form-control:focus, .form-select:focus { border-color: var(--tpm-ink); box-shadow: 0 0 0 .2rem rgba(255, 194, 26, .35); background-color: var(--tpm-surface); color: var(--tpm-ink); }
.form-control::placeholder { color: var(--tpm-muted); opacity: .8; }
.form-label { font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.form-text { color: var(--tpm-muted); }
.form-check-input:checked { background-color: var(--tpm-ink); border-color: var(--tpm-ink); }
[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--tpm-yellow); border-color: var(--tpm-yellow); }
.invalid-feedback, .errorlist { color: var(--tpm-red); font-size: .875rem; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0 0; }

/* ---------- Thème : bouton bascule ---------- */
.theme-toggle .bi-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle .bi-sun { display: inline-block; }
[data-bs-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }

/* ==========================================================================
   VITRINE
   ========================================================================== */
.shop-header {
  position: sticky; top: 0; z-index: 1030;
  background: color-mix(in srgb, var(--tpm-bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.shop-header.is-scrolled { border-bottom-color: var(--tpm-line); }
.shop-header .inner { display: flex; align-items: center; gap: .75rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--tpm-ink); }
.brand img { width: 40px; height: 40px; border-radius: 12px; background: var(--tpm-yellow); padding: 4px; object-fit: contain; }
.brand .brand-name { font-family: var(--tpm-display); font-weight: 800; font-size: 1.55rem; line-height: 1; }
.brand .brand-tag { display: block; font-size: .78rem; color: var(--tpm-muted); line-height: 1.1; }
.desk-nav { display: none; gap: .25rem; margin-left: 1rem; }
.desk-nav a { text-decoration: none; padding: .45rem .85rem; border-radius: 999px; font-weight: 600; color: var(--tpm-muted); }
.desk-nav a:hover { color: var(--tpm-ink); }
.desk-nav a.active { color: var(--tpm-ink); background: var(--tpm-surface); }
.header-search { display: none; flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.header-search input { border-radius: 999px; padding-left: 2.6rem; background: var(--tpm-surface); border-color: transparent; }
.header-search .bi { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--tpm-muted); }
.header-actions { display: flex; gap: .4rem; margin-left: auto; }
.cart-badge {
  position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--tpm-red); color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.cart-badge:empty, .cart-badge[data-count="0"] { display: none; }
@media (min-width: 992px) {
  .desk-nav, .header-search { display: flex; }
  .header-actions { margin-left: .5rem; }
  .only-mobile { display: none !important; }
}

/* Recherche mobile (dépliée sous l'en-tête) */
.mobile-search { padding: 0 0 .85rem; }
.mobile-search[hidden] { display: none; }

/* ---------- Héros « route » : l'élément signature ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--tpm-asphalt); color: #F2F3F5;
  border-radius: var(--tpm-radius-lg);
  margin-top: .5rem;
  min-height: 430px;
  display: grid;
}
.hero::before {         /* grain du bitume */
  content: ""; position: absolute; inset: 0; z-index: -2; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.2px), radial-gradient(rgba(0,0,0,.35) 1px, transparent 1.2px);
  background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 4px;
}
.hero-photo {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
}
.hero-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,18,21,.25) 0%, rgba(16,18,21,.88) 72%);
}
.hero-body { align-self: end; padding: 2rem 1.4rem 4.6rem; max-width: 640px; }
.hero h1 { color: #fff; font-weight: 800; font-size: clamp(2.6rem, 1.6rem + 4.6vw, 4.6rem); line-height: .95; margin-bottom: .9rem; }
.hero p { color: rgba(242,243,245,.82); font-size: 1.08rem; max-width: 46ch; margin-bottom: 1.4rem; }
@media (max-width: 575.98px) { .hero .btn { width: 100%; } }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn-ghost:hover { border-color: #fff; color: #fff; }
/* Ligne médiane pointillée : elle « se trace » une seule fois au chargement */
.lane {
  position: absolute; left: 0; right: 0; bottom: 1.9rem; height: 6px; z-index: 0;
  background: repeating-linear-gradient(90deg, var(--tpm-yellow) 0 46px, transparent 46px 82px);
  transform-origin: left center;
  animation: lane-draw 1.1s cubic-bezier(.2,.7,.2,1) .15s both;
}
@keyframes lane-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (min-width: 992px) {
  .hero { min-height: 520px; grid-template-columns: 1.05fr 1fr; }
  .hero-body { padding: 3.5rem 3.2rem 5.4rem; }
  .hero-photo { left: 42%; clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%); }
  .hero-photo::after { background: linear-gradient(90deg, rgba(16,18,21,.85) 0%, rgba(16,18,21,.05) 45%); }
}
.hero-mark {            /* sans photo : grand casque en filigrane */
  position: absolute; right: -4%; bottom: 8%; width: min(58%, 420px); opacity: .1; z-index: -1;
  filter: invert(1) grayscale(1);
}

/* ---------- Bandeau défilant (marquage au sol) ---------- */
.marquee {
  background: var(--tpm-yellow); color: var(--tpm-on-yellow); overflow: hidden;
  border-radius: 999px; margin: .9rem 0 0; white-space: nowrap;
  font-family: var(--tpm-display); font-weight: 700; font-size: 1.05rem;
}
.marquee-track { display: inline-flex; gap: 2.2rem; padding: .55rem 0; animation: marquee 32s linear infinite; }
.marquee-track span { display: inline-flex; align-items: center; gap: 2.2rem; }
.marquee-track span::after { content: ""; width: 10px; height: 10px; background: var(--tpm-on-yellow); clip-path: polygon(0 0, 55% 0, 100% 50%, 55% 100%, 0 100%, 45% 50%); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { margin-top: 2.6rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; color: var(--tpm-muted); white-space: nowrap; }
.section-head a:hover { color: var(--tpm-ink); }

/* ---------- Catégories : grands blocs image + texte ---------- */
.cat-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: .9rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; scrollbar-width: none; }
.cat-rail::-webkit-scrollbar { display: none; }
@media (min-width: 576px) { .cat-rail { grid-auto-columns: 44%; } }
@media (min-width: 992px) {
  .cat-rail { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; }
  .cat-rail .cat-tile:first-child { grid-column: span 2; grid-row: span 2; }
  .cat-rail .cat-tile:first-child .cat-name { font-size: 2.3rem; }
}
.cat-tile {
  position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--tpm-radius);
  overflow: hidden; scroll-snap-align: start; text-decoration: none; color: #fff;
  background: var(--tpm-asphalt-2);
}
@media (min-width: 992px) { .cat-tile { aspect-ratio: 1 / 1; } }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cat-tile:hover img { transform: scale(1.04); }
.cat-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(16,18,21,.86)); }
.cat-meta { position: absolute; left: 1rem; right: 1rem; bottom: .9rem; z-index: 1; }
.cat-name { font-family: var(--tpm-display); font-weight: 800; font-size: 1.6rem; line-height: 1; display: block; }
.cat-count { font-size: .875rem; opacity: .8; }

/* ---------- Cartes produit (base Shopline) ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; } }
@media (min-width: 1200px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.3rem; } }
.product-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: .3rem; }
.product-rail::-webkit-scrollbar { display: none; }
.product-rail > * { scroll-snap-align: start; }
@media (min-width: 768px) { .product-rail { grid-auto-columns: 31%; } }
@media (min-width: 1200px) { .product-rail { grid-auto-columns: calc(25% - 1rem); gap: 1.3rem; } }

.p-card {
  position: relative; display: flex; flex-direction: column; background: var(--tpm-surface);
  border-radius: var(--tpm-radius); padding: .55rem .55rem .8rem; height: 100%;
}
.p-media {
  position: relative; display: block; aspect-ratio: 1 / 1; border-radius: calc(var(--tpm-radius) - 5px);
  background: var(--tpm-surface-2); overflow: hidden;
}
.p-media img { width: 100%; height: 100%; object-fit: cover; }
.p-card.is-out .p-media img { filter: grayscale(.85); opacity: .7; }
.p-badge {
  position: absolute; top: .5rem; left: .5rem; z-index: 1; padding: .18rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; background: var(--tpm-red); color: #fff;
}
.p-badge.is-out { background: var(--tpm-ink); color: var(--tpm-surface); }
.p-body { padding: .7rem .35rem 0; display: flex; flex-direction: column; flex: 1; }
.p-cat { font-size: .78rem; color: var(--tpm-muted); }
.p-name { font-weight: 600; font-size: .98rem; line-height: 1.3; margin: .1rem 0 .45rem; text-decoration: none; color: var(--tpm-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-name::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.p-foot { margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: .4rem; }
.price { font-family: var(--tpm-display); font-weight: 700; font-size: 1.35rem; line-height: 1; white-space: nowrap; }
.price-old { font-size: .85rem; color: var(--tpm-muted); text-decoration: line-through; display: block; }
.p-add {
  position: relative; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; flex-shrink: 0;
  background: var(--tpm-ink); color: var(--tpm-surface); display: grid; place-items: center;
  transition: transform .15s ease, background-color .15s ease;
}
.p-add:hover { transform: scale(1.06); }
.p-add.is-added { background: var(--tpm-yellow); color: var(--tpm-on-yellow); }
.p-add:disabled { opacity: .3; transform: none; }
.p-stock-low { font-size: .78rem; color: var(--tpm-red); font-weight: 600; margin-bottom: .2rem; }

/* ---------- Fiche produit ---------- */
.pd-media { background: var(--tpm-surface); border-radius: var(--tpm-radius-lg); padding: .7rem; position: relative; }
.pd-media img { display: block; width: 100%; height: auto; max-height: 78vh; aspect-ratio: auto; object-fit: contain; border-radius: calc(var(--tpm-radius-lg) - 8px); background: var(--tpm-surface-2); }
.pd-price { font-family: var(--tpm-display); font-weight: 800; font-size: 2.5rem; line-height: 1; }
.pd-panel { background: var(--tpm-surface); border-radius: var(--tpm-radius-lg); padding: 1.4rem; }
.stock-line { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .95rem; }
.stock-line .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tpm-green); }
.stock-line.is-low .dot { background: var(--tpm-yellow-deep); }
.stock-line.is-out { color: var(--tpm-red); }
.stock-line.is-out .dot { background: var(--tpm-red); }
.qty {
  display: inline-flex; align-items: center; border: 1.5px solid var(--tpm-line); border-radius: 999px; overflow: hidden; background: var(--tpm-surface);
}
.qty button { width: 42px; height: 44px; border: 0; background: transparent; color: var(--tpm-ink); font-size: 1.1rem; }
.qty button:disabled { opacity: .3; }
.qty input { width: 48px; text-align: center; border: 0; background: transparent; color: var(--tpm-ink); font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pd-desc { white-space: pre-line; color: var(--tpm-ink); }
.pd-sticky { position: sticky; bottom: calc(var(--tpm-bottomnav-h) + env(safe-area-inset-bottom, 0px) + .6rem); z-index: 5; }
@media (min-width: 992px) { .pd-sticky { position: static; } }

/* ---------- Filtres catalogue ---------- */
.chips { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: .1rem 0 .4rem; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: .45rem 1rem; border-radius: 999px; background: var(--tpm-surface); color: var(--tpm-ink);
  text-decoration: none; font-weight: 600; font-size: .92rem; border: 1.5px solid transparent;
}
.chip:hover { border-color: var(--tpm-line); color: var(--tpm-ink); }
.chip.active { background: var(--tpm-ink); color: var(--tpm-surface); }

/* ---------- Panier ---------- */
.cart-line { display: grid; grid-template-columns: 76px 1fr; gap: .9rem; background: var(--tpm-surface); border-radius: var(--tpm-radius); padding: .6rem; }
.cart-line img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; background: var(--tpm-surface-2); }
.cart-line .name { font-weight: 600; line-height: 1.25; text-decoration: none; }
.cart-summary { background: var(--tpm-surface); border-radius: var(--tpm-radius-lg); padding: 1.3rem; }
.cart-total { font-family: var(--tpm-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.wa-choice { display: grid; gap: .5rem; }
.wa-choice label { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border: 1.5px solid var(--tpm-line); border-radius: var(--tpm-radius-sm); cursor: pointer; }
.wa-choice input:checked + span { font-weight: 700; }
.wa-choice label:has(input:checked) { border-color: var(--tpm-ink); }

/* ---------- États vides ---------- */
.empty { text-align: center; padding: 3rem 1rem; background: var(--tpm-surface); border-radius: var(--tpm-radius-lg); }
.empty .bi { font-size: 2.4rem; color: var(--tpm-muted); }
.empty h3 { margin: .7rem 0 .4rem; }

/* ---------- Pied de page ---------- */
.shop-footer { margin-top: 3.5rem; padding: 2.2rem 0 calc(var(--tpm-bottomnav-h) + 2rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--tpm-line); color: var(--tpm-muted); font-size: .92rem; }
.shop-footer a { color: var(--tpm-ink); }
@media (min-width: 992px) { .shop-footer { padding-bottom: 2.2rem; } }

/* ---------- Navigation basse mobile ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
  background: var(--tpm-surface); border-top: 1px solid var(--tpm-line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav ul { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; height: var(--tpm-bottomnav-h); }
.bottom-nav a {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--tpm-muted); font-size: .72rem; font-weight: 600;
}
.bottom-nav a .bi { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--tpm-ink); }
.bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--tpm-yellow); }
.bottom-nav .cart-badge { top: 8px; right: calc(50% - 22px); }
@media (min-width: 992px) { .bottom-nav { display: none; } }

/* ---------- Toasts ---------- */
.tpm-toast {
  position: fixed; left: 50%; bottom: calc(var(--tpm-bottomnav-h) + 1rem + env(safe-area-inset-bottom, 0px)); z-index: 1090;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--tpm-ink); color: var(--tpm-surface); padding: .7rem 1.1rem; border-radius: 999px; font-weight: 600;
  box-shadow: var(--tpm-shadow); transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 2rem);
  display: flex; align-items: center; gap: .6rem;
}
.tpm-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tpm-toast a { color: var(--tpm-yellow); font-weight: 700; }
@media (min-width: 992px) { .tpm-toast { bottom: 1.5rem; } }

/* ---------- Invitation à installer la PWA ---------- */
.install-sheet .modal-content { border: 0; border-radius: var(--tpm-radius-lg); background: var(--tpm-surface); color: var(--tpm-ink); }
.install-sheet .app-icon { width: 64px; height: 64px; border-radius: 16px; }
@media (max-width: 575.98px) {
  .install-sheet .modal-dialog { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; max-width: none; }
  .install-sheet .modal-content { border-radius: var(--tpm-radius-lg) var(--tpm-radius-lg) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* ---------- Pages d'erreur / hors ligne ---------- */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 2rem 1rem; }
.error-code { font-family: var(--tpm-display); font-weight: 800; font-size: clamp(5rem, 3rem + 10vw, 9rem); line-height: .9; }
.error-code .lane-mini { display: block; height: 6px; margin: .6rem auto 1.2rem; width: 160px; background: repeating-linear-gradient(90deg, var(--tpm-yellow) 0 26px, transparent 26px 42px); }

/* ==========================================================================
   CONNEXION (immersive, couleur de marque)
   ========================================================================== */
.login-page {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem;
  background: var(--tpm-yellow); color: var(--tpm-on-yellow); position: relative; overflow: hidden;
}
.login-page::before {   /* chevrons de virage, discrets */
  content: ""; position: absolute; inset: -20%; opacity: .07; pointer-events: none;
  background: repeating-linear-gradient(-45deg, #1C1F24 0 34px, transparent 34px 68px);
  mask-image: radial-gradient(circle at 50% 50%, transparent 30%, #000 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 30%, #000 75%);
}
.login-box { width: 100%; max-width: 380px; position: relative; text-align: center; }
.login-box .logo { width: 96px; height: 96px; margin-bottom: 1rem; }
.login-box h1 { font-size: 2.4rem; font-weight: 800; color: #1C1F24; margin-bottom: .2rem; }
.login-box p.sub { color: rgba(28,31,36,.72); margin-bottom: 1.6rem; }
.login-card { background: #fff; color: #1C1F24; border-radius: var(--tpm-radius-lg); padding: 1.5rem; text-align: left; box-shadow: 0 30px 60px -30px rgba(28,31,36,.55); }
.login-card .form-control { background: #F1F3F5; border-color: #F1F3F5; color: #1C1F24; }
.login-card .form-control:focus { background: #fff; border-color: #1C1F24; }
.login-card .btn-ink { background: #1C1F24; color: #fff; }
.login-back { display: inline-block; margin-top: 1.2rem; color: #1C1F24; font-weight: 600; }

/* ==========================================================================
   ESPACE DE GESTION
   ========================================================================== */
.g-shell { min-height: 100vh; }
.g-sidebar {
  --bs-offcanvas-width: 264px;
  background: var(--tpm-asphalt) !important; color: #C9CED5;
}
@media (min-width: 992px) {
  .g-sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 1030; display: flex; flex-direction: column; }
  .g-main { margin-left: 264px; }
}
.g-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 1.2rem 1rem; overflow-y: auto; height: 100%; }
.g-brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; padding: .2rem .5rem 1.4rem; }
.g-brand img { width: 40px; height: 40px; border-radius: 12px; background: var(--tpm-yellow); padding: 4px; }
.g-brand strong { font-family: var(--tpm-display); font-size: 1.5rem; font-weight: 800; line-height: 1; display: block; }
.g-brand small { color: #8D949E; font-size: .78rem; }
.g-nav-group { font-size: .78rem; color: #7E858F; padding: 1rem .75rem .35rem; }
.g-nav a {
  display: flex; align-items: center; gap: .8rem; padding: .62rem .8rem; border-radius: 12px; color: #C9CED5;
  text-decoration: none; font-weight: 600; font-size: .95rem; margin-bottom: 2px;
}
.g-nav a .bi { font-size: 1.15rem; width: 1.3rem; text-align: center; }
.g-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.g-nav a.active { background: var(--tpm-yellow); color: #1C1F24; }
.g-nav .count { margin-left: auto; background: var(--tpm-red); color: #fff; border-radius: 999px; font-size: .72rem; padding: .1rem .45rem; }
.g-nav a.active .count { background: #1C1F24; }
.g-side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.g-side-foot a { color: #C9CED5; text-decoration: none; font-weight: 600; display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: 12px; }
.g-side-foot a:hover { background: rgba(255,255,255,.06); color: #fff; }

.g-topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .6rem;
  padding: .8rem 1rem; background: color-mix(in srgb, var(--tpm-bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
@media (min-width: 992px) { .g-topbar { padding: 1rem 2rem; } }
.g-topbar h1 { font-size: 1.6rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--tpm-ink); color: var(--tpm-surface); display: grid; place-items: center; font-weight: 700; font-size: .85rem; border: 0; }
.g-content { padding: .5rem 1rem 2.5rem; }
@media (min-width: 992px) { .g-content { padding: .5rem 2rem 3rem; } }

.g-card { background: var(--tpm-surface); border-radius: var(--tpm-radius); padding: 1.15rem; }
.g-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.g-card-head h2 { font-size: 1.3rem; margin: 0; }
.kpi { display: flex; gap: .9rem; align-items: center; text-decoration: none; color: inherit; height: 100%; }
.kpi .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.kpi .val { font-family: var(--tpm-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.kpi .lbl { font-size: .875rem; color: var(--tpm-muted); }
.ico-yellow { background: rgba(255,194,26,.2); color: #A87800; }
.ico-red { background: rgba(211,58,44,.12); color: var(--tpm-red); }
.ico-green { background: rgba(30,143,80,.12); color: var(--tpm-green); }
.ico-ink { background: var(--tpm-surface-2); color: var(--tpm-ink); }
[data-bs-theme="dark"] .ico-yellow { color: var(--tpm-yellow); }

/* Jauge de stock façon réservoir : 5 segments */
.gauge { display: inline-flex; gap: 3px; vertical-align: middle; }
.gauge i { width: 9px; height: 14px; border-radius: 2px; background: var(--tpm-line); }
.gauge.is-ok i.on { background: var(--tpm-green); }
.gauge.is-low i.on { background: var(--tpm-yellow-deep); }
.gauge.is-out i { background: color-mix(in srgb, var(--tpm-red) 30%, var(--tpm-line)); }

.g-table { --bs-table-bg: transparent; --bs-table-color: var(--tpm-ink); margin: 0; }
.g-table th { font-size: .82rem; color: var(--tpm-muted); font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.g-table td { vertical-align: middle; border-color: var(--tpm-line); }
.g-table tr.rowlink { cursor: pointer; }
.g-table tr.rowlink:hover td { background: var(--tpm-surface-2); }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--tpm-surface-2); flex-shrink: 0; }
.status { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.status-new { background: rgba(255,194,26,.22); color: #8A6300; }
.status-confirmed { background: rgba(60,120,220,.14); color: #2F63C0; }
.status-delivered { background: rgba(30,143,80,.14); color: var(--tpm-green); }
.status-cancelled { background: var(--tpm-surface-2); color: var(--tpm-muted); }
[data-bs-theme="dark"] .status-new { color: var(--tpm-yellow); }
[data-bs-theme="dark"] .status-confirmed { color: #7EA8F0; }
.mv-in { color: var(--tpm-green); font-weight: 700; }
.mv-out { color: var(--tpm-red); font-weight: 700; }

/* Liste produits mobile (cartes) / desktop (tableau) */
.g-list-item { display: flex; gap: .8rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--tpm-line); text-decoration: none; color: inherit; }
.g-list-item:last-child { border-bottom: 0; }
.g-list-item .meta { min-width: 0; flex: 1; }
.g-list-item .meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Période */
.period-nav { display: inline-flex; align-items: center; gap: .3rem; background: var(--tpm-surface); border-radius: 999px; padding: .25rem; }
.period-nav a, .period-nav button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; color: var(--tpm-ink); border: 0; background: transparent; }
.period-nav a:hover { background: var(--tpm-surface-2); }
.period-nav a.disabled { opacity: .3; pointer-events: none; }
.period-nav .label { font-weight: 700; padding: 0 .4rem; min-width: 128px; text-align: center; white-space: nowrap; }

/* Pagination */
.pagination { --bs-pagination-bg: var(--tpm-surface); --bs-pagination-color: var(--tpm-ink); --bs-pagination-border-color: transparent;
  --bs-pagination-active-bg: var(--tpm-ink); --bs-pagination-active-color: var(--tpm-surface); --bs-pagination-active-border-color: var(--tpm-ink);
  --bs-pagination-hover-bg: var(--tpm-surface-2); --bs-pagination-hover-color: var(--tpm-ink); --bs-pagination-disabled-bg: var(--tpm-surface); gap: .3rem; }
.pagination .page-link { border-radius: 10px !important; font-weight: 600; }

/* Catégorie à la volée dans la fiche produit */
.cat-picker { display: flex; gap: .5rem; }
.cat-picker .form-select { flex: 1; }
.cat-new { display: flex; gap: .5rem; margin-top: .5rem; }
.cat-new[hidden] { display: none; }
.img-drop {
  position: relative; display: grid; place-items: center; text-align: center; gap: .4rem; cursor: pointer;
  border: 2px dashed var(--tpm-line); border-radius: var(--tpm-radius); background: var(--tpm-surface-2);
  aspect-ratio: 1 / 1; overflow: hidden; color: var(--tpm-muted);
}
@media (max-width: 991.98px) { .img-drop-square { aspect-ratio: 4 / 3; max-height: 280px; } }
.img-drop-wide { aspect-ratio: 16 / 9; }
.img-drop { cursor: default; }
.img-drop img[hidden], .img-drop .hint[hidden], .img-drop .img-busy[hidden] { display: none; }
.img-busy { position: absolute; left: 50%; bottom: .8rem; transform: translateX(-50%); z-index: 2; background: var(--tpm-ink); color: var(--tpm-surface);
  border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.img-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.img-actions .btn { flex: 1 1 auto; cursor: pointer; }
.step-num { min-width: 1.6rem; color: var(--tpm-yellow-deep); }
[data-bs-theme="dark"] .step-num { color: var(--tpm-yellow); }
.img-drop:hover, .img-drop.is-drag { border-color: var(--tpm-ink); color: var(--tpm-ink); }
.img-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.img-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-drop .bi { font-size: 2rem; }
.kind-switch .btn { border-radius: 12px; border: 1.5px solid var(--tpm-line); color: var(--tpm-ink); }
.btn-check:checked + .btn.kind-in { background: var(--tpm-green); border-color: var(--tpm-green); color: #fff; }
.btn-check:checked + .btn.kind-out { background: var(--tpm-red); border-color: var(--tpm-red); color: #fff; }

.alert { border-radius: var(--tpm-radius-sm); border: 0; }
.dropdown-menu { --bs-dropdown-bg: var(--tpm-surface); --bs-dropdown-link-color: var(--tpm-ink); --bs-dropdown-link-hover-bg: var(--tpm-surface-2); --bs-dropdown-link-hover-color: var(--tpm-ink); border: 1px solid var(--tpm-line); border-radius: 14px; box-shadow: var(--tpm-shadow); }
.modal-content { background: var(--tpm-surface); color: var(--tpm-ink); border-radius: var(--tpm-radius-lg); border: 0; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .marquee-track { animation: none; }
}

/* ==========================================================================
   ACCUEIL ENRICHI (v1.1)
   ========================================================================== */
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1rem;
  background: rgba(255,194,26,.16); color: var(--tpm-yellow); border: 1px solid rgba(255,194,26,.35);
  padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.6rem; margin: 1.8rem 0 0; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt { font-family: var(--tpm-display); font-weight: 800; font-size: 1.9rem; line-height: 1; color: #fff; }
.hero-stats dd { margin: .2rem 0 0; font-size: .82rem; color: rgba(242,243,245,.7); }
.hero-edit {
  position: absolute; top: 1rem; right: 1rem; z-index: 3; text-decoration: none; font-weight: 600; font-size: .85rem;
  background: rgba(16,18,21,.65); color: #fff; padding: .45rem .85rem; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-edit:hover { background: var(--tpm-yellow); color: var(--tpm-on-yellow); }
.hero-float { display: none; }
@media (min-width: 992px) {
  .hero-float {
    position: absolute; right: 2rem; bottom: 4.2rem; z-index: 2; width: 330px;
    display: grid; grid-template-columns: 76px 1fr auto; gap: .9rem; align-items: center;
    background: var(--tpm-surface); color: var(--tpm-ink); text-decoration: none;
    border-radius: 18px; padding: .6rem .9rem .6rem .6rem; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6);
    animation: float-in .7s cubic-bezier(.2,.7,.2,1) .5s both;
  }
  .hero-float img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; background: var(--tpm-surface-2); }
  .hero-float small { color: var(--tpm-muted); font-size: .78rem; }
  .hero-float strong { display: block; font-size: .95rem; line-height: 1.25; margin: .1rem 0 .25rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-float .price { font-size: 1.25rem; }
  .hero-float > .bi { font-size: 1.6rem; color: var(--tpm-muted); }
  .hero-float:hover > .bi { color: var(--tpm-ink); }
}
@keyframes float-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.kicker { display: block; font-size: .85rem; font-weight: 600; color: var(--tpm-muted); margin-bottom: .15rem; }
.section-head a .bi { transition: transform .15s ease; }
.section-head a:hover .bi { transform: translateX(3px); }
.rail-nav { gap: .4rem; }

/* Atouts */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
@media (min-width: 992px) { .features { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; } }
.feature { display: flex; gap: .8rem; align-items: flex-start; background: var(--tpm-surface); border-radius: var(--tpm-radius); padding: 1rem; }
.feature-ico { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--tpm-yellow); color: var(--tpm-on-yellow); font-size: 1.2rem; }
.feature strong { display: block; line-height: 1.25; }
.feature span:not(.feature-ico) { display: block; font-size: .86rem; color: var(--tpm-muted); line-height: 1.4; margin-top: .2rem; }
@media (max-width: 575.98px) {
  .feature { flex-direction: column; gap: .6rem; padding: .9rem; }
}

/* Bannière promo */
.promo {
  position: relative; display: grid; overflow: hidden; isolation: isolate; text-decoration: none;
  border-radius: var(--tpm-radius-lg); min-height: 280px; color: var(--tpm-on-yellow);
  background: var(--tpm-yellow);
}
.promo:not(.has-photo)::before {   /* chevrons de virage */
  content: ""; position: absolute; right: -6%; top: 0; bottom: 0; width: 55%; z-index: -1; opacity: .9;
  background: repeating-linear-gradient(-60deg, #1C1F24 0 26px, transparent 26px 58px);
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
  mask-image: linear-gradient(90deg, transparent, #000 40%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.promo.has-photo { color: #fff; background: var(--tpm-asphalt); }
.promo-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s ease; }
.promo:hover .promo-photo { transform: scale(1.03); }
.promo.has-photo::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(16,18,21,.88) 0%, rgba(16,18,21,.35) 70%, rgba(16,18,21,.1)); }
.promo-body { align-self: center; padding: 2rem 1.5rem; max-width: 560px; display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
.promo-title { font-family: var(--tpm-display); font-weight: 800; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem); line-height: .95; }
.promo-text { font-size: 1.05rem; opacity: .85; max-width: 44ch; }
@media (min-width: 992px) { .promo { min-height: 340px; } .promo-body { padding: 3rem; } }

/* Étapes */
.steps { background: var(--tpm-surface); border-radius: var(--tpm-radius-lg); padding: 1.6rem; }
.steps h2 { margin-bottom: 1.2rem; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
@media (min-width: 768px) { .steps ol { grid-template-columns: repeat(3, 1fr); } }
.steps li { display: flex; gap: .9rem; align-items: flex-start; }
.steps .step-num { font-family: var(--tpm-display); font-weight: 800; font-size: 2.6rem; line-height: .85; min-width: 1.6rem; }
.steps strong { display: block; }
.steps li span:not(.step-num) { color: var(--tpm-muted); font-size: .92rem; }

/* Appel final */
.final-cta {
  position: relative; overflow: hidden; display: grid; gap: 1.4rem; align-items: center;
  background: var(--tpm-asphalt); color: #F2F3F5; border-radius: var(--tpm-radius-lg); padding: 2rem 1.5rem 3.6rem;
}
.final-cta h2 { color: #fff; font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); font-weight: 800; }
.final-cta p { color: rgba(242,243,245,.78); margin: .6rem 0 0; max-width: 48ch; }
.final-cta-side { display: flex; flex-direction: column; gap: .8rem; align-items: flex-start; }
.final-cta-side small { color: rgba(242,243,245,.7); line-height: 1.7; }
.final-cta .lane { bottom: 1.4rem; animation: none; }
@media (min-width: 992px) {
  .final-cta { grid-template-columns: 1.4fr 1fr; padding: 2.8rem 3rem 4rem; }
  .final-cta-side { align-items: flex-end; text-align: right; }
}
.hero-stats dt .bi { color: var(--tpm-yellow); font-size: 1.75rem; }
