/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

body {
  font-family: 'Inter', sans-serif;
  color: #1a2e3b;
  background: #edf2f5;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased
}

a {
  text-decoration: none;
  color: inherit
}

img {
  display: block;
  max-width: 100%
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px
}

/* ===== HEADER ===== */
.header {
  background: #fff;
  border-bottom: 1px solid #e8ebed;
  position: sticky;
  top: 0;
  z-index: 100
}

.header-inner {
  display: flex;
  align-items: center;
  height: 56px;
  gap: 32px
}

.logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #1a2e3b;
  white-space: nowrap
}

.nav {
  display: flex;
  gap: 24px;
  flex: 1
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #5a6872;
  transition: color .2s;
  padding: 18px 0;
  border-bottom: 2px solid transparent
}

.nav-link:hover {
  color: #1a8a7d
}

.nav-link.active {
  color: #1a8a7d;
  border-bottom-color: #1a8a7d
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f6f7;
  border-radius: 8px;
  padding: 8px 14px;
  width: 180px
}

.header-search input {
  background: none;
  width: 100%;
  font-size: 13px;
  color: #1a2e3b
}

.header-search input::placeholder {
  color: #a0a8b0
}

.btn-list {
  background: #1a8a7d;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .2s;
  cursor: pointer
}

.btn-list:hover {
  background: #157a6e
}

.btn-user {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a8a7d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s
}

.btn-user:hover {
  background: #157a6e
}

/* ===== FILTER SECTION (auto.ru style) ===== */
.filter-section {
  background: #f5f6f7;
  padding: 28px 0 24px
}

.filter-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start
}

.filter-card {
  flex: 1;
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06)
}

/* Hero title */
.filter-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #1a2e3b;
  margin-bottom: 2px
}

.filter-hero-sub {
  font-size: 14px;
  color: #8a939c;
  margin-bottom: 16px
}

/* Top row: tabs + checkbox + mode tabs */
.filter-row-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef0f2
}

.filter-tabs {
  display: flex;
  gap: 6px
}

.ftab {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #dde1e4;
  color: #5a6872;
  transition: all .15s
}

.ftab.active {
  background: #1a2e3b;
  color: #fff;
  border-color: #1a2e3b
}

.ftab:hover:not(.active) {
  border-color: #1a8a7d;
  color: #1a8a7d
}

.ff-check-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #5a6872;
  cursor: pointer;
  margin-left: 4px
}

.ff-check-inline input {
  width: 15px;
  height: 15px;
  accent-color: #1a8a7d;
  cursor: pointer
}

.filter-mode-tabs {
  display: flex;
  gap: 0;
  margin-left: auto;
  background: #f0f2f4;
  border-radius: 8px;
  overflow: hidden
}

.mtab {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #5a6872;
  transition: all .15s;
  border: 1.5px solid transparent
}

.mtab.active {
  background: #fff;
  color: #1a2e3b;
  border-color: #dde1e4;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08)
}

.mtab:hover:not(.active) {
  color: #1a8a7d
}

/* Brand icons row (like auto.ru logos) */
.brand-icons-row {
  display: flex;
  gap: 4px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #eef0f2;
  overflow-x: auto
}

.brand-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: #5a6872;
  transition: all .15s;
  min-width: 68px;
  cursor: pointer
}

.brand-icon:hover {
  background: #f0f8f7;
  color: #1a8a7d
}

.brand-icon.active {
  color: #1a8a7d
}

.brand-icon.active .bi-img {
  transform: scale(1.08)
}

.bi-img {
  font-size: 28px;
  transition: transform .15s;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center
}

.brand-icon span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap
}

/* Types grid (like auto.ru brands list) */
.types-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eef0f2
}

.tg-col {
  flex: 1;
  min-width: 0
}

.tg-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  text-decoration: none;
  transition: color .15s
}

.tg-item:hover {
  color: #1a8a7d
}

.tg-name {
  font-size: 13px;
  font-weight: 500;
  color: #1a2e3b;
  transition: color .15s
}

.tg-item:hover .tg-name {
  color: #1a8a7d
}

.tg-count {
  font-size: 12px;
  color: #b0b8c0;
  font-weight: 400
}

.tg-all .tg-name {
  color: #1a8a7d;
  font-weight: 600
}

/* City selector in top row */
.city-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f8f7;
  border: 1.5px solid #c8e6e3;
  border-radius: 8px;
  padding: 5px 12px;
  margin-left: 4px
}

.city-select {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #1a8a7d;
  cursor: pointer;
  appearance: none;
  outline: none;
  padding-right: 4px
}

/* Room buttons (shared) */
.room-btn {
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #e8ebed;
  color: #5a6872;
  transition: all .15s;
  white-space: nowrap
}

.room-btn.active {
  background: #1a2e3b;
  color: #fff;
  border-color: #1a2e3b
}

.room-btn:hover:not(.active) {
  border-color: #1a8a7d;
  color: #1a8a7d
}

/* ===== MEGA FILTER PANEL ===== */
.mega-filter {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4, 0, .2, 1), padding .3s, opacity .3s;
  opacity: 0;
  background: #fafbfc;
  border-radius: 10px;
  margin-bottom: 0
}

