/* ============================================================
   СТРАНИЦА ТОВАРА
   ============================================================ */

.product-page {
    padding: 30px 0 60px;
    background: #f8f9fb;
    min-height: 70vh;
}

/* Хлебные крошки */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 25px;
    padding: 12px 18px;
    background: #fff;
    border-radius: 10px;
    font-size: 14px;
    color: #6b7280;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumbs .sep {
    color: #cbd5e0;
    margin: 0 4px;
}

.breadcrumbs .current {
    color: #2c3e50;
    font-weight: 500;
}

/* Основная сетка */
.product-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

/* Галерея */
.product-gallery {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    position: relative;
}

.main-image {
    width: 100%;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fb 0%, #eef2f7 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.main-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s;
}

.main-image:hover img {
    transform: scale(1.05);
}

.main-image.no-image {
    font-size: 120px;
    opacity: 0.4;
}

/* Бейдж скидки */
.product-card .discount-badge,
.product-image .discount-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(231,76,60,0.35);
    z-index: 2;
}

/* Миниатюры */
.thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    overflow-x: auto;
    padding: 4px 0;
}

.thumbnails::-webkit-scrollbar {
    height: 6px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumbnails img:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

/* Правая колонка — информация */
.product-info-details {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.product-info-details h1 {
    font-size: 28px;
    line-height: 1.3;
    color: #1a202c;
    margin: 0 0 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Мета-данные */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #718096;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-meta a {
    color: #3498db;
    text-decoration: none;
}

/* Рейтинг */
.product-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.stars {
    display: flex;
    gap: 2px;
    font-size: 20px;
    color: #e2e8f0;
}

.star {
    color: #e2e8f0;
}

.star.active {
    color: #fbbf24;
}

.rating-text {
    font-size: 14px;
    color: #718096;
}
/* Звёздный рейтинг — форма отзыва */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.rating-input input {
    display: none;
}

.rating-input label {
    display: inline-block;
    cursor: pointer;
    font-size: 38px;
    color: #d1d5db;         /* серый — видно на любом фоне */
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
    user-select: none;
    padding: 0 2px;
}

/* При наведении — все звёзды до курсора становятся жёлтыми */
.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
    transform: scale(1.1);
}

/* Плавное исчезновение при уходе курсора */
.rating-input:hover input:not(:checked) ~ label {
    color: #d1d5db;
    transform: none;
    text-shadow: none;
}
/* Цена */
.product-price-section {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fb 0%, #eef2f7 100%);
    border-radius: 12px;
}

.old-price {
    text-decoration: line-through;
    color: #a0aec0;
    font-size: 20px;
    font-weight: 500;
}

.new-price {
    color: #e53e3e;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.price {
    color: #1a202c;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

/* Информация о наличии */
.product-stock-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 15px;
}

.in-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2f855a;
    font-weight: 600;
    background: #f0fff4;
    padding: 6px 12px;
    border-radius: 8px;
}

.out-of-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c53030;
    font-weight: 600;
    background: #fff5f5;
    padding: 6px 12px;
    border-radius: 8px;
}

.supply-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c05621;
    background: #fffaf0;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
}

.delivery-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2b6cb0;
    background: #ebf8ff;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

/* Кнопки действий */
.product-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
}

.btn-cart {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(39,174,96,0.35);
}

.btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39,174,96,0.45);
}

.btn-cart:active {
    transform: translateY(0);
}

.btn-wishlist {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #fff;
    border: 2px solid #edf2f7;
    border-radius: 12px;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.2s;
}

.btn-wishlist:hover {
    border-color: #e53e3e;
    background: #fff5f5;
    transform: scale(1.05);
}

/* Табы (Описание / Отзывы) */
.product-tabs {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    border-bottom: 1px solid #edf2f7;
    background: #fafbfc;
    padding: 0 10px;
    overflow-x: auto;
}

.tabs-nav::-webkit-scrollbar {
    height: 0;
}

.tab-btn {
    padding: 18px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #718096;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: #3498db;
}

.tab-btn.active {
    color: #3498db;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10px;
    right: 10px;
    height: 3px;
    background: #3498db;
    border-radius: 2px 2px 0 0;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-description {
    line-height: 1.8;
    color: #2d3748;
    font-size: 15px;
}

.product-description h2,
.product-description h3 {
    color: #1a202c;
    margin: 24px 0 12px;
}

.product-description p {
    margin-bottom: 16px;
}

.product-description img {
    max-width: 100%;
    border-radius: 8px;
    margin: 12px 0;
}

.product-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: #fafbfc;
    border-radius: 8px;
    overflow: hidden;
}

.product-description table td {
    padding: 10px 14px;
    border-bottom: 1px solid #edf2f7;
}

.product-description table tr:last-child td {
    border-bottom: none;
}

.product-description ul,
.product-description ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.product-description li {
    margin-bottom: 6px;
}

/* Отзывы */
.review-item {
    padding: 20px 0;
    border-bottom: 1px solid #edf2f7;
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.review-header strong {
    color: #1a202c;
    font-size: 15px;
}

.review-rating {
    color: #fbbf24;
    font-size: 16px;
}

.review-date {
    color: #a0aec0;
    font-size: 13px;
    margin-left: auto;
}

.review-comment {
    color: #4a5568;
    line-height: 1.7;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 992px) {
    .product-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .main-image {
        height: 400px;
    }
    
    .product-info-details {
        padding: 24px;
    }
    
    .product-info-details h1 {
        font-size: 24px;
    }
    
    .new-price, .price {
        font-size: 30px;
    }
}

@media (max-width: 768px) {
    .product-page {
        padding: 20px 0 40px;
    }
    
    .breadcrumbs {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .main-image {
        height: 280px;
    }
    
    .main-image.no-image {
        font-size: 80px;
    }
    
    .product-info-details {
        padding: 20px;
    }
    
    .product-info-details h1 {
        font-size: 20px;
    }
    
    .product-meta {
        font-size: 13px;
        gap: 12px;
    }
    
    .product-price-section {
        padding: 16px;
        gap: 10px;
    }
    
    .new-price, .price {
        font-size: 26px;
    }
    
    .old-price {
        font-size: 16px;
    }
    
    .btn-cart {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .btn-wishlist {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .tabs-nav {
        padding: 0 5px;
    }
    
    .tab-btn {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .thumbnails img {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .main-image {
        height: 240px;
    }
    
    .product-info-details {
        padding: 16px;
    }
    
    .product-info-details h1 {
        font-size: 18px;
    }
    
    .product-price-section {
        padding: 14px;
    }
    
    .new-price, .price {
        font-size: 24px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn-cart {
        width: 100%;
    }
    
    .btn-wishlist {
        width: 100%;
        height: 48px;
    }
    
    .tab-content {
        padding: 16px;
    }
}

/* Форма отзыва */
.add-review {
    background: #f8f9fb;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.add-review h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
}

.review-form .form-group {
    margin-bottom: 20px;
}

.review-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.review-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.review-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52,152,219,0.35);
}

/* Звёздный рейтинг */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}

.rating-input input {
    display: none;
}

.rating-input label {
    cursor: pointer;
    font-size: 32px;
    color: #e2e8f0;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label {
    color: #fbbf24;
    transform: scale(1.1);
}

/* Сообщения */
.review-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.review-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #27ae60;
}

.review-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #e74c3c;
}

.login-to-review {
    background: #ebf8ff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.login-to-review a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.login-to-review a:hover {
    text-decoration: underline;
}