/*
 * Специфические RTL стили для корзины WooCommerce
 * Основано на предоставленной HTML структуре
 */

/* Основной контейнер корзины */
.woocommerce {
    direction: rtl;
}

/* Таблица корзины */
.woocommerce .shop_table.cart {
    direction: rtl;
    text-align: right;
}

/* Заголовки таблицы */
.woocommerce table.cart thead th {
    text-align: right;
    padding: 8px 12px;
}

/* Колонка удаления товара */
.woocommerce table.cart .product-remove {
    text-align: center;
    width: 50px;
}

.woocommerce table.cart .product-remove .remove {
    float: none;
    display: inline-block;
    text-align: center;
}

/* Колонка изображения */
.woocommerce table.cart .product-thumbnail {
    text-align: center;
    width: 80px;
}

.woocommerce table.cart .product-thumbnail img {
    max-width: 64px;
    height: auto;
}

/* Колонка названия товара */
.woocommerce table.cart .product-name {
    text-align: right;
}

.woocommerce table.cart .product-name a {
    text-decoration: none;
    font-weight: bold;
}

/* Колонка цены */
.woocommerce table.cart .product-price {
    text-align: center;
    direction: ltr; /* Цены лучше отображать LTR */
}

/* Колонка количества */
.woocommerce table.cart .product-quantity {
    text-align: center;
}

/* Стили для количества с кнопками */
.woocommerce .quantity_wrap {
    display: inline-block;
    text-align: center;
}

.woocommerce .quantity.buttons_added {
    position: relative;
    display: inline-flex;
    flex-direction: row-reverse; /* Обращаем порядок кнопок для RTL */
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.woocommerce .quantity.buttons_added .minus {
    order: 1; /* Минус справа */
    border: none;
    background: #f7f7f7;
    padding: 0 10px;
    height: 32px;
    cursor: pointer;
}

.woocommerce .quantity.buttons_added .qty {
    order: 2; /* Поле в центре */
    border: none;
    text-align: center;
    width: 60px;
    height: 32px;
    margin: 0;
    -moz-appearance: textfield;
}

.woocommerce .quantity.buttons_added .plus {
    order: 3; /* Плюс слева */
    border: none;
    background: #f7f7f7;
    padding: 0 10px;
    height: 32px;
    cursor: pointer;
}

/* Убираем стрелки у input number */
.woocommerce .quantity.buttons_added .qty::-webkit-outer-spin-button,
.woocommerce .quantity.buttons_added .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Колонка подитога */
.woocommerce table.cart .product-subtotal {
    text-align: center;
    direction: ltr; /* Суммы лучше отображать LTR */
}

/* Строка действий (купоны и кнопка обновления) */
.woocommerce table.cart .actions {
    padding: 16px 12px;
    background: #f9f9f9;
    text-align: right;
}

/* Блок купона */
.woocommerce .coupon {
    float: right;
    margin-left: 20px;
}

.woocommerce .coupon input[type="text"] {
    margin-left: 8px;
    width: 150px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woocommerce .coupon .button {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Кнопка обновления корзины */
.woocommerce .actions .button[name="update_cart"] {
    float: left;
    background: #666;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
}

/* Боковой блок итогов */
.woocommerce .cart-collaterals {
    direction: rtl;
    width: 100%;
}

.woocommerce .cart_totals {
    float: left;
    width: 48%;
    margin-left: 0;
    margin-right: 4%;
    text-align: right;
}

.woocommerce .cart_totals h2 {
    text-align: right;
    margin-bottom: 20px;
    font-size: 24px;
}

/* Таблица итогов */
.woocommerce .cart_totals .shop_table {
    direction: rtl;
    text-align: right;
    width: 100%;
    margin-bottom: 20px;
}

.woocommerce .cart_totals .shop_table th {
    text-align: right;
    padding: 12px;
    background: #f9f9f9;
    font-weight: bold;
    width: 40%;
}

.woocommerce .cart_totals .shop_table td {
    text-align: left; /* Суммы лучше LTR */
    padding: 12px;
    direction: ltr;
}

/* Блок способов доставки */
.woocommerce .woocommerce-shipping-totals ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce .woocommerce-shipping-totals li {
    margin-bottom: 8px;
    text-align: right;
}

.woocommerce .woocommerce-shipping-totals input[type="radio"] {
    margin-left: 8px;
    float: right;
}

.woocommerce .woocommerce-shipping-totals label {
    display: inline-block;
    text-align: right;
    direction: rtl;
}

/* Калькулятор доставки */
.woocommerce-shipping-calculator {
    text-align: right;
    direction: rtl;
}

.woocommerce-shipping-calculator .shipping-calculator-button {
    text-align: right;
    color: #007cba;
    text-decoration: none;
}

.woocommerce-shipping-calculator .form-row {
    margin-bottom: 16px;
    text-align: right;
}

.woocommerce-shipping-calculator .form-row input,
.woocommerce-shipping-calculator .form-row select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
    direction: rtl;
}

/* Кнопка перехода к оформлению */
.woocommerce .wc-proceed-to-checkout {
    text-align: right;
    margin-top: 20px;
}

.woocommerce .wc-proceed-to-checkout .checkout-button {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    min-width: 200px;
}

.woocommerce .wc-proceed-to-checkout .checkout-button:hover {
    background: #005a87;
}

/* Цены и символы валют */
.woocommerce-Price-amount {
    direction: ltr;
    unicode-bidi: embed;
}

.woocommerce-Price-currencySymbol {
    margin-right: 2px;
    margin-left: 0;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .woocommerce .cart_totals {
        float: none;
        width: 100%;
        margin: 20px 0 0 0;
    }
    
    .woocommerce .coupon {
        float: none;
        margin: 10px 0;
        text-align: right;
    }
    
    .woocommerce .actions .button[name="update_cart"] {
        float: none;
        width: 100%;
        margin-top: 10px;
    }
    
    /* Скрываем некоторые колонки на мобильных */
    .woocommerce table.cart .product-thumbnail {
        display: none;
    }
    
    .woocommerce table.cart .product-price {
        display: none;
    }
    
    /* Стековое отображение для мобильных */
    .woocommerce table.cart.shop_table_responsive tbody tr td {
        display: block;
        text-align: right;
        border: none;
    }
    
    .woocommerce table.cart.shop_table_responsive tbody tr td::before {
        content: attr(data-title) ": ";
        font-weight: bold;
        float: right;
        margin-left: 10px;
    }
} 