/* Полное переопределение стилей корзины WooCommerce */

/* Основной контейнер корзины */
.cart-page-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    padding: 3rem 0 !important;
    min-height: 70vh !important;
}

.cart-page-wrapper .woocommerce {
    background: white !important;
    border-radius: 20px !important;
    padding: 3rem !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1) !important;
    margin: 0 auto !important;
    max-width: 1200px !important;
    position: relative !important;
}

.cart-page-wrapper .woocommerce::before {
    content: "🛒 Ваша корзина" !important;
    display: block !important;
    text-align: center !important;
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    margin-bottom: 2rem !important;
}

/* КРИТИЧНО: Принудительное отображение таблицы */
.woocommerce-cart-form .shop_table {
    display: table !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 15px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    margin-bottom: 2rem !important;
    table-layout: fixed !important;
}

.woocommerce-cart-form .shop_table thead {
    display: table-header-group !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 15px 15px 0 0 !important;
}

.woocommerce-cart-form .shop_table thead tr {
    display: table-row !important;
    background: transparent !important;
}

.woocommerce-cart-form .shop_table thead th {
    display: table-cell !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 1.5rem 1rem !important;
    text-align: center !important;
    border: none !important;
    font-size: 1rem !important;
    vertical-align: middle !important;
    position: relative !important;
}

