body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
	background: #f5f5f5;
    transition: background 0.3s ease;
}
body.dark {
    background: #000;
}
.container {
    display: flex;
    flex-direction: row;
    max-width: 1400px;
    margin: 20px auto;
    gap: 20px;
}
header {
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 20px auto auto;
    gap: 20px;
}
#catalog-title {
    text-decoration: none;
    color: inherit;
}
#catalog-title:hover h1 {
    color: #1e3c72;
}
body.dark #catalog-title:hover h1 {
    color: #357abd;
}
h1 {
    color: #438ef4;
    font-size: 28px;
    margin: 0;
}
body.dark h1 {
    color: #438ef4;
}
.search-container {
    display: flex;
    gap: 10px;
    flex-grow: 1;
}
.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px;
    gap: 10px;
}
.exchange-rates {
    margin-right: 10px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exchange-rates span {
    margin-left: 15px;
}
.dark .exchange-rates {
    color: #ccc;
}
#search {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 100%;
    max-width: 700px;
}
#search-button {
    padding: 8px 16px;
    background: #438ef4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
#search-button:hover {
    background: #1e3c72;
}
body.dark #search-button {
    background: #438ef4;
}
body.dark #search-button:hover {
    background: #357abd;
}
#theme-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}
body.light #theme-toggle::before {
    content: '🌙';
}
body.dark #theme-toggle::before {
    content: '☀️';
}
.filters {
    position: relative;
    width: 300px;
    padding: 15px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
}
body.dark .filters {
    background: #1c1c1c;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.popular-brands {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}
.favorites-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.dark .favorites-btn {
    color: #ccc;
}
/* Метка аренды - похожа на метку лизинга, но с другим цветом */
.rent-mark {
  display: inline-block;
  background: rgba(120, 180, 120, 0.1);
  padding: 0 5px;
  border-radius: 4px;
  color: #5a9e5a;
  font-size: 12px;
  cursor: help;
  margin-left: 4px;
}

body.dark .rent-mark {
  color: #8abb8a;
  background: rgba(120, 180, 120, 0.1);
}
.car-item.sold {
    position: relative;
}
.car-item.sold h3,
.car-item.sold p {
    opacity: 0.5;
}
.car-item.sold img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}
.profile-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #438ef4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s;
}
body.dark .profile-circle {
    background: #438ef4;
}
.profile-circle:hover {
    background: #1e3c72;
}
body.dark .profile-circle:hover {
    background: #357abd;
}
.selection-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.dark .selection-btn {
    color: #ccc;
}
.brand {
    padding: 10px;
    text-align: center;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.brand img {
    width: 40px;
    height: 40px;
}
body.dark .brand {
    background: #1c1c1c;
}
.brand:hover {
    background: #438ef4;
}
body.dark .brand:hover {
    background: #438ef4;
}
.sort {
    text-align: right;
}
.sort select {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
}
body.dark .sort select {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}
.filter-group {
    position: relative;
    margin-bottom: 15px;
}
.filter-group label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 5px;
}
.filter-group.hidden {
    display: none;
}
.manufacturer-header {
    font-weight: bold;
    padding: 5px 10px;
    color: #333;
    cursor: default;
}
body.dark .filter-group label {
    color: #e0e0e0;
}
body.dark .body-type,
body.dark .color,
body.dark .car-type-btn,
body.dark .condition-btn {
    color: #e0e0e0;
    background: #3a3a3a;
}
body.dark .body-type.active,
body.dark .color.active,
body.dark .car-type-btn.active,
body.dark .condition-btn.active {
    color: white;
}
.car-type-buttons, .condition-buttons {
    display: flex;
    gap: 10px;
}
.car-type-btn, .condition-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    text-align: center;
}
.car-type-btn.active, .condition-btn.active {
    background: #438ef4;
    color: white;
    border-color: #438ef4;
}
body.dark .car-type-btn, body.dark .condition-btn {
    border-color: #555;
}
body.dark .car-type-btn.active, body.dark .condition-btn.active {
    background: #438ef4;
    border-color: #438ef4;
}
.options-list {
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-top: 5px;
    background: white;
    display: none;
    position: relative;
}
.options-list.active {
    display: block;
}
.hide-options {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 8px;
    background: #438ef4;
    color: white;
    border: none;
    border-radius: 0 0 5px 5px;
    cursor: pointer;
}
body.dark .hide-options {
    background: #438ef4;
}
.hide-options:hover {
    background: #1e3c72;
}
body.dark .hide-options:hover {
    background: #357abd;
}
body.dark .options-list {
    background: #3a3a3a;
    border-color: #555;
}
.option-item {
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.option-item:hover {
    background: #f0f0f0;
}
body.dark .option-item:hover {
    background: #4a4a4a;
}
.year-month-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.wide {
    width: 70%;
}
.narrow {
    width: 30%;
}
.range-filter {
    display: flex;
    gap: 10px;
}
.range-filter input, .range-filter select, .filter-group select, .filter-group input[type="number"], .filter-group input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}
.range-filter select, .range-filter input {
    width: 50%;
}
body.dark .range-filter input, body.dark .range-filter select, body.dark .filter-group select, body.dark .filter-group input[type="number"], body.dark .filter-group input[type="text"] {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.body-type {
    cursor: pointer;
    user-select: none;
}
.body-type.active {
    background-color: #e0e0e0;
}
.body-types, .colors {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.body-type, .color {
    padding: 5px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}
.body-type.active, .color.active {
    background: #438ef4;
    color: white;
    border-color: #438ef4;
}
body.dark .body-type, body.dark .color {
    border-color: #555;
}
body.dark .body-type.active, body.dark .color.active {
    background: #438ef4;
    border-color: #438ef4;
}
.color {
    display: flex;
    align-items: center;
}
.color-circle {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 5px;
}
#more-colors {
    cursor: pointer;
    color: #438ef4;
}
body.dark #more-colors {
    color: #438ef4;
}
.reset-filter {
    display: none;
    position: absolute;
    right: 0;
    top: 0;
    color: #438ef4;
    cursor: pointer;
    font-size: 14px;
}
body.dark .reset-filter {
    color: #438ef4;
}
.reset-filter:hover {
    text-decoration: underline;
}
.car-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.car-item {
    position: relative;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    min-height: 350px;
}
body.dark .car-item {
    background: #1c1c1c;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.car-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
body.dark .car-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.car-item img {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.car-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.car-item h3 {
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
body.dark .car-item h3 {
    color: #e0e0e0;
}
.car-item p {
    margin: 5px 0;
    font-size: 14px;
    color: inherit;
    white-space: normal;
    text-overflow: clip;
}
body.dark .car-item p {
    color: #b0b0b0;
}
.price {
    color: #438ef4;
    font-weight: bold;
    font-size: 16px;
    margin-top: auto;
}
body.dark .price {
    color: #438ef4;
}
.profile-content {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
body.dark .profile-content {
    background: #1c1c1c;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.profile-section {
    margin-bottom: 20px;
}
.profile-section h3 {
    color: #438ef4;
    margin-bottom: 10px;
}
body.dark .profile-section h3 {
    color: #438ef4;
}
.theme-switcher {
    display: flex;
    gap: 10px;
}
.theme-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: none;
    cursor: pointer;
}
.theme-btn.active {
    background: #438ef4;
    color: white;
    border-color: #438ef4;
}
body.dark .theme-btn {
    border-color: #555;
}
body.dark .theme-btn.active {
    background: #438ef4;
    border-color: #438ef4;
}
.admin-content {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
body.dark .admin-content {
    background: #1c1c1c;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.admin-section {
    margin-bottom: 20px;
}
.admin-section h3 {
    color: #438ef4;
    margin-bottom: 10px;
}
body.dark .admin-section h3 {
    color: #438ef4;
}
.car-item .favorite {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #cccccc;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	-webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    border: none;
}
.car-item .favorite.active {
    color: #e63946 !important;
}

/* 
 * Стили для отображения города
 * Добавьте этот код в catalog.css
 */

/* Стили для города в ценнике */
.city-link {
  text-decoration: none;
  color: inherit;
}

/* Настройка для Price Breakdown в деталях автомобиля */
.price-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.price-item.note {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

body.dark .price-item.note {
  color: #aaa;
}

/* Стили для контейнера подсказки */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: default;
}

/* Стили для иконки вопроса */
.tooltip-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-left: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #438ef4;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

body.dark .tooltip-icon {
    background-color: #438ef4;
}

/* Стили для текста подсказки */
.tooltip-text {
    visibility: hidden;
    width: 280px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: normal;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Добавляем стрелочку */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* При наведении на всю метку показываем подсказку */
.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Метка лизинга */
.lease-mark {
  display: inline-block;
  background: rgba(120, 120, 120, 0.1);
  padding: 0 5px;
  border-radius: 4px;
  color: #777;
  font-size: 12px;
  cursor: help;
  margin-left: 4px;
}

body.dark .lease-mark {
  color: #aaa;
  background: rgba(170, 170, 170, 0.1);
}

/* Метки статусов расчетов */
.repair-status {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
  text-align: center;
}

.repair-status-none {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.repair-status-minor {
  background-color: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.repair-status-major {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

body.dark .repair-status-none {
  background-color: rgba(40, 167, 69, 0.2);
  color: #5bda7d;
}

body.dark .repair-status-minor {
  background-color: rgba(255, 193, 7, 0.2);
  color: #ffda6a;
}

body.dark .repair-status-major {
  background-color: rgba(220, 53, 69, 0.2);
  color: #eb8591;
}

/* Исправление цвета текста в выпадающих меню для темной темы */
body.dark .option-item {
  color: #e0e0e0;
}

body.dark #manufacturer-options, 
body.dark #model-options,
body.dark #generation-options, 
body.dark #grade-options {
  color: #e0e0e0;
  background: #3a3a3a;
}

/* Стили для исправления отображения сердечек на iPhone */
.car-item .favorite {
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  color: #cccccc !important;
}

.car-item .favorite.active {
  color: #e63946 !important;
}

@media (max-width: 768px) {
  .car-item .favorite {
    color: #cccccc !important;
  }
  
  .car-item .favorite.active {
    color: #e63946 !important;
  }
}

/* Стиль для новой опции "Кроме лизинговых" */
.exclude-lease-option {
  display: flex;
  align-items: center;
  margin-top: 10px;
  cursor: pointer;
}

.exclude-lease-option input {
  margin-right: 8px;
}

body.dark .exclude-lease-option {
  color: #e0e0e0;
}
    .car-item .favorite {
        color: #cccccc !important;
    }
    .car-item .favorite.active {
        color: #e63946 !important;
        transform: scale(1.05);
    }
}
    /* На мобильных устройствах сделаем подсказку при клике */
    .tooltip-text {
        visibility: hidden;
        opacity: 0;
    }
    
    .tooltip-icon.active + .tooltip-text {
        visibility: visible;
        opacity: 1;
    }
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #438ef4;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
body.dark .scroll-to-top {
    background-color: #438ef4;
}
.scroll-to-top:hover {
    background-color: #1e3c72;
}
body.dark .scroll-to-top:hover {
    background-color: #357abd;
}
.scroll-to-top svg {
    width: 20px;
    height: 20px;
}
@media (max-width: 768px) {
    .scroll-to-top {
        width: 50px;
        height: 50px;
        bottom: 70px;
    }
    .scroll-to-top svg {
        width: 24px;
        height: 24px;
    }
}
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #438ef4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}
body.dark .loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #438ef4;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.error {
    color: #e63946;
    text-align: center;
    margin-top: 20px;
    font-size: 16px;
}
.filter-apply {
    position: sticky;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px 0;
    z-index: 100;
    background: transparent;
}
#apply-filters {
    padding: 10px 20px;
    background: #438ef4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    min-width: 120px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}
body.dark #apply-filters {
    background: #438ef4;
}
#apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
#filter-count {
    font-weight: bold;
}
#filter-tags {
    min-height: 20px;
    background: #f0f0f0;
}
.filter-tag {
    display: inline-block;
    background: #e0e0e0;
    padding: 5px 10px;
    margin: 0 5px 5px 0;
    border-radius: 15px;
    cursor: pointer;
}
.mobile-header {
    display: none;
    max-width: 100%;
    padding: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
body.dark .mobile-header {
    background: #1c1c1c;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.mobile-header .search-container {
    flex-wrap: nowrap;
    align-items: center;
}
.mobile-header #mobile-search {
    flex-grow: 1;
    max-width: none;
    margin-right: 5px;
}
.mobile-header #mobile-search-button {
    padding: 8px 12px;
    font-size: 14px;
}
.mobile-rates {
    display: flex;
    font-size: 12px;
    overflow-x: hidden;
    width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.mobile-rates span {
    margin-right: 10px;
}
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}
body.dark .bottom-nav {
    background: #1c1c1c;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}
.nav-item {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
}
body.dark .nav-item {
    color: #ccc;
}
.nav-item:hover {
    color: #438ef4;
}
body.dark .nav-item:hover {
    color: #438ef4;
}
.filters-toggle {
    display: none;
    text-align: center;
    padding: 10px;
    background: #438ef4;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    margin: 10px;
}
body.dark .filters-toggle {
    background: #438ef4;
}
.filters-toggle:hover {
    background: #1e3c72;
}
body.dark .filters-toggle:hover {
    background: #357abd;
}

/* Медиа-запросы для мобильных устройств (до 768px) */
@media (max-width: 768px) {
    header {
        display: none;
    }
    .mobile-header {
        display: block;
    }
    .mobile-header #mobile-search {
        height: 16px;
        padding: 10px;
        flex-grow: 1;
    }
    .mobile-header .search-container {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0;
    }
    .mobile-header #mobile-search-button {
        height: 40px;
        padding: 0 12px;
        white-space: nowrap;
    }
    .bottom-nav {
        display: flex;
    }
    .container {
        flex-direction: column;
        max-width: 100%;
        padding: 0;
    }
    .filters {
		left: 10px;
        width: auto;
        padding: 10px;
        padding-bottom: 80px;
    }
    .filters.hidden {
        display: none;
    }
    .filters-toggle {
        display: block; /* Показываем кнопку фильтров */
    }
    .filters-toggle.active {
        display: block; /* Оставляем видимость при активности */
    }
    .main-content {
        width: auto;
        margin-left: 10px;
        margin-right: 10px;
    }
    .popular-brands {
        display: none;
    }
    .car-list {
        gap: 15px;
        padding: 0;
    }
    .car-item {
        padding: 10px;
        min-height: auto;
        max-width: 100%;
    }
    .car-item img {
        object-position: center;
        background: #f5f5f5;
    }
    body.dark .car-item img {
        background: #1c1c1c;
    }
    .car-info {
        padding-top: 5px;
    }
    .car-item h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    .mobile-rates {
        display: flex;
        flex-direction: column;
        gap: 2px;
        font-size: 12px;
        white-space: nowrap;
        margin-right: 5px;
        min-width: 80px;
        width: 0;
    }
    .mobile-rates span {
        margin-right: 0;
    }
.filter-apply {
        width: 90%; /* На мобильных кнопка чуть уже контейнера */
    }
    #apply-filters {
        width: 100%; /* На мобильных кнопка растягивается */
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Медиа-запросы для планшетов (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    header {
        display: none;
    }
    .mobile-header {
        display: block;
    }
    .bottom-nav {
        display: flex;
    }
    .container {
        flex-direction: column;
        max-width: 100%;
    }
    .filters {
        width: auto;
        padding: 15px;
        margin-left: 10px;
        margin-right: 10px;
        padding-bottom: 80px;
    }
    .filters.hidden {
        display: none;
    }
    .filters-toggle {
        display: block; /* Показываем кнопку фильтров */
    }
    .filters-toggle.active {
        display: block;
    }
    .main-content {
        width: auto;
        margin-left: 10px;
        margin-right: 10px;
    }
    .popular-brands {
        display: none;
    }
    .car-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
        margin-left: 10px;
        margin-right: 10px;
        max-width: calc(100% - 20px);
    }
    .car-item {
        padding: 12px;
        min-height: auto;
        max-width: 100%;
    }
    .car-item img {
        height: 170px;
        object-fit: cover;
        object-position: center;
    }
    .car-info {
        padding-top: 5px;
    }
    .car-item h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }
