/* WildCamel_VDS\static\css\main.css */
.container {
    padding-left: 1rem;  /* Или 0.5rem для мобильных */
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
}

.footer {
    height: auto;
    line-height: 1.5;
    position: static;
    margin-top: auto;
}
header {
    padding: 1rem 2rem;
    z-index: 1000;
}

nav a {
    padding: 0.5rem 0;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f3f4f6;
}

main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-favorite-deleted {
    background-color: #f9fafb !important; /* Серый фон при удалении */
}

.car-name-container {
    height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}
.card-img-container {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
}
.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.card:hover .card-img-container img {
    transform: scale(1.05);
}
.filter-btn {
    transition: all 0.2s ease;
}
.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px; /* Справа */
    width: 40px;
    height: 40px;
    background-color: #1d4ed8;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
}

.favorite-btn .rounded-full:hover i {
    color: #1e40af !important;
    transition: color 0.2s;
}

/* Мобильный блок фильтров */
.md\:hidden.bg-white.shadow-sm.sticky {
    z-index: 30;
}

.filter-container {
    z-index: 25; 
    margin-top: 0;
}
/* Уточним правило для выпадающих списков внутри фильтров */
.filter-container .absolute.z-10 {
    z-index: 26; /* Ещё выше, чтобы выпадающие списки фильтров перекрывали всё */
}

/* Адаптивные классы для карточек авто - увеличенные для больших экранов */
.car-card-content {
    padding: clamp(12px, 3vw, 24px) clamp(12px, 3vw, 24px) clamp(8px, 2vw, 16px);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.car-info-container {
    margin-bottom: clamp(8px, 2.5vw, 24px);
    min-height: clamp(2.5rem, 6vw, 4rem);
    flex-grow: 1;
}

/* Текст информации об авто */
.car-info-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 
                Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: clamp(11px, 3.2vw, 20px); /* Увеличил максимум до 20px */
    line-height: clamp(1.2, 1.4, 1.4);
    color: #1F2937;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
    overflow-wrap: break-word;
    hyphens: none;
}

.car-price-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    padding-top: clamp(8px, 2vw, 16px);
    margin-top: auto;
}

.price-highlight {
    color: #1e40af;
    font-weight: 600;
    font-size: clamp(12px, 3.3vw, 21px);
}

@media (max-width: 640px) {
    .footer {
        position: static;
        width: auto;
        margin-top: auto;
    }
    
    #mobile-menu {
        animation: slideDown 0.3s ease-out;
    }
    
    .filter-btn {
        padding: 0.5rem;
    }
    
    .card-img-container {
        height: 160px;
    }
    
    /* Переопределяем для мобильных */
    .car-card-content {
        padding: clamp(8px, 2.5vw, 12px) clamp(8px, 2.5vw, 12px) clamp(6px, 1.5vw, 10px);
    }
    
    .car-info-container {
        margin-bottom: clamp(6px, 2vw, 12px);
        min-height: clamp(2rem, 5vw, 2.5rem);
    }
    
    .car-info-text {
        font-size: clamp(10px, 3vw, 14px);
        line-height: 1.2;
    }
    
    .car-price-container {
        padding-top: clamp(6px, 1.5vw, 10px);
    }
    
    .price-highlight {
        font-size: clamp(14px, 4vw, 18px);
    }
}

/* Для очень маленьких экранов (менее 360px) */
@media (max-width: 360px) {
    .car-card-content {
        padding: clamp(6px, 2vw, 10px) clamp(6px, 2vw, 10px) clamp(4px, 1vw, 8px);
    }
    
    .car-info-container {
        margin-bottom: clamp(4px, 1.5vw, 8px);
        min-height: clamp(1.8rem, 4.5vw, 2rem);
    }
    
    .car-info-text {
        font-size: clamp(9px, 2.8vw, 12px);
        line-height: 1.1;
    }
    
    .car-price-container {
        padding-top: clamp(4px, 1vw, 8px);
    }
    
    .price-highlight {
        font-size: clamp(12px, 3.5vw, 16px);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}