/* Основные стили страницы товара */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Галерея */
.product-gallery {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-image {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    text-align: center;
    max-width: 800px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.zoom-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    transition: opacity 0.2s ease;
    z-index: 1;
}

.main-image:hover .zoom-hint {
    opacity: 0.8;
}

.thumbnail-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    justify-content: center;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
}

.thumbnail-list::-webkit-scrollbar {
    height: 4px;
}

.thumbnail-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.thumbnail-list::-webkit-scrollbar-thumb {
    background: #c9daf8;
    border-radius: 2px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumbnail:hover {
    border-color: #0066c0;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: #0066c0;
    box-shadow: 0 0 0 2px rgba(0, 102, 192, 0.2);
}

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

.thumbnail.more-button {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: #0066c0;
    border-color: #0066c0;
}

.thumbnail.more-button span {
    font-size: 14px;
    font-weight: normal;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    position: relative;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#modalImage {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #0066c0;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 40px;
    padding: 15px 25px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    z-index: 10001;
}

.modal-nav:hover {
    background: rgba(0, 102, 192, 0.8);
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }
.modal-nav:disabled { opacity: 0.3; cursor: not-allowed; }

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 14px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
    margin: 0 auto;
    width: fit-content;
    max-width: 80%;
    border-radius: 4px;
}

.modal-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10001;
}

body.modal-open { overflow: hidden; }

/* Информация о товаре */
.product-info h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.product-brand {
    color: #565959;
    margin-bottom: 1rem;
}

.product-brand a {
    color: #0066c0;
    text-decoration: none;
    transition: color 0.2s;
}

.product-brand a:hover {
    color: #004b8f;
    text-decoration: underline;
}

.product-sku {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

/* Рейтинг */
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #ddd;
    font-size: 18px;
}

.star.filled {
    color: #ffa41c;
}

.rating-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.reviews-link {
    font-size: 13px;
    color: #0066c0;
    text-decoration: none;
}

.reviews-link:hover {
    text-decoration: underline;
    color: #004b8f;
}

/* Цены */
.product-prices {
    margin: 15px 0;
}

.old-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
}

.current-price {
    font-size: 28px;
    font-weight: bold;
    color: #B12704;
}

/* Наличие */
.product-stock {
    margin: 15px 0;
}

.in-stock {
    color: #008a00;
    font-weight: 500;
}

.in-stock.waiting {
    color: #ff9900;
}

.out-of-stock {
    color: #cc0000;
    font-weight: 500;
}

