/* css/product.css - Стили для страницы товара */

/* Хлебные крошки */
.breadcrumb {
    padding: 15px 0;
    background: #f8f9fa;
    margin-bottom: 30px;
}

.breadcrumb-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.breadcrumb a {
    color: #4caf50;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #666;
}

/* Основной контейнер товара */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
    align-items: start; /* Выравниваем блоки по верхнему краю */
}

@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
}

/* Галерея */
.product-gallery {
    position: relative;
}

.main-image {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
/* Главное изображение не должно исчезать при клике */
.main-image img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background: #f5f5f5;
    cursor: zoom-in;
    transition: transform 0.3s;
}
.main-image img:hover {
    transform: scale(1.05);
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.thumbnail {
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.thumbnail.active {
    border-color: #4caf50;
}

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

/* Информация о товаре */
.product-info-detail {
    padding: 0; /* Убираем лишний отступ */
}

.product-title {
    font-size: 32px;
    color: #2e7d32;
    margin-bottom: 15px;
    font-weight: 700;
}

.product-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    color: #4caf50;
}

.product-description-detail {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
}

.features-list {
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.feature-item i {
    color: #4caf50;
    width: 20px;
}

/* Цена и добавление в корзину */
.product-price-detail {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

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

.current-price-large {
    font-size: 36px;
    font-weight: 700;
    color: #e53935;
}

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

.stock-status {
    display: inline-block;
    padding: 5px 15px;
    background: #4caf50;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.stock-status.out-of-stock {
    background: #f44336;
}

.actions-detail {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    margin-top: 20px;
}

.quantity-selector-detail {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.qty-btn-detail {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-input-detail {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 18px;
}

.btn-add-to-cart-detail {
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-add-to-cart-detail:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.btn-add-to-cart-detail:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Вкладки */
.product-tabs {
    margin-bottom: 60px;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
}

.tab-header-item {
    padding: 15px 30px;
    background: none;
    border: none;
    font-size: 18px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
}

.tab-header-item.active {
    color: #2e7d32;
}

.tab-header-item.active:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #4caf50;
}

.tab-content {
    display: none;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

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

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #eee;
}

.specs-table td {
    padding: 15px 10px;
}

.specs-table td:first-child {
    font-weight: 600;
    color: #555;
    width: 200px;
}

/* Отзывы */
.reviews-list {
    max-height: 400px;
    overflow-y: auto;
}

.review-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: white;
    border-radius: 5px;
    margin-bottom: 15px;
}

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

.review-author {
    font-weight: 600;
    color: #333;
}

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

.review-rating {
    color: #ff9800;
    margin-bottom: 10px;
}

.review-text {
    color: #444;
    line-height: 1.6;
}

/* Похожие товары */
.similar-products {
    margin-bottom: 60px;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Модальное окно для изображений */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    display: block;
    cursor: default;
}
.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: bold;
    z-index: 3001;
    transition: 0.3s;
    font-weight: bold;
}

.close-modal:hover {
    color: #4caf50;
}
.nav-modal {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    cursor: pointer;
    border: none;
    background: rgba(0,0,0,0.6);
    padding: 15px 20px;
    border-radius: 50%;
    transition: 0.3s;
    z-index: 3001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-modal {
    left: 30px;
}

.next-modal {
    right: 30px;
}
.nav-modal:hover {
    background: #4caf50;
    color: white;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .modal-image {
        max-width: 95%;
        max-height: 80%;
    }
    
    .nav-modal {
        font-size: 20px;
        padding: 10px 15px;
         width: 40px;
        height: 40px;
    }
    
    .close-modal {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .product-title {
        font-size: 24px;
    }
    
    .current-price-large {
        font-size: 28px;
    }
    
    .actions-detail {
        grid-template-columns: 1fr;
    }
    
    .quantity-selector-detail {
        justify-self: center;
        width: 150px;
    }
    
    .thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .similar-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-header {
        flex-wrap: wrap;
    }
    
    .tab-header-item {
        flex: 1 0 auto;
        padding: 10px 15px;
        font-size: 16px;
    }
}
.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.reviews-summary {
    display: flex;
    align-items: center;
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rating-value {
    font-size: 24px;
    font-weight: bold;
    color: #ff9800;
}

.rating-stars i {
    color: #ff9800;
    font-size: 18px;
}

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

.write-review-btn {
    background: #4caf50;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.write-review-btn:hover {
    background: #2e7d32;
}

.review-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.review-item:last-child {
    border-bottom: none;
}

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

.review-author {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.review-author i {
    color: #4caf50;
    font-size: 20px;
}

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

.review-rating {
    margin-bottom: 10px;
}

.review-rating i {
    color: #ff9800;
    font-size: 16px;
    margin-right: 2px;
}

.review-text {
    line-height: 1.6;
    color: #666;
}

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

@media (max-width: 768px) {
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .write-review-btn {
        width: 100%;
    }
}
/* Стили для фото в отзывах */
.review-photo {
    margin-top: 15px;
    max-width: 300px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #eee;
    transition: transform 0.3s;
}

.review-photo:hover {
    transform: scale(1.02);
}

.review-photo img {
    width: 100%;
    height: auto;
    display: block;
}

/* Модальное окно для просмотра фото */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    cursor: pointer;
}

.photo-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

.photo-modal-content img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.close-photo-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .review-photo {
        max-width: 100%;
    }
}