.tl-page--stock {
  background: #f6f7fb;
}

.tl-stock {
  padding: 28px 0 88px;
  color: #0d1234;
}

.tl-stock__wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.tl-stock__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7085;
}

.tl-stock__crumbs a {
  color: #0d1234;
  text-decoration: none;
}

.tl-stock__crumbs a:hover {
  color: #ef4136;
}

.tl-stock__hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0d1234;
}

.tl-stock__eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ef4136;
}

.tl-stock__lead {
  max-width: 640px;
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: #4c5166;
}

.tl-stock__filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 32px;
  padding: 20px;
  background: #fff;
  border: 1px solid rgba(13, 18, 52, 0.08);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(13, 18, 52, 0.04);
}

.tl-stock__field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0d1234;
}

.tl-stock__field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d5dae6;
  border-radius: 12px;
  background: #fff;
  color: #0d1234;
  font: inherit;
  font-size: 16px;
}

.tl-stock__field input:focus {
  outline: 2px solid #ef4136;
  outline-offset: 1px;
  border-color: #ef4136;
}

.tl-stock__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.tl-stock__submit.tl-btn {
  min-height: 48px;
  padding: 12px 28px;
}

.tl-stock__clear {
  color: #0d1234;
  font-weight: 600;
  text-decoration: none;
}

.tl-stock__clear:hover {
  color: #ef4136;
}

.tl-stock__count {
  margin: 22px 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: #4c5166;
}

.tl-stock__empty {
  margin: 12px 0 0;
  padding: 36px 24px;
  background: #fff;
  border: 1px dashed #d5dae6;
  border-radius: 16px;
  text-align: center;
  color: #4c5166;
}

.tl-stock__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Catalog results: one offer under another (parity with producers list). */
.tl-results--stock {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Stock listing: vehicle photo as 4:3 cover (not circular producer logo). */
.tl-page--stock-catalog .tl-prod-card__logo {
  width: 160px !important;
  height: 120px !important;
  flex: 0 0 160px !important;
  object-fit: cover;
  object-position: center;
  border-radius: 12px !important;
}

.tl-page--stock-catalog .tl-prod-card__logo--fallback {
  width: 160px;
  height: 120px;
  flex: 0 0 160px;
  border-radius: 12px;
}

.tl-page--stock-catalog .tl-prod-card__badge {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  padding: 6px 12px;
}

@media (max-width: 900px) {
  .tl-page--stock-catalog .tl-prod-card__logo,
  .tl-page--stock-catalog .tl-prod-card__logo--fallback {
    width: 112px !important;
    height: 84px !important;
    flex: 0 0 112px !important;
    border-radius: 10px !important;
  }
}

.tl-stock-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(217, 217, 217, 0.9);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(13, 18, 52, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tl-stock-row:hover,
.tl-stock-row.is-selected,
.tl-stock-row:focus-visible {
  border-color: #ef4136;
  box-shadow: 0 10px 28px rgba(239, 65, 54, 0.12);
  outline: none;
}

.tl-stock-row__media {
  display: block;
  aspect-ratio: 4 / 3;
  min-height: 0;
  background: #eef0f5;
  overflow: hidden;
}

.tl-stock-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.tl-stock-row__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px 16px;
  min-width: 0;
}

.tl-stock-row__cat {
  margin: 0;
  font-size: 13px;
  color: #707072;
}

.tl-stock-row__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  color: #0a0c19;
}

.tl-stock-row__title a {
  color: inherit;
  text-decoration: none;
}

.tl-stock-row__title a:hover {
  color: #ef4136;
}

.tl-stock-row__price {
  margin: 6px 0 0;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  color: #ef4136;
}

.tl-stock-row__meta {
  margin: 4px 0 0;
  font-size: 14px;
  color: #0d1234;
}

.tl-page--stock-catalog .tl-stock__grid--catalog {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.tl-stock-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(217, 217, 217, 0.9);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(13, 18, 52, 0.04);
}

.tl-stock-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  background: #eef0f5;
  overflow: hidden;
}

.tl-stock-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tl-stock-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 18px 20px;
}

.tl-stock-card__cat {
  margin: 0;
  font-size: 13px;
  color: #707072;
}

.tl-stock-card__title {
  margin: 4px 0 12px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  color: #0a0c19;
}

.tl-stock-card__title a {
  color: inherit;
  text-decoration: none;
}

.tl-stock-card__title a:hover {
  color: #ef4136;
}

.tl-stock-card__price {
  margin: auto 0 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  color: #ef4136;
}

.tl-stock-card__price small {
  font-size: 16px;
  font-weight: 700;
}

.tl-stock-card__meta {
  margin: 12px 0 0;
  font-size: 14px;
  color: #0d1234;
}

.tl-stock__pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
}

.tl-stock__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d5dae6;
  border-radius: 12px;
  background: #fff;
  color: #0d1234;
  font-weight: 600;
  text-decoration: none;
}

.tl-stock__page:hover,
.tl-stock__page.is-current {
  background: #0d1234;
  border-color: #0d1234;
  color: #fff;
}

.tl-stock__page--step {
  padding: 0 16px;
}

.tl-stock__gap {
  color: #6b7085;
}

