/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

header h1 a {
    color: white;
    text-decoration: none;
}

/* Фильтры и поиск */
.filters {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.search-form select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.search-form button {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #5568d3;
}

.reset-btn {
    padding: 12px 20px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    font-size: 15px;
    transition: background 0.3s;
}

.reset-btn:hover {
    background: #e0e0e0;
}

.search-info {
    background: #e8f4f8;
    padding: 12px 20px;
    margin: 20px 0;
    border-radius: 6px;
    color: #0277bd;
    font-weight: 500;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.product-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #ececec 25%, #f5f5f5 37%, #ececec 63%);
    background-size: 400% 100%;
    animation: imageSkeleton 1.2s ease-in-out infinite;
    transition: opacity 0.2s ease;
}

.product-image img.loaded {
    opacity: 1;
}

.product-image.loaded::before {
    opacity: 0;
    pointer-events: none;
}

@keyframes imageSkeleton {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0 0;
    }
}

.no-image {
    color: #999;
    font-size: 14px;
}

.quick-filters {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #d8d8d8;
    color: #555;
    background: #fff;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.quick-chip:hover {
    border-color: #667eea;
    color: #667eea;
}

.quick-chip.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.product-info {
    padding: 15px;
}

.product-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    min-height: 48px;
}

.genre {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.activation {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.price {
    font-size: 22px;
    font-weight: 700;
    color: #667eea;
}

.available {
    background: #4caf50;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
}

.no-products p {
    font-size: 18px;
    color: #999;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 15px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    font-weight: 500;
}

.page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    cursor: default;
}

/* Страница товара */
.breadcrumbs {
    padding: 20px 0;
    color: #666;
    font-size: 14px;
}

.breadcrumbs a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.product-detail-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.product-detail-image img {
    width: 100%;
    height: auto;
    display: block;
}

.no-image-large {
    padding: 100px 20px;
    text-align: center;
    color: #999;
}

.product-detail-info h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

.product-meta {
    margin-bottom: 25px;
}

.meta-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.meta-label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
}

.meta-value {
    color: #333;
}

.available-badge {
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.product-price-block {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.product-price-large {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
}

.btn-buy {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.product-description {
    margin: 25px 0;
}

.product-description h2 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #333;
}

.product-description p {
    color: #555;
    line-height: 1.8;
    font-size: 16px;
}

.product-actions {
    margin-top: 30px;
}

.btn-back {
    display: inline-block;
    padding: 12px 25px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
    font-weight: 500;
}

.btn-back:hover {
    background: #e0e0e0;
}

/* Футер */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input[type="text"],
    .search-form select,
    .search-form button {
        width: 100%;
    }
    
    header h1 {
        font-size: 22px;
    }
    
    .product-detail-info h1 {
        font-size: 24px;
    }
}
