﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: #f8f9fa;
    padding-top: 80px;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ===== ШАПКА ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar {
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Кнопка каталога */
.catalog-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

    .catalog-btn:hover {
        background: #764ba2;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    }

    .catalog-btn svg {
        stroke: white;
    }

/* Логотип */
.logo {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    transition: transform 0.3s;
}

    .logo:hover {
        transform: scale(1.05);
    }

.logo-bold {
    color: #667eea;
}

.logo-light {
    color: #ffffff;
}

/* Поиск по центру */
.navbar-center {
    flex: 1;
    max-width: 500px;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    overflow: hidden;
    transition: all 0.3s;
}

    .search-form:focus-within {
        background: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
    }

.search-input-header {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.7rem 1.2rem;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

    .search-input-header::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }

.search-btn {
    background: transparent;
    border: none;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

    .search-btn svg {
        stroke: white;
        opacity: 0.7;
        transition: opacity 0.3s;
    }

    .search-btn:hover svg {
        opacity: 1;
    }

/* Навигация справа */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

    .nav-link:hover {
        color: #667eea;
    }

/* Иконка корзины */
.cart-icon {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s;
}

    .cart-icon:hover {
        transform: scale(1.1);
    }

    .cart-icon svg {
        stroke: white;
    }

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #667eea;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

/* ===== БОКОВАЯ ПАНЕЛЬ ===== */
.sidebar {
    position: fixed;
    left: -400px;
    top: 0;
    width: 400px;
    height: 100%;
    background: white;
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

    .sidebar.open {
        left: 0;
    }

.sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

    .sidebar-header h3 {
        margin: 0;
        font-size: 1.3rem;
    }

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s;
}

    .sidebar-close:hover {
        transform: rotate(90deg);
    }

.sidebar-search {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 70px;
    background: white;
    z-index: 9;
}

.search-input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

    .search-input:focus {
        border-color: #667eea;
    }

.sidebar-content {
    padding: 1rem;
}

/* Дерево категорий */
.category-tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

    .category-tree ul {
        list-style: none;
        padding-left: 1.2rem;
        display: none;
    }

    .category-tree li:hover > ul {
        display: block;
    }

    .category-tree li {
        margin: 0.3rem 0;
    }

    .category-tree a {
        text-decoration: none;
        color: #333;
        display: block;
        padding: 0.5rem 0.8rem;
        border-radius: 8px;
        transition: all 0.3s;
        font-size: 0.9rem;
    }

        .category-tree a:hover {
            background: #f0f0f0;
            color: #667eea;
            padding-left: 1rem;
        }

    .category-tree .category-link {
        font-weight: 500;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

.category-count {
    background: #e9ecef;
    color: #6c757d;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 20px;
}

.category-link.has-children::after {
    content: "▶";
    font-size: 0.7rem;
    margin-left: 0.5rem;
    color: #999;
    transition: transform 0.2s;
}

.category-tree li:hover .category-link.has-children::after {
    transform: rotate(90deg);
}

/* Оверлей */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

    .sidebar-overlay.show {
        display: block;
    }

/* ===== ФУТЕР ===== */
.main-footer {
    background: #1a1a2e;
    color: #ffffff;
    padding: 3rem 0 1rem;
}

    /* Убираем margin-top у футера на главной странице */
    .main-footer.footer-home {
        margin-top: 0;
    }

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-decoration: none;
    color: white;
    transition: all 0.3s;
}

    .social-link:hover {
        background: #667eea;
        transform: translateY(-3px);
    }

.footer-section h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

    .footer-links li {
        margin-bottom: 0.5rem;
    }

    .footer-links a {
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        transition: color 0.3s;
    }

        .footer-links a:hover {
            color: #667eea;
        }

.contact-info li {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .navbar {
        padding: 0.8rem 1rem;
    }

    .navbar-left {
        gap: 1rem;
    }

    .catalog-btn span {
        display: none;
    }

    .catalog-btn {
        padding: 0.5rem;
    }

    .navbar-center {
        max-width: 200px;
    }

    .nav-menu {
        display: none;
    }

    .sidebar {
        width: 100%;
        left: -100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}
