body {
    margin: 0px;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

header {
    background: #0a1730;
}

/* Header Top */
.header-top {
    display: grid;
    grid-template-columns: 1fr 900px 500px;
    align-items: end;
    padding: 10px 20px 15px;
    background: #0a1730;
    max-width: 100%;
    box-sizing: border-box;
    gap: 20px;
    overflow: visible;
}

.header-center {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

/* Контейнер поиска */
.search-container {
    position: relative;
    width: 900px;
    order: 2;
}

/* Форма поиска */
.search-form {
    width: 100%;
}

/* Группа input + button */
.search-input-group {
    display: flex;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
}

.search-input-group:focus-within {
    border-color: #1abc9c;
}

/* Поле ввода */
.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid white;
    border-right: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: white;
}

.search-input::placeholder {
    color: #95a5a6;
}

/* Кнопка поиска */
.search-button {
    padding: 12px 20px;
    background: none;
    border: 1px solid white;
    border-left: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.search-button:hover svg {
    color: #1abc9c;
    transform: scale(1.1);
}

.search-button:active {
    transform: scale(0.95);
}

.search-button svg {
    color: white;
    width: 18px;
    height: 18px;
}

/* Результаты поиска */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
}

.search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Элемент результата */
.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: block;
    color: #2c3e50;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Заголовок результата */
.search-result-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #2c3e50;
    font-size: 14px;
}

/* Категория результата */
.search-result-category {
    font-size: 12px;
    color: #7f8c8d;
}

/* Сообщение "Ничего не найдено" */
.search-result-empty {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
}

/* Индикатор загрузки */
.search-loading {
    padding: 15px;
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
}

/* ===== СКРОЛЛБАР ДЛЯ РЕЗУЛЬТАТОВ ПОИСКА ===== */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #1abc9c;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #16a085;
}

.header-left .logo h1 {
    margin: 0;
    font-size: 24px;
    color: #0a1730;
    font-weight: 700;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.main-nav {
    display: flex;
    gap: 25px;
    order: 1;
    padding-bottom: 10px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    transition: color 0.3s;
    white-space: nowrap;
    display: inline-block;
}

.main-nav a:hover {
    color: #1abc9c;
}

/* Блок с иконками */
.header-icons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    column-gap: 20px;
    order: 2;
    padding: 5px 10px 0 0;
}

.cart-amount {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.icon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
    position: relative;
}

/* Стили для корзины */
.cart-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
    position: relative;
}

.cart-icon:hover {
    color: #1abc9c;
}

.cart-icon:hover svg {
    color: #1abc9c;
}

.cart-icon:hover .cart-amount {
    color: #1abc9c;
    transition: color 0.3s ease;
}

.cart-icon svg {
    transition: transform 0.3s ease;
}

.cart-icon:hover svg {
    transform: scale(1.1);
}

.icon-item:hover {
    color: #1abc9c;
}

.icon-item svg {
    transition: transform 0.3s ease;
}

.icon-item:hover {
    transform: scale(1.1);
}

