/* Общие стили */
:root {
    --primary-color: #3C2A98;
    --secondary-color: #9ae2ff;
    --accent-color: #FF6B00;
    --text-color: #333;
    --light-bg: #f9f9f9;
    --white: #ffffff;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--white);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    background: var(--accent-color);
    bottom: -10px;
    left: 25%;
}

.section-header p {
    font-size: 1.1rem;
    color: #666;
}

.btn {
    display: inline-block;
    background: var(--accent-color);
    color: var(--white);
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
    border: 2px solid var(--accent-color);
}

.btn:hover {
    background: transparent;
    color: var(--accent-color);
}

/* Шапка */
header {
    background-color: var(--white);
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-container h1 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.tagline {
    color: #666;
    font-size: 0.9rem;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-right: 25px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--accent-color);
}

nav ul li a i {
    font-size: 1.1rem;
}

.search-settings {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 50px;
    width: 200px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box input:focus {
    width: 250px;
    border-color: var(--accent-color);
    outline: none;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.phone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Герой-баннер */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 50px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Модели автомобилей */
.models-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.model-group {
    background: var(--white);
    border-radius: 10px;
    padding: 30px 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    border-top: 4px solid var(--primary-color);
}

.model-group:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.model-icon {
    width: 60px;
    height: 60px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.model-group h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.model-group ul {
    list-style: none;
}

.model-group ul li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.model-group ul li i {
    color: var(--accent-color);
}

/* Преимущества */
.advantages {
    background: var(--light-bg);
    padding: 60px 0;
}

.advantages .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.advantage-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.advantage-card:hover {
    transform: translateY(-5px);
}

.advantage-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.advantage-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Контакты */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.contact-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-card h3 i {
    color: var(--accent-color);
}

.address-row {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
}

.address-col {
    flex: 1;
    min-width: 120px;
}

.workhours-col {
    flex: 1;
    text-align: right;
}

.map-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    height: 100%;
    min-height: 500px;
}

.map-container iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    border: none;
}

/* Адаптивность */
@media (max-width: 992px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .map-container {
        height: 400px;
    }
}

@media (max-width: 576px) {
    .address-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .workhours-col {
        text-align: left;
        margin-top: 5px;
    }
}

/* Бренды */
#brands {
    background-color: #f9f9f9;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.brand-card {
    background: white;
    border-radius: 10px;
    padding: 25px 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.brand-card:hover {
    transform: translateY(-5px);
}

.brand-card img {
    max-width: 100%;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.brand-card p {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* Социальные ссылки */
.social-links {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}

.social-links i {
    font-size: 1.2rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .phone {
        font-size: 14px;
        margin-right: 160px;
    }
}
/* Стили для каталога */
.brand-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.brand-btn {
    padding: 10px 20px;
    background: #3C2A98;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.brand-btn:hover {
    background: #2a1c6e;
}

.parts-list {
    margin-top: 30px;
}

.category {
    margin-bottom: 25px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
}

.category h3 {
    margin-top: 0;
    color: #3C2A98;
}

.parts-list ul {
    list-style: none;
    padding: 0;
}

.parts-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.part-name {
    font-weight: 500;
}

.part-price {
    color: #FF6B00;
    font-weight: bold;
}

/* Стили для каталога */
.catalog-header {
    background-color: #3C2A98;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-bottom: 30px;
}

.catalog-header h1 {
    margin: 0;
    font-size: 2rem;
}

.catalog-header p {
    margin: 5px 0 0;
    opacity: 0.9;
}

/* Сетка брендов */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    width: 100%; /* Занимает всю ширину */
}

.brand-btn {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    width: 100%; /* Занимает всю доступную ширину */
    box-sizing: border-box; /* Учитывает padding в ширине */
}


.brand-btn:hover {
    border-color: #3C2A98;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.brand-btn.active {
    border-color: #3C2A98;
    background-color: #3C2A98;
    color: rgb(255, 255, 255);
}

.brand-btn i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Стили для кнопки "На главную" */
.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin: 15px 0;
    transition: background-color 0.3s;
}

.home-btn:hover {
    background-color: #2a1c6e;
}

.home-btn i {
    font-size: 1rem;
}

/* Секция запчастей */
.parts-section {
   background-color: #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.parts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.parts-header.hidden {
    display: none;
}

.parts-header h2 {
    margin: 0;
    color: #3C2A98;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 15px 8px 35px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}


/* Список запчастей */
.parts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.part-item {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    border-left: 3px solid #3C2A98;
}

.part-name {
    font-weight: 500;
    margin-bottom: 5px;
    color: #222;
}

.part-article {
    font-size: 14px;
    color: #666;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    font-family: 'Courier New', monospace;
}

/* Состояния */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

.empty-state.error i {
    color: #e74c3c;
}

.error {
    color: #e74c3c;
}

.no-brands {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Адаптивность */
@media (max-width: 768px) {
    .brand-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .parts-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        width: 100%;
        margin-top: 10px;
    }
}

/* Категории запчастей */
.part-category {
    margin-bottom: 30px;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.category-header h3 {
    margin: 0;
    color: #3C2A98;
    font-size: 1.3rem;
}

.category-count {
    background: #3C2A98;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-left: 10px;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.part-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
    border-left: 3px solid #3C2A98;
}

.part-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.part-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.part-price {
    color: #FF6B00;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.hidden {
    display: none;
}

/* Основной каталог */
.compact-part-item {
    background: #f5f5f5;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.part-name-line {
    font-weight: 500;
    margin-bottom: 5px;
}

.part-details-line {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

/* Админ-панель */
.brand-header {
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
    color: #3C2A98;
}

.brand-parts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.admin-part-item {
    background: #f8f8f8;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.part-info {
    flex-grow: 1;
}

.part-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.part-article {
    font-size: 13px;
    color: #666;
}

.part-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.edit-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
}

.no-parts {
    color: #888;
    font-style: italic;
    padding: 10px;
}

/* Кнопки */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    
    
}

.edit-btn {
    background: #3C2A98;
    color: white;
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.save-btn {
    background: #27ae60;
    color: white;
}

@media (max-width: 768px) {
    .brand-parts-container {
        grid-template-columns: 1fr;
    }
    
    .edit-form {
        grid-template-columns: 1fr;
    }
}

.edit-form {
    grid-column: 1 / -1;
    display: none;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #ddd;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.cancel-btn {
    background: #95a5a6;
    color: white;
}

.save-btn {
    background: #27ae60;
    color: white;
    flex: 1;
}

.cancel-btn {
    flex: 1;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-text {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .home-btn {
        align-self: flex-end;
        margin-top: 10px;
    }
}
/* Мобильное меню (добавлено в конец файла) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px 10px;
    position: absolute;
    right: 20px;
    top: 20px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    nav {
        display: none;
        width: 100%;
        order: 3;
        margin-top: 15px;
    }
    
    nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
        background: var(--white);
        padding: 15px;
        border-radius: 5px;
        box-shadow: var(--shadow);
    }
    
    nav ul li {
        margin: 5px 0;
    }
    
    .search-settings {
        width: 100%;
        order: 2;
        margin-top: 10px;
    }
}
/* Стили только для мобилок (до 768px) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary-color);
        cursor: pointer;
        position: absolute;
        right: 20px;
        top: 20px;
        z-index: 1001;
    }

    /* Скрываем обычное меню */
    nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        padding: 15px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    nav ul li {
        margin-right: 0;
    }
}

/* На ПК кнопка бургера всегда скрыта */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}
/* Мобильное меню (добавлено в конец файла) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px 10px;
    position: absolute;
    right: 20px;
    top: 20px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    nav {
        display: none;
        width: 100%;
        order: 3;
        margin-top: 15px;
    }
    
    nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
        background: var(--white);
        padding: 15px;
        border-radius: 5px;
        box-shadow: var(--shadow);
    }
    
    nav ul li {
        margin: 5px 0;
    }
    
    .search-settings {
        width: 100%;
        order: 2;
        margin-top: 10px;
    }
}
/* Мобильные стили (добавлены в конец файла) */
@media (max-width: 768px) {
    /* Шапка */
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary-color);
        cursor: pointer;
    }

    nav {
        display: none;
        width: 100%;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    nav ul li {
        margin-right: 0;
    }

    .search-settings {
        justify-content: center;
        margin-top: 15px;
    }

    /* Герой-баннер */
    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Модели автомобилей */
    .models-list {
        grid-template-columns: 1fr;
    }

    /* Преимущества */
    .advantages .container {
        grid-template-columns: 1fr;
    }

    /* Бренды */
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .brand-card {
        padding: 15px;
    }

    /* Контакты */
    .contact-container {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 300px;
        margin-top: 20px;
    }

    .address-row {
        flex-direction: column;
    }

    .workhours-col {
        text-align: left;
        margin-top: 5px;
    }

    /* Каталог */
    .brand-grid {
        grid-template-columns: 1fr;
    }

    .parts-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        width: 100%;
        margin-top: 10px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .hero-content {
        padding: 0 15px;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .section {
        padding: 40px 0;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

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

    .contact-card {
        padding: 15px;
    }

    .social-links a {
        font-size: 0.9rem;
    }
}