/* ===== СТИЛИ СТРАНИЦЫ ТОВАРА ===== */

/* Основной контент */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 30px 0 60px;
    background: #fff;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    font-size: 13px;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: #e31e24;
}

.breadcrumbs .separator {
    color: #ccc;
}

.breadcrumbs .current {
    color: #e31e24;
}

/* Заголовок страницы */
.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

/* Основная информация о товаре */
.product-main {
    display: flex;
    gap: 40px;
    margin-bottom: 50px;
}

/* Галерея фото */
.product-gallery {
    flex: 0 0 500px;
}

.main-image {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 15px;
}

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

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gallery-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-nav.prev {
    left: 15px;
}

.gallery-nav.next {
    right: 15px;
}

.thumbnails {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    background: #f5f5f5;
}

.thumbnail:hover {
    border-color: #ddd;
}

.thumbnail.active {
    border-color: #e31e24;
}

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

/* Информация о товаре */
.product-info {
    flex: 1;
}

.product-name {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

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

.product-price {
    font-size: 32px;
    font-weight: 700;
    color: #e31e24;
}

.product-old-price {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
}

.product-discount {
    padding: 4px 10px;
    background: #e31e24;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

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

.rating-count {
    color: #666;
    font-size: 14px;
}

/* Действия с товаром */
.product-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: #e31e24;
    color: #fff;
}

.qty-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 30px;
    text-align: center;
}

.add-to-cart-btn {
    flex: 1;
    padding: 14px 30px;
    background: #e31e24;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s;
}

.add-to-cart-btn:hover {
    background: #c62828;
}

.favorite-btn {
    width: 50px;
    height: 50px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.favorite-btn:hover {
    border-color: #e31e24;
    color: #e31e24;
}

.favorite-btn.active {
    background: #e31e24;
    border-color: #e31e24;
    color: #fff;
}

/* Характеристики */
.product-specs {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 25px;
}

.specs-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #ddd;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    color: #666;
    font-size: 14px;
}

.spec-value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-align: right;
    max-width: 60%;
}

/* Описание товара */
.product-description {
    margin-bottom: 50px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e31e24;
    display: inline-block;
}

.description-content {
    color: #555;
    font-size: 15px;
    line-height: 1.8;
}

.description-content p {
    margin-bottom: 15px;
}

/* Отзывы */
.product-reviews {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 30px;
}

.reviews-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.rating-big {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.rating-number {
    font-size: 48px;
    font-weight: 700;
    color: #333;
}

.stars-big {
    color: #ffc107;
    font-size: 18px;
}

.reviews-count {
    color: #666;
    font-size: 14px;
}

.write-review-btn {
    padding: 12px 25px;
    background: #fff;
    border: 2px solid #e31e24;
    border-radius: 8px;
    color: #e31e24;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.write-review-btn:hover {
    background: #e31e24;
    color: #fff;
}

/* ===== РАСПРЕДЕЛЕНИЕ ОЦЕНОК ===== */

.rating-distribution {
    flex: 1;
    max-width: 320px;
    margin: 0 20px;
    min-width: 250px;
}

.rating-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
    width: 100%;
}

.rating-bar-row:hover {
    background: #f0f0f0;
}

.rating-bar-row.active {
    background: #fff5f5;
}

.rating-bar-row.active .rating-label {
    color: #e31e24;
    font-weight: 600;
}

.rating-label {
    font-size: 14px;
    color: #666;
    width: 55px;
    min-width: 55px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.rating-label i {
    font-size: 11px;
    color: #ffc107;
}

.rating-progress {
    flex: 1;
    height: 12px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    min-width: 120px;
}

.rating-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
    border-radius: 6px;
    transition: width 0.4s ease;
}

.rating-count-bar {
    font-size: 14px;
    color: #666;
    width: 35px;
    min-width: 35px;
    text-align: right;
    flex-shrink: 0;
}

/* Список отзывов */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 25px;
}

