/* ================================================================
   MyGiftsCorner - Cart Page Styles
   Matches checkout page design system
   ================================================================ */

/* --- Hide default page title/banner --- */
body.woocommerce-cart .entry-hero-container-inner,
body.woocommerce-cart .entry-header {
    display: none !important;
}

/* --- Wrapper --- */
.mgc-cart-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 15px 60px;
}

/* --- Progress Bar (shared with checkout) --- */
.mgc-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 20px 0 10px;
}

.mgc-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}

.mgc-progress-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: #e8e8e8;
    color: #999;
    border: 2px solid #e8e8e8;
}

.mgc-progress-step.completed .mgc-progress-circle {
    background: #2D7D46;
    border-color: #2D7D46;
    color: #fff;
    font-size: 15px;
}

.mgc-progress-step.active .mgc-progress-circle {
    background: #8B6F47;
    border-color: #8B6F47;
    color: #fff;
}

.mgc-progress-label {
    font-size: 12px;
    font-weight: 500;
    color: #999;
}

.mgc-progress-step.completed .mgc-progress-label {
    color: #2D7D46;
}

.mgc-progress-step.active .mgc-progress-label {
    color: #8B6F47;
    font-weight: 600;
}

.mgc-progress-line {
    width: 60px;
    height: 3px;
    background: #e8e8e8;
    border-radius: 2px;
    margin-bottom: 20px;
}

.mgc-progress-line.active {
    background: #2D7D46;
}

/* --- Card Base --- */
.mgc-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 22px 24px 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.mgc-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 18px 0 !important;
    padding: 0 0 14px 0 !important;
    border-bottom: 1px solid #f0f0f0;
}

/* --- Trust Card --- */
.mgc-trust-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px !important;
}

.mgc-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
}

.mgc-trust-item span:first-child {
    font-size: 16px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

/* --- Heading --- */
.mgc-cart-heading {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
}

.mgc-cart-count {
    font-size: 16px;
    font-weight: 400;
    color: #888;
}

/* --- Grid --- */
.mgc-cart-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 26px;
    align-items: start;
}

/* --- Right Column Sticky --- */
.mgc-cart-right {
    position: sticky;
    top: 20px;
}

/* --- Cart Items Card --- */
.mgc-cart-items-card {
    padding-bottom: 10px !important;
}

/* --- Individual Cart Item --- */
.mgc-cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.mgc-cart-item:last-of-type {
    border-bottom: none;
}

/* Image */
.mgc-cart-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.mgc-cart-item-image img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.mgc-cart-item-image a {
    display: block;
}

/* Details */
.mgc-cart-item-details {
    flex: 1;
    min-width: 0;
}

.mgc-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 4px;
}

.mgc-cart-item-name a {
    color: #1a1a1a;
    text-decoration: none;
}

.mgc-cart-item-name a:hover {
    color: #8B6F47;
}

.mgc-cart-item-price {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* Quantity */
.mgc-cart-item-qty {
    flex-shrink: 0;
    width: 80px;
}

body.woocommerce-cart .mgc-cart-item-qty .quantity {
    display: flex;
    align-items: center;
    border: 1.5px solid #d4d4d4;
    border-radius: 8px;
    overflow: hidden;
    height: 38px;
}

body.woocommerce-cart .mgc-cart-item-qty .quantity input.qty {
    width: 36px !important;
    height: 36px !important;
    text-align: center !important;
    border: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    -moz-appearance: textfield;
    -webkit-appearance: none;
}

body.woocommerce-cart .mgc-cart-item-qty .quantity input.qty::-webkit-inner-spin-button,
body.woocommerce-cart .mgc-cart-item-qty .quantity input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Subtotal */
.mgc-cart-item-subtotal {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: right;
    min-width: 70px;
}

/* Remove button */
.mgc-cart-item-remove {
    position: absolute;
    top: 10px;
    right: 0;
}

.mgc-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #999 !important;
    font-size: 12px;
    text-decoration: none !important;
    transition: all 0.2s;
    line-height: 1;
}

.mgc-remove-btn:hover {
    background: #fee;
    color: #c0392b !important;
}

/* --- Coupon Row --- */
.mgc-coupon-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mgc-coupon-row input.input-text {
    flex: 1;
    padding: 10px 14px !important;
    border: 1.5px solid #d4d4d4 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #fafafa !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
}

.mgc-coupon-row input.input-text:focus {
    border-color: #8B6F47 !important;
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1) !important;
    outline: none !important;
    background: #fff !important;
}

.mgc-apply-coupon-btn {
    padding: 10px 20px !important;
    background: #8B6F47 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    min-height: 44px !important;
    white-space: nowrap !important;
    transition: background 0.2s !important;
}

.mgc-apply-coupon-btn:hover {
    background: #74593a !important;
}

