/* --------------------------------------------------
   PHASE 7: SLIDE CART
   Editorial, Calm, Minimalist
-------------------------------------------------- */

:root {
    --cart-width: 440px;
    --cart-bg: #F9F8F6;
    /* Warm off-white */
    --cart-text: #1A1A1A;
    --cart-meta: #757575;
    --cart-anim: 0.18s ease-out;
    --z-overlay: 99990;
    --z-cart: 99991;
}

/* 1. CONTAINER & GEOMETRY */
#slide-cart {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: var(--cart-width);
    max-width: 92vw;
    background: var(--cart-bg);
    z-index: var(--z-cart);
    transform: translateX(100%);
    transition: transform var(--cart-anim);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

#slide-cart.open {
    transform: translateX(0);
}

/* 1b. OVERLAY */
#slide-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(2px);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--cart-anim), visibility var(--cart-anim);
}

#slide-cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

body.slide-cart-open {
    overflow: hidden;
}


/* 2. INNER LAYOUT */
.weequb-slide-cart-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--cart-text);
}

.widget_shopping_cart_content {
    height: 100%;
    display: block;
}

#slide-cart .widget_shopping_cart_content,
#slide-cart .weequb-slide-cart-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}


/* 3. HEADER */
.cart-header-row {
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.cart-title {
    font-family: var(--font-serif, sans-serif);
    font-size: 24px;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    color: var(--cart-text);
}

.cart-meta-line {
    font-family: var(--font-sans, sans-serif);
    font-size: 13px;
    color: var(--cart-meta);
    margin-top: 8px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.close-slide-cart {
    background: transparent;
    border: none;
    font-family: var(--font-sans, sans-serif);
    font-size: 13px;
    color: var(--cart-text);
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 20px;
    transition: background 0.2s;
    outline: none;
    box-shadow: none;
}

.close-slide-cart:hover {
    background: rgba(0, 0, 0, 0.06);
}


/* 4. CONTENT SCROLL AREA */
.cart-items-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 32px;
    -webkit-overflow-scrolling: touch;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #E0E0E0;
    border-radius: 3px;
}


/* 5. ITEM LIST (STRUCTURAL FIX) */
ul.cart-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

li.wee-cart-item {
    position: relative;
    padding: 24px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);

    /* FLEX ROOT */
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

li.wee-cart-item:last-child {
    border-bottom: none;
}

/* Child 1: Image */
.wee-cart-item__image {
    flex-shrink: 0;
}

.wee-cart-item__image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0;
    background: #f0f0f0;
    display: block;
}

/* Child 2: Info (Grow) */
.wee-cart-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 2px;
}

h3.wee-cart-item__title {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
    color: var(--cart-text);
}

h3.wee-cart-item__title a {
    color: inherit;
    text-decoration: none;
}

.product-variant-meta {
    font-size: 13px;
    color: var(--cart-meta);
}

/* KEY FIX: PRICE ROW */
.wee-cart-item__price-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
}

.wee-cart-item__price {
    font-size: 14px;
    font-weight: 600;
    color: var(--cart-text);
}

/* Quantity Pill */
.wee-cart-item__qty {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #EBEBEB;
    border-radius: 100px;
    height: 30px;
    min-width: 70px;
    padding: 0 4px;
    gap: 0;
    justify-content: space-between;
}

.qty-btn {
    width: 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 300;
    color: var(--cart-meta);
    text-decoration: none;
    line-height: normal;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.qty-btn:hover {
    color: var(--cart-text);
}

.qty-value {
    font-size: 13px;
    width: 22px;
    text-align: center;
    font-weight: 500;
    line-height: normal;
    font-variant-numeric: tabular-nums;
}

.quantity-pill.updating {
    opacity: 0.5;
    pointer-events: none;
}

/* 6. UPSELL SECTION */
.cart-upsell-section {
    margin-top: 32px;
    margin-bottom: 32px;
}

h4.upsell-title {
    font-size: 13px;
    color: var(--cart-meta);
    margin: 0 0 16px 0;
    font-weight: 500;
}

.upsell-scroll-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.upsell-scroll-container::-webkit-scrollbar {
    display: none;
}

.upsell-card {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upsell-image {
    width: 140px;
    height: 140px;
    background: #fff;
    display: block;
}

.upsell-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upsell-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upsell-name {
    font-size: 13px;
    line-height: 1.3;
    color: var(--cart-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upsell-price {
    font-size: 13px;
    color: var(--cart-meta);
}

.upsell-add-btn {
    margin-top: 8px;
    font-size: 12px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--cart-text);
    color: var(--cart-text);
    text-align: center;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.upsell-add-btn:hover {
    background: var(--cart-text);
    color: #fff;
}


/* 7. FOOTER */
.cart-footer-block {
    padding: 32px;
    background: var(--cart-bg);
    flex-shrink: 0;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--cart-text);
}

.cart-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkout-button,
.view-cart-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 2px;
    /* App-like sharp/soft */
    transition: all 0.2s;
    border: 1px solid transparent;
}

.checkout-button {
    background: #1A1A1A;
    color: #fff;
}

.checkout-button:hover {
    opacity: 0.9;
    background: #000;
}

.view-cart-button {
    background: transparent;
    border: 1px solid var(--cart-text);
    color: var(--cart-text);
}

.view-cart-button:hover {
    background: var(--cart-text);
    color: white;
}

/* 8. EMPTY STATE */
.cart-empty-state {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.empty-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: var(--cart-meta);
}

.empty-message {
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.btn-soft {
    border-bottom: 1px solid var(--cart-text);
    color: var(--cart-text);
    text-decoration: none;
    padding-bottom: 2px;
    font-weight: 500;
}


/* -------------------------------------------------- */
/* PHASE 5: MOBILE UX OPTIMIZATION                   */
/* -------------------------------------------------- */

@media (max-width: 767px) {
    :root {
        /* Faster animation for mobile (<300ms perceived time) */
        --cart-anim: 0.12s ease-out;
    }

    #slide-cart {
        /* Full width on mobile for better UX */
        max-width: 100vw;
        width: 100vw;
    }

    /* Prevent iOS bounce scroll when cart is open */
    body.slide-cart-open {
        position: fixed;
        width: 100%;
        overflow: hidden;
    }

    /* Adjust padding for mobile */
    .cart-header-row {
        padding: 20px 24px;
    }

    .cart-items-scroll-area {
        padding: 0 24px;
    }

    .cart-footer-block {
        padding: 24px;
    }
}