/* Mobile-First Cart Design */
:root {
    --primary: #0062CC;
    --primary-hover: #004fb3;
    --bg: #E6ECFD;
    --surface: #fff;
    --text-main: #1A1C21;
    --text-muted: #64748B;
    --danger: #EF4444;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 10px 25px -5px rgba(0, 98, 204, .08);
    --transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

.woo-cart-page {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    /* animation: fadeIn .6s ease-out; Moved animation to wrap to prevent full page flash */
}

.woo-cart-wrap {
    width: 100%;
    max-width: 480px;
    animation: fadeIn .6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.woo-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.woo-cart-header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.5px;
    margin: 0;
}

.woo-clear-cart {
    background: none;
    border: none;
    color: var(--danger);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
}

.woo-clear-cart:hover {
    opacity: .7;
}

.woo-cart-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.woo-cart-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.woo-cart-item {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.woo-cart-item:hover {
    transform: scale(1.01);
}

/* UPDATED: Original Aspect Ratio for Images */
.woo-cart-img {
    width: 80px;
    /* Fixed width for consistency */
    height: auto;
    /* Natural height */
    border-radius: 12px;
    background: #f1f5f9;
    object-fit: contain;
    /* Ensure image isn't cropped if standard restrictions apply elsewhere */
    align-self: flex-start;
    /* Prevent stretching if flex container aligns stretch */
}

.woo-cart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.woo-cart-title {
    font-weight: 800;
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
}

.woo-cart-title a {
    color: inherit;
    text-decoration: none;
}

.woo-cart-title a:hover {
    color: var(--primary);
}

.woo-cart-subtotal {
    color: var(--primary);
    font-weight: 800;
    font-size: 15px;
}

.woo-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 10px;
    width: fit-content;
}

.woo-qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #fff;
    border-radius: 6px;
    color: var(--primary);
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
    transition: var(--transition);
}

.woo-qty-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.woo-qty input.qty {
    width: 54px;
    border: 0;
    background: transparent;
    text-align: center;
    font-weight: 700;
    outline: none;
    -moz-appearance: textfield;
}

.woo-qty input.qty::-webkit-outer-spin-button,
.woo-qty input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.woo-remove {
    align-self: flex-start;
    text-decoration: none;
    color: var(--danger);
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
    transition: var(--transition);
}

.woo-remove:hover {
    opacity: .75;
}

.woo-coupon {
    background: var(--surface);
    padding: 8px 8px 8px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.woo-coupon input {
    border: none;
    outline: none;
    flex: 1;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background: transparent;
}

.woo-apply-btn {
    background: var(--bg);
    color: var(--primary);
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.woo-apply-btn:hover {
    transform: translateY(-1px);
}

.woo-summary {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.woo-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.woo-summary-total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px dashed #f1f5f9;
    color: var(--text-main);
    font-weight: 900;
    font-size: 20px;
    display: flex;
    justify-content: space-between;
}

.woo-checkout-bar {
    width: 100%;
    max-width: 100%;
    margin-top: 16px;
    /* Removed fixed position styles per user request */
}


.woo-checkout-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 98, 204, .3);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.woo-checkout-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.woo-empty {
    text-align: center;
    padding: 60px 20px;
    background: transparent;
}

/* Processing State for AJAX */
.woo-cart-list.processing,
.woo-cart-sidebar.processing {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Desktop layout upgrade */
@media(min-width: 900px) {
    .woo-cart-page {
        align-items: flex-start;
        padding-top: 60px;
    }

    .woo-cart-wrap {
        max-width: 1100px;
        padding: 0 40px 40px;
    }

    .woo-cart-header {
        margin-bottom: 40px;
    }

    .woo-cart-header h1 {
        font-size: 32px;
    }

    .woo-cart-layout {
        grid-template-columns: 1fr 380px;
        gap: 48px;
        align-items: start;
    }

    .woo-cart-sidebar {
        position: sticky;
        top: 40px;
    }

    .woo-checkout-bar {
        position: static;
        transform: none;
        padding: 0;
        background: none;
        max-width: 100%;
    }

    .woo-cart-img {
        width: 100px;
        /* height: 100px; REMOVED per user request */
    }

    .woo-cart-item {
        padding: 24px;
    }
}