/* Стили для каталога товаров */

/* Хлебные крошки */
.breadcrumbs {
    background: var(--bg-secondary);
    padding: 15px 0;
    margin-top: 140px;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    color: var(--text-secondary);
}

/* Заголовок каталога */
.catalog-header {
    padding: 40px 0;
    background: var(--bg-main);
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Элементы управления каталогом */
.catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.catalog-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9rem;
    min-width: 180px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Корзина в шапке */
.cart-summary {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-icon {
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    padding: 2px 6px;
    margin-left: 5px;
    min-width: 20px;
    text-align: center;
}

.cart-total {
    font-weight: 600;
    color: var(--accent);
    font-size: 1.1rem;
}

/* Сетка товаров */
.catalog-products {
    padding: 40px 0;
    background: var(--bg-secondary);
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Карточка товара */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
    cursor: pointer;
}

.product-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(0, 163, 255, 0.15);
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-specs {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.product-specs span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-main);
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 15px;
}

.price-current {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.price-per-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.add-to-cart {
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
}

.add-to-cart:hover {
    background: var(--accent-hover);
}

/* Активное состояние навигации */
.nav-link.active {
    color: var(--accent);
    position: relative;
}

@media (min-width: 1024px) {
    .nav-link.active::after {
        width: 100%;
    }
}

/* Боковая корзина */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--card-bg);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--card-border);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--card-border);
}

.cart-header h3 {
    color: var(--text-main);
    margin: 0;
}

.cart-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.cart-close:hover {
    color: var(--text-main);
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--card-border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    background: #2a2a2a;
    border-radius: 6px;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 5px;
    line-height: 1.3;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    background: var(--bg-main);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.quantity-btn:hover {
    background: var(--card-border);
}

.quantity-value {
    font-weight: 600;
    color: var(--text-main);
    min-width: 20px;
    text-align: center;
}

.cart-item-price {
    font-weight: 600;
    color: var(--accent);
}

.remove-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px;
    font-size: 0.9rem;
}

.remove-item:hover {
    color: #ff4444;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--card-border);
}

.cart-total-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 15px;
    text-align: center;
}

.cart-total-amount span {
    color: var(--accent);
}

#checkoutBtn {
    width: 100%;
    padding: 12px;
}

/* Оверлей корзины */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Пустая корзина */
.cart-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}

/* Адаптивность */
@media (max-width: 1023px) {
    .catalog-controls {
        justify-content: center;
        text-align: center;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .breadcrumbs {
        margin-top: 81px;
    }
}

@media (min-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-title {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .breadcrumbs {
        margin-top: 140px;
    }
    
    .catalog-controls {
        justify-content: space-between;
    }
}

/* Анимация добавления в корзину */
@keyframes addToCart {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.add-to-cart.adding {
    animation: addToCart 0.3s ease;
    background: #28a745 !important;
}

.add-to-cart.adding::after {
    content: " ✓";
}
