/* ============================================================
   CATALOGUE.CSS — Vélothèque Uccle
   Variables depuis variables.css uniquement.
   Mobile-first — drawer mobile < 768px.
   Les styles du slider sont dans velo-slider.css.
   ============================================================ */

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */

/* Entrée des cartes — stagger géré par JS (animation-delay inline) */
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Animation du compteur de résultats */
@keyframes catalogue-count-flip {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Micro-bounce sur activation d'un filtre pill */
@keyframes pill-bounce {
  0%, 100% { transform: scale(1); }
  40%       { transform: scale(1.1); }
  70%       { transform: scale(0.96); }
}

/* ══════════════════════════════════════════
   WRAPPER
══════════════════════════════════════════ */
.catalogue-wrapper {
  padding-bottom: 48px;
}

/* ══════════════════════════════════════════
   FILTER PANEL — desktop
   sticky sous la nav
══════════════════════════════════════════ */
.filter-panel {
  background: var(--surface-white);
  border-bottom: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
}

.filter-panel .site-inner {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fg-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fg-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.fg-sep {
  width: 1px;
  height: 42px;
  background: var(--border-subtle);
  align-self: center;
}

/* ── Swatches couleur ── */
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  padding: 0;
  outline: none;
  background: none;
  position: relative;
}

.swatch:hover {
  transform: scale(1.18);
}

.swatch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface-white), 0 0 0 4px var(--color-focus);
}

.swatch.is-active {
  box-shadow: 0 0 0 2px var(--surface-white), 0 0 0 4px var(--brand-primary);
}

.swatch.is-active::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--color-white);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 50%;
  line-height: 1;
}

.swatch-all {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  background: #EDF2F8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
  outline: none;
}

.swatch-all:hover {
  transform: scale(1.1);
}

.swatch-all:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface-white), 0 0 0 4px var(--color-focus);
}

.swatch-all.is-active {
  background: var(--brand-primary);
  color: var(--color-white);
  border-color: var(--brand-primary);
}

/* ── Pills taille / statut ── */
.fpill {
  appearance: none;
  outline: none;
  box-shadow: none;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1.5px solid var(--border-subtle);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}

.fpill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.fpill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-focus);
}

.fpill.is-active {
  background: var(--brand-primary);
  color: var(--color-white);
  border-color: var(--brand-primary);
  animation: pill-bounce 0.3s ease;
}

/* ══════════════════════════════════════════
   BARRE RÉSULTATS
══════════════════════════════════════════ */
.results-bar .site-inner {
  padding-top: 14px;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.results-count b {
  color: var(--text-main);
  font-weight: 700;
}

.js-results-count {
  display: inline-block;
}

.js-filter-badge {
  background: var(--brand-accent);
  color: var(--brand-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

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

.reset-btn {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color 0.15s, opacity 0.15s;
  opacity: 0;
  pointer-events: none;
}

.reset-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.reset-btn:hover {
  color: var(--brand-primary);
}

.reset-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ══════════════════════════════════════════
   BOUTON MOBILE — déclenche le drawer
══════════════════════════════════════════ */
.filter-panel-mobile-btn {
  display: none;
}

/* ══════════════════════════════════════════
   DRAWER MOBILE
══════════════════════════════════════════ */
.filter-drawer-overlay {
  display: none;
}

/* ══════════════════════════════════════════
   GRILLE
══════════════════════════════════════════ */
.velo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding-top: 16px;
}

.catalogue-grid-wrap .site-inner {
  padding-top: 0;
  padding-bottom: 48px;
}

.velo-grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: pop 0.3s ease;
}

.velo-grid__empty-icon {
  font-size: 40px;
  opacity: 0.35;
  display: block;
}

/* ══════════════════════════════════════════
   CARTE
══════════════════════════════════════════ */
.velo-card {
  background: var(--surface-white);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s;
  display: flex;
  flex-direction: column;
  animation: pop 0.32s ease both;
  text-decoration: none;
  color: inherit;
}

.velo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 59, 104, 0.1);
}