.filters {
        width: auto;
        padding: 10px;
        padding-bottom: 80px; /* Учитываем кнопку и нижнее меню */
        margin-left: 10px;
        margin-right: 10px;
    }
    .filter-apply {
        width: 90%;
    }
    #apply-filters {
        width: 100%; /* На мобильных кнопка растягивается */
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* ПК и большие планшеты (1025px и выше) */
@media (min-width: 1025px) {
    .mobile-header {
        display: none;
    }
    .bottom-nav {
        display: none;
    }
    .filters-toggle {
        display: none;
    }
    .car-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    .car-item {
        min-height: 350px;
    }
    .car-item img {
        height: 180px;
        object-fit: cover;
        object-position: center;
    }
    .car-info {
        padding-top: 5px;
    }
    .car-item h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
.filters {
        position: relative;
    }
    .filter-apply {
        width: auto; /* На ПК ширина по содержимому */
    }
    #apply-filters {
        width: auto;
    }
}


/* Стили для контейнера изображения и кнопки избранного */
.car-image-container {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
}

.car-image-container img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

/* Фиксируем стили для избранного (кнопка сердца) */
.car-item .favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
  background: transparent;
  box-shadow: none;
  border: none;
}

.car-item .favorite svg {
  width: 24px;
  height: 24px;
  transition: fill 0.3s, stroke 0.3s;
  filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.5));
}