/* Количество и кнопки */
.product-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input {
    -moz-appearance: textfield;
    appearance: textfield;
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #e0e0e0;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-add-to-cart {
    padding: 12px 24px;
    background: #ff9900;
    color: #000000;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-add-to-wishlist {
    padding: 12px 20px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-to-wishlist:hover {
    border-color: #ff9900;
    color: #ff9900;
}

/* Быстрые характеристики */
.quick-specs {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.quick-specs h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.specs-list {
    list-style: none;
    padding: 0;
}

.specs-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.spec-name {
    color: #666;
}

.spec-value {
    font-weight: 500;
}

/* Детальная информация */
.product-details-bottom {
    margin-top: 40px;
}

.product-details-bottom h2 {
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.product-description,
.product-included,
.product-specifications,
.product-files {
    margin-top: 30px;
}

.included-content {
    line-height: 1.5;
}

.product-description ul,
.product-included ul,
.product-specifications ul,
.product-files ul {
    list-style-type: none;
    padding-left: 0;
}

.product-description li,
.product-included li,
.product-specifications li,
.product-files li {
    margin-bottom: 8px;
}

/* Характеристики */
.specifications-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 20px;
}

.spec-item .spec-name {
    flex: 0 0 40%;
}

.spec-item .spec-value {
    flex: 0 0 60%;
    text-align: left;
}

/* Файлы */
.files-list {
    list-style: none;
    padding: 0;
}

.files-list li {
    margin-bottom: 8px;
}

.files-list a {
    color: #0066c0;
    text-decoration: none;
}

.files-list a:hover {
    text-decoration: underline;
}

/* Блоки сравнения и похожие товары */
.compare-products,
.similar-products {
    margin-top: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.slider-controls {
    display: flex;
    gap: 8px;
}

.slider-prev,
.slider-next {
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-prev:hover,
.slider-next:hover {
    background: #e0e0e0;
    border-color: #ff9900;
    color: #ff9900;
}

.compare-slider,
.similar-slider {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.compare-track,
.similar-track {
    display: flex;
    gap: 16px;
    padding: 4px 0 12px;
}

.compare-card,
.similar-card {
    flex: 0 0 220px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 0.2s;
}

.compare-card:hover,
.similar-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.compare-image,
.similar-image {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: #f8f8f8;
    border-radius: 4px;
}

.compare-image img,
.similar-image img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}

.compare-name,
.similar-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
}

.compare-name a,
.similar-name a {
    color: #111;
    text-decoration: none;
}

.compare-name a:hover,
.similar-name a:hover {
    color: #c45500;
    text-decoration: underline;
}

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

.compare-price .current-price,
.similar-price {
    font-size: 16px;
    font-weight: bold;
    color: #B12704;
    margin: 8px 0;
}

.compare-actions,
.similar-actions {
    display: flex;
    gap: 8px;
}

.btn-add-to-cart-small {
    flex: 1;
    padding: 6px 12px;
    background: #ff9900;
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-add-to-wishlist-small {
    width: 32px;
    padding: 6px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-to-wishlist-small:hover {
    border-color: #ff9900;
    color: #ff9900;
}

/* Отзывы */
.product-reviews {
    margin-top: 40px;
}

.reviews-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.average-rating {
    text-align: center;
}

.big-stars .star {
    font-size: 24px;
}

.rating-number {
    font-size: 18px;
    font-weight: bold;
    margin: 5px 0;
}

.reviews-count {
    color: #666;
}

.btn-write-review {
    padding: 10px 20px;
    background: white;
    border: 1px solid #0066c0;
    border-radius: 6px;
    color: #0066c0;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-write-review:hover {
    background: #0066c0;
    color: white;
}

.reviews-list {
    padding: 20px 0;
}

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

/* Хлебные крошки */
.breadcrumbs {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    border-bottom: none;
}

.breadcrumbs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: #0066c0;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: #004b8f;
    text-decoration: underline;
}

.breadcrumb-item .current {
    color: #000000;
    font-weight: 500;
}

.separator {
    margin: 0 8px;
    color: #adb5bd;
    font-size: 0.85rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .product-gallery {
        position: static;
    }
    
    .main-image {
        max-width: 100%;
        height: 400px;
    }
    
    .zoom-hint {
        font-size: 11px;
        padding: 4px 10px;
        bottom: 15px;
    }
    
    .thumbnail-list {
        max-width: 100%;
        gap: 0.8rem;
        padding: 0.5rem;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .specifications-grid {
        grid-template-columns: 1fr;
    }
    
    .reviews-summary {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .product-prices .current-price {
        font-size: 24px;
    }
    
    .breadcrumb-item {
        font-size: 0.75rem;
    }
    
    .separator {
        margin: 0 4px;
    }
    
    .modal-nav {
        font-size: 30px;
        padding: 10px 15px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
    
    .compare-card,
    .similar-card {
        flex: 0 0 180px;
    }
    
    .compare-image,
    .similar-image {
        height: 130px;
    }
    
    .compare-name,
    .similar-name {
        font-size: 12px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .zoom-hint {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* ========== КНОПКА ИЗБРАННОГО НА СТРАНИЦЕ ТОВАРА ========== */

.btn-add-to-wishlist {
    padding: 12px 20px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add-to-wishlist:hover {
    border-color: #ff9900;
    color: #ff9900;
}

.btn-add-to-wishlist.active {
    color: #ff4444;
    border-color: #ff4444;
}

.btn-add-to-wishlist.active:hover {
    border-color: #cc0000;
    color: #cc0000;
}

.btn-add-to-wishlist-small {
    width: 32px;
    padding: 6px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-add-to-wishlist-small:hover {
    border-color: #ff9900;
    color: #ff9900;
}

.btn-add-to-wishlist-small.active {
    color: #ff4444;
    border-color: #ff4444;
}

/* ========== СТАТУС КОРЗИНЫ ========== */

.cart-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    background: #f8f9fa;
}

.cart-status-info {
    font-size: 14px;
    color: #008a00;
}

.cart-status-warning {
    font-size: 12px;
    color: #cc0000;
    margin-top: 5px;
}

.cart-status-available {
    font-size: 12px;
    color: #ff9900;
    margin-top: 5px;
}

/* Кнопка добавления в корзину в disabled состоянии */
.btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

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

/* Селектор количества в disabled состоянии */
.quantity-input:disabled,
.quantity-btn:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.5;
}

/* ========== УВЕДОМЛЕНИЯ ========== */

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.notification-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notification-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.notification-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.btn-add-to-cart-small.disabled,
.btn-add-to-cart-small:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}