/**
 * CSS tùy chỉnh trang Giỏ hàng
 * Prefix: edit-page-cart-wat
 */

/* ===== CARD SẢN PHẨM ===== */
.edit-page-cart-wat-products {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.edit-page-cart-wat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
    background: transparent;
}

.edit-page-cart-wat-card:first-of-type {
    border-top: 1px solid #e5e7eb;
}

/* Ảnh sản phẩm (cờ quốc gia) */
.edit-page-cart-wat-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
}

.edit-page-cart-wat-thumb img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 99px;
}

.edit-page-cart-wat-thumb a {
    display: block;
}

/* Thông tin sản phẩm */
.edit-page-cart-wat-info {
    flex: 1;
    min-width: 0;
}

.edit-page-cart-wat-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
}

.edit-page-cart-wat-name a {
    color: #1a1a1a;
    text-decoration: none;
}

.edit-page-cart-wat-name a:hover {
    color: #2563eb;
}

/* Meta data (Dung Lượng, Số Ngày) */
.edit-page-cart-wat-meta {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}


.edit-page-cart-wat-meta dt {
    display: inline;
    font-weight: 500;
    color: #6b7280;
}

.edit-page-cart-wat-meta dd {
    display: inline;
    margin: 0;
    color: #374151;
}

.edit-page-cart-wat-meta dd p {
    display: inline;
    margin: 0;
}

/* Khu vực hành động: quantity + giá + xóa */
.edit-page-cart-wat-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Quantity input */
.edit-page-cart-wat-qty .quantity {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 99px;
    overflow: hidden;
}

.edit-page-cart-wat-qty .quantity input[type="number"],
.edit-page-cart-wat-qty .quantity .qty {
    width: 40px;
    height: 36px;
    text-align: center;
    border: none;
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 0;
}

.edit-page-cart-wat-qty .quantity input[type="number"]::-webkit-outer-spin-button,
.edit-page-cart-wat-qty .quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.edit-page-cart-wat-qty .quantity .minus,
.edit-page-cart-wat-qty .quantity .plus {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #374151;
    transition: background 0.15s;
    padding: 0;
    line-height: 1;
    background: none;
}

.edit-page-cart-wat-qty .quantity .minus:hover,
.edit-page-cart-wat-qty .quantity .plus:hover {
    background: #e5e7eb;
}

/* Giá sản phẩm */
.edit-page-cart-wat-price {
    font-size: 16px;
    font-weight: 700;
    color: #dc2626;
    white-space: nowrap;
    min-width: 90px;
    text-align: right;
}

.edit-page-cart-wat-price .woocommerce-Price-amount {
    color: #dc2626;
}

/* Nút xóa */
.edit-page-cart-wat-remove {
    flex-shrink: 0;
}

.edit-page-cart-wat-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #9ca3af;
    transition: all 0.15s;
    text-decoration: none !important;
}

.edit-page-cart-wat-remove-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Nút Update Cart */
.edit-page-cart-wat-update-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
}

.edit-page-cart-wat-update-btn {
    font-size: 13px !important;
}

/* ===== SIDEBAR - CHI TIẾT THANH TOÁN ===== */

.cart-collaterals.large-5.col.pb-0 {
    border-left: none !important; 
}

.edit-page-cart-wat-totals th.product-name {
    border-bottom: none;
    text-transform: none;
    font-size: 18px;
}
.edit-page-cart-wat-totals {
    background: #F5F5F8;
    border-radius: 12px;
    padding: 24px;
}

.edit-page-cart-wat-totals-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1a1a1a;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Coupon section */

.edit-page-cart-wat-coupon-row {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s;
}

.edit-page-cart-wat-coupon-row:focus-within {
    border-color: #a0a0a0;
}

.edit-page-cart-wat-coupon-input {
    flex: 1;
    height: auto !important;
    padding: 0 16px !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    color: #374151 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    margin-bottom: 0;
}

.edit-page-cart-wat-coupon-input::placeholder {
    color: #9ca3af;
}

.edit-page-cart-wat-coupon-btn {
    height: 44px;
    padding: 0 18px;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 14px;
    font-weight: 700;
    color: #4600B9;
    cursor: pointer;
    white-space: nowrap;
    text-transform: capitalize;
    margin: 0;
}

.edit-page-cart-wat-coupon-btn:hover {
    color: #7c3aed;
}

/* Bảng chi tiết thanh toán */
.edit-page-cart-wat-table {
    border: none !important;
    margin: 0 !important;
}

.edit-page-cart-wat-totals span.woocommerce-Price-amount.amount {
    color: #222222;
}

.edit-page-cart-wat-table tr {
    border: none !important;
}

.edit-page-cart-wat-table tr th,
.edit-page-cart-wat-table tr td {
    padding: 10px 0 !important;
    border: none !important;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6 !important;
}

.edit-page-cart-wat-table tr th {
    color: #6b7280;
    font-weight: 500;
}

.edit-page-cart-wat-table tr td {
    text-align: right;
    color: #1a1a1a;
    font-weight: 500;
}

/* Dòng giảm giá (fee âm) */
.edit-page-cart-wat-table tr.fee td .woocommerce-Price-amount,
.edit-page-cart-wat-table tr.cart-discount td .woocommerce-Price-amount {
    color: #222222;
    font-weight: 400;
}