.car-item .favorite.active {
  transform: scale(1.05);
}

/* Фиксы для отображения на мобильных устройствах */
@media (max-width: 768px) {
  .car-image-container img {
    height: 220px;
  }  

  .car-item .favorite svg {
    width: 28px;
    height: 28px;
  }
}

/* Обеспечиваем корректное отображение на iPhone */
@supports (-webkit-touch-callout: none) {
  .car-item .favorite {
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  .car-item .favorite svg {
    stroke: white;
  }
  
  .car-item .favorite.active svg {
    stroke: #e63946;
    fill: #e63946;
  }
}

/* Метки статуса ремонта - улучшенное отображение */
.repair-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
  text-align: center;
  width: auto;
  margin-bottom: 5px;
}

.repair-status-none {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.repair-status-minor {
  background-color: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.repair-status-major {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

body.dark .repair-status-none {
  background-color: rgba(40, 167, 69, 0.2);
  color: #5bda7d;
}

body.dark .repair-status-minor {
  background-color: rgba(255, 193, 7, 0.2);
  color: #ffda6a;
}

body.dark .repair-status-major {
  background-color: rgba(220, 53, 69, 0.2);
  color: #eb8591;
}

/* Метка лизинга */
.lease-mark {
  display: inline-block;
  background: rgba(120, 120, 120, 0.1);
  padding: 0 5px;
  border-radius: 4px;
  color: #777;
  font-size: 12px;
  cursor: help;
  margin-left: 4px;
}

body.dark .lease-mark {
  color: #aaa;
  background: rgba(170, 170, 170, 0.1);
}

/* Стили для загрузки (для favorites.js) */
.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 20px auto;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #438ef4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

body.dark .loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: #438ef4;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Стили для карточки автомобиля - НОВЫЕ */
.car-item {
    position: relative;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    min-height: 220px; /* Уменьшили высоту */
}

body.dark .car-item {
    background: #1c1c1c;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.car-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Исправляем блок цены - фиксированная структура для симметрии */
.car-info-section {
    display: flex;
    flex-direction: column;
    min-height: 60px; /* Фиксированная минимальная высота для всех карточек */
}

.car-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.car-specs {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
    align-content: flex-start;
}

.car-spec {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 10px;
    color: #333;
    white-space: nowrap;
    line-height: 1.2;
}

body.dark .car-spec {
    background: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
}

/* Исправляем контейнер фото для корректного скролла */
.car-photos-container {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
    overflow: hidden;
}

.car-photos-scroll {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 4px;
    height: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px;
}

.car-photos-scroll::-webkit-scrollbar {
    display: none;
}

.car-photo {
    flex: 0 0 auto;
    width: 70px;
    height: 76px;
    border-radius: 4px;
    object-fit: contain; /* Меняем на contain - показывает всё фото целиком */
    cursor: pointer;
    transition: transform 0.2s;
    background: #f0f0f0;
    border: 1px solid rgba(0,0,0,0.1);
}

body.dark .car-photo {
    background: #333;
    border-color: rgba(255,255,255,0.1);
}

.car-photo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.car-photo.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 10px;
    background: #f0f0f0;
}

/* Кнопка избранного поверх фото */
.car-item .favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    cursor: pointer;
    z-index: 10;
    border: none;
    transition: all 0.2s ease;
}

.car-item .favorite svg {
    width: 18px;
    height: 18px;
}

.car-item .favorite.active {
    background: rgba(231, 57, 70, 0.2);
}

/* Заголовок с светофором и названием */
.car-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.traffic-light {
    width: 10px;
    height: 10px;
    border-radius: 20%;
    flex-shrink: 0;
}

.traffic-light.green {
    background-color: #28a745;
}

.traffic-light.yellow {
    background-color: #ffc107;
}

.traffic-light.red {
    background-color: #dc3545;
}

.car-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    color: #333;
}

body.dark .car-title {
    color: #e0e0e0;
}

/* Строка с характеристиками и ценой */
.car-info-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.car-specs {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
}

.car-spec {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    color: #333;
    white-space: nowrap;
}

body.dark .car-spec {
    background: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
}

/* Блок с ценой */
.car-price-block {
    color: #000;
    border-radius: 6px;
    min-width: 80px;
    max-width: 100px;
    display: flex;
}

body.dark .car-price-block {
    color: #fff;
}

.car-price {
    font-size: 11px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.car-location {
    font-size: 9px;
    opacity: 0.7;
    text-transform: uppercase;
}

/* Желтый фон для лизинга/аренды */
.car-price-block.lease-rent {
    color: #ffc107;
}

body.dark .car-price-block.lease-rent {
    color: #ffc107;
}

.car-price {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.car-location {
    font-size: 10px;
    opacity: 0.7;
    text-transform: uppercase;
    line-height: 2.5;
	color: #000
}

body.dark .car-location {
	color: #fff
}

/* Метки лизинга/аренды под ценой */
.lease-rent-info {
    text-align: right; /* Выравниваем под блоком цены */
    min-height: 14px; /* Фиксированная высота для симметрии */
    margin-top: 2px;
}

.lease-mark, .rent-mark {
    display: inline-block;
    background: rgba(255, 193, 7, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
    color: #856404;
    font-size: 10px;
    cursor: help;
    border: 1px solid rgba(255, 193, 7, 0.3);
    line-height: 1;
}

body.dark .lease-mark, body.dark .rent-mark {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.4);
}

.rent-mark {
    background: rgba(120, 180, 120, 0.1);
    color: #5a9e5a;
}

body.dark .rent-mark {
    color: #8abb8a;
}

.car-action-btn {
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.inspection-btn {
  background: #28a745;
  color: white;
  display: none
}

.inspection-btn:hover {
  background: #218838;
}

.price-inquiry-btn {
  background: #ffc107;
  color: #000;
  display: none
}

.price-inquiry-btn:hover {
  background: #e0a800;
}

.viewed-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 10px;
  z-index: 5;
}

.viewed-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  z-index: 5;
  text-transform: uppercase;
}

.search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.mobile-search-history {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-top: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-history-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.search-history-item:hover {
  background: #f5f5f5;
}

.search-history-item:last-child {
  border-bottom: none;
}

body.dark .search-history,
body.dark .mobile-search-history {
  background: #1c1c1c;
  border-color: #555;
}

body.dark .search-history-item:hover {
  background: #3a3a3a;
}

/* Контейнер для фото в карточке */
.car-photos-container {
  position: relative;
  width: 100%;
  height: 180px;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 8px;
}

/* Горизонтальный скролл фото */
.car-photos-scroll {
  display: flex;
  height: 100%;
  gap: 2px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.car-photos-scroll::-webkit-scrollbar {
  display: none;
}

/* Отдельные фото */
.car-photo {
  height: 100%;
  object-fit: contain; /* Меняем на contain - показывает всё фото целиком */
  cursor: pointer;
  transition: transform 0.2s;
  background: #f0f0f0;
  border-radius: 6px;
  flex-shrink: 0;
}

body.dark .car-photo {
  background: #333;
}

/* Первое фото занимает 70% ширины */
.car-photo:first-child {
  width: 70%;
  min-width: 70%;
}

/* Второе фото занимает 30% ширины */
.car-photo:nth-child(2) {
  width: 30%;
  min-width: 30%;
}

/* Остальные фото тоже по 30% */
.car-photo:not(:first-child):not(:nth-child(2)) {
  width: 30%;
  min-width: 30%;
}

.car-photo:hover {
  transform: scale(1.02);
}

/* Кнопка избранного поверх фото */
.car-item .favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  cursor: pointer;
  z-index: 9;
  border: none;
  transition: all 0.2s ease;
}

.car-item .favorite svg {
  width: 18px;
  height: 18px;
}

.car-item .favorite.active {
  background: rgba(231, 57, 70, 0.2);
}

/* Метка просмотра */
.viewed-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  z-index: 5;
  text-transform: uppercase;
}

/* Фиксируем проблемы мобильной версии */
@media (max-width: 768px) {
  .car-photos-container {
    height: 220px;
  }
  
  .car-photo:first-child {
    width: 75%;
    min-width: 75%;
  }
  
  .car-photo:nth-child(2) {
    width: 75%;
    min-width: 35%;
  }
  
  .car-photo:not(:first-child):not(:nth-child(2)) {
    width: 75%;
    min-width: 75%;
  }
}
  
  /* Предотвращаем расширение страницы */
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
  }
  
  .modal-content {
    max-width: 95%;
    margin: 10px auto;
  }
}

