/* ===== ОСНОВНЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #f7fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== ШАПКА ===== */
header {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: white;
    padding: 1.5rem 2rem;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

header p {
    color: #a0aec0;
    font-size: 1rem;
}

.user-menu {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background-color: rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.user-menu a:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ===== НАВИГАЦИЯ ===== */
nav {
    background-color: #2d3748;
    padding: 1rem 2rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
}

nav a:hover {
    background-color: #4299e1;
    color: white;
    transform: translateY(-2px);
}

/* ===== КОНТЕЙНЕР ===== */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
}

/* ===== СЕТКА ТОВАРОВ ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-card h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.2rem;
    color: #2d3748;
}

.product-card .category {
    padding: 0 1rem;
    color: #718096;
    font-size: 0.9rem;
}

.product-card .price {
    padding: 0.5rem 1rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: #4299e1;
}

.product-card .rating {
    padding: 0 1rem;
    color: #fbbf24;
}

.star {
    color: #cbd5e0;
    font-size: 1.1rem;
}

.star.filled {
    color: #fbbf24;
}

.product-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    background-color: #4299e1;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover {
    background-color: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-remove {
    background-color: #f56565;
}

.btn-remove:hover {
    background-color: #e53e3e;
}

.btn-checkout {
    background-color: #48bb78;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
}

.btn-checkout:hover {
    background-color: #38a169;
}

.btn-favorite {
    background-color: #ed64a6;
}

.btn-favorite:hover {
    background-color: #d53f8c;
}

/* ===== ФОРМЫ ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
}

.form-group input.readonly {
    background-color: #f7fafc;
    color: #718096;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== КОРЗИНА ===== */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.cart-table th {
    background-color: #4299e1;
    color: white;
    padding: 1rem;
    text-align: left;
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.cart-table tr:hover {
    background-color: #f7fafc;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.quantity-input {
    width: 70px;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    text-align: center;
}

.total-label {
    text-align: right;
    font-weight: bold;
    font-size: 1.2rem;
}

.total-amount {
    font-weight: bold;
    font-size: 1.2rem;
    color: #4299e1;
}

.cart-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.empty-cart {
    text-align: center;
    padding: 3rem;
    background-color: white;
    border-radius: 10px;
    font-size: 1.2rem;
    color: #718096;
}

/* ===== СТРАНИЦА ТОВАРА ===== */
.breadcrumbs {
    margin-bottom: 2rem;
    color: #718096;
}

.breadcrumbs a {
    color: #4299e1;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.product-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.product-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.rating-large {
    font-size: 1.3rem;
    margin: 1rem 0;
}

.price-large {
    font-size: 2rem;
    font-weight: bold;
    color: #4299e1;
}

.in-stock {
    color: #48bb78;
    font-weight: 600;
}

.out-of-stock {
    color: #f56565;
    font-weight: 600;
}

.product-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.product-description {
    background-color: #f7fafc;
    padding: 1.5rem;
    border-radius: 10px;
}

.product-description h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

/* ===== ОТЗЫВЫ ===== */
.reviews-section {
    margin: 3rem 0;
}

.reviews-section h3 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: #2d3748;
}

.review-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.review-author {
    font-weight: 600;
    color: #2d3748;
}

.review-date {
    color: #718096;
    font-size: 0.9rem;
}

.review-rating {
    color: #fbbf24;
}

.review-comment {
    color: #4a5568;
    line-height: 1.6;
}

.add-review {
    background-color: #f7fafc;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.add-review h4 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.rating-select {
    margin-bottom: 1.5rem;
}

.rating-select select {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    width: 200px;
}

.no-reviews,
.login-to-review {
    text-align: center;
    padding: 2rem;
    background-color: #f7fafc;
    border-radius: 10px;
    color: #718096;
}

/* ===== ЛИЧНЫЙ КАБИНЕТ ===== */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.profile-sidebar {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.profile-menu h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.profile-menu ul {
    list-style: none;
    margin-bottom: 2rem;
}

.profile-menu li {
    margin-bottom: 0.5rem;
}

.profile-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #4a5568;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.profile-menu a:hover,
.profile-menu a.active {
    background-color: #4299e1;
    color: white;
}

.profile-stats {
    background-color: #f7fafc;
    padding: 1rem;
    border-radius: 5px;
}

.profile-stats h4 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.profile-stats p {
    margin-bottom: 0.5rem;
    color: #718096;
}

.profile-content {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.profile-section {
    margin-bottom: 3rem;
}

.profile-section h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.profile-form {
    max-width: 600px;
}

/* ===== ЗАКАЗЫ ===== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.order-header {
    background-color: #f7fafc;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid #e2e8f0;
}

.order-number {
    font-weight: 600;
    color: #2d3748;
}

.order-date {
    color: #718096;
    font-size: 0.9rem;
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-new { background-color: #fefcbf; color: #744210; }
.status-processing { background-color: #bee3f8; color: #2a4365; }
.status-shipped { background-color: #c6f6d5; color: #22543d; }
.status-delivered { background-color: #9ae6b4; color: #22543d; }
.status-cancelled { background-color: #fed7d7; color: #742a2a; }

.order-body {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.order-info p {
    margin-bottom: 0.25rem;
    color: #4a5568;
}

.order-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===== ОФОРМЛЕНИЕ ЗАКАЗА ===== */
.checkout-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.checkout-section {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.checkout-section h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.contact-info {
    background-color: #f7fafc;
    padding: 1rem;
    border-radius: 5px;
}

.delivery-options,
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.radio-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover {
    border-color: #4299e1;
    background-color: #f7fafc;
}

.radio-option input[type="radio"] {
    margin-right: 1rem;
}

.radio-title {
    font-weight: 600;
    flex: 1;
}

.radio-price {
    font-weight: 600;
    color: #4299e1;
    margin-right: 1rem;
}

.radio-desc {
    width: 100%;
    color: #718096;
    font-size: 0.9rem;
    margin-left: 1.75rem;
    margin-top: 0.5rem;
}

.order-summary {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
}

.order-items {
    margin: 1rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.item-name {
    flex: 2;
}

.item-quantity {
    flex: 1;
    text-align: center;
    color: #718096;
}

.item-price {
    flex: 1;
    text-align: right;
    font-weight: 500;
}

.order-totals {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.total-row.final {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2d3748;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.final-price {
    color: #4299e1;
}

.agreement {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #718096;
    text-align: center;
}

.agreement a {
    color: #4299e1;
    text-decoration: none;
}

/* ===== СТРАНИЦА УСПЕХА ===== */
.success-page {
    max-width: 600px;
    margin: 3rem auto;
    text-align: center;
    background-color: white;
    border-radius: 10px;
    padding: 3rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.success-page h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.2rem;
    color: #4299e1;
    margin-bottom: 0.5rem;
}

.info-message {
    color: #718096;
    margin-bottom: 2rem;
}

.order-details {
    background-color: #f7fafc;
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    text-align: left;
}

.order-details h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.order-details ol {
    padding-left: 1.5rem;
}

.order-details li {
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ===== ПУСТЫЕ СОСТОЯНИЯ ===== */
.empty-state {
    text-align: center;
    padding: 4rem;
    background-color: white;
    border-radius: 10px;
    margin: 2rem 0;
}

.empty-state p {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 2rem;
}

/* ===== ПОИСК ===== */
.search-form {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1.1rem;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #4a5568;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
}

.search-results-info {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 5px;
    font-weight: 500;
}

/* ===== КАТЕГОРИИ ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.category-card p {
    margin-bottom: 1rem;
    opacity: 0.9;
    font-size: 0.9rem;
}

.category-card .btn {
    background-color: rgba(255,255,255,0.2);
    color: white;
}

.category-card .btn:hover {
    background-color: rgba(255,255,255,0.3);
}

/* ===== СООБЩЕНИЯ ===== */
.error-message {
    background-color: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid #c53030;
}

.success-message {
    background-color: #c6f6d5;
    color: #22543d;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid #22543d;
}

/* ===== ПОДВАЛ ===== */
footer {
    background-color: #2d3748;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .order-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .product-page {
        grid-template-columns: 1fr;
    }
    
    .profile-layout {
        grid-template-columns: 1fr;
    }
    
    .profile-sidebar {
        position: static;
    }
    
    .cart-table {
        display: block;
        overflow-x: auto;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .user-menu {
        position: static;
        margin-top: 1rem;
        justify-content: center;
    }
    
    nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    nav a {
        text-align: center;
    }
    
    .order-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .order-body {
        flex-direction: column;
        text-align: center;
    }
    
    .success-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .product-card img {
        height: 200px;
    }
    
    .product-buttons {
        flex-direction: column;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}