/* ================================================================
   CART PAGE STYLES (Desktop & Mobile Responsive)
   Premium Gold & Ivory Luxury Aesthetic for Jewelers
   ================================================================ */

/* Cart Container */
.mg-cart-wrap {
    background: #faf8f5;
    min-height: 60vh;
}

/* Breadcrumb Header Alignment */
.customer-portal-header {
    background: linear-gradient(135deg, #1b2430 0%, #0f1722 100%) !important;
    padding: 24px 0 !important;
    border-bottom: 2px solid rgba(212, 175, 55, 0.4) !important;
}

.customer-portal-header h1 {
    color: #ffffff !important;
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    margin-bottom: 6px !important;
    font-family: inherit;
}

.customer-portal-header .page-breadcrumb-links {
    font-size: 0.85rem;
    color: #c9b185;
}

.customer-portal-header .page-breadcrumb-links a {
    color: #f1dfb8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.customer-portal-header .page-breadcrumb-links a:hover {
    color: #ffffff;
}

.customer-portal-header .page-breadcrumb-links .sep {
    margin: 0 8px;
    opacity: 0.6;
}

.customer-portal-header .page-breadcrumb-links .current-page {
    color: #e5c378;
    font-weight: 600;
}

/* ================================================================
   EMPTY CART STATE
   ================================================================ */
.mg-cart-empty-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
    padding: 50px 24px;
    text-align: center;
    margin: 15px 0 40px;
}

.mg-cart-empty-icon-wrap {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #faf4e6 0%, #f4e8cb 100%);
    border: 2px dashed rgba(212, 175, 55, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.15);
}

.mg-cart-empty-icon-wrap i {
    font-size: 40px;
    color: #a8802a;
}

.mg-cart-empty-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #241c14;
    margin-bottom: 10px;
}

.mg-cart-empty-desc {
    font-size: 0.95rem;
    color: #6c757d;
    max-width: 480px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.mg-cart-empty-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 35px;
}

.mg-btn-shop-now {
    background: linear-gradient(135deg, #d4af37 0%, #a8802a 100%) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.92rem !important;
    padding: 12px 28px !important;
    border-radius: 30px !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(168, 128, 42, 0.3) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.25s ease !important;
}

.mg-btn-shop-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 128, 42, 0.4) !important;
    color: #ffffff !important;
}

.mg-btn-wishlist {
    background: #ffffff !important;
    color: #a8802a !important;
    font-weight: 600 !important;
    font-size: 0.92rem !important;
    padding: 11px 24px !important;
    border-radius: 30px !important;
    border: 1.5px solid rgba(168, 128, 42, 0.4) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.25s ease !important;
}

.mg-btn-wishlist:hover {
    background: #faf4e6 !important;
    border-color: #a8802a !important;
    color: #8c671a !important;
}

.mg-cart-trust-badges {
    display: flex;
    justify-content: center;
    gap: 30px;
    border-top: 1px solid #f0ede6;
    padding-top: 25px;
    flex-wrap: wrap;
}

.mg-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #555555;
    font-weight: 500;
}

.mg-trust-item i {
    font-size: 1.15rem;
    color: #a8802a;
}

/* ================================================================
   ACTIVE CART TABLE (DESKTOP)
   ================================================================ */
.mg-cart-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 30px;
}

.mg-cart-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.mg-cart-table thead {
    background: #fbf8f2;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.mg-cart-table thead th {
    padding: 14px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #3d3024;
    border: none;
    vertical-align: middle;
    text-align: center;
}

.mg-cart-table thead th.th-product {
    text-align: left;
    padding-left: 20px;
}

.mg-cart-table tbody tr {
    transition: background 0.2s ease;
    border-bottom: 1px solid #f2ede4;
}

.mg-cart-table tbody tr:last-child {
    border-bottom: none;
}

.mg-cart-table tbody tr:hover {
    background: #faf6ee;
}

.mg-cart-table td {
    padding: 16px 12px;
    vertical-align: middle;
    border: none;
    border-bottom: 1px solid #f2ede4;
    text-align: center;
    font-size: 0.9rem;
    color: #2b2118;
}

/* Product Info Cell */
.mg-cart-table td.td-product {
    text-align: left;
    padding-left: 20px;
}

.mg-cart-product-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mg-cart-thumb {
    width: 65px;
    height: 65px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: #ffffff;
    flex-shrink: 0;
    padding: 2px;
}

.mg-cart-p-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #241c14;
    line-height: 1.35;
    margin-bottom: 4px;
}

.mg-cart-p-purity {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    background: #faf0da;
    color: #8c671a;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    text-transform: uppercase;
}

/* Price & Breakdown details */
.mg-cart-val {
    font-weight: 600;
    font-size: 0.92rem;
}

.mg-cart-subtext {
    font-size: 0.74rem;
    color: #7b746d;
    display: block;
    margin-top: 3px;
    line-height: 1.2;
}

.mg-cart-line-total {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
}

/* Remove button */
.mg-cart-btn-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(220, 53, 69, 0.3);
    background: rgba(220, 53, 69, 0.05);
    color: #dc3545;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.mg-cart-btn-remove:hover {
    background: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
    transform: rotate(90deg);
}

