/* =========================================================
   ROOT / BASE
   ========================================================= */

:root{
  --card-bg: rgba(255, 255, 255, 0.035);
  --panel-bg: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --input-bg: rgba(0, 0, 0, 0.22);
  --input-border: rgba(255, 255, 255, 0.10);
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* =========================
   PAGE
   ========================= */

body{
  font-family: "Poppins", sans-serif;
}

.cars-page{
  position: relative;
  width: min(1500px, calc(100% - 60px));
  margin: 120px auto 0;
}

.cars-hero{
  margin: 6px 0 18px;
}

.cars-hero h1{
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: 0.2px;
}

.cars-sub{
  margin: 0;
  opacity: 0.75;
  line-height: 1.4;
}

#f-q::-webkit-search-cancel-button{
  -webkit-appearance: none;
  appearance: none;
}

/* =========================
   ANIMATION
   ========================= */

@media (prefers-reduced-motion: no-preference){
  .cars-filters{
    animation: carIn 700ms ease both;
    animation-delay: 120ms;
  }

  @keyframes carIn{
    from{ opacity: 0; transform: translateY(10px); }
    to{ opacity: 1; transform: translateY(0); }
  }
}

/* =========================
   FILTERS
   ========================= */

.cars-filters{
  margin: 14px 0 120px;
  padding: 14px;
  border-radius: var(--radius-lg);

  background: radial-gradient(120% 140% at 0% 0%, rgba(83, 83, 83, 0.062) 0%, rgba(0,0,0,0.25) 60%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);

  opacity: 0.92;
}

.filters-grid{
  display: grid;
  grid-template-columns: 1.4fr repeat(6, minmax(0, 1fr)) 140px;
  gap: 12px;
  align-items: end;
}

.field{
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span{
  font-size: 12px;
  opacity: 0.80;
  letter-spacing: 0.2px;
}

.field select option{
  background: #0f131ae1;
  color: #fff;
}

.field input,
.field select{
  width: 100%;
  min-width: 0;
  box-sizing: border-box;

  height: 40px;
  padding: 0 8px;

  border-radius: var(--radius-md);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: inherit;

  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field input::placeholder{
  opacity: 0.55;
}

.field input:focus,
.field select:focus{
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(250, 231, 191, 0.10);
  background: rgba(0, 0, 0, 0.26);
}

.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

.field input[type="number"]{
  -moz-appearance: textfield;
  appearance: textfield;
}

.field-actions{
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.btn-reset{
  width: 100%;
  min-width: 0;
  box-sizing: border-box;

  height: 42px;
  padding: 0 14px;

  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;

  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
}

.btn-reset:hover{
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-reset:active{
  transform: translateY(1px);
}

.filters-meta{
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  font-size: 13px;
  opacity: 0.85;
}

/* =========================
   GRID
   ========================= */

.cars-list-wrap{
  margin-top: 0;
  display: flex;
  justify-content: center;
}

.cars-grid{
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

/* =========================
   EMPTY / LOADING (cards)
   ========================= */

.cars-loading,
.cars-empty{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  position: relative;
  padding: 22px 22px;
  border-radius: var(--radius-lg);

  background: radial-gradient(120% 140% at 0% 0%, rgba(250, 231, 191, 0) 0%, rgba(0,0,0,0.25) 60%);
  border: 1px solid rgba(250, 231, 191, 0.32);

  box-shadow: 0 14px 34px rgba(0,0,0,0.30);
  backdrop-filter: blur(10px);

  opacity: 0.98;
  max-width: 420px;
}

.cars-loading strong,
.cars-empty strong{
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.cars-loading span,
.cars-empty span,
.cars-loading p,
.cars-empty p{
  display: block;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0.78;
}

@media (max-width: 700px){
  .cars-loading,
  .cars-empty{
    padding: 18px 16px;
    max-width: 100%;
  }

  .cars-loading::before,
  .cars-empty::before{
    left: 12px;
    top: 12px;
    bottom: 12px;
  }
}

/* =========================
   CARD
   ========================= */

.car-card{
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;

  border-radius: 16px;
  overflow: hidden;

  text-decoration: none;
  color: inherit;

  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);

  transition:
    transform 1000ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 1000ms ease,
    box-shadow 1000ms cubic-bezier(0.22, 1, 0.36, 1);

  transform-origin: center;
  will-change: transform;
}

.car-card:hover{
  transform: translateY(-2px) scale(1.02);
  z-index: 2;

  border-color: rgba(250, 231, 191, 0.35);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.car-media{
  position: relative;
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.car-media img{
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 600ms ease;
}

.car-card:hover .car-media img{
  transform: scale(1.06);
}

.car-media::after{
  z-index: 1;
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.00) 35%,
    rgba(0,0,0,0.28) 70%,
    rgba(0,0,0,0.55) 100%
  );
  pointer-events: none;
}

.car-body{
  padding: 12px 12px 14px;
  display: grid;
  gap: 10px;
  background: rgba(17, 17, 17, 0.75);
}

.car-top{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.car-title{
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.2px;

  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-price{
  z-index: 2;
  position: absolute;
  bottom: 10px;
  right: 10px;

  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;

  padding: 8px 12px;
  border-radius: 12px;

  background: rgba(0, 0, 0, 0.171);
  border: 1px solid rgba(255, 255, 255, 0.185);
  backdrop-filter: blur(6px);
  color: #ffffff;
}

.car-specs{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  opacity: 0.92;
}

.car-specs span{
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 6px 10px;
  border-radius: 10px;

  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.226);
}

.car-specs span:has(:not(*)){
  opacity: 0.75;
}

.car-cta{
  display: flex;
  justify-content: flex-end;
}

.car-link{
  font-size: 13px;
  opacity: 0.85;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
   SECTION VEHICULES NEUFS
   ========================================================= */

.cars-new{
  margin: 90px 0 40px;
  display: flex;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cars-new::before{
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);

  width: min(1100px, 100%);
  height: 260px;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(250, 231, 191, 0.10),
      transparent 40%
    );

  filter: blur(90px);
  opacity: 0.6;
  pointer-events: none;
}

.cars-new__panel{
  position:relative;
  width: min(900px, 100%);
  padding: 34px 38px;
  text-align:center;

}

.cars-new__panel::before{
  content:"";
  position:absolute;
  left:30%;
  right:30%;
  top:0;

  height:1px;

  background:
    linear-gradient(
      to right,
      transparent,
      rgba(250, 231, 191, 0.34),
      transparent
    );
}

.cars-new__panel h2{
  margin:0 0 10px;
  font-size:26px;
  letter-spacing:0.3px;
}

.cars-new__panel p{
  margin:0 0 18px;
  opacity:0.78;
  line-height:1.5;
}

.cars-new .cta-halo{
  margin-top: 10px;
}


/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1100px){
  .filters-grid{
    grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr 1fr;
  }

  .field-actions{
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .cars-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px){
  .cars-page{
    width: calc(100% - 24px);
  }

  .filters-grid{
    grid-template-columns: 1fr 1fr;
  }

  .cars-grid{
    grid-template-columns: 1fr;
  }

  .car-title{
    max-width: 62%;
  }

}