.mega-filter.open {
  max-height: 800px;
  opacity: 1;
  padding: 20px 22px;
  margin-bottom: 16px;
  border: 1px solid #eef0f2
}

.mf-row {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f2
}

.mf-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0
}

.mf-group {
  flex: 1;
  min-width: 0
}

.mf-wide {
  flex: 2
}

.mf-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #8a939c;
  margin-bottom: 7px;
  text-transform: uppercase
}

.mf-pair {
  display: flex;
  align-items: center;
  gap: 6px
}

.mf-input {
  width: 100%;
  background: #fff;
  border: 1.5px solid #e8ebed;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #1a2e3b;
  transition: border-color .15s
}

.mf-input:focus {
  border-color: #1a8a7d
}

.mf-input::placeholder {
  color: #b0b8c0
}

.mf-dash {
  color: #c0c8d0;
  font-size: 14px;
  flex-shrink: 0
}

.mf-rooms {
  display: flex;
  gap: 4px;
  flex-wrap: wrap
}

/* Chip buttons */
.mf-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.mf-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid #dde1e4;
  color: #5a6872;
  transition: all .15s;
  background: #fff
}

.mf-chip.active {
  background: #1a8a7d;
  color: #fff;
  border-color: #1a8a7d
}

.mf-chip:hover:not(.active) {
  border-color: #1a8a7d;
  color: #1a8a7d
}

/* Checkboxes */
.mf-checks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap
}

.mf-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #5a6872;
  cursor: pointer;
  white-space: nowrap
}

.mf-check input {
  width: 15px;
  height: 15px;
  accent-color: #1a8a7d;
  cursor: pointer
}

/* Amenities grid */
.mf-amenities {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.mf-amen {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #5a6872;
  cursor: pointer;
  padding: 5px 12px;
  border: 1.5px solid #e8ebed;
  border-radius: 8px;
  background: #fff;
  transition: all .15s;
  white-space: nowrap
}

.mf-amen:hover {
  border-color: #1a8a7d;
  color: #1a8a7d
}

.mf-amen input {
  width: 14px;
  height: 14px;
  accent-color: #1a8a7d;
  cursor: pointer
}

.mf-amen:has(input:checked) {
  background: #f0faf9;
  border-color: #1a8a7d;
  color: #1a8a7d
}

/* Misc row */
.mf-row-misc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px
}

.mf-toggle-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #5a6872;
  cursor: pointer;
  white-space: nowrap
}

.mf-toggle-check input {
  width: 14px;
  height: 14px;
  accent-color: #1a8a7d;
  cursor: pointer
}

.mf-actions {
  display: flex;
  gap: 8px;
  margin-left: auto
}

.mf-reset {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #8a939c;
  border: 1.5px solid #dde1e4;
  transition: all .15s;
  background: #fff
}

.mf-reset:hover {
  border-color: #e74c3c;
  color: #e74c3c
}

.mf-apply {
  padding: 8px 22px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: #1a8a7d;
  color: #fff;
  border: 1.5px solid #1a8a7d;
  transition: all .15s
}

.mf-apply:hover {
  background: #157a6e;
  border-color: #157a6e
}

/* Filter bottom */
.filter-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.fb-info {
  font-size: 12px;
  color: #8a939c
}

.fb-count {
  font-weight: 700;
  color: #1a2e3b
}

.btn-show {
  background: #1a8a7d;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 36px;
  border-radius: 24px;
  cursor: pointer;
  transition: background .2s
}

.btn-show:hover {
  background: #157a6e
}

/* Valuation widget */
.val-widget {
  width: 270px;
  background: #1a2e3b;
  border-radius: 14px;
  padding: 22px 20px;
  color: #fff;
  flex-shrink: 0
}

.val-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  color: #e74c3c;
  border: 1.5px solid #e74c3c;
  margin-bottom: 12px;
  letter-spacing: .3px
}

.val-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px
}

.val-input {
  width: 100%;
  background: #253747;
  border: 1.5px solid #35495c;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
  margin-bottom: 10px;
  transition: border-color .2s
}

.val-input:focus {
  border-color: #1a8a7d
}

.val-input::placeholder {
  color: #7b8fa0
}

.val-pair {
  display: flex;
  gap: 8px
}

.val-sm {
  flex: 1
}

.val-city {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 12px;
  padding: 0 2px
}

.val-city-label {
  font-size: 12px;
  color: #7b8fa0
}

.val-city-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff
}

.btn-val {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  padding: 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 6px
}

.btn-val-primary {
  background: #1a8a7d;
  color: #fff;
  border: 1.5px solid #1a8a7d
}

.btn-val-primary:hover {
  background: #157a6e;
  border-color: #157a6e
}

.btn-val-secondary {
  background: transparent;
  color: #fff;
  border: 1.5px solid #45586b
}

.btn-val-secondary:hover {
  border-color: #fff
}

.val-note {
  font-size: 10px;
  color: #5a7080;
  line-height: 1.4;
  margin-top: 8px
}


