:root {
    --primary: #4a6fa5;
    --secondary: #6b8cbc;
    --accent: #ff6b6b;
    --background-second: rgb(8, 174, 127);
    --background-second-active: rgb(21, 159, 120);
    --background: linear-gradient(to bottom, rgba(43, 111, 83, 0.7), rgb(245, 245, 245));
    --gray: #e0e0e0;
    --text: #333;
    --text-light: #777;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

a {
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--background);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Навигационная панель */
.sidebar {
    width: 280px;
    background: var(--background-second);
    color: white;
    padding: 20px;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo i {
    font-size: 28px;
    margin-right: 10px;
    color: var(--accent);
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
}

.search-box {
    position: relative;
    margin-bottom: 25px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border-radius: 30px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 16px;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.6);
}

.nav-section h3 {
    font-size: 16px;
    text-transform: uppercase;
    margin: 25px 0 15px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 1px;
}

.collection-list {
    list-style: none;
}

.collection-list li {
    margin-bottom: 8px;
}

.collection-list a {
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.collection-list a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.collection-list a:hover, .collection-list a.active {
    background: rgba(255,255,255,0.1);
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.category-list a {
    display: block;
    background: rgba(255,255,255,0.05);
    color: white;
    padding: 8px 15px;
    border-radius: 30px;
    font-size: 14px;
    transition: var(--transition);
}

.category-list a:hover {
    background: rgba(255,255,255,0.1);
}

/* Основной контент */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    transition: var(--transition);
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title h2 {
    font-size: 28px;
    color: white;
}

.mobile-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-image {
    height: 300px;
    width: 100%;
    background: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    object-fit: cover;
    transition: var(--transition);
}

/* .product-image .img1, */
.product-image:hover .img2 {
    opacity: 1;
    visibility: visible;
}

.product-image .img2 {
/* .product-image:hover .img1 { */
    opacity: 0;
    visibility: hidden;
}

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

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-light);
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-category {
    background: rgba(74, 111, 165, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}

.product-rating {
    color: #ffc107;
    font-size: 14px;
}

/* Страница товара */
.product-detail {
    display: none;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.product-detail-container {
    display: flex;
    flex-wrap: wrap;
}

.product-gallery {
    flex: 1;
    min-width: 300px;
    padding: 30px;
    background: #fafafa;
}

.main-image {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumbnail:hover, .thumbnail.active {
    border-color: var(--background-second-active);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info-detail {
    flex: 1;
    min-width: 300px;
    padding: 30px;
}

.product-title-detail {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-light);
}

.product-price-detail {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.product-description {
    margin-bottom: 30px;
    line-height: 1.6;
    color: var(--text-light);
}

.sizes h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.size-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.size-option {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.buy-button {
    display: inline-block;
    background: var(--background-second);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.buy-button:hover {
    background: var(--background-second-active);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255,107,107,0.4);
}

.back-button {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin: 20px;
    transition: var(--transition);
}

.back-button i {
    margin-right: 8px;
}

.back-button:hover {
    color: var(--background-second);
}

/* Футер */
footer {
    text-align: center;
    padding: 20px;
    background-color: #000000;
    font-size: 0.9rem;
    opacity: 0.7;
}

footer p {
    color: #ffffff;
}

/* Адаптивность */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 80%;
        max-width: 300px;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px 15px;
    }
    
    .product-detail-container {
        flex-direction: column;
    }
    
    .product-gallery, .product-info-detail {
        padding: 20px;
    }
    
    .main-image {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title h2 {
        font-size: 22px;
    }
    
    .product-title-detail {
        font-size: 24px;
    }
}

/* Анимации и утилиты */
.hidden {
    display: none;
}

.visible {
    display: block;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading {
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: var(--text-light);
}

.loading i {
    font-size: 24px;
    margin-bottom: 15px;
    display: block;
}