/* Модальные окна для заказа осмотра */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  z-index: 10000; /* Еще выше z-index */
}

body.dark .modal-content {
  background-color: #1c1c1c;
  color: #e0e0e0;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 28px;
  color: #aaa;
  cursor: pointer;
  width: 30px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  z-index: 10001;
}

.close-modal:hover {
  color: #333;
}

body.dark .close-modal:hover {
  color: #eee;
}

/* Стили для формы заказа осмотра */
.inspection-modal-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.inspection-car-preview {
  display: flex;
  margin-bottom: 20px;
  background: #f8f8f8;
  border-radius: 8px;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}

body.dark .inspection-car-preview {
  background: #1c1c1c;
}

.inspection-car-image {
  width: 100px;
  height: 75px;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 15px;
  border-radius: 4px;
}

.inspection-car-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inspection-car-info {
  flex: 1;
  min-width: 0;
}

.inspection-car-info h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark .inspection-car-info h3 {
  color: #fff;
}

.inspection-car-year, .inspection-car-id {
  margin: 3px 0;
  font-size: 14px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark .inspection-car-year, body.dark .inspection-car-id {
  color: #aaa;
}

.inspection-form {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.inspection-input, .inspection-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

body.dark .inspection-input, body.dark .inspection-textarea {
  background-color: #333;
  color: #fff;
  border-color: #444;
}

.inspection-textarea {
  min-height: 80px;
  resize: vertical;
}

.inspection-validation-message {
  display: none;
  color: red;
  margin-bottom: 10px;
  font-size: 14px;
}

.inspection-buttons {
  display: flex;
  justify-content: space-between;
}

.submit-inspection-btn, .cancel-inspection-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
}

.submit-inspection-btn {
  background-color: #3a7bd5;
  color: white;
  flex-grow: 1;
  margin-right: 10px;
}

.submit-inspection-btn:disabled {
  background-color: #aaa;
  cursor: not-allowed;
}

body.dark .submit-inspection-btn:disabled {
  background-color: #555;
  color: #aaa;
}

.cancel-inspection-btn {
  background-color: #f0f0f0;
  color: #333;
}

body.dark .cancel-inspection-btn {
  background-color: #444;
  color: #eee;
}

.submit-inspection-btn:hover:not(:disabled) {
  background-color: #2a6bc5;
}

.cancel-inspection-btn:hover {
  background-color: #e0e0e0;
}

body.dark .cancel-inspection-btn:hover {
  background-color: #555;
}

@media (max-width: 576px) {
  .modal-content {
    width: 95%;
    padding: 15px;
  }
  
  .inspection-modal-content {
    width: 100%;
    padding: 0;
  }
  
  .inspection-car-image {
    width: 80px;
    height: 60px;
  }
  
  .inspection-car-info h3 {
    font-size: 14px;
  }
  
  .inspection-car-year, 
  .inspection-car-id {
    font-size: 12px;
  }
  
  .inspection-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .submit-inspection-btn {
    margin-right: 0;
  }
  
  .inspection-input, 
  .inspection-textarea {
    font-size: 16px;
  }
}

.modal {
  display: flex; /* Изменяем на flex для центрирования */
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 90%;
  max-width: 480px; /* Фиксированная ширина */
  min-width: 320px;
  max-height: 85vh;
  margin: 0; /* Убираем авто-отступы */
}

/* Заголовок на темной теме */
.modal-content h3,
.modal-title {
  color: #333;
}

body.dark .modal-content h3,
body.dark .modal-title {
  color: #e0e0e0; /* Исправляем цвет на темной теме */
}

.car-photos-scroll {
  overflow-x: auto;
  overflow-y: hidden; /* Принудительно убираем вертикальный скролл */
}

.car-photo {
  object-fit: cover;
  object-position: center top; /* Обрезаем снизу, показываем верх */
}

/* Селектор города для ПК */
.city-selector {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.city-selector:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark .city-selector {
    color: #e0e0e0;
}

body.dark .city-selector:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Мобильная версия */
.mobile-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
}

.mobile-city-selector {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #333;
    font-size: 13px;
    padding: 6px 8px;
}

body.dark .mobile-city-selector {
    color: #e0e0e0;
}

.filters-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #333;
    font-size: 13px;
    padding: 6px 8px;
}