.favorites-link {
    position: relative;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

.like-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.favorites-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Стили для иконки при наведении */
.favorites-link:hover .like-icon svg {
    stroke: #e74c3c;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Стили для активной иконки */
.favorites-link.active .like-icon svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* Телефон */
.header-actions {
    order: 3;
}

.header-actions .phone {
    font-weight: 600;
    color: white;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Cars Menu */
.cars-menu {
    background: #0a1730;
    position: relative;
    width: 100%;
    overflow: visible;
}

.cars-menu-container {
    display: flex;
    align-items: stretch;
    margin: 0 auto;
    min-height: 50px;
    max-width: 100%;
    position: relative;
    overflow: visible;
}

.brands-menu-wrapper {
    display: flex;
    flex: 1;
    align-items: stretch;
    position: relative;
}


.all-brands-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 100%;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    text-decoration: none;
    gap: 4px;
}

.all-brands-trigger::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #1abc9c;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.all-brands-trigger:hover {
    color: #1abc9c;
    background: transparent !important;
}

.all-brands-trigger:hover::after {
    width: 100%;
}

/* Стрелочки */
.all-brands-trigger .arrow,
.popular-arrow {
    position: relative;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.all-brands-trigger .arrow::before,
.popular-arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 5px;
    height: 5px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.3s ease;
}

.all-brands-button:hover .all-brands-trigger .arrow,
.popular-brand-item:hover .popular-arrow {
    transform: rotate(180deg);
}

.all-brands-trigger.active {
    color: #1abc9c !important;
}

.all-brands-trigger.active::after {
    width: 100% !important;
}

/* All Brands Dropdown */
.all-brands-dropdown {
    position: fixed;
    left: 0;
    width: 100vw;
    background: #0a1730;
    padding: 40px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1400;
}

.all-brands-button:hover .all-brands-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.brand-column {
    display: flex;
    flex-direction: column;
}

.brand-header {
    padding: 8px 0;
    margin-bottom: 10px;
    border-bottom: 2px solid white;
    font-size: 14px;
    color: white;
    font-weight: 600;
}

.models-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.models-list .model-link {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 13px;
    border-radius: 3px;
    transition: all 0.3s;
    padding: 2px 0;
}

.models-list .model-link:hover {
    color: #1abc9c;
}

/* Home Button */
.home-button {
    display: flex;
    align-items: center;
    margin-right: 10px;
    margin-left: 50px;
}

.home-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.home-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #1abc9c;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.home-link:hover {
    color: #1abc9c;
}

.home-link:hover::after {
    width: 100%;
}

.home-link svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.home-link:hover svg {
    transform: scale(1.1);
}

/* Popular Brands */
.popular-brands {
    overflow: hidden;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    max-width: 1200px;
    z-index: 1002;
}

.popular-brands-scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%; /* Занимаем всю ширину */
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 0 40px; /* Отступы для кнопок */
    box-sizing: border-box; /* Важно! */
}

.popular-brands-scroll-container::-webkit-scrollbar {
    display: none;
}

.popular-brand-item {
    flex-shrink: 0;
}

.popular-brand-trigger {
    padding: 0 20px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    background: transparent;
    white-space: nowrap;
    height: 50px;
    position: relative;
    font-size: 14px;
}

.popular-brand-item:last-child .popular-brand-trigger {
    border-right: none;
}

.popular-brand-trigger::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #1abc9c;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.popular-brand-trigger:hover {
    color: #1abc9c;
}

.popular-brand-trigger:hover::after {
    width: 100%;
}

.popular-brand-trigger.active {
    color: #1abc9c;
}

.popular-brand-trigger.active::after {
    width: 100%;
}

/* Кнопки навигации */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001; /* Поверх контента */
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}



.nav-button.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%) scale(0.8);
}

.nav-button:active {
    transform: translateY(-50%) scale(0.95);
}



.nav-button svg {
    color: white;
    stroke: white;
    stroke-width: 2.5;
}

.nav-button-prev {
    left: 0px;
}

.nav-button-next {
    right: 0px;
}


.popular-brand-item:hover .popular-models-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


.popular-models-container .model-link {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 0;
    transition: color 0.3s;
    display: block;
}

.popular-models-container .model-link:hover {
    color: #1abc9c;
}

/* Language Dropdown */
.language-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
    order: 3;
    z-index: 1100;
}

.language-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: white;
    transition: all 0.3s ease;
}

.language-selected img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.language-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.language-dropdown.active .language-arrow {
    transform: rotate(180deg);
}

.language-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1101;
    margin-top: 5px;
}

.language-dropdown.active .language-options {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: #f8f9fa;
}

.language-option img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

