/**
 * Stylesheet cho Trang Giỏ Hàng (Cart Page) & Khối Sản phẩm Gợi ý
 * Theme: Vtipz
 */

/* ==========================================================================
   1. BỐ CỤC TRANG GIỎ HÀNG
   ========================================================================== */
.vtipz-cart-page {
    background-color: #F8FAFC;
    min-height: 60vh;
    padding-bottom: 60px;
}

.vtipz-cart-header {
    margin-bottom: 28px;
}

.vtipz-cart-title {
    font-size: 26px;
    font-weight: 800;
    color: #0E4E85;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.vtipz-cart-title i {
    color: #F26B21;
}

.vtipz-cart-count-badge {
    display: inline-block;
    background: #E8F2FA;
    color: #1C75BC;
    font-size: 15px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
}

.vtipz-cart-desc {
    color: #64748B;
    font-size: 14px;
    margin: 0;
}

/* Lưới 2 cột giỏ hàng */
.vtipz-cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

/* ==========================================================================
   2. CỘT TRÁI: BẢNG SẢN PHẨM TRONG GIỎ HÀNG
   ========================================================================== */
.vtipz-cart-items-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(14, 78, 133, 0.04);
    overflow: hidden;
}

.vtipz-cart-table-head {
    display: grid;
    grid-template-columns: 3fr 1.2fr 1.4fr 1.4fr 48px;
    padding: 16px 20px;
    background: #F4F8FC;
    border-bottom: 1px solid #CFE3F6;
    font-weight: 700;
    font-size: 13px;
    color: #0E4E85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vtipz-cart-item-row {
    display: grid;
    grid-template-columns: 3fr 1.2fr 1.4fr 1.4fr 48px;
    padding: 20px;
    align-items: center;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.2s ease, opacity 0.3s ease;
}

.vtipz-cart-item-row:last-child {
    border-bottom: none;
}

.vtipz-cart-item-row:hover {
    background: #FAFCFE;
}

.vtipz-cart-item-row.is-updating {
    opacity: 0.4;
    pointer-events: none;
}

/* Cột thông tin sản phẩm */
.vtipz-cart-product-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vtipz-cart-thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vtipz-cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.vtipz-cart-thumb:hover img {
    transform: scale(1.06);
}

.vtipz-cart-details {
    flex: 1;
    min-width: 0;
}

.vtipz-cart-brand-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #1C75BC;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.vtipz-cart-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #1E293B;
    margin: 0 0 4px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vtipz-cart-item-title a {
    color: #1E293B;
    text-decoration: none;
    transition: color 0.2s ease;
}

.vtipz-cart-item-title a:hover {
    color: #F26B21;
}

.vtipz-cart-item-meta {
    font-size: 12px;
    color: #64748B;
}

/* Cột đơn giá */
.vtipz-cart-price-col {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

/* Bộ điều khiển số lượng (- / +) */
.vtipz-cart-qty-ctrl {
    display: inline-flex;
    align-items: center;
    border: 1px solid #CFE3F6;
    border-radius: 8px;
    background: #FFFFFF;
    overflow: hidden;
    height: 36px;
}

.vtipz-cart-qty-btn {
    width: 32px;
    height: 100%;
    background: #F4F8FC;
    border: none;
    color: #0E4E85;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.vtipz-cart-qty-btn:hover {
    background: #0E4E85;
    color: #FFFFFF;
}

.vtipz-cart-qty-input {
    width: 44px;
    height: 100%;
    border: none;
    border-left: 1px solid #E2E8F0;
    border-right: 1px solid #E2E8F0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1E293B;
    padding: 0;
    -moz-appearance: textfield;
}

.vtipz-cart-qty-input::-webkit-outer-spin-button,
.vtipz-cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Cột thành tiền */
.vtipz-cart-subtotal-col {
    font-size: 15px;
    font-weight: 700;
    color: #0E4E85;
}

/* Nút xóa sản phẩm */
.vtipz-cart-remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #F1F5F9;
    background: #FFFFFF;
    color: #94A3B8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s ease;
}

.vtipz-cart-remove-btn:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
    color: #DC2626;
    transform: scale(1.05);
}

/* Thanh hành động chân bảng */
.vtipz-cart-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #FAFCFE;
    border-top: 1px solid #E2E8F0;
}

.vtipz-btn-continue-shop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1C75BC;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.vtipz-btn-continue-shop:hover {
    color: #0E4E85;
}

.vtipz-btn-clear-cart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.vtipz-btn-clear-cart:hover {
    color: #DC2626;
}

/* ==========================================================================
   3. CỘT PHẢI: TÓM TẮT ĐƠN HÀNG (ORDER SUMMARY)
   ========================================================================== */
.vtipz-cart-summary-card {
    background: #FFFFFF;
    border: 1px solid #CFE3F6;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(14, 78, 133, 0.06);
    position: sticky;
    top: 100px;
}

.vtipz-cart-summary-title {
    font-size: 18px;
    font-weight: 700;
    color: #0E4E85;
    margin: 0 0 20px 0;
    padding-bottom: 14px;
    border-bottom: 2px solid #F4F8FC;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vtipz-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.vtipz-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #475569;
}

