/* ═══════════════════════════════════════════════════════════
   Motivarto – Cart Page Redesign
   Clean, calm, card-based cart – same style as checkout
   ═══════════════════════════════════════════════════════════ */

/* ── Hide original table when JS is active ────────────── */
body.mp-cart-active .woocommerce-cart-form__contents {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   Cards Container
   ═══════════════════════════════════════════════════════════ */
.mp-cart-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════
   Product Card
   ═══════════════════════════════════════════════════════════ */
.mp-cart-card {
    background: #FFFFFF;
    border: 1px solid #EAEAEA;
    border-radius: 12px;
    padding: 14px 16px;
    position: relative;
}

/* ── Remove button (top-right ×) ──────────────────────── */
.mp-cart-card__remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc !important;
    text-decoration: none !important;
    border-radius: 50%;
    transition: color 150ms ease, background 150ms ease;
    z-index: 1;
}

.mp-cart-card__remove:hover {
    color: #e74c3c !important;
    background: #FFF0F0;
}

/* ── Card body: thumbnail + details side by side ──────── */
.mp-cart-card__body {
    display: flex;
    gap: 12px;
    padding-right: 28px; /* space for remove button */
}

.mp-cart-card__thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    display: block;
}

.mp-cart-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mp-cart-card__details {
    flex: 1;
    min-width: 0;
}

.mp-cart-card__name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a !important;
    text-decoration: none !important;
    line-height: 1.35;
    display: block;
    margin-bottom: 4px;
}

.mp-cart-card__name:hover {
    color: #555 !important;
}

/* ── Compact options ──────────────────────────────────── */
.mp-cart-card__options {
    margin-bottom: 6px;
}

.mp-cart-card__option {
    font-size: 13px;
    color: #777;
    line-height: 1.5;
}

/* ── Price (reuses shared .mp-price classes) ──────────── */
.mp-cart-card__price {
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   Card Footer: Quantity Stepper + Edit Link
   ═══════════════════════════════════════════════════════════ */
.mp-cart-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #F5F5F5;
}

/* ── Quantity Stepper ─────────────────────────────────── */
.mp-cart-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.mp-cart-stepper__btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F8F8;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
    color: #555;
    transition: background 150ms ease;
    padding: 0;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}

.mp-cart-stepper__btn:hover {
    background: #EFEFEF;
}

.mp-cart-stepper__btn:active {
    background: #E5E5E5;
}

/* The moved qty input sits between the two buttons */
.mp-cart-stepper .mp-cart-stepper__val {
    width: 40px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #EAEAEA;
    border-right: 1px solid #EAEAEA;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff;
    padding: 0;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.mp-cart-stepper .mp-cart-stepper__val::-webkit-inner-spin-button,
.mp-cart-stepper .mp-cart-stepper__val::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Edit link (secondary) ────────────────────────────── */
.mp-cart-card__edit {
    font-size: 12px;
    color: #b0b0b0 !important;
    text-decoration: none !important;
    transition: color 150ms ease;
}

.mp-cart-card__edit:hover,
.mp-cart-card__edit:focus {
    color: #777 !important;
    text-decoration: underline !important;
}

/* ═══════════════════════════════════════════════════════════
   Actions: Coupon + Update Cart
   ═══════════════════════════════════════════════════════════ */
.mp-cart-actions {
    margin-bottom: 24px;
}

/* ── Coupon toggle ────────────────────────────────────── */
.mp-cart-coupon__toggle {
    display: inline-block;
    font-size: 13px;
    color: #999 !important;
    text-decoration: none !important;
    margin-bottom: 10px;
    transition: color 150ms ease;
}

.mp-cart-coupon__toggle:hover {
    color: #666 !important;
}

.mp-cart-coupon__toggle::before {
    content: '＋';
    display: inline-block;
    margin-right: 4px;
    font-size: 11px;
    transition: transform 200ms ease;
}

.mp-cart-coupon__toggle.mp-active::before {
    content: '−';
}

/* ── Coupon form ──────────────────────────────────────── */
.mp-cart-coupon__form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mp-cart-coupon__form input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    outline: none;
    background: #fff;
    transition: border-color 200ms ease;
    min-width: 0;
}

