/* ===== КАРТОЧКА ТОВАРА - SINGLE PRODUCT ===== */

.product-page {
    background-color: var(--bg-color);
    min-height: 100vh;
    padding: 20px 0;
}

.product-page .container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 48px;
}

/* Хлебные крошки */
.custom-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    font-family: var(--font-family-primary);
    font-size: 14px;
    color: var(--color-text-dark);
}

.product-gallery .custom-breadcrumbs {
    margin-bottom: 16px;
}

.breadcrumb-link {
    color: var(--color-text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: var(--color-primary);
}

.breadcrumb-separator {
    font-family: 'Manrope', sans-serif;
    font-weight: 300;
    font-size: 13px;
    color: var(--color-text-dark);
}

.breadcrumb-current {
    font-weight: 300;
    color: var(--color-text-dark);
}

/* Основной контент продукта */
.product-content {
    display: grid;
    grid-template-columns: 546px 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

/* Галерея изображений */
.product-gallery {
    position: relative;
}

.main-product-image {
    width: 546px;
    height: 546px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #D9D9D9;
}

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

.product-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.thumbnail-item {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #D9D9D9;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.thumbnail-item:hover {
    transform: scale(1.05);
}

.thumbnail-item.active {
    border: 2px solid var(--color-primary);
}

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

/* Информация о продукте */
.product-info {
    padding-top: 0;
}

.product-header {
    margin-bottom: 40px;
}

.product-sku {
    font-family: var(--font-family-primary);
    font-weight: 500;
    font-size: 18px;
    color: var(--color-text-dark);
    margin-bottom: 16px;
    line-height: 1.22;
}

.product-title {
    font-family: var(--font-family-primary);
    font-weight: 500;
    font-size: 40px;
    line-height: 1.22;
    letter-spacing: -0.08em;
    color: var(--color-text-dark);
    margin-bottom: 16px;
}

.product-description {
    font-family: var(--font-family-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-dark-semi);
    max-width: 474px;
}

/* Секция с ценами */
.price-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-price {
    font-family: var(--font-family-primary);
    font-weight: 500;
    font-size: 32px;
    line-height: 1.22;
    letter-spacing: -0.1em;
    color: var(--color-text-dark);
}

.original-price-container {
    position: relative;
}

.original-price {
    font-family: var(--font-family-primary);
    font-weight: 500;
    font-size: 24px;
    line-height: 1.22;
    letter-spacing: -0.133em;
    color: var(--color-text-gray);
}

.price-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-text-gray);
    transform: translateY(-50%);
}