.vtipz-summary-row .row-val {
    font-weight: 600;
    color: #1E293B;
}

.vtipz-summary-row.discount-row {
    color: #16A34A;
}

.vtipz-summary-row.discount-row .row-val {
    color: #16A34A;
}

/* Khối nhập mã giảm giá */
.vtipz-coupon-box {
    margin: 16px 0;
    padding: 14px;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 12px;
}

.vtipz-coupon-box label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    margin-bottom: 6px;
}

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

.vtipz-coupon-input {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 13px;
    text-transform: uppercase;
    color: #1E293B;
    outline: none;
    transition: border-color 0.2s ease;
}

.vtipz-coupon-input:focus {
    border-color: #1C75BC;
}

.vtipz-btn-apply-coupon {
    height: 38px;
    padding: 0 16px;
    background: #0E4E85;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.vtipz-btn-apply-coupon:hover {
    background: #1C75BC;
}

.vtipz-coupon-msg {
    margin-top: 8px;
    font-size: 12px;
    display: none;
}

.vtipz-coupon-msg.success {
    color: #16A34A;
    display: block;
}

.vtipz-coupon-msg.error {
    color: #DC2626;
    display: block;
}

/* Hàng tổng cộng */
.vtipz-summary-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 16px 0;
}

.vtipz-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.vtipz-total-label {
    font-size: 16px;
    font-weight: 700;
    color: #1E293B;
}

.vtipz-total-amount {
    font-size: 22px;
    font-weight: 800;
    color: #F26B21;
}

.vtipz-vat-notice {
    font-size: 12px;
    color: #94A3B8;
    text-align: right;
    margin-bottom: 20px;
}

/* Nút Tiến hành thanh toán */
.vtipz-btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    background: #F26B21;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 16px 0 !important;
    box-shadow: 0 4px 12px rgba(242, 107, 33, 0.3);
    transition: all 0.25s ease;
}

.vtipz-btn-checkout:hover {
    background: #d95611;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(242, 107, 33, 0.4);
    color: #FFFFFF;
}

/* Cam kết an tâm mua sắm */
.vtipz-cart-trust-badges {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #F1F5F9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vtipz-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #64748B;
}

.vtipz-trust-item i {
    color: #009444;
    font-size: 14px;
}

/* ==========================================================================
   4. TRẠNG THÁI GIỎ HÀNG TRỐNG (EMPTY STATE)
   ========================================================================== */
.vtipz-cart-empty-wrap {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    max-width: 680px;
    margin: 0 auto 50px auto;
}

.vtipz-empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    background: #F4F8FC;
    color: #1C75BC;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
}

.vtipz-empty-heading {
    font-size: 22px;
    font-weight: 700;
    color: #0E4E85;
    margin-bottom: 10px;
}

.vtipz-empty-subtext {
    font-size: 14px;
    color: #64748B;
    max-width: 440px;
    margin: 0 auto 26px auto;
    line-height: 1.6;
}

.vtipz-btn-empty-shop {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #F26B21;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 32px;
    border-radius: 0 0 16px 0 !important;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(242, 107, 33, 0.25);
    transition: all 0.2s ease;
}

.vtipz-btn-empty-shop:hover {
    background: #d95611;
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* ==========================================================================
   5. KHỐI SẢN PHẨM GỢI Ý (SUGGESTED PRODUCTS)
   ========================================================================== */
.vtipz-cart-suggested-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid #E2E8F0;
}

.vtipz-suggested-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.vtipz-suggested-title {
    font-size: 22px;
    font-weight: 800;
    color: #0E4E85;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vtipz-suggested-title i {
    color: #F5BD06;
}

.vtipz-suggested-subtitle {
    font-size: 14px;
    color: #64748B;
    margin: 0;
}

.vtipz-suggested-link-all {
    color: #1C75BC;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.vtipz-suggested-link-all:hover {
    color: #F26B21;
}

/* Lưới hiển thị các thẻ sản phẩm chính */
.vtipz-suggested-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Đảm bảo thẻ sản phẩm trong gợi ý có chiều cao đồng đều */
.vtipz-suggested-grid .vtipz-product-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.vtipz-suggested-grid .vtipz-product-card:hover {
    box-shadow: 0 8px 24px rgba(14, 78, 133, 0.08);
    border-color: #CFE3F6;
    transform: translateY(-3px);
}

/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .vtipz-cart-layout {
        grid-template-columns: 1fr;
    }

    .vtipz-cart-summary-card {
        position: static;
    }

    .vtipz-suggested-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .vtipz-cart-table-head {
        display: none;
    }

    .vtipz-cart-item-row {
        grid-template-columns: 1fr;
        gap: 12px;
        position: relative;
        padding: 16px;
    }

    .vtipz-cart-remove-btn {
        position: absolute;
        top: 14px;
        right: 14px;
    }

    .vtipz-cart-item-mobile-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px dashed #E2E8F0;
    }

    .vtipz-suggested-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .vtipz-suggested-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .vtipz-suggested-grid {
        grid-template-columns: 1fr;
    }
}
