/* ========================================
   Каталог автомобилей — oxvati.рф
   ======================================== */

.oxv-catalog {
  font-family: 'Nunito Sans', Arial, sans-serif;
  padding: 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Табы категорий --- */
.oxv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  margin-bottom: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.oxv-tabs::-webkit-scrollbar { display: none; }

.oxv-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.oxv-tab:hover {
  border-color: #f52c44;
  color: #f52c44;
}
.oxv-tab--active {
  background: #f52c44;
  border-color: #f52c44;
  color: #fff;
}
.oxv-tab--active:hover {
  color: #fff;
}

/* --- Поиск + сортировка --- */
.oxv-controls {
  display: flex;
  gap: 12px;
  padding: 0 20px;
  margin-bottom: 16px;
  align-items: center;
}

.oxv-search-wrap {
  flex: 1;
  position: relative;
}

.oxv-search {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  box-sizing: border-box;
}
.oxv-search:focus {
  border-color: #f52c44;
}

.oxv-sort {
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  outline: none;
  cursor: pointer;
  min-width: 200px;
}

/* --- Мобильная кнопка фильтров --- */
.oxv-mob-filter-btn {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 20px 12px;
  padding: 10px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: #333;
}
.oxv-mob-filter-btn:hover {
  border-color: #f52c44;
  color: #f52c44;
}

/* --- Layouts --- */
.oxv-main {
  display: flex;
  gap: 24px;
  padding: 0 20px;
}

/* --- Sidebar фильтры --- */
.oxv-sidebar {
  width: 240px;
  flex-shrink: 0;
}

.oxv-sidebar-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #333;
}

.oxv-clear-filters {
  font-size: 12px;
  color: #f52c44;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 4px;
}
.oxv-clear-filters:hover {
  background: #fef2f2;
}

.oxv-filter-group {
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 12px;
}

.oxv-filter-title {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.oxv-filter-title::after {
  content: '▾';
  font-size: 10px;
  color: #999;
  transition: transform 0.2s;
}
.oxv-filter-group--open .oxv-filter-title::after {
  transform: rotate(180deg);
}

.oxv-filter-list {
  display: none;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding-top: 6px;
  scrollbar-width: thin;
}
.oxv-filter-group--open .oxv-filter-list {
  display: flex;
}

.oxv-filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  padding: 3px 0;
}
.oxv-filter-label--hidden {
  display: none !important;
}
.oxv-filter-label input[type=checkbox] {
  accent-color: #f52c44;
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.oxv-filter-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oxv-filter-more {
  font-size: 13px;
  color: #f52c44;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 4px 0;
  font-family: inherit;
}

/* --- Контент --- */
.oxv-content {
  flex: 1;
  min-width: 0;
}

.oxv-counter {
  font-size: 14px;
  color: #777;
  margin-bottom: 12px;
}

/* --- Сетка карточек --- */
.oxv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.oxv-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

/* --- Карточка --- */
.oxv-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #eee;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.oxv-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.oxv-card-img-wrap {
  position: relative;
  padding-bottom: 60%;
  background: #f7f7f7;
  overflow: hidden;
}

.oxv-card-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s;
  padding: 8px;
}
.oxv-card:hover .oxv-card-img {
  transform: scale(1.03);
}

.oxv-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.oxv-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
.oxv-badge--new { background: #22c55e; }
.oxv-badge--used { background: #f59e0b; }
.oxv-badge--seized { background: #ef4444; }

.oxv-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.oxv-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
  line-height: 1.3;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.oxv-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #888;
  align-items: center;
}
.oxv-spec-dot {
  margin: 0 4px;
  color: #ccc;
}

.oxv-card-prices {
  margin-bottom: 10px;
}
.oxv-card-price {
  font-size: 18px;
  font-weight: 800;
  color: #222;
  line-height: 1.3;
}
.oxv-card-monthly {
  font-size: 14px;
  font-weight: 600;
  color: #4a6cf7;
  margin-top: 2px;
}

.oxv-card-leasing {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}
.oxv-leasing-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 11px;
  color: #666;
}

.oxv-card-btn {
  display: block;
  text-align: center;
  padding: 10px;
  background: #f52c44;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s;
  margin-top: auto;
  font-family: inherit;
}
.oxv-card-btn:hover {
  background: #d91e36;
}

/* --- Пагинация --- */
.oxv-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 30px 0;
  flex-wrap: wrap;
}

