/* LeaseBooking – unified new/used car module */

.lb-cars,
.lb-cars * {
  box-sizing: border-box;
}

.lb-cars {
  --lb-blue: #006cff;
  --lb-blue-soft: #0878f9;
  --lb-blue-dark: #1747ae;
  --lb-navy: #0b2a78;
  --lb-card-title: #071d48;
  --lb-muted: #8593b5;
  --lb-line: #dce5f2;
  --lb-soft: #f3f6fa;
  --lb-white: #ffffff;
  --lb-card-shadow: 0 3px 15px rgba(15, 40, 80, .07);
  --lb-card-hover-shadow: 0 10px 25px rgba(15, 40, 80, .12);

  position: relative;
  width: 100%;
  overflow: visible;
  background: transparent;
  color: var(--lb-navy);
  font-family: inherit;
}

.lb-cars__inner {
  position: relative;
  width: min(1500px, 100%);
  margin: 0 auto;
  overflow: visible;
}

.lb-cars__title {
  max-width: 700px;
  margin: 0 0 28px;
  color: #ffffff;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -1.5px;
}

/* ---------- filter bar ---------- */

.lb-cars__filters {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: 245px minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(210px, 1fr) 76px;
  align-items: stretch;
  min-height: 88px;
  padding: 7px;
  overflow: visible;
  border: 1px solid #e2eaf5;
  border-radius: 20px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 8px 28px rgba(15, 42, 90, .07), 0 1px 3px rgba(15, 42, 90, .03);
}

.lb-cars__switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-self: center;
  height: 60px;
  padding: 4px;
  overflow: hidden;
  border-radius: 32px;
  background: #eef3f9;
}

.lb-cars__mode {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 28px;
  background: transparent;
  color: #173b82;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.lb-cars__mode:hover { color: var(--lb-blue); }

.lb-cars__mode.is-active {
  color: #fff;
  background: var(--lb-blue-soft);
  box-shadow: 0 5px 14px rgba(0, 108, 255, .22);
}

.lb-cars__field {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 20px;
  overflow: visible;
  border-left: 1px solid var(--lb-line);
  cursor: pointer;
}

.lb-cars__field.is-open { z-index: 500; }

.lb-cars__field:hover,
.lb-cars__field:focus-within { background: rgba(245, 249, 255, .5); }

.lb-cars__field-icon {
  display: flex;
  width: 30px;
  min-width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  color: var(--lb-blue);
  pointer-events: none;
}

.lb-cars__field-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-cars__field-content {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.lb-cars__field-label {
  display: block;
  color: #7890bd;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  pointer-events: none;
}

.lb-cars__trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 0 26px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lb-navy);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.lb-cars__trigger:hover { color: var(--lb-blue); }

.lb-cars__trigger:disabled {
  cursor: wait;
  opacity: .55;
}

.lb-cars__value {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lb-cars__value > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lb-cars__chevron {
  position: absolute;
  top: 50%;
  right: 2px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #0b3f91;
  border-bottom: 2px solid #0b3f91;
  transform: translateY(-65%) rotate(45deg);
  transition: transform .18s ease, border-color .18s ease;
  pointer-events: none;
}

.lb-cars__field.is-open .lb-cars__chevron {
  border-color: var(--lb-blue);
  transform: translateY(-25%) rotate(225deg);
}

.lb-cars__field.is-open .lb-cars__trigger { color: var(--lb-blue); }

/* ---------- dropdown menu ---------- */

.lb-cars__menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 600;
  display: none;
  min-width: 100%;
  max-height: 310px;
  padding: 7px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #dbe5f3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 42, 90, .16), 0 4px 12px rgba(15, 42, 90, .08);
  scrollbar-width: thin;
  scrollbar-color: #c7d5e9 transparent;
}

.lb-cars__field.is-open .lb-cars__menu {
  display: block;
  animation: lbMenuIn .16s ease-out both;
}

@keyframes lbMenuIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.lb-cars__menu::-webkit-scrollbar { width: 6px; }
.lb-cars__menu::-webkit-scrollbar-thumb { border-radius: 10px; background: #c7d5e9; }

.lb-cars__option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #18366f;
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.lb-cars__option:hover,
.lb-cars__option:focus-visible {
  background: #f1f6ff;
  color: var(--lb-blue);
  outline: none;
}

.lb-cars__option.is-selected {
  background: #eaf2ff;
  color: #075dd1;
  font-weight: 700;
}

.lb-cars__option.is-selected::after {
  content: "✓";
  margin-left: auto;
  padding-left: 12px;
  color: var(--lb-blue);
  font-size: 14px;
  font-weight: 800;
}

.lb-cars__flag {
  display: block;
  width: 24px;
  height: 18px;
  flex: 0 0 24px;
  margin-right: 9px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 42, 90, .1);
}

.lb-cars__value .lb-cars__flag { margin-right: 0; }

/* ---------- search button ---------- */

.lb-cars__refresh {
  display: grid;
  width: 60px;
  height: 60px;
  align-self: center;
  justify-self: center;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #1681ff 0%, #006cff 100%);
  box-shadow: 0 6px 18px rgba(0, 108, 255, .18);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.lb-cars__refresh:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(0, 108, 255, .24);
}

.lb-cars__refresh:active { transform: translateY(0); }
.lb-cars__refresh:disabled { cursor: wait; opacity: .65; }

.lb-cars__refresh svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-cars__mode:focus-visible,
.lb-cars__trigger:focus-visible,
.lb-cars__refresh:focus-visible,
.lb-cars__arrow:focus-visible,
.lb-car__link:focus-visible {
  outline: 3px solid rgba(0, 108, 255, .28);
  outline-offset: 2px;
}

/* ---------- results ---------- */

.lb-cars__results-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}

