/* Product Page - специфичные стили */

.product-page {
    padding: 40px 0;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: fit-content;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.main-image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Кнопки на блоке изображения */
.main-image .product-quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

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

/* Thumbnails wrapper с кнопками */
.thumbnails-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Thumbnails - горизонтальный скролл */
.thumbnails-gallery {
    display: flex;
    gap: 12px;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px 0;
    flex: 1;
    min-width: 0;
}

/* Стилизация скроллбара - WebKit (Chrome, Safari, Edge) */
.thumbnails-gallery::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-gallery::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.thumbnails-gallery::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), #ff9800);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.thumbnails-gallery::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff9800, var(--primary-color));
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.4);
}

/* Firefox скроллбар */
.thumbnails-gallery {
    scrollbar-color: var(--primary-color) #f0f0f0;
    scrollbar-width: thin;
}

/* Кнопки навигации */
.thumbnails-nav-btn {
    background: white;
    border: 2px solid #eee;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s;
    flex-shrink: 0;
}

.thumbnails-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.thumbnails-nav-btn:disabled {
    background: #f0f0f0;
    border-color: #e0e0e0;
    color: #999;
    opacity: 0.35;
    cursor: default;
}

.product-thumbnail {
    flex: 0 0 auto;
    aspect-ratio: 1;
    width: 80px;
    height: 80px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
}

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

.product-thumbnail:hover {
    border-color: var(--primary-color);
}

.product-thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.product-details h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    align-items: center;
}

.product-sku {
    color: var(--text-light);
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
}

.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    font-weight: 600;
}

.stock-status.in-stock {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
}

.stock-status.out-of-stock {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

.product-price-block {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.product-price-block .old-price {
    font-size: clamp(1rem, 3vw, 1.5rem);
    text-decoration: line-through;
    color: var(--text-light);
    order: -1;
}

.product-price-block .current-price {
    font-size: clamp(1.3rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
}

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

.product-attributes {
    margin-bottom: 30px;
}

.product-attributes h3 {
    margin-bottom: 15px;
}

.attribute-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.attribute-name {
    flex: 0 0 200px;
    font-weight: 700;
    color: var(--text-dark);
}

.attribute-name::after {
    content: ":";
}

.attribute-value {
    flex: 1;
    color: var(--text-light);
    margin-left: 20px;
    text-align: right;
}

.product-tabs {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 60px;
    margin-top: 60px;
}

.similar-products {
    margin-top: 60px;
}

.similar-products .products-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive */
@media (max-width: 768px) {
    .product-page {
        padding: 20px 0;
    }

    .product-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }

    .product-gallery {
        gap: 15px;
        align-items: center;
    }

    .main-image {
        max-width: 90%;
        margin: 0 auto;
    }

    .product-thumbnail {
        width: 70px;
        height: 70px;
    }

    .thumbnails-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .product-details h1 {
        font-size: 1.3rem;
    }

    .product-meta {
        gap: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .product-tabs {
        padding: 15px;
        margin-bottom: 40px;
    }

    .similar-products .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .product-page {
        padding: 15px 0;
    }

    .product-layout {
        gap: 15px;
        margin-bottom: 30px;
    }

    .product-gallery {
        gap: 10px;
    }

    .main-image {
        border-radius: 8px;
    }

    .product-thumbnail {
        width: 60px;
        height: 60px;
        border-radius: 6px;
    }

    .thumbnails-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .product-details h1 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .product-meta {
        gap: 10px;
        font-size: 0.85rem;
    }

    .product-price-block {
        font-size: 1.2rem;
        gap: 10px;
        flex-wrap: wrap;
    }

    .product-tabs {
        padding: 12px;
        margin-bottom: 30px;
    }

    .similar-products .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
