/* design.css */

/* --- БАЗОВЫЕ СТИЛИ --- */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; padding: 0; margin: 0; background-color: #f4f4f9; }
.container { max-width: 1000px; margin: 0 auto; padding: 20px; }
h1, h2, h3 { color: #333; }
h1, h2 { text-align: center; }

/* --- ФОРМЫ И ВВОД ДАННЫХ --- */
.form-group { margin-bottom: 15px; }
label { font-weight: bold; display: block; margin-bottom: 5px; color: #555; font-size: 14px; }
input, textarea, select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; }
select:disabled { background-color: #e9ecef; cursor: not-allowed; }

/* --- СЕТКИ --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
@media (max-width: 768px) {
    .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

/* --- КНОПКИ --- */
button { width: 100%; padding: 14px; background: #28a745; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: bold; margin-top: 15px; }
button:hover { background: #218838; }

/* --- БЛОК АВТОРИЗАЦИИ --- */
.login-box { text-align: center; margin-top: 50px; }

/* --- ШАПКА САЙТА --- */
.header { background: #fff; padding: 15px 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
.header-container { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 24px; font-weight: bold; color: #333; cursor: pointer; }
.btn-sell { width: auto; margin-top: 0; padding: 10px 20px; background: #0088cc; }
.btn-sell:hover { background: #006699; }

/* --- НАВИГАЦИЯ --- */
.btn-back { background: #f4f4f9; color: #333; border: 1px solid #ccc; width: auto; padding: 8px 15px; margin-bottom: 20px; font-size: 14px; }
.btn-back:hover { background: #e9ecef; }

/* --- ФИЛЬТРЫ ПОИСКА --- */
.search-filters-block { background: white; padding: 25px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.btn-search { background: #0088cc; margin-top: 20px; }
.btn-search:hover { background: #006699; }

/* --- СТИЛИ ДЛЯ ВИТРИНЫ ОБЪЯВЛЕНИЙ (КАРТОЧКИ) --- */
.ads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.ad-card { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: transform 0.2s; cursor: pointer; }
.ad-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.ad-image { width: 100%; height: 180px; object-fit: cover; }
.ad-info { padding: 15px; }
.ad-title { font-size: 18px; font-weight: bold; margin: 0 0 10px; color: #333; }
.ad-price { font-size: 20px; color: #28a745; font-weight: bold; margin-bottom: 10px; }
.ad-details { font-size: 13px; color: #666; line-height: 1.5; }

/* --- ДЕТАЛЬНАЯ СТРАНИЦА ОБЪЯВЛЕНИЯ --- */
.ad-detail-container { display: flex; flex-direction: column; gap: 30px; background: #fff; padding: 25px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

/* Галерея фотографий */
.ad-detail-gallery { display: flex; flex-direction: column; gap: 15px; }
.detail-main-image { width: 100%; height: 400px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }
.detail-thumbnails { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.detail-thumb { width: 90px; height: 65px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 3px solid transparent; transition: border-color 0.2s; }
.detail-thumb:hover { border-color: #ccc; }
.detail-thumb.active { border-color: #0088cc; }

/* Информация об автомобиле */
.ad-detail-info { display: flex; flex-direction: column; }
.detail-title { margin: 0 0 10px; font-size: 26px; text-align: left; }
.detail-price { font-size: 32px; color: #28a745; font-weight: bold; margin-bottom: 25px; }

/* Кнопки связи */
.btn-contact { font-size: 18px; padding: 15px; border: none; border-radius: 5px; cursor: pointer; color: white; font-weight: bold; width: 100%; transition: background 0.2s; margin-top: 0; }
.telegram-btn { background: #0088cc; }
.telegram-btn:hover { background: #006699; }
.phone-btn { background: #28a745; }
.phone-btn:hover { background: #218838; }

/* Список характеристик */
.detail-attributes-list { list-style: none; padding: 0; margin: 0 0 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.detail-attributes-list li { padding: 12px; background: #f8f9fa; border-radius: 6px; font-size: 14px; color: #444; border-left: 4px solid #ddd; }

/* Описание */
.detail-description { line-height: 1.6; color: #333; white-space: pre-wrap; background: #f8f9fa; padding: 15px; border-radius: 6px; font-size: 15px; border: 1px solid #eee; }

/* Адаптивность для больших экранов */
@media (min-width: 800px) {
    .ad-detail-container { flex-direction: row; }
    .ad-detail-gallery { flex: 1.2; width: 60%; }
    .ad-detail-info { flex: 1; width: 40%; }
    .detail-attributes-list { grid-template-columns: 1fr; }
}

/* --- КНОПКИ ЛИЧНОГО КАБИНЕТА --- */
.header-buttons { display: flex; gap: 10px; }
.btn-cabinet { background: #6c757d; padding: 10px 20px; width: auto; margin-top: 0; display: none; }
.btn-cabinet:hover { background: #5a6268; }

.cabinet-actions { display: flex; gap: 10px; margin-top: 15px; }
.btn-edit { background: #ffc107; color: #333; padding: 10px; font-size: 14px; margin-top: 0; }
.btn-edit:hover { background: #e0a800; }
.btn-delete { background: #dc3545; padding: 10px; font-size: 14px; margin-top: 0; }
.btn-delete:hover { background: #c82333; }