/* Глобальные переменные */
:root {
    --color-primary: #007aff; /* Apple Blue */
    --color-secondary: #f5f5f7; /* Light Gray */
    --color-background: #000000; /* Black background */
    --color-card-bg: #1c1c1e; /* Dark Card Background */
    --color-text-light: #ffffff;
    --color-text-dark: #e0e0e0;
    --color-border: #333333;
    --color-highlight: #ffcc00; /* Gold/Yellow for highlights */
    --transition-speed: 0.3s;
}

/* Базовые стили */
body {
    font-family: 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-background);
    color: var(--color-text-light);
    min-height: 100vh;
}

/* Хедер и навигация */
header {
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.8em;
    color: var(--color-text-light);
    font-weight: 700;
}

.nav-links a {
    color: var(--color-text-dark);
    text-decoration: none;
    margin-left: 25px;
    font-size: 1em;
    transition: color var(--transition-speed);
}

.nav-links a:hover {
    color: var(--color-primary);
}

.cart-icon {
    color: var(--color-text-light);
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 25px;
}

/* Основной контент */
.main-content {
    display: flex;
    width: 90%;
    max-width: 1400px;
    margin: 30px auto;
    gap: 30px;
}

/* Боковая панель (Фильтры) */
.sidebar {
    width: 250px;
    padding: 20px;
    background-color: var(--color-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    height: fit-content;
}

.sidebar h3 {
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text-dark);
}

.filter-group select,
.filter-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: #333;
    color: var(--color-text-light);
    box-sizing: border-box;
}

/* Каталог товаров */
.catalog {
    flex-grow: 1;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.product-card {
    background-color: var(--color-card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    text-align: center;
    padding: 20px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.product-image {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition-speed);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info h2 {
    margin-top: 0;
    font-size: 1.4em;
    color: var(--color-text-light);
    margin-bottom: 5px;
}

.product-info p {
    color: var(--color-text-dark);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.price {
    font-size: 1.6em;
    color: var(--color-highlight);
    font-weight: bold;
    margin-bottom: 15px;
}

.add-to-cart {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 1em;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color var(--transition-speed);
    width: 100%;
    font-weight: 600;
}

.add-to-cart:hover {
    background-color: #0056b3;
}

/* Стили для корзины (мини-корзина) */
.cart-summary {
    position: fixed;
    top: 80px;
    right: 5%;
    width: 300px;
    padding: 20px;
    background-color: var(--color-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-border);
    z-index: 100;
    display: none; /* Скрыто по умолчанию */
}

.cart-summary.open {
    display: block;
}

.cart-summary h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    color: var(--color-text-light);
    font-size: 1.3em;
}

#cart-items {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

#cart-items li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--color-border);
    color: var(--color-text-dark);
}

#cart-items li:last-child {
    border-bottom: none;
}

.cart-total {
    font-size: 1.4em;
    font-weight: bold;
    margin-top: 15px;
    color: var(--color-highlight);
    display: flex;
    justify-content: space-between;
}

.checkout-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    text-align: center;
    font-size: 1em;
    margin-top: 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color var(--transition-speed);
    width: 100%;
}

.checkout-button:hover {
    background-color: #1e7e34;
}

.remove-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
    font-size: 0.9em;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    .cart-summary {
        position: static;
        width: 100%;
        margin-top: 20px;
    }
}