tr.order-total.edit-page-cart-wat-order-total span.woocommerce-Price-amount.amount {
    font-weight: bold;
}
.edit-page-cart-wat-totals span.woocommerce-Price-amount.amount {
    color: #222222;
    font-weight: 400;
}
/* Dòng tổng thanh toán */
.edit-page-cart-wat-order-total th {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    border-bottom: none !important;
    padding-top: 16px !important;
}

.edit-page-cart-wat-order-total td {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #dc2626 !important;
    border-bottom: none !important;
    padding-top: 16px !important;
}

.woocommerce-message.message-wrapper:focus-visible {
    outline: none;
}

/* Nút Tiến hành thanh toán - nằm ngoài khối background */
.edit-page-cart-wat-checkout {
    margin-top: 16px;
    padding: 0;
}

.edit-page-cart-wat-checkout .checkout-button,
.edit-page-cart-wat-checkout .wc-forward {
    display: block;
    width: 100%;
    background: #7F56D9 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: none !important;
    letter-spacing: 0;
    margin: 0;
}

.edit-page-cart-wat-checkout .checkout-button:hover,
.edit-page-cart-wat-checkout .wc-forward:hover {
    box-shadow: 0 6px 16px rgba(235, 226, 226, 0.4);
}

/* Ẩn coupon mặc định của Flatsome ở sidebar (đã tích hợp vào cart-totals) */
.cart-sidebar .ux-cart-coupon,
.cart-sidebar .coupon {
    display: none !important;
}

/* Ẩn coupon ở bottom cart (đã chuyển vào sidebar) */
.woocommerce-cart-form .coupon {
    display: none !important;
}

/* Ẩn nút "Tiếp tục xem sản phẩm" */
.continue-shopping {
    display: none !important;
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 849px) {
    .edit-page-cart-wat-card {
        flex-wrap: wrap;
        padding: 16px 0;
        gap: 12px;
    }

    .edit-page-cart-wat-thumb {
        width: 50px;
        height: 50px;
    }

    .edit-page-cart-wat-thumb img {
        width: 50px;
        height: 50px;
    }

    /* Dòng 1: Ảnh + Thông tin */
    .edit-page-cart-wat-info {
        flex: 1;
        min-width: 0;
    }

    /* Dòng 2: Qty + Giá + Xóa - full width */
    .edit-page-cart-wat-actions {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        border-top: 1px solid #f3f4f6;
    }

    .edit-page-cart-wat-name {
        font-size: 14px;
    }

    .edit-page-cart-wat-price {
        font-size: 15px;
        flex: 1;
    }
}

/* Mobile */
@media (max-width: 549px) {
    .edit-page-cart-wat-card {
        padding: 14px 0;
        gap: 10px;
    }

    .edit-page-cart-wat-thumb {
        width: 44px;
        height: 44px;
    }

    .edit-page-cart-wat-thumb img {
        width: 44px;
        height: 44px;
    }

    .edit-page-cart-wat-name {
        font-size: 13px;
    }

    .edit-page-cart-wat-meta {
        font-size: 12px;
    }

    .edit-page-cart-wat-actions {
        gap: 8px;
        padding-top: 10px;
    }

    .edit-page-cart-wat-qty .quantity .minus,
    .edit-page-cart-wat-qty .quantity .plus {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .edit-page-cart-wat-qty .quantity input[type="number"],
    .edit-page-cart-wat-qty .quantity .qty {
        width: 32px;
        height: 30px;
        font-size: 13px;
    }

    .edit-page-cart-wat-price {
        font-size: 14px;
        min-width: auto;
    }

    .edit-page-cart-wat-remove-btn {
        width: 30px;
        height: 30px;
    }

    .edit-page-cart-wat-remove-btn img {
        width: 18px;
        height: 18px;
    }

    /* Sidebar */
    .edit-page-cart-wat-totals {
        padding: 16px;
    }

    .edit-page-cart-wat-totals-title {
        font-size: 16px !important;
    }

    .edit-page-cart-wat-coupon-input {
        height: 38px;
        font-size: 13px;
    }

    .edit-page-cart-wat-coupon-btn {
        height: 38px;
        font-size: 13px;
        padding: 0 12px;
    }

    .edit-page-cart-wat-order-total th {
        font-size: 14px !important;
    }

    .edit-page-cart-wat-order-total td {
        font-size: 18px !important;
    }

    .edit-page-cart-wat-checkout .checkout-button,
    .edit-page-cart-wat-checkout .wc-forward {
        font-size: 15px !important;
        border-radius: 10px !important;
    }

    /* Ẩn nút update cart trên mobile */
    .edit-page-cart-wat-update-row {
        margin-top: 8px;
        padding-top: 8px;
    }
}

/* ===== Ẩn label "Giảm trên đơn hàng" mặc định nếu dùng label từ fee ===== */
.edit-page-cart-wat-table .fee th {
    color: #6b7280;
}

/* Thông báo khuyến mãi trong cart-totals */
.edit-page-cart-wat-totals .woocommerce-thong-bao-wat.tdgg-wat-notice {
    margin: 0 0 4px 0;
    padding: 10px 0;
    font-size: 13px;
}
