/* ========== КАРТОЧКА ТОВАРА ========== */

/* Название товара */
.product-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    gap: 15px;
}
.product-title-wrapper h1 {
    font-size: 24px;
    font-weight: 700;
    color: #01295b;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}
.product-nav-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.product-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #01295b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 16px;
}
.product-nav-btn:hover {
    background: #01295b;
    color: #fff;
    border-color: #01295b;
    box-shadow: 0 4px 12px rgba(1,41,91,0.2);
}
.product-nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Три колонки */
.product-layout {
    display: grid;
    grid-template-columns: 33% 39% 25%;
    gap: 20px;
    margin-bottom: 40px;
}

/* Колонка 1: Фото */
.product-gallery-col .woocommerce-product-gallery {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}
.woocommerce div.product .woocommerce-product-gallery .flex-viewport {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}
.product-gallery-col .flex-control-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 10px !important;
}
.product-gallery-col .flex-control-thumbs li {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: border-color 0.3s;
}
.product-gallery-col .flex-control-thumbs li img.flex-active {
    border: 2px solid #01295b;
}
.product-gallery-col .wpbl_image_disclaimer {
    text-align: center;
    font-size: 13px;
    color: #888;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 12px;
}

/* Колонка 2: Описание */
.product-info-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.product-short-description {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}
.product-sku {
    font-size: 16px;
    color: #6c757d;
    padding: 8px 12px;
    border-radius: 8px;
}
.product-sku strong {
    color: #01295b;
}
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.product-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: #e3f2fd;
    color: #01295b;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
}
.product-tags a:hover {
    background: #01295b;
    color: #fff;
    text-decoration: none;
}
.product-attributes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.product-attributes-table tr {
    border-bottom: 1px solid #e9ecef;
}
.product-attributes-table tr:last-child {
    border-bottom: none;
}
.product-attributes-table td {
    padding: 8px 0;
}
.product-attributes-table td:first-child {
    color: #6c757d;
    width: 30%;
    padding-right: 15px;
}
.product-attributes-table td:last-child {
    color: #212529;
    font-weight: 500;
}

/* Колонка 3: Цена и покупка */
.product-cart-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    position: sticky;
    top: 20px;
    height: fit-content;
}
.product-cart-col .price {
    font-size: 28px;
    font-weight: 700;
    color: #01295b;
    margin: 0;
}
.product-cart-col .price del {
    font-size: 18px;
    color: #999;
}
.product-cart-col .stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0a7e3a;
    font-size: 15px;
    font-weight: 500;
}
.product-cart-col .quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}
.product-cart-col .quantity input.qty {
    width: 70px;
    height: 44px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}
.product-cart-col .single_add_to_cart_button {
    width: 100%;
    height: 48px;
    background: #01295b;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: none;
}
.product-cart-col .single_add_to_cart_button:hover {
    background: #1c96ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1,41,91,0.2);
}
.product-cart-col .stock-info.out-of-stock {
    color: #ff0000;
}

.product-cart-col .stock-info.out-of-stock svg {
    fill: #ff0000;
}

