/* Stock listing — BE FORWARD marketplace theme */

body.bf-stock-page main.stk {
  background: var(--bf-page);
  overflow-x: clip;
}

/* ── Page head ───────────────────────────────────────────────── */

.stk-head {
  background: #fff;
  border-bottom: 1px solid var(--bf-line);
  padding: 20px 0 0;
}

.stk-head__crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--bf-muted);
  margin-bottom: 12px;
}

.stk-head__crumb a {
  color: var(--bf-muted) !important;
  text-decoration: none;
}

.stk-head__crumb a:hover {
  color: var(--bf-orange) !important;
}

.stk-head__crumb i {
  font-size: 9px;
  opacity: 0.45;
}

.stk-head__crumb span {
  color: var(--bf-black);
  font-weight: 600;
}

.stk-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 20px;
}

.stk-head__title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bf-black);
}

.stk-head__title em {
  font-style: normal;
  color: var(--bf-orange);
}

.stk-head__lead {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--bf-muted);
}

.stk-head__stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stk-head__stat {
  padding: 10px 16px;
  background: var(--bf-bg-soft);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  text-align: center;
  min-width: 88px;
}

.stk-head__stat strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bf-black);
  line-height: 1.1;
}

.stk-head__stat span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bf-muted);
}

/* ── Search panel ────────────────────────────────────────────── */

.stk-search-wrap {
  padding: 24px 0;
  background: var(--bf-page);
}

.stk-search-panel {
  background: linear-gradient(145deg, #0047FF 0%, #0038CC 55%, #002FA8 100%);
  padding: 22px 24px;
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stk-search-panel h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.stk-search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stk-search-form__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stk-search-form label span {
  display: block;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stk-search-form select,
.stk-search-form input[type="search"],
.stk-search-form input[type="number"] {
  width: 100%;
  border: none;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  border-radius: var(--bf-radius-sm);
  color: var(--bf-black);
}

.stk-search-form__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.stk-search-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bf-black);
  color: #fff;
  border: none;
  padding: 11px 28px;
  min-height: 42px;
  border-radius: var(--bf-radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.stk-search-form__submit:hover {
  background: #000;
}

.stk-search-form__submit small {
  font-size: 11px;
  font-weight: 500;
  color: #ccc;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.stk-search-form__clear {
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.9;
}

.stk-search-form__clear:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── Sidebar quick filters (type / make) ─────────────────────── */

.stk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--bf-line);
  color: var(--bf-grey);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.stk-pill em {
  font-style: normal;
  font-size: 11px;
  color: var(--bf-muted);
}

.stk-pill:hover,
.stk-pill.active {
  background: var(--bf-orange-soft);
  border-color: var(--bf-orange);
  color: var(--bf-orange-d);
}

.stk-pill.active em {
  color: var(--bf-orange);
}

.stk-sidebar__quick {
  padding-top: 14px;
  padding-bottom: 14px;
}

.stk-sidebar__pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stk-sidebar__pills .stk-pill {
  width: 100%;
  justify-content: space-between;
  white-space: normal;
  border-radius: var(--bf-radius-sm);
  padding: 9px 12px;
}

.stk-sidebar__pills .stk-pill span {
  min-width: 0;
  line-height: 1.35;
}

.stk-sidebar__pills .stk-pill em {
  flex-shrink: 0;
  margin-left: 8px;
}

/* ── Layout ──────────────────────────────────────────────────── */

.stk-body {
  padding: 0 0 48px;
  background: var(--bf-page);
}

.stk-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ── Sidebar filters ─────────────────────────────────────────── */

.stk-sidebar {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow);
  overflow: hidden;
}

.stk-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--bf-line);
  background: var(--bf-bg-soft);
}

.stk-sidebar__kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bf-orange);
  margin: 0 0 2px;
}

.stk-sidebar__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--bf-black);
}

.stk-sidebar__close {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  background: #fff;
  cursor: pointer;
  color: var(--bf-grey);
}

.stk-sidebar__section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--bf-line);
}

.stk-sidebar__section:last-of-type {
  border-bottom: none;
}

.stk-sidebar__section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bf-muted);
  margin: 0 0 12px;
}

.stk-sidebar__form .stock-filter-group {
  margin-bottom: 12px;
}

.stk-sidebar__form .stock-filter-group:last-child {
  margin-bottom: 0;
}

.stk-sidebar__form .stock-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stk-sidebar__form .stock-filter-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--bf-grey);
  margin-bottom: 6px;
}

.stk-sidebar__form .stock-filter-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--bf-black);
}

.stk-sidebar__form .stock-filter-input:focus {
  outline: none;
  border-color: var(--bf-orange);
  box-shadow: 0 0 0 3px rgba(0, 71, 255, 0.15);
}

.stk-sidebar__form .stock-filter-input-wrap {
  position: relative;
}

.stk-sidebar__form .stock-filter-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bf-muted);
  font-size: 13px;
}

.stk-sidebar__form .stock-filter-input-wrap .stock-filter-input {
  padding-left: 36px;
}

.stk-sidebar__actions {
  padding: 14px 18px 18px;
  display: grid;
  gap: 8px;
  background: var(--bf-bg-soft);
  border-top: 1px solid var(--bf-line);
}

.stk-sidebar__actions .rj-btn {
  width: 100%;
  justify-content: center;
}

.stock-filter-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 950;
}

.stock-filter-backdrop.show {
  display: block;
}

.stk-sidebar.open {
  transform: translateX(0);
}

/* ── Toolbar ─────────────────────────────────────────────────── */

.stk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--bf-shadow);
}

.stk-toolbar__left,
.stk-toolbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stk-toolbar__filters {
  display: none;
}

.stk-toolbar__count strong {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bf-black);
}