body.dark .filters-toggle {
    color: #e0e0e0;
}

/* Убираем exchange-rates полностью */
.exchange-rates {
    display: none;
}

.city-list {
    margin: 15px 0;
}

.city-option {
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: background-color 0.3s;
}

.city-option:hover {
    background-color: #f5f5f5;
}

.city-option.selected {
    background-color: #438ef4;
    color: white;
}

body.dark .city-option:hover {
    background-color: #3a3a3a;
}

body.dark .city-option.selected {
    background-color: #438ef4;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.confirm-btn, .cancel-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.confirm-btn {
    background: #438ef4;
    color: white;
}

.cancel-btn {
    background: #f0f0f0;
    color: #333;
}
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.desktop-city-selector {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.desktop-city-selector:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark .desktop-city-selector {
    color: #e0e0e0;
}

body.dark .desktop-city-selector:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Убираем курсы валют полностью */
.exchange-rates,
.mobile-rates {
    display: none !important;
}

/* Мобильные контролы под шапкой */
.mobile-controls {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-bottom: 1px solid #eee;
}

body.dark .mobile-controls {
    background: #1c1c1c;
    border-bottom-color: #444;
}

.mobile-city-selector {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #333;
    font-size: 16px;
    padding: 8px 0;
}

body.dark .mobile-city-selector {
    color: #e0e0e0;
}

.mobile-filters-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    padding: 8px 0;
}

body.dark .mobile-filters-toggle {
    color: #e0e0e0;
}

/* Десктопные контролы */
.desktop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.desktop-city-selector {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.desktop-city-selector:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark .desktop-city-selector {
    color: #e0e0e0;
}

body.dark .desktop-city-selector:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Старую кнопку фильтров убираем полностью */
.filters-toggle {
    display: none !important;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    
    .desktop-controls {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-controls {
        display: none;
    }
    
    .desktop-controls {
        display: flex;
    }
}

.city-list {
    margin: 15px 0;
}

.city-option {
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: background-color 0.3s;
}

.city-option:hover {
    background-color: #f5f5f5;
}

.city-option.selected {
    background-color: #438ef4;
    color: white;
}

body.dark .city-option:hover {
    background-color: #3a3a3a;
}

body.dark .city-option.selected {
    background-color: #438ef4;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.confirm-btn, .cancel-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.confirm-btn {
    background: #438ef4;
    color: white;
}

.cancel-btn {
    background: #f0f0f0;
    color: #333;
}

body.dark .cancel-btn {
    background: #444;
    color: #e0e0e0;
}

/* Убираем фон у мобильных контролов */
.mobile-controls {
    justify-content: space-between;
    align-items: center;
    background: transparent; /* Убираем фон */
    border: none; /* Убираем границу */
}

body.dark .mobile-controls {
    background: transparent; /* Убираем фон на темной теме */
    border: none;
}

.city-list {
    margin: 15px 0;
}

.city-option {
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: background-color 0.3s;
}

.city-option:hover {
    background-color: #f5f5f5;
}

.city-option.selected {
    background-color: #438ef4;
    color: white;
}

body.dark .city-option:hover {
    background-color: #3a3a3a;
}

body.dark .city-option.selected {
    background-color: #438ef4;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.confirm-btn, .cancel-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.confirm-btn {
    background: #438ef4;
    color: white;
}

.cancel-btn {
    background: #f0f0f0;
    color: #333;
}

body.dark .cancel-btn {
    background: #444;
    color: #e0e0e0;
}

/* Кнопка сортировки в мобильной шапке */
.mobile-sort-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #333;
    margin-left: 5px;
}

body.dark .mobile-sort-btn {
    color: #e0e0e0;
}

/* Модальное окно сортировки */
.mobile-sort-modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.mobile-sort-content {
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 0;
    transform: translateY(100%);
    animation: slideUp 0.3s ease forwards;
}

body.dark .mobile-sort-content {
    background: #1c1c1c;
}

.mobile-sort-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

body.dark .mobile-sort-header {
    border-bottom-color: #444;
}

.mobile-sort-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

body.dark .mobile-sort-header h3 {
    color: #e0e0e0;
}

.mobile-sort-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

body.dark .mobile-sort-close {
    color: #aaa;
}

.mobile-sort-options {
    padding: 0 0 20px 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.sort-option:hover {
    background-color: #f5f5f5;
}

body.dark .sort-option:hover {
    background-color: #3a3a3a;
}

.sort-option span {
    color: #333;
    font-size: 16px;
}

body.dark .sort-option span {
    color: #e0e0e0;
}

.sort-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
}

body.dark .sort-radio {
    border-color: #555;
}

.sort-option.active .sort-radio {
    border-color: #438ef4;
}

body.dark .sort-option.active .sort-radio {
    border-color: #438ef4;
}

.sort-option.active .sort-radio::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #438ef4;
    border-radius: 50%;
}

body.dark .sort-option.active .sort-radio::before {
    background: #438ef4;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Обновляем мобильную шапку для размещения кнопки */
.mobile-header .search-container {
    display: flex;
    align-items: center;
    gap: 0;
}

.mobile-header #mobile-search {
    flex: 1;
}

.stories-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

