/* ==========================================================================
   CSS CHO TOÀN BỘ GIAO DIỆN GIỎ HÀNG (DESKTOP & MOBILE)
   ========================================================================== */

/* 1. KHUNG CHỨA TOÀN TRANG */
.woocommerce-cart .woocommerce {
    max-width: 1350px !important;
    width: 100% !important;
    margin: 30px auto 80px auto !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
}

.woocommerce-cart .woocommerce * {
    box-sizing: border-box !important;
}

/* Ẩn thông báo mặc định */
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info {
    display: none !important;
}

/* 2. TIÊU ĐỀ BẢNG */
.cart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px solid #f1f5f9;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    text-transform: uppercase;
}

.cart-header-row .header-qty {
    margin-right: 15px;
}

/* 3. DANH SÁCH SẢN PHẨM */
.cart-items-list {
    margin-bottom: 20px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

/* Khung ảnh & nút X tròn */
.item-thumb-wrapper {
    position: relative;
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
}

.item-thumb-wrapper .btn-remove-item {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    color: #64748b;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.item-thumb-wrapper .btn-remove-item:hover {
    background: #e53935;
    color: #fff;
    border-color: #e53935;
}

.item-thumb-wrapper .item-img img {
    width: 70px !important;
    height: 70px !important;
    aspect-ratio: 1/1 !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    border: 1px solid #eee !important;
    display: block !important;
    background: #fff;
}

/* Cột tên và giá */
.item-info {
    flex: 1 1 auto;
    text-align: left;
}

.item-info .item-title a {
    color: #0f172a;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.item-info .item-title a:hover {
    color: #e53935;
}

.item-info .item-price {
    color: #e53935;
    font-weight: 700;
    font-size: 15px;
    margin-top: 5px;
}

/* ==========================================================================
   4. BỘ NÚT SỐ LƯỢNG DẠNG VIÊN THUỐC ( - | 1 | + )
   ========================================================================== */
.item-quantity,
.woocommerce-cart .item-quantity {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center !important;
}

/* Khung bọc viên thuốc */
.item-quantity .quantity,
.woocommerce-cart .item-quantity .quantity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 50px !important; /* Bo tròn dạng viên thuốc */
    padding: 0 !important;
    margin: 0 !important;
    height: 34px !important;
    width: auto !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

/* Xóa viền/nền mặc định của theme trên nút (-) và (+) */
.item-quantity .quantity button.btn-qty,
.item-quantity .quantity .btn-qty,
.woocommerce-cart .item-quantity .quantity button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 34px !important;
    min-width: unset !important;
    min-height: unset !important;
    max-width: unset !important;
    max-height: unset !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #334155 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    outline: none !important;
    transition: background 0.2s ease !important;
}

.item-quantity .quantity button.btn-qty:hover,
.item-quantity .quantity .btn-qty:hover {
    background: #f1f5f9 !important;
    color: #000000 !important;
}

/* Ô nhập số ở giữa */
.item-quantity .quantity input.qty,
.woocommerce-cart .item-quantity .quantity input.qty {
    width: 36px !important;
    height: 34px !important;
    min-height: unset !important;
    border: none !important;
    border-left: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    -moz-appearance: textfield !important;
}

/* Ẩn mũi tên lên xuống của trình duyệt */
.item-quantity .quantity input.qty::-webkit-outer-spin-button,
.item-quantity .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* 5. MÃ ƯU ĐÃI & NÚT CẬP NHẬT */
.cart-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.coupon-box {
    display: flex;
    gap: 8px;
}

.coupon-box input.input-text {
    width: 200px;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}

.coupon-box .btn-apply {
    height: 44px;
    padding: 0 20px;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.coupon-box .btn-apply:hover {
    background: #e53935;
}

.btn-update {
    height: 44px;
    padding: 0 20px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-update:hover {
    background: #e2e8f0;
}

/* 6. KHUNG TỔNG TIỀN (GÓC PHẢI) */
.cart-collaterals {
    margin-top: 30px;
    width: 100%;
}

.cart_totals {
    width: 450px !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    background: #f8fafc !important;
    padding: 24px !important;
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
}

.cart_totals h2 {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 0 16px 0 !important;
    color: #0f172a !important;
    text-transform: uppercase !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding-bottom: 10px !important;
}

.cart_totals table.shop_table {
    width: 100% !important;
    border: none !important;
    margin-bottom: 20px !important;
    background: transparent !important;
}

.cart_totals table.shop_table tr th,
.cart_totals table.shop_table tr td {
    padding: 12px 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
}

.cart_totals table.shop_table tr td {
    text-align: right !important;
}

.cart_totals .order-total strong .woocommerce-Price-amount {
    color: #e53935 !important;
    font-size: 22px !important;
    font-weight: 800 !important;
}

/* NÚT TIẾN HÀNH THANH TOÁN */
.wc-proceed-to-checkout a.checkout-button,
a.button.checkout-button {
    background-color: #e53935 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 16px 20px !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.35) !important;
    text-decoration: none !important;
    transition: background 0.2s;
}

.wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #c62828 !important;
}

/* 7. RESPONSIVE CHO MOBILE */
@media (max-width: 768px) {
    .cart-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .coupon-box {
        width: 100%;
    }
    .coupon-box input.input-text {
        flex: 1;
        width: 100%;
    }
    .btn-update {
        width: 100%;
    }
    .cart_totals {
        width: 100% !important;
        float: none !important;
    }
}