.velo-card:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 16px;
}

.velo-card[hidden] {
  display: none;
}

.velo-card__img {
  background: #EDF2F8;
  margin: 10px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 8px;
}

.velo-card__model {
  position: absolute;
  top: 9px;
  left: 9px;
  background: var(--brand-primary);
  color: var(--color-white);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 5px 8px 3px;
  border-radius: 12px;
  text-transform: uppercase;
  z-index: 2;
}

.velo-card__status {
  position: absolute;
  top: 9px;
  right: 9px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  z-index: 2;
  white-space: nowrap;
}

.velo-card__single-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.28s ease;
}

.velo-card:hover .velo-card__single-img {
  transform: scale(1.05);
}

.velo-card__svg {
  width: 120px;
  height: auto;
  transition: transform 0.25s ease;
}

.velo-card:hover .velo-card__svg {
  transform: scale(1.08);
}

.velo-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.velo-card__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 9px;
}

.velo-card__color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: inline-block;
  flex-shrink: 0;
}

.velo-card__size {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary);
  background: #EDF2F8;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.velo-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-primary);
  margin: 0 0 3px;
  line-height: 1.2;
}

.velo-card__frame {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 12px;
  flex: 1;
  line-height: 1.4;
}

.velo-card__btn {
  appearance: none;
  background: var(--brand-primary);
  color: var(--color-white);
  border: none;
  outline: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s;
  text-decoration: none;
  display: inline-block;
  align-self: flex-start;
}

.velo-card__btn:hover {
  background: var(--brand-secondary);
  color: var(--color-white);
}

.velo-card:focus-visible .velo-card__btn {
  outline: none;
}

/* ══════════════════════════════════════════
   RESPONSIVE — TABLETTE 900px
══════════════════════════════════════════ */
@media (max-width: 900px) {
  .fg-sep {
    display: none;
  }

  .filter-panel .site-inner {
    gap: 16px;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE 768px
══════════════════════════════════════════ */
@media (max-width: 768px) {

  .filter-panel .site-inner {
    display: none;
  }

  .filter-panel-mobile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-align: left;
  }

  .filter-panel-mobile-btn:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
  }

  .filter-panel-mobile-btn__icon {
    font-size: 16px;
    flex-shrink: 0;
  }

  .js-mobile-filter-count {
    background: var(--brand-primary);
    color: var(--color-white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
  }

  .filter-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .filter-drawer-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .filter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-white);
    border-radius: 20px 20px 0 0;
    z-index: 201;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .filter-drawer.is-open {
    transform: translateY(0);
  }

  .filter-drawer__handle {
    width: 40px;
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    margin: 14px auto 0;
  }

  .filter-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .filter-drawer__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
  }

  .filter-drawer__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    padding: 4px;
    line-height: 1;
    font-family: inherit;
  }

  .filter-drawer__close:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: 4px;
  }

  .filter-drawer__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .filter-drawer .filter-group {
    gap: 10px;
  }

  .filter-drawer .fg-sep {
    display: none;
  }

  .filter-drawer__footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    position: sticky;
    bottom: 0;
    background: var(--surface-white);
  }

  .filter-drawer__apply {
    flex: 1;
    padding: 11px;
    background: var(--brand-primary);
    color: var(--color-white);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
  }

  .filter-drawer__apply:hover {
    background: var(--brand-secondary);
  }

  .filter-drawer__apply:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
  }

  .filter-drawer__reset {
    flex: 1;
    padding: 11px;
    background: none;
    border: 1.5px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }

  .filter-drawer__reset:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
  }

  .filter-drawer__reset:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
  }

  .velo-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filter-panel {
    position: static;
  }

  .velo-card__img {
    height: 200px;
  }

  .velo-card__title {
    font-size: 15px;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — PETIT MOBILE 400px
══════════════════════════════════════════ */
@media (max-width: 400px) {
  .velo-card__img {
    height: 180px;
  }
}