@media (max-width: 1023px) {
  .tl-stock__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tl-stock-row {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .tl-stock {
    padding-top: 16px;
  }

  .tl-stock__wrap {
    padding: 0 16px;
  }

  .tl-stock__filters {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .tl-stock__actions {
    flex-wrap: wrap;
  }

  .tl-stock__submit.tl-btn {
    width: 100%;
  }

  .tl-stock__grid {
    grid-template-columns: 1fr;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  .tl-stock-row {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .tl-stock-row__title {
    font-size: 16px;
  }

  .tl-stock-row__price {
    font-size: 18px;
  }

  .tl-results--stock {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  .tl-stock__pager {
    justify-content: flex-start;
  }
}

/* Otomoto-like stock filter controls (scoped) */
.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-field__label {
  font-size: 12px;
  font-weight: 600;
  color: #5c647a;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d8dde8;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: #0b1f3a;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-input:focus {
  outline: 2px solid #ef4136;
  outline-offset: 1px;
  border-color: #ef4136;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-combo {
  position: relative;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-combo .tl-stock-filter-input {
  padding-right: 36px;
  cursor: pointer;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-combo.is-open .tl-stock-filter-input {
  border-color: #ef4136;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-combo__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -3px;
  border-right: 2px solid #8a93a8;
  border-bottom: 2px solid #8a93a8;
  transform: rotate(45deg);
  pointer-events: none;
  transition: transform 0.15s ease;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-combo.is-open .tl-stock-filter-combo__chevron {
  margin-top: 2px;
  transform: rotate(-135deg);
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-suggest {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d8dde8;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(11, 31, 58, 0.12);
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-suggest[hidden] {
  display: none !important;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-suggest__opt {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: #0b1f3a;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-suggest__opt:hover,
.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-suggest__opt.is-active {
  background: #fff1f0;
  color: #ef4136;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d8dde8;
  border-radius: 999px;
  background: #fff;
  color: #0b1f3a;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-pill input:checked + span {
  border-color: #ef4136;
  background: #fff1f0;
  color: #ef4136;
}

.tl-page--stock-catalog .tl-stock-filters .tl-stock-filter-pill input:focus-visible + span {
  outline: 2px solid #ef4136;
  outline-offset: 2px;
}

.tl-page--stock-catalog .tl-stock-filters .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tl-page--stock-catalog .tl-catalog__save-filters.is-saved {
  color: #ef4136;
}

/* --- Audit fixes: map + save filters (stock-only, leave producer catalog alone) --- */

/* ≥1200px: restore 3-col split with map (overrides katalog.css hide at 901–1440). */
@media (min-width: 1200px) and (max-width: 1440px) {
  .tl-page--stock-catalog .tl-catalog-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(260px, 340px);
    gap: 24px;
  }

  .tl-page--stock-catalog .tl-catalog__map {
    display: block;
  }

  .tl-page--stock-catalog .tl-map--catalog,
  .tl-page--stock-catalog #trucklo-stock-map.tl-map--catalog {
    min-height: 480px;
    height: min(65vh, 720px);
  }
}

/* 901–1199: no split map — enable Lista/Mapa full-pane toggle instead. */
@media (min-width: 901px) and (max-width: 1199px) {
  .tl-page--stock-catalog .tl-results-mobile-bar {
    display: flex;
  }

  .tl-page--stock-catalog .tl-results-mobile-bar .tl-filter-open {
    display: none;
  }

  .tl-page--stock-catalog .tl-catalog-layout.is-map-view .tl-catalog__results {
    display: none;
  }

  .tl-page--stock-catalog .tl-catalog-layout.is-map-view .tl-catalog__map {
    display: block;
    position: relative;
    top: auto;
    min-height: 60vh;
  }

  .tl-page--stock-catalog .tl-catalog-layout.is-map-view .tl-map--catalog,
  .tl-page--stock-catalog .tl-catalog-layout.is-map-view #trucklo-stock-map.tl-map--catalog {
    min-height: 60vh;
    height: 70vh;
  }
}

/* ≤900: show Zapisz filtry (katalog.css hides it globally). */
@media (max-width: 900px) {
  .tl-page--stock-catalog .tl-catalog__actions .tl-catalog__save-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
  }

  .tl-page--stock-catalog .tl-catalog__toolbar {
    gap: 12px;
  }

  .tl-page--stock-catalog .tl-catalog__actions {
    flex-wrap: wrap;
    gap: 10px 14px;
  }
}

/* ≤480: icon-only save to avoid toolbar wrap clash. */
@media (max-width: 480px) {
  .tl-page--stock-catalog .tl-catalog__save-filters .tl-catalog__save-filters-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .tl-page--stock-catalog .tl-catalog__save-filters {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }
}

/* PDF download on marketplace listing cards */
.tl-page--stock-catalog .tl-prod-card {
  position: relative;
}
.tl-page--stock-catalog .tl-prod-card__pdf {
  display: inline-flex;
  align-items: center;
  margin: 0 16px 14px;
  padding: 6px 12px;
  border: 1px solid rgba(13, 18, 52, 0.18);
  border-radius: 999px;
  color: #0d1234;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
}
.tl-page--stock-catalog .tl-prod-card__pdf:hover {
  border-color: #ef4136;
  color: #ef4136;
}