.lb-cars__results-head h3 {
  margin-top: 180px;
  color: #ffffff;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.8px;
}

.lb-cars__count {
  color: var(--lb-muted);
  font-size: 14px;
}

.lb-cars__stage {
  position: relative;
  z-index: 1;
}

.lb-cars__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.lb-cars__viewport::-webkit-scrollbar { display: none; }

.lb-cars__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 70px) / 6);
  gap: 14px;
  min-height: 390px;
}

/* ---------- card ---------- */

.lb-car {
  position: relative;
  min-width: 0;
  min-height: 390px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--lb-white);
  box-shadow: var(--lb-card-shadow);
  scroll-snap-align: start;
  transition: transform .2s ease, box-shadow .2s ease;
}

.lb-car:hover {
  transform: translateY(-3px);
  box-shadow: var(--lb-card-hover-shadow);
}

.lb-car__link {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 390px;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.lb-car__image {
  position: relative;
  display: flex;
  width: 100%;
  height: 175px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  pa
  overflow: hidden;
  background: var(--lb-white);
}

.lb-car__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform .25s ease;
}

.lb-car:hover .lb-car__image img { transform: scale(1.03); }

.lb-car__placeholder {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  background: var(--lb-soft);
}

.lb-car__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #075dd1;
  font-size: 12px;
  font-weight: 800;
}

.lb-car__body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  padding: 18px 18px 22px;
}

.lb-car__body h4 {
  display: -webkit-box;
  min-width: 0;
  min-height: 52px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--lb-card-title);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lb-car__variant {
  display: -webkit-box;
  min-height: 22px;
  margin: 0 0 4px;
  overflow: hidden;
  color: #837b77;
  font-size: 14px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lb-car__price {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 8px 0 0;
  color: var(--lb-blue-dark);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
}

.lb-car__before {
  margin-left: 6px;
  color: var(--lb-muted);
  font-size: 14px;
  font-weight: 600;
}

.lb-car__price small {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.lb-car__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(to top, hsl(221 64% 40%), transparent 55%);
  transition: opacity .2s ease;
}

.lb-car:hover .lb-car__overlay {
  opacity: 1;
  pointer-events: auto;
}

.lb-car__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border-radius: 6px;
  background: var(--lb-white);
  color: var(--lb-blue-dark);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  transition: transform .2s ease, background-color .2s ease;
}

