/* ============================================================
   LUXDRIVE — catalogue.css
   Standalone styles for the Nos Offres catalogue page.
   Depends on: styles.css (base vars, nav, footer, car cards)
   ============================================================ */

/* ── Page hero sub ── */
.ld-page-hero__sub {
  font-size: .95rem;
  color: var(--text-muted);
  margin-top: .6rem;
  font-weight: 300;
}

/* ── 2-column grid override for catalogue page ── */
.ld-catalogue-body .ld-cars-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* ============================================================
   VERTICAL CARD OVERRIDE — catalogue page only
   Image on top, details underneath. Overrides any flex-row
   layout from styles.css.
   ============================================================ */

/* Card itself: block, no flex-row */
.ld-catalogue-body .ld-car-card {
  display: flex;
  flex-direction: column;
}

/* Image wrap: full width, fixed height, no left/right sizing */
.ld-catalogue-body .ld-car-card__img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}

.ld-catalogue-body .ld-car-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* No-image placeholder: same proportions */
.ld-catalogue-body .ld-car-card__no-img {
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* Body: takes remaining height, normal flow */
.ld-catalogue-body .ld-car-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  min-width: 0;
}

/* Push footer (price + buttons) to the bottom of the card */
.ld-catalogue-body .ld-car-card__footer {
  margin-top: auto;
}

/* ============================================================
   CATALOGUE SECTION
   ============================================================ */
.ld-catalogue-section {
  background: #080808;
  min-height: 50vh;
}

.ld-catalogue-wrap {
  width: 100%;
}

/* ============================================================
   FILTER BAR — horizontal sticky strip
   ============================================================ */
.ld-filterbar {
  background: rgba(13, 13, 13, 0.97);
  border-bottom: 1px solid rgba(201, 168, 76, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.25rem 0 1rem;
  top: var(--nav-h, 72px);
  z-index: 90;
  backdrop-filter: blur(20px);
}

/* ── Main grid row: all filter groups + actions in one line ── */
.ld-filterbar__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 0.8fr 0.8fr auto;
  align-items: end;
  gap: 1rem;
}

/* Individual group */
.ld-filterbar__group {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

/* Label above each filter */
.cat-filter-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.7);
  display: block;
  white-space: nowrap;
}

/* Number range (Prix / Année) */
.ld-range-pair {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.ld-filter-num {
  width: 100%;
  min-width: 0;
  padding: .6rem .75rem;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #F0EDE8;
  font-family: 'Barlow', sans-serif;
  font-size: .85rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.ld-filter-num:focus {
  border-color: #C9A84C;
  box-shadow: 0 0 0 2px rgba(201, 168, 76, .12);
}

.ld-filter-num::placeholder {
  color: #555550;
}

/* hide number spinners */
.ld-filter-num::-webkit-inner-spin-button,
.ld-filter-num::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.ld-filter-num[type=number] {
  appearance: textfield;
}

.ld-range-sep {
  color: #555550;
  font-size: .8rem;
  flex-shrink: 0;
  line-height: 1;
}

/* Select wrapper */
.ld-filter-select-wrap {
  position: relative;
}

.cat-filter-select {
  width: 100%;
  padding: .6rem 2.2rem .6rem .85rem;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #F0EDE8;
  font-family: 'Barlow', sans-serif;
  font-size: .85rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .2s, box-shadow .2s;
}

.cat-filter-select:focus {
  border-color: #C9A84C;
  box-shadow: 0 0 0 2px rgba(201, 168, 76, .12);
}

.cat-filter-select option {
  background: #141414;
  color: #F0EDE8;
}

.cat-select-arrow {
  position: absolute;
  right: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: #C9A84C;
  font-size: .6rem;
  pointer-events: none;
}

/* Action buttons */
.ld-filterbar__actions {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.cat-btn-filter {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  background: #C9A84C;
  color: #080808;
  border: 1px solid #C9A84C;
  border-radius: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background .25s, transform .2s, box-shadow .2s;
}

.cat-btn-filter:hover {
  background: #E4C76B;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, .3);
}

.cat-btn-reset {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.1rem;
  background: transparent;
  color: #888880;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .25s, color .25s;
}

.cat-btn-reset:hover {
  border-color: #C9A84C;
  color: #C9A84C;
}

/* Meta row (results count) */
.ld-filterbar__meta {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.cat-results-count {
  font-family: 'Barlow', sans-serif;
  font-size: .82rem;
  color: #888880;
}

.cat-results-count strong {
  color: #C9A84C;
  font-size: .95rem;
}

/* ============================================================
   CATALOGUE BODY
   ============================================================ */
.ld-catalogue-body {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

/* Loading spinner */
.ld-catalogue-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
}

.ld-spinner {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(201, 168, 76, .15);
  border-top-color: #C9A84C;
  border-radius: 50%;
  animation: catSpin .7s linear infinite;
}

@keyframes catSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   EMPTY STATE — shown when list is empty on load OR no results
   ============================================================ */
.cat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
  min-height: 380px;
}

.cat-empty-state__icon-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(201, 168, 76, .07);
  border: 1px solid rgba(201, 168, 76, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: #C9A84C;
}

.cat-empty-state__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #F0EDE8;
  margin-bottom: .6rem;
}

.cat-empty-state__title em {
  font-style: italic;
  color: #C9A84C;
}

.cat-empty-state__sub {
  font-size: .95rem;
  color: #888880;
  font-weight: 300;
  max-width: 380px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.cat-empty-state__btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  background: #C9A84C;
  color: #080808;
  border: none;
  border-radius: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s, transform .2s;
  text-decoration: none;
}

.cat-empty-state__btn:hover {
  background: #E4C76B;
  transform: translateY(-2px);
}

/* No results (after filtering) */
.cat-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
}

.cat-no-results__icon {
  font-size: 2.2rem;
  color: #555550;
  margin-bottom: 1.25rem;
  display: block;
}

.cat-no-results h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: .5rem;
  color: #F0EDE8;
}