/* --- Cart Actions --- */
.mgc-cart-actions {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

.mgc-update-cart-btn {
    padding: 10px 20px !important;
    background: #f5f5f5 !important;
    color: #555 !important;
    border: 1.5px solid #d4d4d4 !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.mgc-update-cart-btn:hover {
    background: #eee !important;
    border-color: #bbb !important;
}

.mgc-update-cart-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* --- Continue Shopping --- */
.mgc-continue-shopping {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: #8B6F47;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.mgc-continue-shopping:hover {
    color: #74593a;
    text-decoration: underline;
}

/* --- Cart Totals (Right Side) --- */
body.woocommerce-cart .cart-collaterals {
    width: 100% !important;
    float: none !important;
}

body.woocommerce-cart .cart_totals {
    width: 100% !important;
    float: none !important;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 22px 24px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-bottom: 18px;
}

body.woocommerce-cart .cart_totals > h2 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 16px 0 !important;
    padding: 0 0 12px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    text-transform: none !important;
}

body.woocommerce-cart .cart_totals table {
    border: none !important;
    margin: 0 !important;
}

body.woocommerce-cart .cart_totals table th,
body.woocommerce-cart .cart_totals table td {
    padding: 10px 0 !important;
    border: none !important;
    border-bottom: 1px solid #f5f5f5 !important;
    font-size: 14px !important;
    vertical-align: middle !important;
}

body.woocommerce-cart .cart_totals table th {
    font-weight: 500 !important;
    color: #666 !important;
    text-align: left !important;
    width: 40% !important;
}

body.woocommerce-cart .cart_totals table td {
    text-align: right !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
}

body.woocommerce-cart .cart_totals .order-total th,
body.woocommerce-cart .cart_totals .order-total td {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    padding-top: 14px !important;
    border-bottom: none !important;
}

/* Shipping section inside totals */
body.woocommerce-cart .cart_totals .shipping th {
    vertical-align: top !important;
    padding-top: 12px !important;
}

body.woocommerce-cart .cart_totals .shipping td {
    text-align: right !important;
}

body.woocommerce-cart .cart_totals .shipping ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.woocommerce-cart .cart_totals .shipping li {
    margin-bottom: 4px !important;
    font-size: 13px !important;
}

body.woocommerce-cart .cart_totals .shipping li label {
    font-weight: 500 !important;
}

/* Checkout button */
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout {
    padding: 0 !important;
    margin-top: 16px !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    display: block !important;
    width: 100% !important;
    padding: 15px 20px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    background: #2D7D46 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: background 0.25s, transform 0.1s !important;
    min-height: 52px !important;
    box-sizing: border-box !important;
    line-height: 1.3 !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background: #246838 !important;
    transform: translateY(-1px) !important;
}

/* --- Cross-Sells --- */
body.woocommerce-cart .cross-sells {
    width: 100% !important;
    float: none !important;
    margin-top: 24px;
}

body.woocommerce-cart .cross-sells > h2 {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-bottom: 16px !important;
}

/* --- WooCommerce Notices --- */
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-message {
    border-radius: 8px !important;
    font-size: 13px !important;
    padding: 12px 16px !important;
    margin-bottom: 14px !important;
}

body.woocommerce-cart .woocommerce-message {
    background: #f0f8f0 !important;
    border: 1px solid #c3e6c3 !important;
    border-left: 3px solid #2D7D46 !important;
}

/* --- Empty Cart --- */
body.woocommerce-cart .cart-empty {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}

body.woocommerce-cart .return-to-shop a {
    display: inline-block;
    padding: 14px 28px;
    background: #8B6F47;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 16px;
    transition: background 0.2s;
}

body.woocommerce-cart .return-to-shop a:hover {
    background: #74593a;
}

/* ===================== MOBILE ===================== */
@media (max-width: 860px) {
    .mgc-cart-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .mgc-cart-right {
        position: static !important;
    }

    .mgc-cart-item {
        flex-wrap: wrap;
        gap: 10px;
        padding-right: 30px;
    }

    .mgc-cart-item-image {
        width: 65px;
        height: 65px;
    }

    .mgc-cart-item-image img {
        width: 65px !important;
        height: 65px !important;
    }

    .mgc-cart-item-details {
        flex: 1;
        min-width: 120px;
    }

    .mgc-cart-item-qty {
        width: 70px;
    }

    .mgc-cart-item-subtotal {
        min-width: auto;
    }

    .mgc-coupon-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .mgc-cart-wrapper {
        padding: 10px 10px 40px !important;
    }

    .mgc-cart-heading {
        font-size: 24px;
    }

    .mgc-cart-item-name {
        font-size: 13px;
    }

    .mgc-cart-item-subtotal {
        font-size: 14px;
    }

    body.woocommerce-cart .cart_totals {
        padding: 16px 14px !important;
    }

    body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
        min-height: 50px !important;
        font-size: 15px !important;
    }
}