/* Принудительно показываем заголовки */
.woocommerce-cart-form .shop_table thead th:nth-child(1) {
    width: 60px !important;
    text-align: center !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(1)::after {
    content: "×" !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
    display: block !important;
    text-align: center !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(2) {
    width: 100px !important;
    text-align: center !important;
    background: transparent !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(2)::after {
    content: "Фото" !important;
    color: white !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(3) {
    text-align: left !important;
    padding-left: 1rem !important;
    background: transparent !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(3)::after {
    content: "Товар" !important;
    color: white !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: left !important;
    padding-left: 1rem !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(4) {
    width: 120px !important;
    text-align: center !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(4)::after {
    content: "Цена" !important;
    color: white !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(5) {
    width: 120px !important;
    text-align: center !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(5)::after {
    content: "Количество" !important;
    color: white !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(6) {
    width: 120px !important;
    text-align: center !important;
}

.woocommerce-cart-form .shop_table thead th:nth-child(6)::after {
    content: "Подытог" !important;
    color: white !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
}

/* Скрываем оригинальный текст заголовков */
.woocommerce-cart-form .shop_table thead th {
    font-size: 0 !important;
    text-indent: -9999px !important;
}

.woocommerce-cart-form .shop_table thead th::after {
    font-size: 1rem !important;
    text-indent: 0 !important;
}

/* Ширины колонок */
.woocommerce-cart-form .shop_table .product-remove {
    width: 60px !important;
}

.woocommerce-cart-form .shop_table .product-thumbnail {
    width: 100px !important;
}

.woocommerce-cart-form .shop_table .product-name {
    width: auto !important;
}

.woocommerce-cart-form .shop_table .product-price {
    width: 120px !important;
}

.woocommerce-cart-form .shop_table .product-quantity {
    width: 120px !important;
}

.woocommerce-cart-form .shop_table .product-subtotal {
    width: 120px !important;
}

.woocommerce-cart-form .shop_table tbody {
    display: table-row-group !important;
}

.woocommerce-cart-form .shop_table tbody tr {
    display: table-row !important;
    transition: background-color 0.3s ease !important;
}

.woocommerce-cart-form .shop_table tbody tr:hover {
    background-color: #f8f9fa !important;
}

.woocommerce-cart-form .shop_table tbody td {
    display: table-cell !important;
    padding: 1.5rem 1rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #e9ecef !important;
    text-align: center !important;
}

/* Скрываем псевдо-заголовки на мобильных */
.woocommerce-cart-form .shop_table tbody td::before {
    display: none !important;
    content: none !important;
}

/* Изображения товаров */
.product-thumbnail {
    width: 100px !important;
}

.product-thumbnail img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    transition: transform 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.product-thumbnail img:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* Названия товаров */
.product-name {
    text-align: left !important;
}

.product-name a {
    color: #2d3748 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
}

.product-name a:hover {
    color: #667eea !important;
    text-decoration: underline !important;
}

/* Кнопка удаления */
.product-remove {
    width: 60px !important;
}

.product-remove .remove {
    background: #dc3545 !important;
    color: white !important;
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    font-size: 1.2rem !important;
    transition: all 0.3s ease !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
    margin: 0 auto !important;
}

.product-remove .remove:hover {
    background: #c82333 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
}

/* Цена */
.product-price {
    text-align: center !important;
}

/* Поле количества */
.product-quantity {
    text-align: center !important;
}

.quantity {
    display: flex !important;
    justify-content: center !important;
}

.quantity input {
    width: 80px !important;
    padding: 0.75rem !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    text-align: center !important;
    font-weight: 600 !important;
    transition: border-color 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.quantity input:focus {
    border-color: #667eea !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Подытог */
.product-subtotal {
    text-align: center !important;
}

/* Цены */
.woocommerce-Price-amount {
    font-weight: 700 !important;
    color: #28a745 !important;
    font-size: 1.1rem !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Действия корзины */
.actions {
    background: #f8f9fa !important;
    padding: 2rem !important;
    border-radius: 0 0 15px 15px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    border-top: 1px solid #e9ecef !important;
}

.coupon {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
}

.coupon input {
    padding: 0.75rem 1rem !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    min-width: 200px !important;
    transition: border-color 0.3s ease !important;
}

.coupon input:focus {
    border-color: #667eea !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Кнопки */
.woocommerce .button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
}

.woocommerce .button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3) !important;
    color: white !important;
}

/* Итоги корзины */
.cart-collaterals {
    margin-top: 3rem !important;
}

.cart_totals {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    padding: 2rem !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    max-width: 400px !important;
    margin-left: auto !important;
}

.cart_totals h2 {
    color: #2d3748 !important;
    margin-bottom: 1.5rem !important;
    font-size: 1.5rem !important;
    text-align: center !important;
}

.cart_totals table {
    width: 100% !important;
    margin-bottom: 2rem !important;
}

.cart_totals table th,
.cart_totals table td {
    padding: 1rem !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    border-bottom: 2px solid #667eea !important;
}

/* Кнопка оформления заказа */
.checkout-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    padding: 1.2rem 2rem !important;
    border-radius: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    display: block !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    border: none !important;
    width: 100% !important;
}

.checkout-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3) !important;
    color: white !important;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .cart-page-wrapper {
        padding: 2rem 0 !important;
    }
    
    .cart-page-wrapper .woocommerce {
        padding: 1.5rem !important;
        margin: 0 1rem !important;
        border-radius: 15px !important;
    }
    
    .cart-page-wrapper .woocommerce::before {
        font-size: 2rem !important;
    }
    
    /* На мобильных превращаем в карточки */
    .woocommerce-cart-form .shop_table,
    .woocommerce-cart-form .shop_table thead,
    .woocommerce-cart-form .shop_table tbody,
    .woocommerce-cart-form .shop_table th,
    .woocommerce-cart-form .shop_table td,
    .woocommerce-cart-form .shop_table tr {
        display: block !important;
    }
    
    .woocommerce-cart-form .shop_table thead tr {
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
    }
    
    .woocommerce-cart-form .shop_table tr {
        border: 1px solid #e9ecef !important;
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
        padding: 1rem !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }
    
    .woocommerce-cart-form .shop_table td {
        border: none !important;
        border-bottom: 1px solid #f1f1f1 !important;
        position: relative !important;
        padding: 0.5rem 0 !important;
        text-align: left !important;
        padding-left: 50% !important;
    }
    
    .woocommerce-cart-form .shop_table td:before {
        content: attr(data-title) !important;
        position: absolute !important;
        left: 6px !important;
        width: 45% !important;
        padding-right: 10px !important;
        white-space: nowrap !important;
        font-weight: 600 !important;
        color: #2d3748 !important;
        display: block !important;
    }
    
    .product-thumbnail {
        text-align: center !important;
        padding-left: 0 !important;
    }
    
    .product-thumbnail img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .coupon {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .coupon input {
        min-width: auto !important;
        margin-bottom: 0.5rem !important;
    }
    
    .cart_totals {
        max-width: none !important;
        margin: 2rem 0 0 0 !important;
    }
}

@media (max-width: 480px) {
    .cart-page-wrapper .woocommerce::before {
        font-size: 1.8rem !important;
    }
    
    .product-thumbnail img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .quantity input {
        width: 60px !important;
        padding: 0.5rem !important;
    }
}