/* Table Footer Row */
.mg-cart-table tfoot {
    background: #fbf8f2;
    border-top: 2px solid rgba(212, 175, 55, 0.3);
}

.mg-cart-table tfoot td {
    padding: 14px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #241c14;
    border: none;
}

/* ================================================================
   CART SUMMARY CARD
   ================================================================ */
.mg-cart-summary-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

.mg-summary-header {
    background: linear-gradient(135deg, #2b2118 0%, #1a130d 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mg-summary-header h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1dfb8;
    margin: 0;
    letter-spacing: 0.5px;
}

.mg-summary-body {
    padding: 20px;
}

.mg-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    color: #555555;
    margin-bottom: 14px;
}

.mg-summary-row.total-row {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a1a1a;
    border-top: 1px dashed rgba(212, 175, 55, 0.4);
    padding-top: 14px;
    margin-top: 14px;
    margin-bottom: 0;
}

.mg-summary-row.total-row .total-amount {
    color: #a8802a;
    font-size: 1.25rem;
}

.mg-summary-footer {
    padding: 0 20px 20px 20px;
}

.mg-btn-checkout {
    background: linear-gradient(135deg, #d4af37 0%, #a8802a 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.5px !important;
    padding: 14px 20px !important;
    border-radius: 30px !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(168, 128, 42, 0.35) !important;
    transition: all 0.25s ease !important;
    text-transform: uppercase !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.mg-btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(168, 128, 42, 0.45) !important;
    color: #ffffff !important;
}

.mg-btn-checkout-disabled {
    background: #e0d8cc !important;
    color: #8c8275 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

.mg-checkout-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #7b746d;
    margin-top: 12px;
    text-align: center;
}

/* ================================================================
   MOBILE RESPONSIVE CARD STYLES (< 768px)
   ================================================================ */
@media (max-width: 767.98px) {
    .mg-cart-wrap {
        padding-top: 12px !important;
        padding-bottom: 95px !important; /* Space above mobile bottom nav */
        overflow-x: hidden !important;
    }

    .mg-cart-wrap .row {
        margin-left: -6px !important;
        margin-right: -6px !important;
    }

    .mg-cart-wrap .col-12 {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .customer-portal-header {
        padding: 16px 0 !important;
    }

    .customer-portal-header h1 {
        font-size: 1.25rem !important;
    }

    /* Transform Table to Cards on Mobile */
    .mg-cart-table,
    .mg-cart-table thead,
    .mg-cart-table tbody,
    .mg-cart-table tfoot,
    .mg-cart-table tr,
    .mg-cart-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .mg-cart-table thead,
    .mg-cart-table tfoot {
        display: none !important;
    }

    .mg-cart-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        margin-bottom: 10px !important;
    }

    .mg-cart-table tbody tr {
        background: #ffffff !important;
        border: 1px solid rgba(212, 175, 55, 0.25) !important;
        border-radius: 14px !important;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04) !important;
        margin-bottom: 14px !important;
        padding: 14px !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Remove button on Mobile */
    .mg-cart-table td.td-remove {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
        z-index: 2 !important;
    }

    .mg-cart-btn-remove {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }

    /* Product Header on Mobile */
    .mg-cart-table td.td-product {
        padding: 0 36px 12px 0 !important;
        border-bottom: 1px solid #f2ede4 !important;
        text-align: left !important;
    }

    .mg-cart-product-cell {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .mg-cart-thumb {
        width: 58px !important;
        height: 58px !important;
        border-radius: 8px !important;
    }

    .mg-cart-p-title {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        margin-bottom: 3px !important;
    }

    /* Specs Grid for Weight, Rate, Labour */
    .mg-cart-mobile-specs {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid #f2ede4 !important;
    }

    .mg-spec-box {
        background: #faf8f5;
        border-radius: 8px;
        padding: 6px 10px;
        border: 1px solid #f0ede6;
    }

    .mg-spec-label {
        font-size: 0.7rem;
        color: #7b746d;
        text-transform: uppercase;
        font-weight: 600;
        display: block;
        margin-bottom: 2px;
    }

    .mg-spec-value {
        font-size: 0.85rem;
        font-weight: 700;
        color: #2b2118;
    }

    .mg-spec-sub {
        font-size: 0.68rem;
        color: #928b84;
    }

    /* Subtotal Pill on Mobile */
    .mg-cart-table td.td-total {
        padding: 10px 0 0 0 !important;
        border: none !important;
        text-align: right !important;
    }

    .mg-mobile-total-pill {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        background: #faf4e6 !important;
        border: 1px solid rgba(212, 175, 55, 0.3) !important;
        border-radius: 10px !important;
        padding: 8px 12px !important;
    }

    .mg-mobile-total-label {
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        color: #614917 !important;
    }

    .mg-mobile-total-val {
        font-size: 1.05rem !important;
        font-weight: 800 !important;
        color: #8c671a !important;
    }

    /* Hide desktop-only elements inside td */
    .mg-cart-table td.td-quantity,
    .mg-cart-table td.td-rate,
    .mg-cart-table td.td-labour {
        display: none !important;
    }

    /* Summary Card on Mobile */
    .mg-cart-summary-card {
        margin-top: 10px !important;
        border-radius: 14px !important;
    }
}
