/* ecombid.io — implémentation du design "EcomBid v3" */

:root {
  --logo-green: #5c9a3d;
  --accent: #12805c;
  --accent-dark: #0d6247;
  --accent-soft: #e8f3ee;
  --accent-softer: #cdeade;
  --accent-tint: #f1faf5;
  --accent-tint-2: #f2faf6;
  --bg: #f7f8f5;
  --ink: #14181a;
  --ink-soft: #3d4642;
  --muted: #5c6560;
  --muted-2: #7a837d;
  --muted-3: #8b938e;
  --muted-4: #98a09a;
  --muted-5: #a2aaa4;
  --line: #e3e6e1;
  --line-2: #dfe3de;
  --line-3: #e9ebe6;
  --line-4: #eceee9;
  --line-5: #f0f2ee;
  --paper: #fafbf9;
  --danger: #c8321f;
  --shadow-card: 0 1px 2px rgba(16, 24, 20, .04);
  --shadow-btn: 0 1px 2px rgba(16, 40, 30, .14);
  --h1-size: 44px;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
input, select, button { font-family: inherit; }
::selection { background: var(--accent-softer); color: #0d3527; }

@keyframes blip { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.page { min-height: 100vh; background: var(--bg); padding-bottom: 90px; }

/* Globe décoratif */
.globe-wrap {
  position: fixed;
  right: -240px;
  top: -140px;
  width: 820px;
  height: 820px;
  pointer-events: none;
  z-index: 0;
}
.globe-sphere {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .95), rgba(232, 243, 238, .55) 48%, rgba(18, 128, 92, .07) 72%, rgba(18, 128, 92, 0) 78%);
  box-shadow: inset -40px -60px 90px rgba(13, 53, 39, .07);
}
.globe-wrap dot-globe { position: absolute; inset: 0; }

.content { position: relative; z-index: 1; }

/* Barre de navigation */
.topbar {
  display: flex;
  align-items: center;
  padding: 13px 28px;
  position: sticky;
  top: 0;
  background: rgba(247, 248, 245, .92);
  backdrop-filter: blur(10px);
  z-index: 40;
}
.topbar__left, .topbar__right { display: flex; align-items: center; }
.topbar__left { gap: 10px; }
.topbar__right { gap: 20px; }
.logo-bag { width: 27px; height: 27px; flex: none; }
.wordmark { font-weight: 700; font-size: 17px; letter-spacing: -.025em; }
.wordmark__dot { color: var(--logo-green); }
.pill-group {
  display: flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
/* le toggle de période est collé au logo, la langue part à droite */
#range-toggle { margin-left: 18px; margin-right: auto; }
.pill-group--tight { margin-left: 0; padding: 0; overflow: hidden; }
.pill {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.pill.is-active { background: var(--ink); color: #fff; }

.container { max-width: 1420px; margin: 0 auto; padding: 0 28px; }

/* Héro */
.hero { padding: 56px 0 40px; display: grid; justify-items: center; gap: 20px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  color: var(--muted);
}
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blip 1.6s infinite; }
.badge__online { font-weight: 600; color: var(--accent-dark); }

.hero__claim { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
h1 { margin: 0; font-size: var(--h1-size); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.stepper button:hover { background: var(--accent-softer); }
.hero__amount {
  display: inline-flex;
  align-items: baseline;
  font-size: var(--h1-size);
  font-weight: 700;
  letter-spacing: -.035em;
  color: var(--accent);
}
.hero__amount input {
  background: transparent;
  border: 0;
  outline: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  padding: 0;
  width: 5ch;
  min-width: 1ch;
  border-bottom: 2px dashed transparent;
  cursor: text;
}
.hero__amount input:hover, .hero__amount input:focus { border-bottom-color: var(--accent-softer); }

.hero__sub {
  margin: 0;
  max-width: 62ch;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}
.hero__start { color: var(--accent); font-weight: 600; }

.hero__form {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 10px;
}
.input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 13px 15px;
  box-shadow: var(--shadow-card);
}
.input-shell__ring { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #b6bdb7; flex: none; }
.input-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
}
.input-shell select {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
  appearance: none;
  cursor: pointer;
}
.input-shell__caret { color: var(--muted-5); font-size: 12px; }
.btn-hero {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
}
.btn-hero:hover { background: var(--accent-dark); }
.hero__note { font-size: 13px; color: var(--muted-2); text-align: center; }

/* Grille classement + slots */
.board {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 218px;
  gap: 28px;
}
.side { display: grid; gap: 12px; align-content: start; align-self: start; position: sticky; top: 78px; }
.side__inner { display: block; }
.side__track { display: grid; gap: 12px; }
.slot--clone { display: none; }
.main-col { min-width: 0; }

/* Filtres */
.filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.chip__ic { width: 14px; height: 14px; flex: none; }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Lignes du classement */
.rows { display: grid; gap: 10px; }
.rows-empty {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed #cfd6d0;
  border-radius: 14px;
  font-size: 14px;
  color: var(--muted-2);
}
.row {
  display: grid;
  grid-template-columns: 52px 56px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-3);
  background: #fff;
  box-shadow: var(--shadow-card);
}
.row:hover { border-color: #cfd6d0; }
.row--first { border-color: var(--accent); background: var(--accent-tint); }
.row--first:hover { border-color: var(--accent); }
.row__rank {
  justify-self: start;
  background: #f1f3ef;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 700;
}
.row--first .row__rank { background: var(--accent); color: #fff; }
.row__logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, #f4f5f2, #f4f5f2 3px, #fff 3px, #fff 6px);
  overflow: hidden;
}
.row__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.row__info { min-width: 0; display: grid; gap: 5px; }
.row__title { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.row__title:hover { color: var(--accent); }
.row__blurb { font-size: 13.5px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.row__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted-3); }
.row__ago { color: var(--accent); }
.row__clicks { color: var(--ink-soft); font-weight: 600; }
.row__bid {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted-3);
  text-decoration: underline;
  cursor: pointer;
}
.row__bid:hover { color: var(--accent); }
.row__price {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  text-align: right;
  align-self: center;
}

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.pager__label { font-size: 12px; color: var(--muted-2); }
.pager__btns { display: flex; gap: 6px; }
.page-btn {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.page-btn.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Slots publicitaires */
.slot {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.slot--free { border-style: dashed; border-color: #cfd6d0; }
.slot { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.slot:hover { border-color: var(--accent); box-shadow: 0 8px 20px rgba(16, 40, 30, .10); transform: translateY(-1px); }
.slot__art {
  height: 92px;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, #f4f5f2, #f4f5f2 4px, #fff 4px, #fff 8px);
  border-bottom: 1px solid var(--line-4);
}
.slot__art-label { font-size: 10px; color: var(--muted-4); letter-spacing: .04em; }
.slot__art--free {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #f6fbf8, var(--accent-soft));
}
.slot__ad-ic { width: 26px; height: 26px; color: var(--accent); }
.slot__art--img { padding: 0; }
.slot__art--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot__art-label--mobile { display: none; color: var(--accent-dark); font-weight: 600; font-size: 11px; letter-spacing: 0; }
.slot__body { padding: 11px 12px 13px; display: grid; gap: 4px; }
.slot__title { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.slot__meta { font-size: 11px; line-height: 1.5; color: var(--muted-2); }
.slot__meta--free { color: var(--accent); }

/* Footer */
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 44px 0 10px;
  font-size: 13px;
  color: var(--muted-4);
}
.footer a { color: var(--muted-2); }
.footer a:hover { color: var(--accent); }

/* Pages de contenu (Rules, Terms, Privacy) */
.doc-home { display: flex; align-items: center; gap: 10px; color: inherit; }
.doc-home:hover { color: inherit; }
.doc { max-width: 720px; margin: 0 auto; padding: 36px 28px 60px; }
.doc h1 { margin: 0 0 6px; font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.doc__updated { font-size: 12.5px; color: var(--muted-4); margin-bottom: 26px; }
.doc h2 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin: 30px 0 10px; }
.doc p, .doc li { font-size: 14.5px; line-height: 1.65; color: var(--muted); }
.doc ul { padding-left: 20px; margin: 10px 0; }
.doc li { margin: 7px 0; }
.doc strong { color: var(--ink); }
.doc .footer { padding-top: 50px; }

/* Badge fondateurs */
.builtby {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #1c2420, #14181a 60%);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  padding: 8px 16px 8px 10px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .5);
  box-shadow: 0 10px 26px rgba(13, 34, 25, .26);
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.builtby:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(13, 34, 25, .32); }
.builtby a { color: #fff; font-weight: 600; }
.builtby a:hover { color: var(--accent-softer); }
.builtby__avatars { display: flex; margin-right: 5px; }
.builtby__avatars img {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 2px solid #14181a;
  object-fit: cover;
  background: var(--accent-soft);
}
.builtby__avatars img + img { margin-left: -8px; }
@media (max-width: 759px) {
  .builtby { right: 10px; bottom: 10px; padding: 7px 13px 7px 9px; font-size: 11.5px; }
}

/* Modale */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 24, .42);
  backdrop-filter: blur(2px);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal {
  width: 100%;
  max-width: 468px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16, 28, 22, .22);
  animation: riseIn .18s ease-out;
  overflow: hidden;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-4);
  background: var(--paper);
}
.modal__kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-3);
}
.modal__close { background: transparent; border: 0; color: var(--muted-3); font-size: 20px; line-height: 1; cursor: pointer; }
.modal__close:hover { color: var(--ink); }
.modal__body { padding: 24px 20px 22px; }
.modal__title { font-size: 22px; font-weight: 600; letter-spacing: -.028em; line-height: 1.18; }
.modal__text { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.55; }
.modal__section { margin-top: 22px; }

.amount { display: grid; gap: 12px; }
.amount__box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  padding: 12px 15px;
  background: var(--paper);
}
.amount__cur { font-size: 20px; color: var(--muted-5); }
.amount__box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
}
.amount__hint { font-size: 12px; font-weight: 500; color: var(--accent); }
.amount__hint--low { color: var(--danger); }
.amount__quick { display: flex; gap: 7px; }
.quick {
  flex: 1;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink);
  padding: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.quick:hover { border-color: var(--accent); color: var(--accent); }
.modal__hint { font-size: 12px; color: var(--muted-2); }

.fields { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--muted); }
.field input {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--ink);
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[type="file"] { padding: 9px 11px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.field__hint { font-size: 11px; color: var(--muted-4); }
.field__hint--busy { color: var(--accent-dark); font-weight: 500; }
.art-preview {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line-2);
}
.field select {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--ink);
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
  appearance: none;
  cursor: pointer;
}
.field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal__error { font-size: 12.5px; color: var(--danger); margin-top: 14px; }

