/* Стили для магазина */

.shop-main {
    min-height: 100vh;
    padding-top: 100px;
    background: linear-gradient(135deg, var(--background-dark) 0%, var(--background-medium) 100%);
}

/* Заголовок магазина */
.shop-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.shop-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.shop-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Фильтры */
.shop-filters {
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

.search-box input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    width: 250px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sort-select {
    padding: 0.75rem 1rem;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

/* Товары */
.shop-products {
    margin-bottom: 3rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--card-background);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

.product-badge.sale {
    background: var(--error-color);
}

.product-badge.new {
    background: var(--success-color);
}

.product-badge.popular {
    background: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.product-content {
    padding: 1.5rem;
}

.product-category {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.product-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.old-price {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
}

.add-to-cart-btn,
.buy-now-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: white;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.buy-now-btn {
    background: var(--success-color);
    color: white;
}

.buy-now-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Корзина */
.shopping-cart {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-background);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    width: 350px;
    max-height: 600px;
    z-index: 100;
    transition: all 0.3s ease;
}

.shopping-cart.minimized {
    height: 80px;
    overflow: hidden;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.cart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-count {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.cart-content {
    padding: 1rem;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.empty-cart {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.empty-cart i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--success-color);
    font-weight: 500;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.quantity-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    min-width: 20px;
    text-align: center;
}

.remove-item {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1rem;
}

.cart-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.total-price {
    font-size: 1.3rem;
    color: var(--success-color);
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--success-color), #059669);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Модальное окно товара */
.product-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.product-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
}

.product-info h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.current-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--success-color);
}

.old-price {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.product-features {
    margin-bottom: 2rem;
}

.product-features h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.product-features ul {
    list-style: none;
}

.product-features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.product-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: 600;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background-light);
    border-radius: 8px;
    padding: 0.5rem;
    width: fit-content;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.quantity-btn:hover {
    background: var(--primary-dark);
}

#quantityInput {
    width: 60px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.add-to-cart-btn,
.buy-now-btn {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: white;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.buy-now-btn {
    background: var(--success-color);
    color: white;
}

.buy-now-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Модальное окно оформления заказа */
.checkout-modal {
    max-width: 600px;
}

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.order-summary h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.checkout-item-name {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.checkout-item-price {
    font-size: 0.9rem;
    color: var(--success-color);
    font-weight: 500;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.total-amount {
    color: var(--success-color);
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method:hover {
    border-color: var(--primary-color);
}

.payment-method input[type="radio"] {
    margin-bottom: 0.5rem;
}

.payment-method i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.payment-method span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.promo-input-group {
    display: flex;
    gap: 0.5rem;
}

.promo-input-group input {
    flex: 1;
}

.apply-promo-btn {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-promo-btn:hover {
    background: var(--primary-dark);
}

.pay-btn {
    padding: 1rem;
    background: linear-gradient(135deg, var(--success-color), #059669);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Модальное окно успешной покупки */
.success-modal {
    max-width: 500px;
    text-align: center;
}

.success-content {
    padding: 2rem;
}

.success-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.success-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.success-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.order-details {
    background: var(--background-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.order-details h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.order-details p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.ok-btn {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ok-btn:hover {
    background: var(--primary-dark);
}

/* Кнопка баланса в навигации */
.user-balance-btn {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-balance-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .shop-title {
        font-size: 2rem;
    }
    
    .shop-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .shopping-cart {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 2rem;
    }
    
    .product-details {
        grid-template-columns: 1fr;
    }
    
    .checkout-content {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        grid-template-columns: 1fr;
    }
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: slideIn 0.6s ease-out;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }

/* Кастомный скроллбар */
.cart-items::-webkit-scrollbar,
.product-modal::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track,
.product-modal::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb,
.product-modal::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover,
.product-modal::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