.oxv-page-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.oxv-page-btn:hover {
  border-color: #f52c44;
  color: #f52c44;
}
.oxv-page-btn--active {
  background: #f52c44;
  border-color: #f52c44;
  color: #fff;
}
.oxv-page-btn--active:hover {
  color: #fff;
}
.oxv-page-dots {
  padding: 0 4px;
  color: #999;
  font-size: 16px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1200px) {
  .oxv-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 960px) {
  .oxv-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .oxv-sidebar {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .oxv-tabs {
    padding: 10px 16px;
  }
  .oxv-controls {
    flex-direction: column;
    padding: 0 16px;
  }
  .oxv-sort {
    width: 100%;
    min-width: unset;
  }
  .oxv-main {
    flex-direction: column;
    padding: 0 16px;
  }
  .oxv-mob-filter-btn {
    display: inline-flex;
  }
  .oxv-sidebar {
    display: none;
    width: 100%;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: #fff;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
  }
  .oxv-sidebar--open {
    display: block;
  }
  .oxv-clear-filters {
    font-size: 14px;
  }
  .oxv-sidebar--open .oxv-sidebar-title::before {
    content: '✕ ';
    cursor: pointer;
  }
  .oxv-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .oxv-grid {
    grid-template-columns: 1fr;
  }
  .oxv-tab {
    font-size: 13px;
    padding: 6px 14px;
  }
  .oxv-card-price {
    font-size: 16px;
  }
  .oxv-card-monthly {
    font-size: 13px;
  }
}

/* ========================================
   Попап карточки товара
   ======================================== */
.oxv-popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: oxv-fadeIn 0.2s ease;
}

@keyframes oxv-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.oxv-popup-container {
  background: #fff;
  border-radius: 18px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: oxv-slideUp 0.25s ease;
}

@keyframes oxv-slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.oxv-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px 0;
}

.oxv-popup-back {
  background: none;
  border: none;
  color: #f52c44;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
}
.oxv-popup-back:hover {
  text-decoration: underline;
}

.oxv-popup-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.2s;
}
.oxv-popup-close:hover {
  color: #333;
  background: #f3f4f6;
}

.oxv-popup-body {
  display: flex;
  gap: 32px;
  padding: 20px 28px 32px;
}

.oxv-popup-image-col {
  flex: 0 0 45%;
  max-width: 45%;
}

.oxv-popup-img-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: #f7f7f7;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.oxv-popup-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.oxv-popup-info-col {
  flex: 1;
  min-width: 0;
}

.oxv-popup-title {
  font-size: 24px;
  font-weight: 800;
  color: #222;
  margin: 0 0 4px;
  line-height: 1.3;
  font-family: 'Nunito Sans', Arial, sans-serif;
}

.oxv-popup-brand {
  font-size: 14px;
  color: #999;
  margin-bottom: 20px;
}

/* Лизинговые компании — чекбоксы */
.oxv-popup-lc-section {
  margin-bottom: 16px;
}

.oxv-popup-lc-title {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
  font-weight: 500;
}

.oxv-popup-lc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.oxv-popup-lc-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  padding: 2px 0;
}

.oxv-popup-lc-cb {
  width: 18px;
  height: 18px;
  accent-color: #f52c44;
  cursor: pointer;
  flex-shrink: 0;
}

/* Кнопка Оформить */
.oxv-popup-order-btn {
  display: inline-block;
  padding: 12px 40px;
  background: #f52c44;
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.2s;
  margin: 16px 0 24px;
  text-align: center;
  font-family: inherit;
}
.oxv-popup-order-btn:hover {
  background: #d91e36;
}

/* Цена и ежемесячный платёж */
.oxv-popup-price-section {
  margin-bottom: 24px;
}

.oxv-popup-monthly {
  font-size: 22px;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.3;
}

.oxv-popup-monthly-val {
  font-weight: 800;
  color: #4a6cf7;
}

.oxv-popup-price-label {
  font-size: 14px;
  color: #777;
  margin-bottom: 4px;
}

.oxv-popup-price {
  font-size: 24px;
  font-weight: 800;
  color: #222;
  line-height: 1.3;
}

/* Характеристики */
.oxv-popup-specs {
  border-top: 1px solid #eee;
  padding-top: 16px;
}

.oxv-popup-spec-row {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.5;
}

.oxv-popup-spec-label {
  color: #999;
  white-space: nowrap;
  font-style: italic;
}

.oxv-popup-spec-value {
  color: #333;
  font-weight: 500;
}

/* ========================================
   Попап — Responsive
   ======================================== */
@media (max-width: 768px) {
  .oxv-popup-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .oxv-popup-container {
    border-radius: 18px 18px 0 0;
    max-height: 95vh;
  }
  .oxv-popup-body {
    flex-direction: column;
    gap: 20px;
    padding: 16px 20px 28px;
  }
  .oxv-popup-image-col {
    flex: none;
    max-width: 100%;
  }
  .oxv-popup-header {
    padding: 16px 20px 0;
  }
  .oxv-popup-title {
    font-size: 20px;
  }
  .oxv-popup-monthly {
    font-size: 18px;
  }
  .oxv-popup-price {
    font-size: 20px;
  }
}