/* Доставка */
.delivery-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}
.delivery-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}
.delivery-item svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}
.delivery-text {
    display: flex;
    flex-direction: column;
}
.delivery-title {
    font-weight: 600;
    color: #01295b;
}
.delivery-subtitle {
    font-size: 12px;
    color: #6c757d;
}
.stock-update-time {
    font-size: 12px;
    color: #888;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* ========== КОЛИЧЕСТВО НА СТРАНИЦЕ ТОВАРА ========== */

/* Растягиваем блок количества на всю ширину колонки */
.product-cart-col form.cart .quantity,
.product-cart-col .quantity {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    background: #f0f0f0 !important;
    border-radius: 40px !important;
    padding: 4px !important;
    gap: 4px !important;
    margin-bottom: 10px !important;
    align-self: stretch !important;
}

/* Кнопки - и + — фиксированного размера, по краям */
.product-cart-col form.cart .quantity .minus,
.product-cart-col form.cart .quantity .plus,
.product-cart-col .quantity .minus,
.product-cart-col .quantity .plus {
    flex: 0 0 50px !important;
    width: 50px !important;
    height: 50px !important;
    line-height: 50px !important;
    font-size: 24px !important;
    background: #fff !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #01295b !important;
    font-weight: bold !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
}

/* Поле ввода — занимает всё оставшееся место по центру */
.product-cart-col form.cart .quantity .qty,
.product-cart-col .quantity .qty {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 50px !important;
    text-align: center !important;
    border: none !important;
    background: transparent !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #01295b !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield !important;
    outline: none !important;
}

/* Убираем стрелки в Chrome/Edge/Safari */
.product-cart-col .quantity .qty::-webkit-outer-spin-button,
.product-cart-col .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Ховер и нажатие на кнопки */
.product-cart-col .quantity .minus:hover,
.product-cart-col .quantity .plus:hover {
    background: #eef2f6 !important;
    transform: scale(0.96);
}

.product-cart-col .quantity .minus:active,
.product-cart-col .quantity .plus:active {
    transform: scale(0.92);
}

/*+- в плавающей панели*/
.quantity:not(.widget_shopping_cart .quantity):not(.woocommerce-mini-cart .quantity) {
    background: #f0f0f0 !important;
    padding: 2px 3px !important;
}
.owp-floating-bar form.cart .quantity .minus, .owp-floating-bar form.cart .quantity .plus {
    color: #01295b !important;
}
.owp-floating-bar form.cart .quantity .qty {
    color: #01295b !important;
}
.quantity:not(.widget_shopping_cart .quantity):not(.woocommerce-mini-cart .quantity) .qty {
    width: 60px !important;
}

/* Похожие товары */
/* ========== ПОХОЖИЕ ТОВАРЫ ========== */

.related-products-section {
    margin: 40px 0;
}

.related-products-section h2 {
    font-size: 22px;
    color: #01295b;
    margin-bottom: 20px;
}

.related-products-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-products-scroll {
    flex-grow: 1;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Родитель карточек */
.related-products-wrapper {
    display: flex;
    gap: 15px;
}

/* Карточка товара — ФИКСИРОВАННАЯ ВЫСОТА */
.related-product-card {
    flex: 0 0 220px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    height: 340px !important;
    box-sizing: border-box;
}

.related-product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* Фото — фиксированная высота */
.related-product-image {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
    height: 160px;
    margin-bottom: 10px;
}

.related-product-image img {
    width: 100%;
    height: 160px;
    object-fit: contain;
}

/* Название — всегда ровно 2 строки */
.related-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 39px;
    min-height: 39px;
    max-height: 39px;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.related-product-title:hover {
    color: #01295b;
    text-decoration: none;
}

/* Цена — прижата к кнопке */
.related-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #01295b;
    flex-shrink: 0;
    margin-bottom: 8px;
}

/* КНОПКА — ВСЕГДА ВНИЗУ через auto margin */
.related-cart-form {
    margin: 0;
    margin-top: auto !important;
    width: 100%;
    flex-shrink: 0;
}

.related-add-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: #01295b;
    color: #fff;
    border: none;
    border-radius: 20px !important;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

a.related-add-btn {
    display: block;
    margin-top: auto !important;
}

.related-add-btn:hover {
    background: #1c96ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1,41,91,0.2);
    color: #fff;
    text-decoration: none;
}

/* Кнопка "Подробнее" */
.related-add-btn.btn-details {
    background: #f8f9fa;
    color: #01295b;
    border: 1px solid #dee2e6;
}

.related-add-btn.btn-details:hover {
    background: #01295b;
    color: #fff;
    border-color: #01295b;
}

/* Состояние "Добавлено" */
.related-add-btn.added {
    background: #0a7e3a !important;
    color: #fff !important;
}


/* ========== ССЫЛКА "ПРОСМОТР КОРЗИНЫ" ========== */

.product-cart-col .added_to_cart {
    display: block;
    width: 100%;
    padding: 12px 20px;
    margin-top: 10px;
    background: transparent;
    color: #01295b;
    border: 2px solid #01295b;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.product-cart-col .added_to_cart:hover {
    background: #01295b;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1,41,91,0.2);
}

/* Анимация появления */
.product-cart-col .added_to_cart {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Кнопки прокрутки (общие) */
.scroll-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #01295b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.scroll-btn:hover {
    background: #01295b;
    color: #fff;
    border-color: #01295b;
}
.scroll-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .product-layout {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .product-cart-col {
        position: static;
        grid-column: 1 / -1;
    }
    .owp-floating-bar .product_price p {
        font-size: 20px;
    }
    p.price {
        padding: 0 0 10px 0;
    }
    .related-product-card {
        flex: 0 0 160px;
    }
    
    .related-product-image img {
        height: 120px;
    }
    
    .related-product-title {
        font-size: 13px;
        height: calc(13px * 1.3 * 2);
    }
    
    .related-product-price {
        font-size: 14px;
    }
    
    .related-add-btn {
        font-size: 13px;
        padding: 8px 10px;
    }
}
@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
    .product-title-wrapper h1 {
        font-size: 20px;
    }
    .product-cart-col {
        position: static;
        padding: 16px !important;
    }

    /* Перебиваем ограничение ширины кнопки */
    button.single_add_to_cart_button.button.alt,
    .product-cart-col .single_add_to_cart_button {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Ссылка "Просмотр корзины" тоже на всю ширину */
    .product-cart-col .added_to_cart {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Форма корзины на всю ширину */
    .product-cart-col form.cart {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Кнопки на всю ширину */
    .product-cart-col .single_add_to_cart_button,
    .product-cart-col .added_to_cart {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Форма с кнопкой тоже на всю ширину */
    .product-cart-col form.cart {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .product-cart-col form.cart .quantity {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .related-product-card {
        flex: 0 0 160px;
        height: 300px !important;
    }
    
    .related-product-image img {
        height: 120px;
    }
    
    .related-product-title {
        font-size: 13px;
        height: calc(13px * 1.3 * 2);
    }
    
    .related-product-price {
        font-size: 14px;
    }
    
    .related-add-btn {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    /* Исправляем опечатку */
    .product-attributes-table {
        display: none;
    }
    
    .product-cart-col .quantity .minus,
    .product-cart-col .quantity .plus {
        flex: 0 0 56px !important;
        width: 56px !important;
        height: 56px !important;
        font-size: 28px !important;
    }
    .product-cart-col .quantity .qty {
        font-size: 22px !important;
    }
}