.cat-no-results p {
  font-size: .9rem;
  color: #888880;
  margin-bottom: 1.5rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.cat-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cat-pagination__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #888880;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  cursor: pointer;
  transition: all .25s;
}

.cat-pagination__btn:hover:not(:disabled) {
  border-color: #C9A84C;
  color: #C9A84C;
}

.cat-pagination__btn:disabled {
  opacity: .2;
  cursor: not-allowed;
}

.cat-pagination__numbers {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.cat-pagination__num {
  min-width: 38px;
  height: 38px;
  padding: 0 .6rem;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #888880;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .85rem;
  letter-spacing: .05em;
  cursor: pointer;
  transition: all .25s;
}

.cat-pagination__num:hover {
  color: #F0EDE8;
  border-color: rgba(255, 255, 255, .1);
}

.cat-pagination__num.is-active {
  background: #C9A84C;
  color: #080808;
  border-color: #C9A84C;
  font-weight: 700;
}

.cat-pagination__dots {
  color: #555550;
  font-size: .85rem;
  padding: 0 .25rem;
  user-select: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* 1280px — tighten gaps */
@media (max-width: 1280px) {
  .ld-filterbar__grid {
    grid-template-columns: 1fr 1fr 1fr 1fr 0.7fr 0.7fr auto;
    gap: .75rem;
  }
}

/* 1024px — two rows */
@media (max-width: 1024px) {
  .ld-filterbar__grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: .75rem 1rem;
  }

  .ld-filterbar__actions {
    grid-column: 3 / 5;
    justify-content: flex-end;
  }
}

/* 768px — two cols */
@media (max-width: 768px) {
  .ld-filterbar {
    position: static;
  }

  .ld-filterbar__grid {
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
  }

  .ld-filterbar__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: .5rem;
  }

  .cat-btn-filter,
  .cat-btn-reset {
    flex: 1;
    justify-content: center;
  }

  /* single column on mobile */
  .ld-catalogue-body .ld-cars-grid {
    grid-template-columns: 1fr;
  }
}

/* 480px — single col */
@media (max-width: 480px) {
  .ld-filterbar__grid {
    grid-template-columns: 1fr;
  }

  .ld-filterbar__actions {
    flex-direction: row;
  }

  .cat-empty-state {
    padding: 4rem 1.5rem;
  }

  .cat-empty-state__icon-wrap {
    width: 70px;
    height: 70px;
    font-size: 1.6rem;
  }

  .cat-empty-state__title {
    font-size: 1.4rem;
  }

  .ld-catalogue-body .ld-cars-grid {
    grid-template-columns: 1fr;
  }
}