.durations { display: grid; gap: 9px; }
.duration {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}
.duration--on { border-color: var(--accent); background: var(--accent-tint-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.duration__label { font-size: 14px; font-weight: 600; }
.duration__note { font-size: 12px; color: var(--muted-2); margin-top: 3px; }
.duration__price { font-size: 17px; font-weight: 600; }

.receipt { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.receipt__line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-5);
  font-size: 13px;
  background: var(--paper);
}
.receipt__line span:first-child { color: var(--muted-2); }
.receipt__v { font-weight: 600; color: var(--ink); }
.receipt__v.accent { color: var(--accent); }

.modal__actions { display: flex; gap: 8px; margin-top: 22px; }
.btn-back {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--ink);
  padding: 12px 17px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-back:hover { border-color: var(--muted-5); }
.btn-primary {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 12px 17px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary--dark { background: var(--ink); }
.btn-primary--dark:hover { background: var(--ink); }
.btn-primary--disabled { opacity: .45; cursor: not-allowed; }
.btn-primary--disabled:hover { background: var(--accent); }
.modal__foot { font-size: 11px; color: var(--muted-4); margin-top: 13px; text-align: center; }

/* Responsive */
@media (max-width: 1179px) {
  .hero { padding-top: 40px; }
  .board { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .side { position: static; grid-column: 1 / -1; }
  .side--l { order: 2; }
  .side--r { order: 3; }
  .side__track { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

@media (max-width: 999px) {
  :root { --h1-size: 34px; }
}

@media (max-width: 759px) {
  :root { --h1-size: 28px; }

  /* topbar : logo à gauche + FR/EN à droite sur la première ligne, toggle
     Tout-temps/Aujourd'hui en pleine largeur dessous */
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar__right { margin-left: auto; }
  #range-toggle { order: 3; flex: 1 1 100%; margin: 0; }
  #range-toggle .pill { flex: 1; text-align: center; }

  /* le badge du héro se replie proprement, centré */
  .badge { flex-wrap: wrap; justify-content: center; text-align: center; row-gap: 3px; }

  .hero__form { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; }
  .row__logo { display: none; }
  .row__price { grid-column: 2; text-align: left; align-self: auto; }

  /* filtres de catégories : barre horizontale défilante sur une seule ligne */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; white-space: nowrap; }

  /* slots : carrousel automatique (visuel seul), au-dessus et en dessous du
     classement — la piste dupliquée boucle sans couture */
  .side--l { order: -1; }
  .side--r { order: 3; }
  .side__inner { overflow: hidden; }
  .side__track {
    display: flex;
    gap: 0;
    width: max-content;
    animation: slotScroll 32s linear infinite;
  }
  .side__inner:hover .side__track,
  .side__inner:active .side__track { animation-play-state: paused; }
  .slot--clone { display: block; }
  .side__track .slot { flex: 0 0 218px; margin-right: 12px; }
  .side__track .slot__body { display: none; }
  .side__track .slot__art { border-bottom: 0; }
  /* bannière libre : le prix s'affiche sur le visuel, à la place de « Bannière L1 » */
  .side__track .slot__art-label { display: none; }
  .side__track .slot__art-label--mobile { display: block; }
}

@keyframes slotScroll {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .side__track { animation: none; }
}