/* Main Content */
main {
    min-height: 60vh;
    padding: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Footer Styles */
footer {
    background-color: #18181a;
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
    width: 100%;
    box-sizing: border-box;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.footer-column {
    flex: 1;
    min-width: 200px;
    margin-bottom: 30px;
    padding: 0 15px;
    box-sizing: border-box;
}

.footer-column h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 14px;
    border-bottom: 2px solid #555;
    padding-bottom: 10px;
}

.footer-column ul {
    font-size: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: #fff;
}

.footer-column ul li:last-child {
    margin-bottom: 0;
}

.payment-icons {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.payment-icons img {
    width: 60px;
    height: 43px;
    object-fit: contain;
    padding: 0px;
}

.payment-icons-2 {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.payment-icons-2 img {
    width: 60px;
    height: 43px;
    object-fit: contain;
    padding: 0px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    margin-top: 20px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    font-size: 14px;
}

/* Убираем старые конфликтующие стили */
.models-dropdown {
    display: none;
}

.models-grid {
    display: none;
}

/* Утилитарные классы */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* Стили для скроллбара */
.brands-grid::-webkit-scrollbar {
    width: 6px;
}

.brands-grid::-webkit-scrollbar-track {
    background: #34495e;
    border-radius: 3px;
}

.brands-grid::-webkit-scrollbar-thumb {
    background: #1abc9c;
    border-radius: 3px;
}

.brands-grid::-webkit-scrollbar-thumb:hover {
    background: #16a085;
}

/* ===== АДАПТИВНОСТЬ ===== */

@media (max-width: 1024px) {
    .header-top {
        grid-template-columns: 1fr 3fr 1fr;
    }

    .search-container {
        max-width: 400px;
    }

    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .popular-brands {
        margin-left: 10px;
    }

    .popular-brand-trigger {
        padding: 0 16px;
        font-size: 13px;
    }

    .nav-button {
        width: 28px;
        height: 28px;
    }

    .nav-button-prev {
        left: -12px;
    }

    .nav-button-next {
        right: -12px;
    }
}

@media (max-width: 768px) {
    .header-top {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }

    .header-center {
        order: 3;
        grid-column: 1;
    }

    .header-left {
        text-align: center;
    }

    .header-right {
        justify-content: center;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .search-container {
        max-width: 100%;
    }

    .main-nav {
        justify-content: center;
        width: 100%;
    }

    .header-icons {
        justify-content: center;
        gap: 15px;
    }

    .icon-item {
        padding: 6px 10px;
    }

    .cart-amount {
        display: none;
    }

    .cars-menu-container {
        flex-direction: column;
    }

    .all-brands-button {
        min-width: 100%;
    }

    .popular-brands {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .popular-brand-item {
        flex: 1;
        min-width: 120px;
        text-align: center;
        padding: 10px;
    }

    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .all-brands-dropdown {
        padding: 15px 10px;
    }

    .popular-models-dropdown {
        padding: 15px 10px;
    }

    .footer-container {
        flex-direction: column;
    }

    .footer-column {
        min-width: 100%;
        margin-bottom: 20px;
    }

    .nav-button {
        display: none;
    }

    .popular-brands-scroll-container {
        padding: 0 2px;
    }

    .popular-brand-trigger {
        padding: 0 14px;
        font-size: 12px;
    }

    .language-dropdown {
        width: 120px;
        margin-left: 10px;
    }

    .language-selected {
        padding: 6px 10px;
        font-size: 13px;
    }

    .language-selected img {
        width: 18px;
        height: 13px;
    }
}

@media (max-width: 480px) {
    .search-input {
        padding: 10px 15px;
        font-size: 13px;
    }

    .search-button {
        padding: 10px 15px;
        min-width: 45px;
    }

    .search-button svg {
        width: 16px;
        height: 16px;
    }

    .search-result-item {
        padding: 10px 15px;
    }

    .search-result-title {
        font-size: 13px;
    }

    .search-result-category {
        font-size: 11px;
    }

    .header-icons {
        gap: 10px;
    }

    .icon-item {
        padding: 5px 8px;
    }

    .icon-item svg {
        width: 18px;
        height: 18px;
    }

    .main-nav {
        gap: 15px;
    }

    .main-nav a {
        font-size: 11px;
    }

    .brands-grid {
        grid-template-columns: 1fr;
    }

    .header-top {
        padding: 10px 15px;
    }

    .popular-brands {
        flex-direction: column;
    }

    .popular-brand-item {
        min-width: 100%;
        justify-content: center;
        padding: 12px 10px;
    }

    .all-brands-trigger {
        padding: 0 15px;
    }

    .header-left .logo h1 {
        font-size: 20px;
    }

    .popular-brand-trigger {
        padding: 0 12px;
        font-size: 11px;
    }

    .popular-models-dropdown {
        width: 250px;
        padding: 15px;
    }
}

@font-face {
    font-family: 'Russo One';
    src: url('../fonts/RussoOne-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Kaliningrad History';
    src: url('../fonts/Kaliningrad_Historical_G_1.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


.header-left {
    display: flex;
    align-items: center; /* центрирование по вертикали */
}

.logo {
    display: inline-flex;
    align-items: flex-start;
    margin-left: 45px;
    margin-bottom: -25px;
}

.logo img {
    width: 84px;
    height: auto;
}


.text-logo {
    font-family: 'Kaliningrad History', sans-serif;
    color: white;
    margin-left: 15px; /* отступ между лого и текстом */
    margin-bottom: -25px; /* регулируйте для точного позиционирования */
    font-size: 23px;
    white-space: nowrap;
    line-height: 1.1;
}


.all-brands-dropdown {
    position: absolute;
    left: 0;
    width: 100vw;
    background: #0a1730;
    padding: 40px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1400;
    border-top: 1px solid #34495e;
}

.popular-models-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background: #0a1730;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    padding: 40px;
    border-top: 1px solid #34495e;
}

/* Гарантируем, что dropdown будет поверх других элементов */
.all-brands-button,
.popular-brand-item {
    z-index: 1002;
}

/* Улучшаем видимость при наведении */
.all-brands-button:hover .all-brands-dropdown,
.popular-brand-item:hover .popular-models-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Убедимся, что триггеры правильно стилизованы */
.all-brands-trigger,
.popular-brand-trigger {
    position: relative;
    z-index: 1003;
}

/* Улучшаем отображение моделей */
.popular-models-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.popular-models-column {
    display: flex;
    flex-direction: column;
}

.popular-models-header {
    padding: 8px 0;
    margin-bottom: 10px;
    border-bottom: 2px solid white;
    font-size: 14px;
    color: white;
    font-weight: 600;
}

.popular-models-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.popular-models-list .model-link {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 13px;
    border-radius: 3px;
    transition: all 0.3s;
    padding: 2px 0;
}


.popular-models-container .model-link {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 0;
    transition: color 0.3s;
    display: block;
}

.popular-models-container .model-link:hover {
    color: #1abc9c;
}

/* ===== МОБИЛЬНЫЕ СТИЛИ (Телефоны) ===== */
@media (max-width: 767px) {
    /* Общие стили для body */
    body {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Шапка */
    .header-top {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 8px 15px;
        text-align: center;
    }

    .header-left {
        justify-content: center;
        margin-bottom: 5px;
    }

    .logo {
        margin-left: 0;
    }

    .logo img {
        width: 60px;
    }

    .text-logo {
        margin-left: 10px;
        margin-bottom: -10px;
    }

    .text-logo h1 {
        font-size: 20px;
    }

    /* Поиск */
    .header-center {
        order: 3;
    }

    .search-container {
        width: 100%;
        max-width: 100%;
    }

    .search-input {
        padding: 10px 15px;
        font-size: 13px;
    }

    .search-button {
        padding: 10px 15px;
        min-width: 45px;
    }

    /* Навигация */
    .header-right {
        width: 100%;
        justify-content: center;
    }

    .main-nav {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        padding-bottom: 5px;
    }

    .main-nav a {
        font-size: 9px;
        padding: 4px 0px;
    }

    /* Иконки */
    .header-icons {
        justify-content: center;
        gap: 8px;
        padding: 0;
    }

    .icon-item {
        padding: 6px 8px;
    }

    .icon-item svg {
        width: 18px;
        height: 18px;
    }

    .cart-amount {
        font-size: 12px;
        display: none; /* Скрываем сумму на маленьких экранах */
    }

    .favorites-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
        top: -6px;
        right: -6px;
    }

    /* Выбор языка */
    .language-dropdown {
        width: 100px;
    }

    .language-selected {
        padding: 6px 8px;
        font-size: 12px;
    }

    .language-selected img {
        width: 16px;
        height: 12px;
    }

    .language-options {
        width: 140px;
        left: -20px;
    }

    /* Меню автомобилей */
    .cars-menu-container {
        flex-direction: column;
        min-height: auto;
    }

    .home-button {
        margin: 0;
        justify-content: center;
        border-bottom: 1px solid #34495e;
    }

    .home-link {
        height: 40px;
        justify-content: center;
        width: 100%;
    }

    .all-brands-button {
        width: 100%;
        border-bottom: 1px solid #34495e;
    }

    .all-brands-trigger {
        justify-content: center;
        height: 40px;
        font-size: 14px;
    }

    /* Выпадающее меню брендов */
    .all-brands-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        padding: 60px 20px 20px;
        z-index: 2000;
        background: #0a1730;
        overflow-y: auto;
    }

    .brands-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .brand-header {
        font-size: 16px;
        padding: 12px 0;
    }

    .models-list .model-link {
        font-size: 14px;
        padding: 8px 0;
    }

    /* Популярные бренды */
    .popular-brands {
        width: 100%;
        margin: 0;
    }

    .popular-brands-scroll-container {
        padding: 10px 0;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .popular-brand-item {
        flex: 0 0 auto;
    }

    .popular-brand-trigger {
        height: 40px;
        font-size: 13px;
        padding: 0 15px;
        white-space: nowrap;
    }

    /* Выпадающее меню моделей */
    .popular-models-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 2000;
        padding: 60px 20px 20px;
        border-radius: 0;
    }

    /* Кнопки навигации */
    .nav-button {
        display: none; /* Скрываем кнопки навигации на мобильных */
    }

    /* Основной контент */
    main {
        padding: 15px;
        min-height: 50vh;
    }

    /* Футер */
    footer {
        margin-top: 30px;
        padding: 30px 0 15px;
    }

    .footer-container {
        flex-direction: column;
        padding: 0 15px;
    }

    .footer-column {
        min-width: 100%;
        margin-bottom: 25px;
        padding: 0 10px;
    }

    .footer-column h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .footer-column ul li {
        margin-bottom: 8px;
    }

    .footer-column ul li a {
        font-size: 14px;
    }

    .payment-icons,
    .payment-icons-2 {
        justify-content: center;
        gap: 8px;
    }

    .payment-icons img,
    .payment-icons-2 img {
        width: 50px;
        height: 35px;
    }

    .footer-bottom {
        padding: 15px 15px 0;
        font-size: 12px;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 360px) {
    .header-top {
        padding: 5px 10px;
    }

    .main-nav {
        gap: 5px;
    }

    .main-nav a {
        font-size: 10px;
        padding: 3px 6px;
    }

    .header-icons {
        gap: 5px;
    }

    .icon-item {
        padding: 4px 6px;
    }

    .logo img {
        width: 50px;
    }

    .text-logo h1 {
        font-size: 18px;
    }

    .search-input {
        padding: 8px 12px;
        font-size: 12px;
    }

    .search-button {
        padding: 8px 12px;
        min-width: 40px;
    }

    .popular-brand-trigger {
        font-size: 12px;
        padding: 0 12px;
    }
}

/* Стили для горизонтальной ориентации телефона */
@media (max-width: 767px) and (orientation: landscape) {
    .header-top {
        grid-template-columns: auto 1fr;
        align-items: center;
    }

    .header-left {
        grid-column: 1;
        justify-content: flex-start;
    }

    .header-right {
        grid-column: 2;
        justify-content: flex-end;
    }

    .header-center {
        grid-column: 1 / span 2;
        order: 3;
    }

    .main-nav {
        justify-content: flex-end;
    }

    .cars-menu-container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .home-button,
    .all-brands-button {
        width: auto;
        border-bottom: none;
    }

    .popular-brands {
        width: 100%;
        order: 3;
    }
}

/* Улучшение touch-интерфейса для мобильных */
@media (max-width: 767px) {
    /* Увеличиваем область клика для touch */
    .icon-item,
    .main-nav a,
    .popular-brand-trigger,
    .all-brands-trigger,
    .home-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Убираем ховер-эффекты для тач-устройств */
    @media (hover: none) {
        .icon-item:hover,
        .main-nav a:hover,
        .popular-brand-trigger:hover,
        .all-brands-trigger:hover,
        .home-link:hover {
            color: inherit;
            transform: none;
        }

        .icon-item:hover svg,
        .main-nav a:hover,
        .popular-brand-trigger:hover,
        .all-brands-trigger:hover,
        .home-link:hover {
            color: inherit;
            transform: none;
        }
    }

    /* Плавная прокрутка */
    html {
        scroll-behavior: smooth;
    }

    /* Предотвращение масштабирования при фокусе на input */
    input, select, textarea {
        font-size: 16px;
    }
}