.discount-badge {
    background: var(--color-secondary);
    color: var(--color-text-light);
    padding: 4px 8px;
    border-radius: 12px;
    font-family: var(--font-family-primary);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* Кнопка добавления в корзину */
.add-to-cart-section .cart {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Отключаем стандартные стили WooCommerce кнопок */
.woocommerce button.button.alt,
.woocommerce button.button,
.woocommerce .button.alt,
.woocommerce .button,
.woocommerce #respond input#submit.alt,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce a.button,
.woocommerce input.button.alt,
.woocommerce input.button {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Основные стили кнопки добавления в корзину */
.woocommerce .custom-add-to-cart-btn,
.woocommerce .single_add_to_cart_button.custom-add-to-cart-btn,
.woocommerce button.single_add_to_cart_button.custom-add-to-cart-btn,
.woocommerce form.cart button.single_add_to_cart_button.custom-add-to-cart-btn,
.custom-add-to-cart-btn,
.single_add_to_cart_button.custom-add-to-cart-btn,
button.single_add_to_cart_button.custom-add-to-cart-btn {
    background: #7DD3CE !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    width: 100% !important;
    max-width: 200px !important;
    height: 44px !important;
    font-family: var(--font-family-primary) !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.woocommerce .custom-add-to-cart-btn:hover,
.woocommerce .single_add_to_cart_button.custom-add-to-cart-btn:hover,
.woocommerce button.single_add_to_cart_button.custom-add-to-cart-btn:hover,
.woocommerce form.cart button.single_add_to_cart_button.custom-add-to-cart-btn:hover,
.custom-add-to-cart-btn:hover,
.single_add_to_cart_button.custom-add-to-cart-btn:hover,
button.single_add_to_cart_button.custom-add-to-cart-btn:hover {
    background: #6BC7C2 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(125, 211, 206, 0.3) !important;
}

.woocommerce .custom-add-to-cart-btn:active,
.woocommerce .single_add_to_cart_button.custom-add-to-cart-btn:active,
.woocommerce button.single_add_to_cart_button.custom-add-to-cart-btn:active,
.woocommerce form.cart button.single_add_to_cart_button.custom-add-to-cart-btn:active,
.custom-add-to-cart-btn:active,
.single_add_to_cart_button.custom-add-to-cart-btn:active,
button.single_add_to_cart_button.custom-add-to-cart-btn:active {
    background: #5BB5B0 !important;
    transform: translateY(0) !important;
    box-shadow: none !important;
}

.custom-add-to-cart-btn.loading,
.single_add_to_cart_button.custom-add-to-cart-btn.loading,
button.single_add_to_cart_button.custom-add-to-cart-btn.loading {
    background: #B8B8B8 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.custom-add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid var(--color-text-light);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Количество товара */
.quantity {
    display: flex;
    align-items: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #7DD3CE;
    border-radius: 8px;
    background: #FFFFFF;
    overflow: hidden;
    height: 36px;
    width: 100px;
}

.quantity-btn {
    width: 28px;
    height: 34px;
    border: none;
    background: #7DD3CE;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #6BC7C2;
}

.quantity-btn:active {
    background: #5BB5B0;
    color: #FFFFFF;
}

.quantity input[type="number"] {
    width: 44px;
    height: 34px;
    border: none;
    border-left: 1px solid #7DD3CE;
    border-right: 1px solid #7DD3CE;
    text-align: center;
    font-family: var(--font-family-primary);
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    background: #FFFFFF;
    outline: none;
    appearance: textfield; /* Стандартное свойство */
    -moz-appearance: textfield; /* Убираем стрелки в Firefox */
}

/* Убираем стрелки в Chrome, Safari, Edge */
.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Раздел "Смотрите также" - используем полностью унифицированные карточки */
.related-products-section {
    margin-top: 60px;
    position: relative;
}

.section-title {
    font-family: var(--font-family-primary);
    font-weight: 500;
    font-size: 40px;
    line-height: 1.22;
    letter-spacing: -0.08em;
    color: var(--color-text-dark);
    margin-bottom: 60px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    justify-content: center;
    transition: transform 0.3s ease;
    will-change: transform;
    max-width: 1200px;
    margin: 0 auto;
}

/* Карточки полностью используют стили из product-card.css */
/* Все стили .product-card__* автоматически применяются */

/* Стрелки навигации */
.navigation-arrows {
    position: absolute;
    right: 0;
    top: 5px;
    display: flex;
    gap: 10px;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-primary);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    background: var(--color-primary);
}

.nav-arrow:hover svg path {
    stroke: var(--color-text-light);
}

/* Адаптивность */
@media (max-width: 1200px) {
    .product-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .main-product-image {
        width: 100%;
        max-width: 546px;
        margin: 0 auto;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 318px));
        gap: 20px;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .products-grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .products-grid::-webkit-scrollbar-track {
        background: var(--bg-color);
        border-radius: 3px;
    }
    
    .products-grid::-webkit-scrollbar-thumb {
        background: var(--color-primary);
        border-radius: 3px;
    }
    
    .navigation-arrows {
        display: none;
    }
}

@media (max-width: 768px) {
    .product-page .container {
        padding: 0 20px;
    }
    
    .custom-breadcrumbs {
        margin-bottom: 30px;
        font-size: 13px;
        gap: 6px;
    }
    
    .product-title {
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 40px;
    }
    
    .main-product-image {
        height: 350px;
    }
    
    .product-thumbnails {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .thumbnail-item {
        width: 40px;
        height: 40px;
        border-radius: 6px;
    }
    
    .product-sku {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .product-description {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .current-price {
        font-size: 26px;
    }
    
    .original-price {
        font-size: 20px;
    }
    
    .custom-add-to-cart-btn {
        width: 100%;
        max-width: 200px;
        height: 44px;
        font-size: 14px;
    }
    
    .add-to-cart-section .cart {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .quantity-controls {
        width: 90px;
        height: 32px;
        margin: 0 auto;
        background: #FFFFFF;
        border: 1px solid #7DD3CE;
        border-radius: 8px;
    }
    
    .quantity-btn {
        width: 24px;
        height: 30px;
        font-size: 14px;
    }
    
    .quantity input[type="number"] {
        width: 42px;
        height: 30px;
        font-size: 13px;
        color: #000000;
        background: #FFFFFF;
        border-left: 1px solid #7DD3CE;
        border-right: 1px solid #7DD3CE;
    }
    
    .product-card {
        height: 420px;
    }
    
    .product-card-image {
        width: calc(100% - 20px);
        height: 240px;
        margin: 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .product-page .container {
        padding: 0 16px;
    }
    
    .custom-breadcrumbs {
        font-size: 12px;
        gap: 4px;
        margin-bottom: 20px;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .main-product-image {
        height: 280px;
        border-radius: 16px;
    }
    
    .thumbnail-item {
        width: 36px;
        height: 36px;
        border-radius: 6px;
    }
    
    .price-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .current-price {
        font-size: 24px;
    }
    
    .original-price {
        font-size: 18px;
    }
    
    .discount-badge {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .product-card {
        height: 380px;
    }
    
    .product-card-image {
        height: 200px;
    }
    
    .product-card-title {
        font-size: 14px;
    }
    
    .product-card-sku {
        font-size: 13px;
    }
    
    .btn-add-to-cart {
        height: 36px;
        font-size: 13px;
    }
}

/* Скрытие стандартных элементов WooCommerce */
.woocommerce div.product .woocommerce-product-gallery,
.woocommerce div.product div.summary,
.woocommerce .woocommerce-breadcrumb {
    display: none !important;
}

/* Переопределение стандартных уведомлений WooCommerce */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    background: var(--color-button-primary);
    color: var(--color-text-light);
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 20px 0;
    font-family: var(--font-family-primary);
}

.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-info::before {
    display: none;
}

/* Дополнительные стили для форм WooCommerce */
.woocommerce table.variations td.value select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border-gray);
    border-radius: 8px;
    background: var(--color-bg-white);
    font-family: var(--font-family-primary);
    font-size: 14px;
}

.woocommerce table.variations td.value .reset_variations {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 12px;
    margin-left: 10px;
}

.woocommerce table.variations td.value .reset_variations:hover {
    text-decoration: underline;
}

/* Стили для variation выбора */
.variations {
    margin-bottom: 20px;
}

.variations td,
.variations th {
    padding: 8px 0;
    border: none;
}

.variations th.label {
    font-family: var(--font-family-primary);
    font-weight: 500;
    color: var(--color-text-dark);
    font-size: 14px;
    width: 120px;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-content {
    animation: fadeIn 0.6s ease-out;
}

.related-products-section {
    animation: fadeIn 0.8s ease-out 0.2s both;
}

/* Улучшения доступности */
.custom-add-to-cart-btn:focus,
.quantity-btn:focus,
.nav-arrow:focus {
    outline: 2px solid #7DD3CE;
    outline-offset: 2px;
}

.thumbnail-item:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

/* Стили для товаров в слайдере на hover */
.product-card:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Дополнительные микроанимации */
.rating-star svg {
    transition: transform 0.2s ease;
}

.rating-star:hover svg {
    transform: scale(1.1);
}

.price-container .current-price {
    transition: color 0.3s ease;
}

/* Стили загрузки для AJAX */
.woocommerce-variation-add-to-cart-disabled .custom-add-to-cart-btn {
    opacity: 0.6;
    cursor: not-allowed;
    background: #B8B8B8;
}

/* Состояние "нет в наличии" */
.product-page .out-of-stock {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-family-primary);
    font-weight: 500;
    margin: 16px 0;
}

/* Дополнительные responsive улучшения */
@media (max-width: 1440px) {
    .product-page .container {
        max-width: 1200px;
    }
}

@media (hover: none) {
    /* Стили для устройств без hover (мобильные) */
    .product-card:hover {
        transform: none;
    }
    
    .product-card:hover .product-card-image img {
        transform: none;
    }
    
    .thumbnail-item:hover {
        transform: none;
    }
}

/* ВАЖНО: Финальное переопределение стилей кнопки */
body .woocommerce .custom-add-to-cart-btn,
body .woocommerce button.single_add_to_cart_button.custom-add-to-cart-btn,
body .woocommerce form.cart button.single_add_to_cart_button.custom-add-to-cart-btn,
body .custom-add-to-cart-btn {
    background-color: #7DD3CE !important;
    background: #7DD3CE !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 8px !important;
    height: 44px !important;
    font-size: 14px !important;
    max-width: 200px !important;
    padding: 12px 24px !important;
}

body .woocommerce .custom-add-to-cart-btn:hover,
body .woocommerce button.single_add_to_cart_button.custom-add-to-cart-btn:hover,
body .woocommerce form.cart button.single_add_to_cart_button.custom-add-to-cart-btn:hover,
body .custom-add-to-cart-btn:hover {
    background-color: #6BC7C2 !important;
    background: #6BC7C2 !important;
}