.stk-toolbar__count span,
.stk-toolbar__count em {
  font-size: 13px;
  color: var(--bf-muted);
  font-style: normal;
}

.stk-view-toggle {
  display: inline-flex;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  overflow: hidden;
}

.stk-view-toggle .stock-view-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #fff;
  color: var(--bf-muted);
  cursor: pointer;
}

.stk-view-toggle .stock-view-btn.active {
  background: var(--bf-orange);
  color: #fff;
}

.stk-sort-form .stock-sort-select {
  min-width: 160px;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.stk-toolbar__save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--bf-grey);
  cursor: pointer;
}

.stk-toolbar__save:hover {
  border-color: var(--bf-orange);
  color: var(--bf-orange);
}

.stk-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bf-orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* ── Filter chips ────────────────────────────────────────────── */

.stk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.stk-chips .stock-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bf-orange-soft);
  border: 1px solid rgba(0, 71, 255, 0.35);
  font-size: 12px;
  font-weight: 600;
  color: var(--bf-orange-d);
  text-decoration: none;
}

.stk-chips .stock-filter-chip-clear {
  background: #fff;
  border-color: var(--bf-line);
  color: var(--bf-muted);
}

/* ── Results grid ────────────────────────────────────────────── */

.stk-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stk-results-grid.list-view {
  grid-template-columns: 1fr;
  gap: 14px;
}

/* ── Vehicle cards ───────────────────────────────────────────── */

.stk-unit {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  overflow: hidden;
  box-shadow: var(--bf-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.stk-unit:hover {
  transform: translateY(-2px);
  box-shadow: var(--bf-shadow-md);
  border-color: #d1d5db;
}

.stk-unit__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bf-bg-soft);
}

.stk-unit__img-link {
  display: block;
  width: 100%;
  height: 100%;
}

.stk-unit__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.stk-unit:hover .stk-unit__media img {
  transform: scale(1.04);
}

.stk-unit__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bf-orange);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
}

.stk-unit__badge.badge-reserved {
  top: auto;
  bottom: 8px;
  left: 8px;
  background: var(--bf-black);
}

.stk-unit__actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.stk-unit__fav {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--bf-muted);
  cursor: pointer;
  box-shadow: var(--bf-shadow);
}

.stk-unit__fav.active,
.stk-unit__fav:hover {
  color: var(--bf-orange);
}

.stk-unit__compare {
  padding: 6px 10px;
  border: none;
  border-radius: var(--bf-radius-sm);
  background: rgba(255, 255, 255, 0.95);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.stk-unit:hover .stk-unit__compare {
  opacity: 1;
}

.stk-unit__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.stk-unit__stock {
  font-size: 11px;
  font-weight: 600;
  color: var(--bf-muted);
  margin: 0 0 4px;
}

.stk-unit__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.stk-unit__title a {
  color: var(--bf-black) !important;
  text-decoration: none;
}

.stk-unit__title a:hover {
  color: var(--bf-orange) !important;
}

.stk-unit__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.stk-unit__specs li {
  font-size: 11px;
  color: var(--bf-muted);
  background: var(--bf-bg-soft);
  padding: 4px 8px;
  border-radius: 4px;
}

.stk-unit__specs li i {
  color: var(--bf-orange);
  margin-right: 4px;
}

.stk-unit__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--bf-line);
}

.stk-unit__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--bf-orange-d);
}

.stk-unit__price small {
  font-size: 10px;
  font-weight: 600;
  color: var(--bf-muted);
}

.stk-unit__link {
  font-size: 12px;
  font-weight: 600;
  color: var(--bf-blue) !important;
  text-decoration: none;
}

.stk-unit__link:hover {
  color: var(--bf-orange) !important;
}

/* List view */
.stk-results-grid.list-view .stk-unit {
  flex-direction: row;
}

.stk-results-grid.list-view .stk-unit__media {
  flex: 0 0 280px;
  aspect-ratio: auto;
  min-height: 180px;
}

/* ── Empty state ─────────────────────────────────────────────── */

.stk-empty {
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
}

.stk-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--bf-orange-soft);
  color: var(--bf-orange);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

.stk-empty h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.stk-empty p {
  color: var(--bf-muted);
  margin: 0 0 20px;
}

.stk-empty__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Pagination ──────────────────────────────────────────────── */

.stk-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.stk-pagination .stock-page-btn {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  background: #fff;
  color: var(--bf-grey);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.stk-pagination .stock-page-btn.active,
.stk-pagination .stock-page-btn:hover {
  background: var(--bf-orange);
  border-color: var(--bf-orange);
  color: #fff;
}

.stk-pagination .stock-page-ellipsis {
  color: var(--bf-muted);
  padding: 0 4px;
}

/* ── CTA ─────────────────────────────────────────────────────── */

.stk-cta {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  padding: 40px 0 48px;
}

.stk-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 32px;
  border-radius: var(--bf-radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stk-cta__copy h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.35rem;
}

.stk-cta__copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  max-width: 48ch;
}

.stk-cta__copy .rj-kicker {
  color: var(--bf-orange);
}

.stk-cta__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stk-cta .rj-btn--ghost {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff !important;
  background: transparent;
}

@media (max-width: 1100px) {
  .stk-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stk-search-form__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .stk-layout {
    grid-template-columns: 1fr;
  }

  .stk-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(100vw, 380px);
    z-index: 960;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    border-radius: 0;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .stk-sidebar::-webkit-scrollbar {
    display: none;
  }

  .stk-sidebar.open {
    transform: translateX(0);
  }

  .stk-sidebar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .stk-toolbar__filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bf-orange);
    color: #fff;
    border: none;
    border-radius: var(--bf-radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
}