.lb-car__button:hover {
  transform: translateY(-1px);
  background: #f5f8ff;
}

/* ---------- arrows, status, loader ---------- */

.lb-cars__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 50px;
  height: 50px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--lb-navy);
  background: var(--lb-white);
  box-shadow: 0 5px 20px rgba(11, 42, 120, .12);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform .2s ease, box-shadow .2s ease;
}

.lb-cars__arrow:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 8px 25px rgba(11, 42, 120, .18);
}

.lb-cars__arrow svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-cars__arrow--prev { left: -25px; }
.lb-cars__arrow--next { right: -25px; }

.lb-cars__arrow:disabled {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.lb-cars__status {
  min-height: 24px;
  padding-top: 18px;
  color: var(--lb-muted);
  text-align: center;
  font-size: 14px;
}

.lb-cars__loader {
  grid-column: 1 / -1;
  display: flex;
  width: 100%;
  min-height: 390px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lb-cars__loader i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lb-blue);
  animation: lbCarsPulse 1.2s infinite ease-in-out;
}

.lb-cars__loader i:nth-child(2) { animation-delay: .15s; }
.lb-cars__loader i:nth-child(3) { animation-delay: .3s; }

@keyframes lbCarsPulse {
  0%, 70%, 100% { transform: scale(.6); opacity: .35; }
  35% { transform: scale(1); opacity: 1; }
}

/* ---------- breakpoints ---------- */

@media (max-width: 1180px) {
  .lb-cars__filters {
    grid-template-columns: 220px repeat(4, minmax(135px, 1fr)) 70px;
  }

  .lb-cars__field {
    gap: 10px;
    padding: 10px 14px;
  }

  .lb-cars__field-icon {
    width: 26px;
    min-width: 26px;
  }

  .lb-cars__field-icon svg {
    width: 24px;
    height: 24px;
  }

  .lb-cars__track { grid-auto-columns: calc((100% - 42px) / 4); }
}

@media (max-width: 900px) {
  .lb-cars { padding: 52px 20px 70px; }

  .lb-cars__filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }

  .lb-cars__switch { grid-column: 1 / -1; }

  .lb-cars__field {
    min-height: 68px;
    padding: 10px 16px;
    border: 1px solid var(--lb-line);
    border-radius: 10px;
  }

  .lb-cars__refresh {
    grid-column: 1 / -1;
    width: 100%;
  }

  .lb-cars__menu {
    top: calc(100% + 7px);
    max-height: 280px;
  }

  .lb-cars__track { grid-auto-columns: calc((100% - 28px) / 3); }
}

@media (max-width: 640px) {
  .lb-cars { padding: 38px 16px 54px; }

  .lb-cars__title {
    max-width: 340px;
    margin-bottom: 22px;
    font-size: 36px;
    letter-spacing: -.8px;
  }

  .lb-cars__filters {
    grid-template-columns: 1fr;
    border-radius: 14px;
  }

  .lb-cars__switch { grid-column: auto; }

  .lb-cars__field {
    min-height: 64px;
    padding: 8px 16px;
  }

  .lb-cars__refresh {
    grid-column: auto;
    width: 100%;
  }

  .lb-cars__menu {
    top: calc(100% + 6px);
    max-height: 260px;
  }

  .lb-cars__results-head {
    align-items: flex-end;
    margin: 40px 0 20px;
  }

  .lb-cars__results-head h3 { font-size: 30px; }

  .lb-cars__count {
    font-size: 12px;
    white-space: nowrap;
  }

  .lb-cars__track {
    grid-auto-columns: 82%;
    gap: 12px;
  }

  .lb-car,
  .lb-car__link { min-height: 410px; }

  .lb-car__image { height: 210px; }

  .lb-cars__arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lb-cars *,
  .lb-cars *::before,
  .lb-cars *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