.review-item {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reviewer-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e31e24;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.reviewer-details {
    display: flex;
    flex-direction: column;
}

.reviewer-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.review-date {
    color: #999;
    font-size: 13px;
}

.review-rating {
    color: #ffc107;
    font-size: 12px;
}

.review-text {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.review-images {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.review-images img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
}

/* ===== СТИЛИ ДЛЯ СИСТЕМЫ ОТЗЫВОВ ===== */

.review-actions {
    display: flex;
    gap: 10px;
}

.review-like {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.review-like:hover {
    border-color: #e31e24;
    color: #e31e24;
}

.review-like.like-btn.active {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

.review-like.like-btn.active:hover {
    background: #45a049;
}

.review-like.dislike-btn.active {
    background: #f44336;
    border-color: #f44336;
    color: #fff;
}

.review-like.dislike-btn.active:hover {
    background: #da190b;
}

.review-like:active {
    transform: scale(0.95);
}

.like-count, .dislike-count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.show-more-reviews {
    width: 100%;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.show-more-reviews:hover {
    border-color: #e31e24;
    color: #e31e24;
    background: #fff5f5;
}

.show-more-reviews:active {
    transform: translateY(1px);
}

.review-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.no-reviews {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 15px;
}

/* Секция популярных товаров */
.popular-section {
    margin-top: 50px;
    margin-bottom: 40px;
}

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

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border: 1px solid #eee;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.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-card .product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding: 15px 20px 5px;
}

.product-card .product-price {
    font-size: 20px;
    font-weight: 700;
    color: #e31e24;
    padding: 0 20px 15px;
}

.product-btn {
    display: block;
    margin: 0 20px 20px;
    padding: 12px;
    background: #e31e24;
    color: #fff;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.product-btn:hover {
    background: #c62828;
}

/* ===== АДАПТИВНОСТЬ ===== */

@media (max-width: 992px) {
    .product-main {
        flex-direction: column;
        gap: 25px;
    }

    .product-gallery {
        flex: none;
        width: 100%;
    }

    .main-image {
        height: 350px;
    }

    .product-name {
        font-size: 24px;
    }

    .product-price {
        font-size: 28px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    
    /* Рейтинг на планшетах */
    .rating-distribution {
        min-width: 220px;
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px 0 40px;
        padding-top: 40px;
    }

    .page-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .main-image {
        height: 280px;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }

    .thumbnails {
        gap: 8px;
    }

    .product-name {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .product-price {
        font-size: 24px;
    }

    .product-image {
        height: 160px;
    }

    .product-old-price {
        font-size: 16px;
    }

    .product-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .add-to-cart-btn {
        flex: 1 1 auto;
        padding: 12px 20px;
        font-size: 14px;
    }

    .favorite-btn {
        width: 44px;
        height: 44px;
    }

    .quantity-selector {
        width: auto;
        justify-content: flex-start;
    }

    .product-specs {
        padding: 18px;
    }

    .spec-label,
    .spec-value {
        font-size: 13px;
    }

    .product-reviews {
        padding: 20px;
    }

    /* ===== МОБИЛЬНЫЕ ОТЗЫВЫ И РЕЙТИНГ ===== */
    .reviews-summary {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .rating-big {
        order: 1;
        justify-content: center;
    }
    
    .rating-distribution {
        order: 2;
        max-width: 100%;
        margin: 0;
        width: 100%;
        min-width: auto;
    }
    
    .rating-bars {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .rating-bar-row {
        padding: 10px 0;
        gap: 15px;
    }
    
    .rating-label {
        font-size: 16px;
        width: 60px;
        min-width: 60px;
    }
    
    .rating-progress {
        height: 14px;
        min-width: 150px;
    }
    
    .rating-count-bar {
        font-size: 16px;
        width: 40px;
        min-width: 40px;
    }
    
    .write-review-btn {
        order: 3;
        width: 100%;
    }

    .rating-number {
        font-size: 36px;
    }

    .review-header {
        flex-direction: column;
        gap: 8px;
    }

    .review-item {
        padding: 15px;
    }

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

    .product-card .product-name {
        font-size: 14px;
        padding: 10px 12px 4px;
    }

    .product-card .product-price {
        font-size: 16px;
        padding: 0 12px 10px;
    }
}

@media (max-width: 480px) {
    .main-image {
        height: 240px;
    }

    .thumbnail {
        width: 50px;
        height: 50px;
    }

    .product-name {
        font-size: 18px;
    }

    .product-image {
        height: 130px;
    }

    .product-price {
        font-size: 22px;
    }

    .product-discount {
        font-size: 11px;
        padding: 3px 8px;
    }

    .add-to-cart-btn {
        font-size: 13px;
        padding: 11px 15px;
    }

    .spec-value {
        max-width: 55%;
    }

    .review-images img {
        width: 60px;
        height: 60px;
    }

    .reviewer-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .review-actions {
        gap: 8px;
    }
    
    .review-like {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Маленькие мобильные - рейтинг */
    .rating-bars {
        max-width: 100%;
    }
    
    .rating-bar-row {
        gap: 10px;
        padding: 8px 0;
    }
    
    .rating-label {
        font-size: 14px;
        width: 50px;
        min-width: 50px;
    }
    
    .rating-progress {
        height: 12px;
        min-width: 100px;
    }
    
    .rating-count-bar {
        font-size: 14px;
        width: 35px;
        min-width: 35px;
    }

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

    .product-card .product-name {
        font-size: 12px;
        padding: 8px 10px 3px;
    }

    .product-card .product-price {
        font-size: 14px;
        padding: 0 10px 8px;
    }

    .product-btn {
        margin: 0 10px 10px;
        padding: 9px;
        font-size: 12px;
    }
}