/* Story элемент */
.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.story-item:hover {
    transform: scale(1.05);
}

.story-avatar {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 3px;
    position: relative;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

body.dark .story-avatar img {
    border-color: #1c1c1c;
}

.story-title {
    font-size: 12px;
    color: #333;
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark .story-title {
    color: #e0e0e0;
}

/* Stories модальное окно */
.stories-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.stories-modal-content {
    width: 100%;
    height: 100%;
    max-width: 400px;
    max-height: 700px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Мобильная версия - на весь экран */
@media (max-width: 768px) {
    .stories-modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        width: 100vw;
        height: 100vh;
    }
}

/* Основной контент story */
.stories-viewer {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.story-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Навигация по story */
.story-navigation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.story-nav-left,
.story-nav-right {
    flex: 1;
    cursor: pointer;
    z-index: 5;
}

/* Информация внизу */
.story-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.story-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    overflow: hidden;
}

.story-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-username {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.story-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-left: auto;
}

/* Мобильные быстрые фильтры */
.mobile-quick-filters {
    display: none;
    padding: 10px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .mobile-quick-filters {
        display: block;
    }
}

/* Селектор марки и модели */
.mobile-filter-selector {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark .mobile-filter-selector {
    background: #1c1c1c;
    border-color: #555;
}

.mobile-filter-selector:hover {
    border-color: #438ef4;
}

body.dark .mobile-filter-selector:hover {
    border-color: #438ef4;
}

.filter-selector-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-selector-text {
    color: #333;
    font-size: 16px;
}

body.dark .filter-selector-text {
    color: #e0e0e0;
}

.filter-selector-arrow {
    color: #666;
    transition: transform 0.3s ease;
}

body.dark .filter-selector-arrow {
    color: #aaa;
}

/* Развернутые фильтры */
.mobile-filters-expanded {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

body.dark .mobile-filters-expanded {
    background: #1c1c1c;
    border-color: #555;
}

.mobile-filter-row {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

body.dark .mobile-filter-row {
    border-bottom-color: #444;
}

.mobile-filter-row:last-child {
    border-bottom: none;
}

.mobile-filter-row:hover {
    background-color: #f5f5f5;
}

body.dark .mobile-filter-row:hover {
    background-color: #3a3a3a;
}

.mobile-filter-label {
    font-weight: 500;
    color: #333;
    min-width: 80px;
}

body.dark .mobile-filter-label {
    color: #e0e0e0;
}

.mobile-filter-value {
    flex: 1;
    margin-left: 10px;
    color: #666;
    font-size: 15px;
}

body.dark .mobile-filter-value {
    color: #aaa;
}

.mobile-filter-value.selected {
    color: #438ef4;
    font-weight: 500;
}

body.dark .mobile-filter-value.selected {
    color: #438ef4;
}

.mobile-filter-clear {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
}

body.dark .mobile-filter-clear {
    color: #666;
}

.mobile-row-arrow {
    margin-left: 10px;
    color: #666;
}

body.dark .mobile-row-arrow {
    color: #aaa;
}

/* Модальные окна фильтров */
.mobile-filter-modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.mobile-filter-modal-content {
    background: white;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    overflow: hidden;
    transform: translateY(100%);
    animation: slideUp 0.3s ease forwards;
    display: flex;
    flex-direction: column;
}

body.dark .mobile-filter-modal-content {
    background: #1c1c1c;
}

.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

body.dark .mobile-filter-header {
    border-bottom-color: #444;
}

.mobile-filter-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

body.dark .mobile-filter-header h3 {
    color: #e0e0e0;
}

.mobile-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

body.dark .mobile-filter-close {
    color: #aaa;
}

.mobile-filter-search {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

body.dark .mobile-filter-search {
    border-bottom-color: #444;
}

.mobile-filter-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

body.dark .mobile-filter-search input {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.mobile-filter-options {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.mobile-filter-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

body.dark .mobile-filter-option {
    border-bottom-color: #333;
}

.mobile-filter-option:hover {
    background-color: #f5f5f5;
}

body.dark .mobile-filter-option:hover {
    background-color: #3a3a3a;
}

.mobile-filter-option:last-child {
    border-bottom: none;
}

.mobile-filter-option span {
    color: #333;
    font-size: 16px;
}

body.dark .mobile-filter-option span {
    color: #e0e0e0;
}

.mobile-filter-option.selected {
    background-color: #e8f0fe;
    color: #438ef4;
}

body.dark .mobile-filter-option.selected {
    background-color: rgba(74, 144, 226, 0.2);
    color: #438ef4;
}

.mobile-filter-option.selected span {
    color: #438ef4;
    font-weight: 500;
}

body.dark .mobile-filter-option.selected span {
    color: #438ef4;
}

.stories-container {
    margin: 20px 0;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .stories-container {
        margin: 0 0;
        padding: 0 10px;
    }
}

.car-price-row {
    justify-content: flex-end;
    margin-bottom: 8px;
}

.car-specs-row {
    display: flex;
    margin-bottom: 8px;
}

.car-price-block {
    text-align: center;
    min-width: 250px;
}

.mobile-bottom-modal {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    height: auto !important;
    background: rgba(0, 0, 0, 0.5) !important;
    justify-content: flex-end !important;
    align-items: flex-end !important;
}

.mobile-bottom-modal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 85vh !important;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-inspection-modal-content,
.mobile-city-modal-content,
.mobile-filters-modal-content {
    padding: 0;
    max-height: 85vh;
    overflow-y: auto;
}

.mobile-inspection-footer,
.mobile-filters-footer {
    padding: 20px;
    position: sticky;
    bottom: 0;
}

.mobile-input,
.mobile-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.city-check {
    color: #438ef4;
    font-weight: bold;
    opacity: 0;
}

.city-check.checked {
    opacity: 1;
}

.mobile-floating-done {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    border-top: 1px solid #eee;
    z-index: 10;
}

.mobile-done-btn {
    width: 100%;
    padding: 12px;
    background: #438ef4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

body.dark .mobile-floating-done {
    background: #1c1c1c;
    border-top-color: #444;
}

body.dark .mobile-done-btn {
    background: #438ef4;
}

.mobile-filter-options {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0 800px 0; /* Добавляем отступ снизу */
}

.mobile-floating-done {
    position: fixed; /* Изменяем на fixed */
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    border-top: 1px solid #eee;
    z-index: 1001; /* Увеличиваем z-index */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

body.dark .mobile-floating-done {
    background: #1c1c1c;
    border-top-color: #444;
}

.mobile-filter-modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    height: 100vh;
    width: 100vw;
}

.mobile-filter-modal-content {
    background: white;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.inspection-content-scroll,
.mobile-filters-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

body.dark .mobile-filter-modal-content {
    background: #1c1c1c;
}

/* Полноэкранное модальное окно */
.mobile-filter-modal.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
}

.mobile-filter-modal.fullscreen .mobile-filter-modal-content {
    width: 100% !important;
    height: 100vh !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow-y: auto;
}

.mobile-filters-scroll {
    padding: 20px;
    padding-bottom: 120px; /* Место для кнопок */
}

.filter-section {
    margin-bottom: 25px;
}

.filter-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

body.dark .filter-section h4 {
    color: #e0e0e0;
}

.filter-inputs-row {
    display: flex;
    gap: 10px;
}

.filter-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

body.dark .filter-input {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active {
    background: #438ef4;
    color: white;
    border-color: #438ef4;
}

body.dark .filter-btn {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

body.dark .filter-btn.active {
    background: #438ef4;
    border-color: #438ef4;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-checkbox input {
    margin: 0;
}

.mobile-filters-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    z-index: 10000;
}

body.dark .mobile-filters-footer {
    background: #1c1c1c;
    border-top-color: #444;
}

.reset-filters-btn, .apply-filters-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.reset-filters-btn {
    background: #f0f0f0;
    color: #333;
}

.apply-filters-btn {
    background: #438ef4;
    color: white;
}

body.dark .reset-filters-btn {
    background: #444;
    color: #e0e0e0;
}

body.dark .apply-filters-btn {
    background: #438ef4;
}

/* Стили для множественного выбора в мобильных модалах */
.mobile-filter-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mobile-filter-option:hover {
  background-color: #f5f5f5;
}

.mobile-filter-option.selected {
  background-color: #e3f2fd;
  color: #1976d2;
}

.mobile-filter-option.selected .checkbox-mark {
  display: block;
}

.checkbox-mark {
  display: none;
  width: 20px;
  height: 20px;
  background: #1976d2;
  border-radius: 50%;
  position: relative;
}

.checkbox-mark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Стили для кнопки "Все"/"Готово" */
.mobile-filter-done-btn {
  background: #1976d2;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mobile-filter-done-btn:hover {
  background: #1565c0;
}

.mobile-filter-done-btn.show-all {
  background: #4caf50;
}

.mobile-filter-done-btn.show-all:hover {
  background: #45a049;
}

/* Стили для группировки поколений по моделям в мобильном интерфейсе */

.model-group-header {
    background: #f5f5f5;
    color: #666;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 16px;
    margin: 8px 0 4px 0;
    border-radius: 8px;
    border-left: 3px solid #438ef4;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-filter-option.model-generation {
    padding-left: 24px;
    background: #fafafa;
    border-left: 2px solid #e0e0e0;
    margin: 2px 0;
}

.mobile-filter-option.model-generation:hover {
    background: #f0f7ff;
    border-left-color: #438ef4;
}

.mobile-filter-option.model-generation.selected {
    background: #e3f2fd;
    border-left-color: #438ef4;
}

/* Улучшенные стили для мобильных фильтров */
.mobile-filter-value.selected {
    color: #438ef4;
    font-weight: 500;
}

.mobile-filter-row:has(.mobile-filter-value.selected) {
    background: #f8fbff;
    border-left: 3px solid #438ef4;
}

/* Анимация для плавного появления групп */
.model-group-header {
    animation: slideInFromTop 0.3s ease-out;
}

.mobile-filter-option.model-generation {
    animation: slideInFromLeft 0.2s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Стили для счетчиков выбранных элементов */
.filter-counter {
    background: #438ef4;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 500;
}

.mobile-filter-value:has(.filter-counter) {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Улучшение видимости для тёмной темы */
/* Исправленные стили для темной темы */
body.dark .model-group-header {
    background: #2a2a2a;
    color: #ccc;
    border-left-color: #64b5f6;
}

body.dark .mobile-filter-option.model-generation {
    background: #1e1e1e;
    border-left-color: #444;
}

body.dark .mobile-filter-option.model-generation:hover {
    background: #0d47a1;
    border-left-color: #64b5f6;
}

body.dark .mobile-filter-option.model-generation.selected {
    background: #1565c0;
    border-left-color: #64b5f6;
}

body.dark .mobile-filter-option:hover {
    background-color: #3a3a3a;
}

body.dark .mobile-filter-option.selected {
    background-color: #1565c0;
    color: #e3f2fd;
}

body.dark .mobile-filter-option {
    border-bottom-color: #444;
    color: #e0e0e0;
}

/* Компактное отображение для темной темы */
body.dark .mobile-compact-brand-model {
    background: #1a2332;
    border-left-color: #64b5f6;
}

body.dark .mobile-compact-brand {
    color: #e0e0e0;
}

body.dark .mobile-compact-models {
    color: #aaa;
}

body.dark .mobile-compact-clear {
    color: #666;
}

body.dark .mobile-compact-arrow {
    color: #aaa;
}

/* Исправление для строк фильтров */
body.dark .mobile-filter-row:has(.mobile-filter-value.selected) {
    background: #1a2332;
    border-left-color: #64b5f6;
}

/* ДОБАВИТЬ В КОНЕЦ ФАЙЛА style.css */

/* Уведомление об автоопределении города */
.city-detection-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 10000;
  max-width: 350px;
  padding: 20px;
  border-left: 4px solid #2a5298;
  animation: slideInRight 0.3s ease-out;
}

.city-detection-notification .notification-content p {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
}

.city-detection-notification .notification-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.city-detection-notification .notification-buttons button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.city-detection-notification .accept-btn {
  background: #2a5298 !important;
  color: white !important;
  border-color: #2a5298 !important;
}

.city-detection-notification .accept-btn:hover {
  background: #1e3a73 !important;
}

.city-detection-notification .change-btn:hover {
  background: #f5f5f5;
}

.city-detection-notification .dismiss-btn {
  background: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
  min-width: 32px;
  padding: 8px 12px;
}

.city-detection-notification .dismiss-btn:hover {
  background: #c82333 !important;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Мобильная версия */
@media (max-width: 768px) {
  .city-detection-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    padding: 16px;
  }
  
  .city-detection-notification .notification-buttons {
    justify-content: space-between;
  }
  
  .city-detection-notification .notification-buttons button {
    flex: 1;
    min-width: 80px;
  }
  
  .city-detection-notification .dismiss-btn {
    flex: 0 0 40px;
  }
}

/* Добавить в CSS файл */

.city-change-notification .old-city-info {
  font-size: 12px;
  color: #666;
  margin: 5px 0 15px 0;
  font-style: italic;
}

.city-change-notification .notification-buttons {
  flex-wrap: wrap;
  gap: 6px;
}

.city-change-notification .notification-buttons button {
  font-size: 11px;
  padding: 6px 12px;
  flex: 1;
  min-width: 80px;
}

@media (max-width: 768px) {
  .city-change-notification .notification-buttons {
    flex-direction: column;
  }
  
  .city-change-notification .notification-buttons button {
    width: 100%;
    margin-bottom: 4px;
  }
  
  .city-change-notification .dismiss-btn {
    width: auto !important;
    align-self: flex-end;
    margin-bottom: 0;
  }
}

.mobile-filter-search {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

body.dark .mobile-filter-search {
    border-bottom-color: #444;
}

.mobile-filter-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

body.dark .mobile-filter-search input {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

/* ИСПРАВЛЕНИЕ: Фиксированный размер модального окна */
.mobile-filter-modal-content {
    background: white;
    border-radius: 16px 16px 0 0;
    height: 70vh; /* Фиксированная высота */
    min-height: 500px; /* Минимальная высота */
    max-height: 85vh; /* Максимальная высота */
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

body.dark .mobile-filter-modal-content {
    background: #1c1c1c;
}

/* Заголовок - фиксированная высота */
.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    height: 60px; /* Фиксированная высота заголовка */
    box-sizing: border-box;
}

body.dark .mobile-filter-header {
    border-bottom-color: #444;
}

.mobile-filter-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

body.dark .mobile-filter-header h3 {
    color: #e0e0e0;
}

.mobile-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

body.dark .mobile-filter-close {
    color: #aaa;
}

/* Поиск - фиксированная высота */
.mobile-filter-search {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    height: 70px; /* Фиксированная высота поиска */
    box-sizing: border-box;
}

body.dark .mobile-filter-search {
    border-bottom-color: #444;
}

.mobile-filter-search input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    height: 44px; /* Фиксированная высота поля ввода */
}

body.dark .mobile-filter-search input {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

/* ОСНОВНОЕ ИСПРАВЛЕНИЕ: Список городов с фиксированной областью прокрутки */
.city-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    /* Вычисляем высоту: общая высота - заголовок - поиск */
    height: calc(70vh - 130px);
    min-height: 370px; /* Минимальная высота списка */
}

/* Опция города */
.city-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    border-bottom: 1px solid #f0f0f0;
    min-height: 54px; /* Минимальная высота каждого элемента */
    box-sizing: border-box;
}

body.dark .city-option {
    border-bottom-color: #333;
}

.city-option:hover {
    background-color: #f5f5f5;
}

body.dark .city-option:hover {
    background-color: #3a3a3a;
}

.city-option:last-child {
    border-bottom: none;
}

.city-option span {
    color: #333;
    font-size: 16px;
    flex: 1;
}

body.dark .city-option span {
    color: #e0e0e0;
}

.city-option.selected {
    background-color: #e8f0fe;
    color: #438ef4;
}

body.dark .city-option.selected {
    background-color: rgba(74, 144, 226, 0.2);
    color: #438ef4;
}

.city-option.selected span {
    color: #438ef4;
    font-weight: 500;
}

body.dark .city-option.selected span {
    color: #438ef4;
}

.city-check {
    color: #438ef4;
    font-weight: bold;
    opacity: 0;
    font-size: 18px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.city-check.checked {
    opacity: 1;
}

/* Улучшенная прокрутка */
.city-list::-webkit-scrollbar {
    width: 6px;
}

.city-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.city-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.city-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

body.dark .city-list::-webkit-scrollbar-track {
    background: #2a2a2a;
}

body.dark .city-list::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark .city-list::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Для Firefox */
.city-list {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

body.dark .city-list {
    scrollbar-color: #555 #2a2a2a;
}

/* Сообщение "Ничего не найдено" */
.no-cities-found {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

body.dark .no-cities-found {
    color: #aaa;
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    .mobile-filter-modal-content {
        height: 75vh;
        min-height: 450px;
    }
    
    .city-list {
        height: calc(75vh - 130px);
        min-height: 320px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .mobile-filter-modal-content {
        height: 80vh;
        min-height: 400px;
    }
    
    .city-list {
        height: calc(80vh - 130px);
        min-height: 270px;
    }
    
    .city-option {
        padding: 12px 15px;
        min-height: 48px;
    }
}

/* Полный CSS для Stories блока */

/* Контейнер Stories */
.stories-container {
    padding: 20px 0;
}

.stories-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 0 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
	position: relative;
    z-index: 1;
}
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

/* Элементы Stories */
.story-item {
    flex-shrink: 0;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.story-item:hover {
    transform: scale(1.05);
}

.story-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 2px;
    transition: all 0.3s ease;
    position: relative;
}

/* Стили для просмотренных stories */
.story-avatar.viewed {
    background: #c7c7c7;
    opacity: 0.6;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.story-title {
    font-size: 12px;
    color: #333 !important;
    display: block;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Модальное окно Stories */
.stories-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.stories-modal-content {
    max-width: 400px;
    width: 90%;
    height: 80%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Заголовок с прогресс-барами */
.stories-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    z-index: 1001;
    pointer-events: none;
}

.stories-header > * {
    pointer-events: all;
}

/* Прогресс-бары */
.stories-progress {
    display: flex;
    flex: 1;
    gap: 4px;
    margin-right: 15px;
}

.progress-bar {
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.progress-bar.completed {
    background: rgba(255, 255, 255, 0.9);
}

.progress-bar.active {
    background: rgba(255, 255, 255, 0.3);
}

/* Убираем старую анимацию с ::after */
.progress-bar.active::after {
    display: none;
}

.progress-fill {
    animation-fill-mode: forwards !important;
    border-radius: 1px;
}

@keyframes progressAnimation {
    from { width: 0%; }
    to { width: 100%; }
}

/* Кнопка закрытия */
.stories-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.stories-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Контейнер для просмотра stories */
.stories-viewer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    border-radius: 12px;
}

/* Контент story (изображения и видео) */
.story-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.story-content img,
.story-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Навигация по stories */
.story-navigation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    z-index: 1000;
}

.story-nav-left,
.story-nav-right {
    flex: 1;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
}

.story-nav-left:active,
.story-nav-right:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Информация внизу */
.story-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    z-index: 1001;
}

.story-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.story-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-username {
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.story-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-left: auto;
}

/* Кнопки воспроизведения видео */
.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
}

.video-play-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-sound-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
}

.video-sound-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .stories-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: none;
    }
    
    .stories-viewer {
        border-radius: 0;
    }
    
    .stories-container {
        padding: 0 0;
    }
    
    .stories-scroll {
        padding: 0 2px 0;
        gap: 12px;
    }
    
    .story-avatar {
        width: 65px;
        height: 65px;
    }
    
    .story-title {
        font-size: 11px;
        max-width: 55px;
    }
    
    .stories-header {
        padding: 10px 15px;
    }
    
    .story-info {
        padding: 10px 15px;
    }
}

/* Анимации для свайпа */
@keyframes story-swipe-out {
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.story-swipe-out {
    animation: story-swipe-out 0.3s ease-out forwards;
}

/* Улучшения для iOS */
@supports (-webkit-appearance: none) {
    .story-content video {
        -webkit-playsinline: true;
        playsinline: true;
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .stories-container {
        border-bottom-color: #333;
    }
    
    .story-title {
        color: #fff;
    }
}

/* Высокое разрешение */
@media (min-resolution: 2dppx) {
    .story-avatar {
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .stories-modal-content {
        height: 100%;
        width: 100%;
    }
    
    .stories-header {
        padding: 8px 15px;
    }
    
    .story-info {
        padding: 8px 15px;
    }
}

/* Анимации появления */
.stories-modal {
    animation: modal-fade-in 0.3s ease-out;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.stories-modal-content {
    animation: modal-scale-in 0.3s ease-out;
}

@keyframes modal-scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Состояния загрузки */
.story-content.loading {
    background: #222;
}

.story-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Исправление для полноэкранного видео */
.stories-viewer video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Обеспечиваем что контент покрывает весь экран */
.story-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Плавный переход между stories */
.story-content {
    transition: opacity 0.2s ease-in-out;
}

.story-content.transitioning {
    opacity: 0;
}