/* products/static/products/css/product_detail.css */

/* ============================================
   ОСНОВНОЙ КОНТЕЙНЕР
   ============================================ */
.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ============================================
   ХЛЕБНЫЕ КРОШКИ
   ============================================ */
.breadcrumbs {
    margin-bottom: 30px;
    font-size: 14px;
    color: #666;
}

.breadcrumbs a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: #004499;
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 8px;
    color: #999;
}

.breadcrumbs .current {
    color: #333;
    font-weight: 500;
}

/* ============================================
   ОСНОВНАЯ СЕКЦИЯ ТОВАРА (2 колонки)
   ============================================ */
.product-detail-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

/* ---------- ГАЛЕРЕЯ ---------- */
.product-gallery {
    position: sticky;
    top: 20px;
}

.main-image {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #f9f9f9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.main-image img {
    width: 100%;
    max-height: 500px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.main-image img:hover {
    transform: scale(1.02);
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail:hover {
    border-color: #0066cc;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

/* ---------- ИНФОРМАЦИЯ О ТОВАРЕ ---------- */
.product-info-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-category-badge {
    display: inline-block;
    align-self: flex-start;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 32px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

.product-price-block {
    display: flex;
    align-items: baseline;
    gap: 15px;
    flex-wrap: wrap;
}
/* ============================================
   КОНТРОЛЫ КОРЗИНЫ (КВАДРАТНЫЙ СТИЛЬ С ОБВОДКОЙ)
   ============================================ */

    /* Блок управления количеством */
    .cart-quantity-controls {
        display: inline-flex;
        align-items: center;
        gap: 0;
        background: white;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        overflow: hidden;
        transition: all 0.2s ease;
    }

    .cart-quantity-controls:hover {
        border-color: #e44c2c;
    }

    /* Кнопки + и - */
    .cart-qty-btn {
        width: 40px;
        height: 44px;
        border: none;
        background: #f8f8f8;
        font-size: 18px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #333;
    }

    .cart-qty-btn:hover {
        background: #e44c2c;
        color: white;
    }

    .cart-qty-btn:active {
        transform: scale(0.95);
    }

    /* Значение количества */
    .cart-qty-value {
        min-width: 50px;
        text-align: center;
        font-weight: 600;
        font-size: 16px;
        color: #333;
        background: white;
        padding: 0 5px;
        border-left: 1px solid #e0e0e0;
        border-right: 1px solid #e0e0e0;
        line-height: 44px;
    }

    /* Кнопка удаления (корзина) */
    .cart-remove-btn {
        width: 90px;
        margin-left:15px;
        height: 44px;
        border: none;
        background: #f8f8f8;
        cursor: pointer;
        font-size: 18px;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #999;
        border-left: 1px solid #e0e0e0;
    }

    .cart-remove-btn:hover {
        background: #dc3545;
        color: white;
    }

    .cart-remove-btn:active {
        transform: scale(0.95);
    }

    /* Анимация кнопки добавления */
    .btn-add-to-cart.added,
    .add-to-cart.added {
        background-color: #28a745 !important;
        border-color: #28a745 !important;
        transition: all 0.3s ease;
    }

    .btn-add-to-cart.added:hover,
    .add-to-cart.added:hover {
        background-color: #218838 !important;
        border-color: #218838 !important;
    }

    /* Адаптация для мобильных */
    @media (max-width: 768px) {
        .cart-qty-btn {
            width: 36px;
            height: 40px;
            font-size: 16px;
        }

        .cart-qty-value {
            min-width: 45px;
            font-size: 14px;
            line-height: 40px;
        }

        .cart-remove-btn {
            width: 40px;
            height: 40px;
            font-size: 16px;
        }
    }

    /* Для тёмной темы (если будет) */
    @media (prefers-color-scheme: dark) {
        .cart-quantity-controls {
            background: #2a2a2a;
            border-color: #444;
        }

        .cart-qty-value {
            background: #2a2a2a;
            color: #eee;
            border-color: #444;
        }

        .cart-qty-btn {
            background: #333;
            color: #ddd;
        }

        .cart-remove-btn {
            background: #333;
            color: #888;
            border-color: #444;
        }
    }
.product-price {
    font-size: 36px;
    font-weight: 700;
    color: #e44c2c;
}

.product-old-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
}

.product-discount {
    background: #e44c2c;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.in-stock {
    color: #28a745;
    font-weight: 600;
    font-size: 16px;
}

.out-of-stock {
    color: #dc3545;
    font-weight: 600;
    font-size: 16px;
}

.product-rating-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.rating-stars {
    color: #ffc107;
    font-size: 18px;
    letter-spacing: 2px;
}

.rating-value {
    font-weight: 500;
    color: #333;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin: 10px 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 45px;
    background: #f5f5f5;
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #e0e0e0;
}

#product-quantity {
    width: 60px;
    height: 45px;
    text-align: center;
    border: none;
    border-left: 2px solid #e0e0e0;
    border-right: 2px solid #e0e0e0;
    font-size: 16px;
    font-weight: 500;
}

#product-quantity:focus {
    outline: none;
}

.btn-add-to-cart {
    min-width: 240px;
    height: 50px;
    background: #e44c2c;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-to-cart:hover {
    background: #c13b1e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(228, 76, 44, 0.3);
}

.btn-favorite {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-favorite:hover {
    background: #ffebee;
    border-color: #e44c2c;
    color: #e44c2c;
}

.product-meta {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.meta-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-label {
    width: 100px;
    font-weight: 500;
    color: #666;
}

.meta-value {
    color: #333;
}
/* ============================================
   Кнопка Все отзывы
   ============================================ */
.reviews-sidebar-widget {
    margin-bottom: 20px;
}

.reviews-link-widget {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 15px 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.reviews-link-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #ffc107;
}

.widget-icon {
    font-size: 32px;
    background: #fff8e7;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.widget-content {
    flex: 1;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.widget-stats {
    font-size: 13px;
    color: #e44c2c;
    font-weight: 500;
}

.widget-arrow {
    font-size: 20px;
    color: #ccc;
    transition: transform 0.3s;
}

.reviews-link-widget:hover .widget-arrow {
    transform: translateX(5px);
    color: #e44c2c;
}
/* ============================================
   ТАБЫ
   ============================================ */
.product-description-tabs {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 60px;
}

.tabs-header {
    display: flex;
    gap: 0;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.tab-btn:hover {
    background: #efefef;
}

.tab-btn.active {
    background: white;
    color: #e44c2c;
    border-bottom: 3px solid #e44c2c;
}

.tabs-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.product-description {
    line-height: 1.6;
    color: #444;
    font-size: 16px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #eee;
}

.specs-table td {
    padding: 12px 0;
}

.spec-name {
    width: 40%;
    font-weight: 600;
    color: #666;
}

.spec-value {
    color: #333;
}

/* ============================================
   ОТЗЫВЫ
   ============================================ */
.reviews-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.rating-distribution {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
}

.rating-distribution h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.rating-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.rating-star {
    width: 45px;
    font-weight: 500;
    color: #888;
}

.rating-bar {
    flex: 1;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: #ffc107;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.rating-count {
    color: #888;
    font-size: 14px;
}

/* Список отзывов */
.reviews-list h4 {
    margin: 0 0 20px 0;
    color: #333;
}

.review-item {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}

.review-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.review-item.user-review {
    background: #e8f4e8;
    border-color: #28a745;
    position: relative;
}

.review-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.review-author {
    font-weight: 600;
    color: #333;
}

.review-rating {
    color: #ffc107;
    font-size: 14px;
    letter-spacing: 1px;
}

.review-date {
    color: #999;
    font-size: 12px;
}

.review-text {
    color: #555;
    line-height: 1.5;
    margin: 12px 0;
}

.review-helpful {
    display: flex;
    gap: 15px;
    margin-top: 12px;
}

.helpful-btn {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.helpful-btn:hover {
    background: #e0e0e0;
}

.no-reviews {
    text-align: center;
    color: #999;
    padding: 40px;
}

.all-reviews-link {
    text-align: center;
    margin-top: 20px;
}

.all-reviews-link a {
    color: #0066cc;
    text-decoration: none;
}

.all-reviews-link a:hover {
    text-decoration: underline;
}

/* Форма добавления отзыва */
.add-review-form {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.add-review-form h4 {
    margin: 0 0 20px 0;
    color: #333;
}

.add-review-form form p {
    margin-bottom: 20px;
}

.add-review-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.add-review-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.add-review-form textarea:focus {
    outline: none;
    border-color: #e44c2c;
}

.btn-submit-review {
    background: #0066cc;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit-review:hover {
    background: #004499;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-warning a {
    color: #0066cc;
    text-decoration: none;
}

/* ============================================
   ЗВЁЗДНЫЙ РЕЙТИНГ В ФОРМЕ
   ============================================ */
#id_rating {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 10px 0 15px 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#id_rating div {
    display: inline-block !important;
}

#id_rating input {
    display: none !important;
}

#id_rating label {
    font-size: 32px !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
    color: #ffc107 !important;
    display: inline-block !important;
}

/* При наведении на звезду */
#id_rating div:hover label,
#id_rating div:hover ~ div label {
    color: #ffc107 !important;
}


.rating-hint {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}


/* ============================================
   ПОХОЖИЕ ТОВАРЫ
   ============================================ */
.related-products {
    margin-top: 60px;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e44c2c;
    display: inline-block;
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.related-product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.related-product-card a {
    text-decoration: none;
    display: block;
}

.related-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.related-product-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f9f9f9;
}

.related-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-product-card:hover .related-product-image img {
    transform: scale(1.05);
}

.related-product-name {
    padding: 12px 12px 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.related-product-price {
    padding: 0 12px 12px;
    font-weight: 700;
    color: #e44c2c;
    font-size: 18px;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 768px) {
    .product-detail-container { padding: 15px; }
    .product-detail-main { grid-template-columns: 1fr; gap: 30px; }
    .product-gallery { position: static; }
    .product-title { font-size: 24px; }
    .product-price { font-size: 28px; }
    .tabs-header { flex-direction: column; }
    .tab-btn { text-align: left; border-bottom: 1px solid #e0e0e0; }
    .tab-btn.active { border-bottom: 1px solid #e0e0e0; border-left: 3px solid #e44c2c; }
    .tabs-content { padding: 20px; }
    .product-actions { flex-direction: column; }
    .btn-add-to-cart { width: 100%; }
    .related-products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
    .review-header { flex-direction: column; align-items: flex-start; gap: 5px; }
}
/* Дополнительные стили для новых секций */
.product-description-section,
.product-reviews-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #e44c2c;
    display: inline-block;
}

.product-description {
    line-height: 1.8;
    color: #444;
    font-size: 16px;
    background: #fafafa;
    padding: 25px;
    border-radius: 12px;
}
@media (max-width: 480px) {
    .product-title { font-size: 20px; }
    .product-price { font-size: 24px; }
    .breadcrumbs { font-size: 12px; }
    .thumbnail { width: 60px; height: 60px; }
    .related-products-grid { grid-template-columns: repeat(2, 1fr); }
}    .product-title { font-size: 20px; }
    .product-price { font-size: 24px; }
    .breadcrumbs { font-size: 12px; }
    .thumbnail { width: 60px; height: 60px; }
    .related-products-grid { grid-template-columns: repeat(2, 1fr); }
}