/* ===== LISTINGS ===== */
.listings {
  padding: 32px 0 40px
}

.list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px
}

.list-title {
  font-size: 26px;
  font-weight: 800;
  color: #1a2e3b;
  margin-bottom: 4px
}

.list-sub {
  font-size: 13px;
  color: #8a939c
}

.list-controls {
  display: flex;
  align-items: center;
  gap: 12px
}

.btn-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #5a6872;
  padding: 8px 14px;
  border: 1.5px solid #dde1e4;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s
}

.btn-filter-toggle:hover {
  border-color: #1a8a7d;
  color: #1a8a7d
}

.sort-sel {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #5a6872;
  cursor: pointer;
  padding: 8px 14px;
  border: 1.5px solid #dde1e4;
  border-radius: 8px;
  transition: all .2s
}

.sort-sel:hover {
  border-color: #1a8a7d;
  color: #1a8a7d
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px
}

.card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  transition: box-shadow .25s, transform .25s;
  cursor: pointer
}

.card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
  transform: translateY(-3px)
}

.card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #1a2e3b
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s
}

.card:hover .card-img img {
  transform: scale(1.04)
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  color: #fff;
  z-index: 2
}

.badge-premium {
  background: #1a8a7d
}

.badge-new {
  background: #2563eb
}

.badge-hot {
  background: #dc2626
}

.card-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #5a6872;
  cursor: pointer;
  transition: all .2s;
  z-index: 2;
  border: none
}

.card-fav:hover,
.card-fav.saved {
  color: #dc2626;
  background: #fff
}

/* Card body */
.card-body {
  padding: 14px 16px 16px
}

.card-price {
  font-size: 17px;
  font-weight: 800;
  color: #1a2e3b;
  margin-bottom: 4px
}

.card-specs {
  font-size: 13px;
  color: #5a6872;
  margin-bottom: 8px
}

.card-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #8a939c;
  margin-bottom: 12px
}

.card-seller {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0f2f4
}

.seller-ava {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1a8a7d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.seller-dev {
  background: #2563eb
}

.seller-priv {
  background: #8a939c
}

.seller-ag {
  background: #7c3aed
}

.card-seller span {
  font-size: 12px;
  font-weight: 500;
  color: #5a6872
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px
}

.pg-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  color: #5a6872;
  transition: all .2s
}

.pg-num.active {
  background: #1a2e3b;
  color: #fff
}

a.pg-num:hover {
  background: #f0f2f4
}

.pg-dots {
  color: #8a939c;
  font-size: 14px;
  padding: 0 4px
}

.pg-next {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #5a6872;
  margin-left: 8px;
  transition: color .2s
}

.pg-next:hover {
  color: #1a8a7d
}

/* ===== FOOTER ===== */
.footer {
  background: #fff;
  border-top: 1px solid #e8ebed;
  padding: 48px 0 0;
  margin-top: 20px
}

.footer-cols {
  display: flex;
  gap: 40px;
  padding-bottom: 36px
}

.footer-col {
  flex: 1
}

.footer-brand {
  flex: 1.3
}

.footer-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #1a2e3b;
  margin-bottom: 12px
}

.footer-brand p {
  font-size: 13px;
  color: #8a939c;
  line-height: 1.6;
  max-width: 220px
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #1a2e3b;
  margin-bottom: 16px
}

.footer-col a {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .4px;
  color: #8a939c;
  margin-bottom: 10px;
  transition: color .2s
}

.footer-col a:hover {
  color: #1a8a7d
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid #e8ebed;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .5px;
  color: #8a939c
}

.footer-legal {
  display: flex;
  gap: 24px
}

.footer-legal a {
  color: #8a939c;
  transition: color .2s
}

.footer-legal a:hover {
  color: #1a8a7d
}

/* ===== RESPONSIVE ===== */
@media(max-width:1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr)
  }

  .filter-layout {
    flex-direction: column
  }

  .val-widget {
    width: 100%
  }

  .types-grid {
    flex-wrap: wrap
  }

  .tg-col {
    min-width: calc(50% - 4px)
  }
}

@media(max-width:768px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .inline-filters {
    flex-wrap: wrap
  }

  .if-group {
    min-width: calc(50% - 8px)
  }

  .nav {
    display: none
  }

  .brand-icons-row {
    gap: 2px
  }

  .brand-icon {
    min-width: 56px;
    padding: 6px 8px
  }

  .filter-row-top {
    flex-wrap: wrap
  }

  .filter-mode-tabs {
    margin-left: 0
  }

  .footer-cols {
    flex-wrap: wrap;
    gap: 24px
  }

  .footer-col {
    min-width: calc(50% - 12px);
    flex: unset
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center
  }
}

@media(max-width:480px) {
  .cards-grid {
    grid-template-columns: 1fr
  }

  .inline-filters {
    flex-direction: column
  }

  .if-group {
    min-width: 100%
  }

  .types-grid {
    flex-direction: column
  }

  .tg-col {
    min-width: 100%
  }

  .header-search {
    display: none
  }

  .filter-hero-title {
    font-size: 20px
  }
}