:root {
    --primary-color: #0047AB; 
    --secondary-color: #FFD700; 
    --accent-yellow: #FFEA00; 
    --text-color: #2c3e50; 
    --bg-color: #f4f6f8; 
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --border-radius: 8px;
    --header-bg-color: #0B132B; /* Ваш темно-синій колір */
    --header-text-color: #ffffff; 
    --header-nav-hover: var(--secondary-color); 
    --btn-primary-bg: var(--secondary-color); 
    --btn-primary-text: #2c3e50; 
    --btn-primary-hover: var(--accent-yellow); 
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background-color: var(--bg-color); color: var(--text-color); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Шапка сайту */
.header { background-color: var(--header-bg-color); box-shadow: 0 4px 15px rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 100; padding: 10px 0; }
.header-content { display: flex; justify-content: space-between; align-items: center; min-height: 70px; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { max-height: 130px; width: auto; }
.nav a { margin: 0 15px; text-decoration: none; color: var(--header-text-color); font-weight: 500; transition: color 0.2s; }
.nav a:hover { color: var(--header-nav-hover); text-shadow: 0 0 10px rgba(255,215,0,0.5); }

/* Кнопки */
.btn { padding: 10px 20px; border: none; border-radius: var(--border-radius); cursor: pointer; font-weight: bold; font-size: 15px; transition: all 0.2s; text-decoration: none; display: inline-block; text-align: center; }
.btn-primary { background-color: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-primary:hover { background-color: var(--btn-primary-hover); }

/* НОВА КНОПКА ВИДАЛЕННЯ (DANGER) */
.btn-danger { background-color: #e74c3c; color: white; transition: background-color 0.2s; }
.btn-danger:hover { background-color: #c0392b; }

/* Ідеальна сітка фільтрів 4x2 */
.search-section { background-color: var(--card-bg); padding: 30px; border-radius: var(--border-radius); margin: 30px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.search-section h2 { margin-bottom: 20px; font-size: 20px; }
.search-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.form-control, .search-form .btn-primary { width: 100%; height: 48px; padding: 0 15px; border: 1px solid var(--border-color); border-radius: var(--border-radius); font-size: 15px; outline: none; font-family: inherit; background-color: #fff; margin: 0;}
.form-control:focus { border-color: var(--primary-color); }
.search-form .btn-primary { padding: 0; display: flex; align-items: center; justify-content: center; }

/* Сітка автомобілів */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin-bottom: 50px; }
.car-card { background-color: var(--card-bg); border-radius: var(--border-radius); overflow: hidden; border: 1px solid var(--border-color); transition: box-shadow 0.2s; display: flex; flex-direction: column; }
.car-card:hover { box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.car-img { width: 100%; height: 200px; object-fit: cover; background-color: #eee; }
.car-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.car-title { font-size: 20px; margin-bottom: 5px; font-weight: bold; }
.car-price { font-size: 22px; color: #2e7d32; font-weight: bold; margin-bottom: 15px; }
.car-details { display: flex; justify-content: space-between; color: #555; font-size: 13px; }
.car-card .btn-primary { width: 100%; margin-top: auto; } 

/* Модальні вікна */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(18, 18, 33, 0.85); justify-content: center; align-items: center; }
.modal-content { background-color: var(--card-bg); padding: 30px; border-radius: var(--border-radius); width: 90%; max-width: 700px; position: relative; max-height: 90vh; overflow-y: auto; overflow-x: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.modal-content h2 { margin-bottom: 20px; font-size: 24px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; transition: 0.2s; }
.close-btn:hover { color: var(--primary-color); }

/* Форма додавання */
.add-form .form-group { margin-bottom: 15px; }
.add-form label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; color: #333; }
textarea.form-control { resize: vertical; min-height: 100px; padding: 15px;}
input[type="file"].form-control { padding: 11px 12px; cursor: pointer; background-color: #f9f9f9; }
input[type="file"].form-control::file-selector-button { background-color: #2c3e50; color: white; border: none; padding: 4px 12px; border-radius: 4px; cursor: pointer; margin-right: 10px; transition: 0.2s; }
input[type="file"].form-control::file-selector-button:hover { background-color: var(--primary-color); }

/* Дизайн "Деталі авто" */
.modal-img-wrapper { position: relative; width: 100%; background-color: #000; border-radius: var(--border-radius) var(--border-radius) 0 0; }
.modal-details-img { width: 100%; height: 45vh; object-fit: cover; border-radius: var(--border-radius) var(--border-radius) 0 0; cursor: zoom-in; display: block; transition: opacity 0.2s; }
.modal-details-img:hover { opacity: 0.9; }
.img-badge { position: absolute; bottom: 15px; right: 15px; background: rgba(0,0,0,0.6); color: white; padding: 5px 12px; border-radius: 20px; font-size: 14px; pointer-events: none; }
.thumbnails-container { display: flex; gap: 10px; padding: 15px 30px 0; overflow-x: auto; }
.thumb-img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.6; transition: 0.2s; border: 2px solid transparent; }
.thumb-img:hover { opacity: 1; }
.thumb-img.active { opacity: 1; border-color: var(--primary-color); }
.modal-details-body { padding: 25px 30px; }
.md-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.md-header h1 { font-size: 28px; line-height: 1.2; }
.md-price { font-size: 28px; color: #2e7d32; font-weight: bold; white-space: nowrap; margin-left: 20px; }
.md-specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 25px; }
.md-spec-item { background-color: var(--bg-color); padding: 12px; border-radius: 8px; text-align: center; }
.md-spec-item span { display: block; font-size: 12px; color: #777; margin-bottom: 3px; }
.md-spec-item strong { font-size: 16px; color: var(--text-color); }
.md-desc { margin-bottom: 25px; }
.md-desc h3 { font-size: 18px; margin-bottom: 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; }
.md-desc p { color: #444; white-space: pre-wrap; font-size: 15px; }
.md-contacts { background-color: #f0f7ff; padding: 15px 20px; border-radius: 8px; border-left: 4px solid var(--primary-color); }
.md-contacts h3 { font-size: 18px; margin-bottom: 10px; }
.md-contacts p { font-size: 16px; margin-bottom: 5px; font-weight: 500; }
.md-contacts a { color: var(--text-color); text-decoration: none; }
.md-contacts a:hover { color: var(--primary-color); text-decoration: underline; }

/* LIGHTBOX */
.lightbox { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.95); justify-content: center; align-items: center; }
.lightbox img { max-width: 90%; max-height: 85vh; object-fit: contain; border-radius: 4px; box-shadow: 0 0 30px rgba(0,0,0,0.5); user-select: none; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: white; font-size: 50px; cursor: pointer; transition: 0.2s; line-height: 1; }
.lightbox-close:hover { color: var(--secondary-color); }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 60px; padding: 20px; cursor: pointer; user-select: none; transition: 0.2s; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--secondary-color); }
.lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: white; font-size: 18px; background: rgba(0,0,0,0.5); padding: 5px 15px; border-radius: 20px; }

/* Підвал */
.footer { background-color: #1a1a1a; color: #aaaaaa; text-align: center; padding: 20px 0; margin-top: auto; font-size: 14px; }

/* Адаптивність для мобільних */
@media (max-width: 900px) { .search-form { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .search-form { grid-template-columns: 1fr; } .nav { display: none; } .form-group[style*="display: flex"] { flex-direction: column; gap: 0; } .md-header { flex-direction: column; } .md-price { margin-left: 0; margin-top: 10px; } .md-specs { grid-template-columns: repeat(2, 1fr); } .lightbox-prev, .lightbox-next { font-size: 40px; padding: 10px; } }