/* ==========================================================================
   CLASSIC WOOCOMMERCE CART (cart.css)
   ========================================================================== */

/* --- БАЗОВЫЕ СТИЛИ (ЭЛЕМЕНТЫ) --- */
.woocommerce table.cart { border-collapse: collapse !important; width: 100% !important; border: none !important; margin-bottom: 20px !important; }
.woocommerce table.cart th { text-align: left !important; padding: 15px 10px !important; border-bottom: 2px solid #e9e9e9 !important; font-weight: bold !important; color: #333 !important; border-top: none !important; border-left: none !important; border-right: none !important; }
.woocommerce table.cart td { padding: 15px 10px !important; border-bottom: 1px solid #e9e9e9 !important; vertical-align: middle !important; border-top: none !important; border-left: none !important; border-right: none !important; }

.woocommerce table.cart a.remove { display: flex !important; align-items: center !important; justify-content: center !important; font-size: 24px !important; color: #888 !important; text-decoration: none !important; width: 28px !important; height: 28px !important; line-height: 1 !important; border-radius: 50% !important; font-weight: normal !important; background: transparent !important; }
.woocommerce table.cart a.remove:hover { color: #fff !important; background: #f84147 !important; }

.woocommerce table.cart td.product-thumbnail img { width: 70px !important; height: auto !important; box-shadow: none !important; }
.woocommerce table.cart td.product-name a { color: #3e77aa !important; text-decoration: none !important; font-size: 16px !important; font-weight: bold !important; }
.woocommerce table.cart td.product-name a:hover { color: #f84147 !important; }

.woocommerce table.cart td.product-price, .woocommerce table.cart td.product-subtotal { font-weight: bold !important; color: #000 !important; font-size: 16px !important; }

/* Кнопки количества */
.woocommerce table.cart .quantity { margin: 0 !important; display: flex !important; border: 1px solid #ccc !important; border-radius: 4px !important; height: 35px !important; width: 100px !important; overflow: hidden !important; background: #fff !important; }
.woocommerce table.cart .quantity input.qty { width: 40px !important; text-align: center !important; border: none !important; font-size: 15px !important; padding: 0 !important; margin: 0 !important; outline: none !important; box-shadow: none !important; background: #fff !important; -moz-appearance: textfield !important; }
.woocommerce table.cart .quantity input.qty::-webkit-outer-spin-button, .woocommerce table.cart .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none !important; margin: 0 !important; }
.woocommerce table.cart .quantity .qty-btn { width: 30px !important; background: #f5f5f5 !important; border: none !important; cursor: pointer !important; font-size: 18px !important; color: #333 !important; display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; margin: 0 !important; }
.woocommerce table.cart .quantity .qty-btn:hover { background: #e0e0e0 !important; color: #00a046 !important; }

/* Купон и кнопка */
.woocommerce table.cart td.actions { padding: 20px 0 !important; text-align: right !important; }
.woocommerce table.cart td.actions .coupon { display: flex !important; gap: 10px !important; float: left !important; }
.woocommerce table.cart td.actions .coupon .input-text { width: 200px !important; height: 40px !important; padding: 0 15px !important; border: 1px solid #ccc !important; border-radius: 4px !important; margin: 0 !important; box-shadow: none !important; }
.woocommerce table.cart td.actions .button { height: 40px !important; padding: 0 20px !important; background: #f5f5f5 !important; border: 1px solid #ccc !important; border-radius: 4px !important; cursor: pointer !important; color: #333 !important; font-weight: normal !important; text-transform: none !important; }
.woocommerce table.cart td.actions .button:hover { background: #e9e9e9 !important; }

/* Блок итогов */
.cart_totals { background: #fafafa !important; padding: 25px !important; border-radius: 8px !important; border: 1px solid #e9e9e9 !important; }
.cart_totals h2 { font-size: 20px !important; margin-top: 0 !important; margin-bottom: 20px !important; border-bottom: 1px solid #e9e9e9 !important; padding-bottom: 15px !important; }
.cart_totals table { width: 100% !important; border: none !important; border-collapse: collapse !important; }
.cart_totals table th { padding: 15px 0 !important; text-align: left !important; font-weight: normal !important; border-bottom: 1px solid #e9e9e9 !important; border-top: none !important; border-left: none !important; border-right: none !important; }
.cart_totals table td { padding: 15px 0 !important; text-align: right !important; font-weight: bold !important; border-bottom: 1px solid #e9e9e9 !important; border-top: none !important; border-left: none !important; border-right: none !important; }
.cart_totals table tr:last-child th, .cart_totals table tr:last-child td { border-bottom: none !important; }
.cart_totals table .order-total td strong { font-size: 22px !important; color: #000 !important; }

.wc-proceed-to-checkout { margin-top: 25px !important; }
.wc-proceed-to-checkout .checkout-button { display: block !important; width: 100% !important; background: #00a046 !important; color: #fff !important; text-align: center !important; padding: 15px !important; border-radius: 6px !important; font-size: 16px !important; font-weight: bold !important; text-decoration: none !important; transition: background 0.2s !important; box-sizing: border-box !important; }
.wc-proceed-to-checkout .checkout-button:hover { background: #008238 !important; }


/* --- САЙДБАР (Итоги заказа) --- */
.wc-block-components-sidebar {
    background: #fafafa !important;
    padding: 25px !important;
    border-radius: 8px !important;
    border: 1px solid #e9e9e9 !important;
    box-sizing: border-box !important;
}

/* Общий итог (Загалом) */
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 22px !important;
    color: #000 !important;
    font-weight: bold !important;
}

/* --- ЗАГОЛОВКИ --- */
.wc-block-components-checkout-step__title,
.wc-block-components-checkout-order-summary__title-text {
    font-size: 20px !important;
    font-weight: bold !important;
    color: #333 !important;
    margin-bottom: 20px !important;
}

/* --- ПОЛЯ ВВОДА --- */
.wc-block-components-text-input input,
.wc-blocks-components-select__select {
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #333 !important;
    box-shadow: none !important;
}

.wc-block-components-text-input input:focus,
.wc-blocks-components-select__select:focus {
    border-color: #00a046 !important;
    outline: none !important;
    box-shadow: 0 0 0 1px #00a046 !important;
}

/* --- КНОПКА "ПІДТВЕРДИТИ ЗАМОВЛЕННЯ" --- */
.wc-block-components-checkout-place-order-button {
    background: #00a046 !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 15px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    width: 100% !important;
    border: none !important;
    transition: background 0.2s !important;
    box-sizing: border-box !important;
    text-transform: none !important;
}

.wc-block-components-checkout-place-order-button:hover {
    background: #008238 !important;
}

/* --- ССЫЛКА "ПОВЕРНУТИСЯ В КОШИК" --- */
.wc-block-components-checkout-return-to-cart-button {
    color: #888 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin-bottom: 15px !important;
    transition: 0.2s !important;
}

.wc-block-components-checkout-return-to-cart-button:hover {
    color: #00a046 !important;
}

/* Иконка корзины вместо крестика */
.woocommerce table.cart a.remove,
.woocommerce-cart-form a.remove {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important; 
    color: #f84147 !important;
    text-decoration: none !important;
    width: 40px !important;
    height: 40px !important;
    background: transparent !important;
    border-radius: 50% !important;
    transition: 0.3s !important;
}

.woocommerce table.cart a.remove::before,
.woocommerce-cart-form a.remove::before {
    content: '\1F5D1' !important; 
    font-size: 26px !important;
    display: block !important;
    line-height: 1 !important;
    color: inherit !important;
}

.woocommerce table.cart a.remove:hover,
.woocommerce-cart-form a.remove:hover {
    background: #f84147 !important;
    color: #fff !important;
}

/* Стили поля количества и скрытие стандартных стрелок браузера */
.woocommerce-cart-form .quantity {
    display: flex !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    height: 40px !important;
    width: 100px !important;
    background: #fff !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.woocommerce-cart-form .quantity input.qty {
    width: 40px !important;
    height: 100% !important;
    text-align: center !important;
    border: none !important;
    font-size: 16px !important;
    font-weight: bold !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    -moz-appearance: textfield !important;
}

.woocommerce-cart-form .quantity input.qty::-webkit-outer-spin-button, 
.woocommerce-cart-form .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Кнопки +/- */
.woocommerce-cart-form .quantity .qty-btn {
    width: 30px !important;
    background: #f5f5f5 !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 18px !important;
    color: #333 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: 0.2s !important;
}

.woocommerce-cart-form .quantity .qty-btn:hover {
    background: #e0e0e0 !important;
    color: #00a046 !important;
}

/* --- ДЕСКТОП (В один ряд 70% / 30%) --- */
@media (min-width: 769px) {
    .woocommerce-cart .woocommerce {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 30px !important;
        align-items: flex-start !important;
    }
    .woocommerce-cart .woocommerce-cart-form {
        width: 70% !important;
        flex-shrink: 0 !important;
    }
    .woocommerce-cart .cart-collaterals {
        width: calc(30% - 30px) !important; 
        flex-grow: 1 !important;
        display: block !important;
        margin-top: 0 !important;
    }
    .woocommerce-cart .cart_totals {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    .wc-block-components-sidebar-layout {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 30px !important;
    }
    .wc-block-components-main {
        width: 70% !important;
        flex-shrink: 0 !important;
    }
    .wc-block-components-sidebar {
        width: calc(30% - 30px) !important;
        flex-grow: 1 !important;
        margin: 0 !important;
    }
    
    /* Відновлення нормальної таблиці на ПК */
    .woocommerce table.cart { display: table !important; }
    .woocommerce table.cart thead { display: table-header-group !important; }
    .woocommerce table.cart tbody { display: table-row-group !important; }
    .woocommerce table.cart tr.woocommerce-cart-form__cart-item {
        display: table-row !important;
        padding: 0 !important;
        border: none !important;
        border-bottom: 1px solid #e9e9e9 !important;
        margin: 0 !important;
    }
    .woocommerce table.cart td {
        display: table-cell !important;
        position: static !important;
    }
    .woocommerce table.cart td::before { display: none !important; }
    .woocommerce table.cart td.product-price { display: table-cell !important; }
    .woocommerce table.cart td.actions { flex-direction: row !important; }
    .woocommerce table.cart td.actions .coupon { flex-direction: row !important; width: auto !important; float: left !important; }
    .woocommerce table.cart td.actions .coupon .input-text, 
    .woocommerce table.cart td.actions .button { width: auto !important; height: 40px !important; margin: 0 !important;}
}

/* --- МОБІЛЬНА ВЕРСІЯ --- */
@media (max-width: 768px) {
    .wc-block-components-sidebar { display: none !important; }

    .wc-block-components-sidebar-layout { display: flex !important; flex-direction: column !important; gap: 20px !important; }
    .wc-block-components-main, .wc-block-components-sidebar { width: 100% !important; }

    .woocommerce-cart .woocommerce { display: block !important; }
    .woocommerce-cart .woocommerce-cart-form { width: 100% !important; }
    .woocommerce-cart .cart-collaterals { width: 100% !important; margin-top: 30px !important; }
    
    .woocommerce table.cart thead { display: none !important; }
    .woocommerce table.cart tbody { display: block !important; width: 100% !important; }
    
    .woocommerce table.cart td::before { display: none !important; }

    .woocommerce table.cart tr.woocommerce-cart-form__cart-item {
        display: block !important;
        position: relative !important;
        padding: 15px 0 65px 90px !important; 
        border: 1px solid #e9e9e9 !important;
        border-radius: 8px !important;
        margin-bottom: 15px !important;
    }

    .woocommerce table.cart tr.woocommerce-cart-form__cart-item td {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
    }

    .woocommerce table.cart td.product-remove {
        position: absolute !important;
        top: 45px !important;
        right: 10px !important;
        left: auto !important;
        width: auto !important;
        z-index: 2 !important;
    }

    .woocommerce table.cart td.product-thumbnail {
        position: absolute !important;
        left: 10px !important;
        top: 15px !important;
        width: 70px !important;
    }
    .woocommerce table.cart td.product-thumbnail img { margin: 0 !important; }

    .woocommerce table.cart td.product-name {
        margin-bottom: 10px !important;
        padding-right: 45px !important; 
        box-sizing: border-box !important;
        width: 100% !important;
        white-space: normal !important;
    }

    .woocommerce table.cart td.product-name a { 
        font-size: 14px !important; 
        display: block !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .woocommerce table.cart td.product-price { display: none !important; }

    .woocommerce table.cart td.product-quantity {
        position: absolute !important;
        left: 90px !important;
        bottom: 15px !important;
    }

    .woocommerce table.cart td.product-subtotal {
        position: absolute !important;
        right: 15px !important;
        bottom: 20px !important;
    }
    .woocommerce table.cart td.product-subtotal .amount { font-size: 18px !important; }

    .woocommerce table.cart tr:last-child { border: none !important; padding: 0 !important; margin-bottom: 0 !important; }
    .woocommerce table.cart td.actions { flex-direction: column !important; gap: 10px !important; padding: 15px 0 0 0 !important; text-align: center !important; }
    .woocommerce table.cart td.actions .coupon { display: flex !important; flex-direction: column !important; width: 100% !important; gap: 10px !important; float: none !important; }
    .woocommerce table.cart td.actions .coupon .input-text, 
    .woocommerce table.cart td.actions .button { width: 100% !important; margin: 0 !important; height: 45px !important; }
}