.mp-cart-coupon__form input[type="text"]:focus {
    border-color: #ccc;
}

.mp-cart-coupon__form input[type="text"]::placeholder {
    color: #bbb;
}

.mp-cart-coupon__form button {
    padding: 10px 16px;
    background: #F8F8F8;
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    transition: background 150ms ease, border-color 150ms ease;
}

.mp-cart-coupon__form button:hover {
    background: #EFEFEF;
    border-color: #ddd;
}

/* ── Update Cart button ───────────────────────────────── */
.mp-cart-actions__update {
    margin-top: 8px;
}

.mp-cart-actions__update button {
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
    border: none;
}

.mp-cart-actions__update button[disabled] {
    background: #F5F5F5;
    color: #ccc;
    cursor: default;
    box-shadow: none;
}

.mp-cart-actions__update button:not([disabled]) {
    background: #1a1a1a;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mp-cart-actions__update button:not([disabled]):hover {
    background: #333;
}

/* ═══════════════════════════════════════════════════════════
   Cart Totals Section (.cart_totals)
   ═══════════════════════════════════════════════════════════ */
body.mp-cart-active .cart_totals {
    margin-top: 0;
}

body.mp-cart-active .cart_totals > h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px;
    text-transform: none;
    letter-spacing: 0;
}

body.mp-cart-active .cart_totals .shop_table {
    background: #FFFFFF;
    border: 1px solid #EAEAEA !important;
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    margin-bottom: 16px;
}

body.mp-cart-active .cart_totals .shop_table th,
body.mp-cart-active .cart_totals .shop_table td {
    padding: 14px 16px;
    border-top: 1px solid #F0F0F0;
    font-size: 14px;
    color: #555;
    vertical-align: middle;
    background: transparent;
}

body.mp-cart-active .cart_totals .shop_table tr:first-child th,
body.mp-cart-active .cart_totals .shop_table tr:first-child td {
    border-top: none;
}

body.mp-cart-active .cart_totals .shop_table th {
    font-weight: 500;
    color: #888;
    background: transparent;
}

body.mp-cart-active .cart_totals .order-total th {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

body.mp-cart-active .cart_totals .order-total td {
    font-size: 16px;
    font-weight: 700;
}

/* Shipping row inside totals */
body.mp-cart-active .cart_totals .shipping td {
    font-size: 13px;
    color: #888;
}

body.mp-cart-active .cart_totals .shipping label {
    font-size: 13px;
    color: #888;
}

/* ── Proceed to Checkout Button ───────────────────────── */
body.mp-cart-active .wc-proceed-to-checkout {
    padding: 0;
}

body.mp-cart-active .wc-proceed-to-checkout a.checkout-button {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.4;
    border: none !important;
    border-radius: 12px;
    background: #F39C12 !important;
    color: #fff !important;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 200ms ease, transform 100ms ease;
    -webkit-appearance: none;
    appearance: none;
    text-transform: none;
    box-shadow: 0 2px 10px rgba(243, 156, 18, 0.3);
    box-sizing: border-box;
}

body.mp-cart-active .wc-proceed-to-checkout a.checkout-button:hover {
    background: #E08E0B !important;
}

body.mp-cart-active .wc-proceed-to-checkout a.checkout-button:active {
    transform: scale(0.985);
}

/* ═══════════════════════════════════════════════════════════
   Responsive – Larger screens
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
    .mp-cart-card {
        padding: 16px 18px;
    }

    .mp-cart-card__thumb {
        width: 80px;
        height: 80px;
    }

    .mp-cart-card__body {
        gap: 16px;
    }
}
