/* ─── Elixira Cart Page Redesign Styles ─── */

/* 1. Free Shipping Progress Bar */
.elixira-cart-progress-container {
    background: #f6f6f6;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 30px;
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box;
}

.elixira-cart-progress-header {
    margin-bottom: 12px;
    font-size: 14.5px;
    font-weight: 500;
    color: #111;
    display: flex;
    justify-content: space-between;
}

.elixira-cart-highlight {
    font-weight: 700;
    color: #111;
}

.elixira-cart-highlight-free {
    font-weight: 700;
    color: #2d6a4f;
}

.elixira-cart-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 100px;
    overflow: hidden;
}

.elixira-cart-progress-bar-fill {
    height: 100%;
    background: #111;
    border-radius: 100px;
    transition: width 0.4s ease;
}

/* 2. Empty Cart Redesign */
.elixira-empty-cart-container {
    text-align: center;
    padding: 80px 20px;
    font-family: 'Outfit', sans-serif;
    max-width: 480px;
    margin: 0 auto;
}

.elixira-empty-cart-icon {
    color: #888;
    margin-bottom: 24px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.elixira-empty-cart-title {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    margin: 0 0 12px 0;
}

.elixira-empty-cart-subtitle {
    font-size: 15px;
    color: #666;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.elixira-empty-cart-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #111;
    color: #fff !important;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.2s ease;
}

.elixira-empty-cart-btn:hover {
    background: #333;
    transform: translateY(-2px);
}

/* Hide standard woocommerce notifications on empty cart */
.woocommerce-info,
.woocommerce-cart .woocommerce > .return-to-shop {
    display: none !important;
}


/* Hide Astra theme default header breadcrumbs on cart page if necessary */
.woocommerce-cart .woocommerce-breadcrumb {
    display: none !important;
}

/* 3. Main Cart Grid Layout */
.woocommerce-cart .woocommerce {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
}

.elixira-cart-progress-container,
.woocommerce-notices-wrapper,
.elixira-cart-cross-sells {
    width: 100% !important;
    flex: 0 0 100% !important;
    box-sizing: border-box;
}

.elixira-cart-progress-container {
    margin-bottom: 10px !important;
}



/* Forms (items table) on left, Collaterals (totals) on right */
.woocommerce-cart .woocommerce-cart-form {
    flex: 0 0 calc(65% - 20px) !important;
    max-width: calc(65% - 20px) !important;
    margin: 0 !important;
}

.woocommerce-cart .cart-collaterals {
    flex: 0 0 calc(35% - 20px) !important;
    max-width: calc(35% - 20px) !important;
    margin: 0 !important;
    position: sticky;
    top: 100px;
}


/* 4. Table Styling Redesign */
.woocommerce-cart table.shop_table {
    border: none !important;
    border-collapse: separate !important;
    border-spacing: 0 16px !important;
    width: 100%;
}

.woocommerce-cart table.shop_table thead {
    display: none !important; /* Muted header for cleaner grid */
}

.woocommerce-cart table.shop_table tr {
    background: #f6f6f6 !important;
    border-radius: 16px !important;
}

.woocommerce-cart table.shop_table td {
    border: none !important;
    padding: 24px 16px !important;
    vertical-align: middle !important;
    font-family: 'Outfit', sans-serif !important;
}

/* Product Remove icon */
.woocommerce-cart table.shop_table td.product-remove {
    padding-left: 24px !important;
    width: 30px;
}

.woocommerce-cart table.shop_table td.product-remove a {
    color: #888 !important;
    font-size: 20px !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.woocommerce-cart table.shop_table td.product-remove a:hover {
    color: #111 !important;
}

/* Product Thumbnail */
.woocommerce-cart table.shop_table td.product-thumbnail {
    width: 80px;
}

.woocommerce-cart table.shop_table td.product-thumbnail img {
    width: 70px !important;
    height: 70px !important;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    mix-blend-mode: multiply;
}

/* Product Name */
.woocommerce-cart table.shop_table td.product-name {
    font-size: 16px;
    font-weight: 600;
}

.woocommerce-cart table.shop_table td.product-name a {
    color: #111 !important;
    text-decoration: none !important;
}

.woocommerce-cart table.shop_table td.product-name a:hover {
    color: #444 !important;
}

/* Product Price */
.woocommerce-cart table.shop_table td.product-price {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

/* Quantity Cell override */
.woocommerce-cart table.shop_table td.product-quantity {
    width: 120px;
}

.woocommerce-cart table.shop_table td.product-quantity .quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid #111;
    border-radius: 100px;
    padding: 4px 8px;
    background: #fff;
    justify-content: space-between;
}

.woocommerce-cart table.shop_table td.product-quantity .quantity .elixira-qty-btn {
    background: none !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    color: #111 !important;
    padding: 0 10px !important;
    margin: 0 !important;
    height: auto !important;
    width: auto !important;
    min-width: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-radius: 0 !important;
}

.woocommerce-cart table.shop_table td.product-quantity .quantity .elixira-qty-btn:hover {
    color: #555 !important;
    background: none !important;
}

.woocommerce-cart table.shop_table td.product-quantity .quantity input.qty {
    border: none !important;
    width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    padding: 0 !important;
    background: none;
    margin: 0 !important;
}

.woocommerce-cart table.shop_table td.product-quantity .quantity input::-webkit-outer-spin-button,
.woocommerce-cart table.shop_table td.product-quantity .quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Subtotal */
.woocommerce-cart table.shop_table td.product-subtotal {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    text-align: right;
    padding-right: 24px !important;
}

/* 5. Coupon & Update actions at bottom of table */
.woocommerce-cart table.shop_table td.actions {
    background: transparent !important;
    padding: 16px 0 !important;
}

.woocommerce-cart table.shop_table td.actions .coupon {
    display: flex;
    gap: 12px;
    float: left;
    align-items: center;
}

.woocommerce-cart table.shop_table td.actions .coupon input#coupon_code {
    border: 1.5px solid #eaeaea !important;
    border-radius: 10px !important;
    padding: 11px 16px !important;
    font-size: 13.5px !important;
    font-family: 'Outfit', sans-serif !important;
    width: 180px !important;
    height: auto !important;
    background: #fff !important;
}

.woocommerce-cart table.shop_table td.actions .coupon input#coupon_code:focus {
    border-color: #111 !important;
}

.woocommerce-cart table.shop_table td.actions button[name="update_cart"] {
    float: right;
    background: transparent !important;
    color: #111 !important;
    border: 1.5px solid #111 !important;
    border-radius: 10px !important;
    padding: 11px 24px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.woocommerce-cart table.shop_table td.actions button[name="update_cart"]:hover {
    background: rgba(17, 17, 17, 0.05) !important;
}

/* 6. Cart Totals Collateral Box */
.woocommerce-cart .cart-collaterals .cart_totals {
    width: 100% !important;
    background: #f6f6f6;
    border-radius: 20px;
    padding: 30px;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

.woocommerce-cart .cart-collaterals .cart_totals h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0 0 24px 0;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 12px;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table {
    border-spacing: 0 !important;
    margin-bottom: 24px !important;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr {
    background: transparent !important;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr td,
.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr th {
    padding: 12px 0 !important;
    font-size: 14.5px;
    color: #444;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr th {
    font-weight: 500;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr td {
    text-align: right;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr.order-total th {
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr.order-total td strong {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

/* Proceed to Checkout button styling */
.woocommerce-cart .cart-collaterals .cart_totals .wc-proceed-to-checkout {
    padding: 0 !important;
}

.woocommerce-cart .cart-collaterals .cart_totals .wc-proceed-to-checkout a.checkout-button {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    background: #111 !important;
    color: #fff !important;
    padding: 15px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
}

.woocommerce-cart .cart-collaterals .cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
    background: #333 !important;
    transform: translateY(-1px);
}

/* 7. Cross-sells Accessories styling */
.elixira-cart-cross-sells {
    width: 100%;
    margin-top: 50px;
    border-top: 1px solid #eaeaea;
    padding-top: 40px;
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box;
}

.elixira-cross-sells-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 24px;
}

.elixira-cross-sells-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.elixira-cross-sell-card {
    background: #f6f6f6;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
    position: relative;
}

.elixira-cross-sell-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none !important;
    flex: 1;
}

.elixira-cross-sell-img-wrapper {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.elixira-cross-sell-img-wrapper img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.elixira-cross-sell-details {
    display: flex;
    flex-direction: column;
}

.elixira-cross-sell-name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin: 0 0 4px 0;
}

.elixira-cross-sell-price {
    font-size: 13.5px;
    color: #666;
}

.elixira-cross-sell-add-btn {
    background: #111;
    color: #fff !important;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s ease;
    cursor: pointer;
}

.elixira-cross-sell-add-btn:hover {
    background: #333;
}

.elixira-cross-sell-add-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 8. Mobile Responsiveness */
@media (max-width: 991px) {
    .woocommerce-cart .woocommerce {
        flex-direction: column !important;
        gap: 30px !important;
    }

    .woocommerce-cart .woocommerce-cart-form,
    .woocommerce-cart .cart-collaterals {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .woocommerce-cart .cart-collaterals {
        position: static !important;
    }

    .elixira-cross-sells-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 767px) {
    .woocommerce-cart table.shop_table tr td {
        padding: 16px 12px !important;
    }

    /* Convert tables to cards on very small devices */
    .woocommerce-cart table.shop_table tr {
        display: block !important;
        background: #fff !important;
        border: 1px solid #eaeaea !important;
        border-radius: 16px !important;
        padding: 16px !important;
        margin-bottom: 16px !important;
        position: relative !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    }

    .woocommerce-cart table.shop_table tr td {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        padding: 6px 0 !important;
        border: none !important;
        box-sizing: border-box !important;
    }

    /* Thumbnail on top-left */
    .woocommerce-cart table.shop_table tr td.product-thumbnail {
        width: 80px !important;
        height: 80px !important;
        float: left !important;
        margin-right: 16px !important;
        padding: 0 !important;
    }
    
    .woocommerce-cart table.shop_table tr td.product-thumbnail img {
        width: 80px !important;
        height: 80px !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }

    /* Name next to thumbnail */
    .woocommerce-cart table.shop_table tr td.product-name {
        width: calc(100% - 110px) !important;
        float: left !important;
        padding: 0 !important;
        padding-right: 30px !important;
        margin-bottom: 8px !important;
        box-sizing: border-box !important;
    }

    .woocommerce-cart table.shop_table tr td.product-name a {
        font-size: 16px !important;
        font-weight: 600 !important;
        color: #111 !important;
        display: block !important;
        line-height: 1.3 !important;
    }

    /* Cross delete button on top-right */
    .woocommerce-cart table.shop_table tr td.product-remove {
        position: absolute !important;
        top: 16px !important;
        right: 16px !important;
        width: auto !important;
        padding: 0 !important;
        z-index: 10 !important;
    }

    .woocommerce-cart table.shop_table tr td.product-remove a {
        font-size: 18px !important;
        color: #999 !important;
    }

    /* Price and Quantity */
    .woocommerce-cart table.shop_table tr td.product-price,
    .woocommerce-cart table.shop_table tr td.product-quantity {
        width: calc(100% - 96px) !important;
        float: right !important;
        clear: none !important;
        padding: 4px 0 !important;
    }

    /* Clear float after name/thumbnail/price/quantity block */
    .woocommerce-cart table.shop_table tr td.product-subtotal {
        width: 100% !important;
        clear: both !important;
        border-top: 1px dashed #eaeaea !important;
        margin-top: 12px !important;
        padding-top: 12px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Custom labels styling */
    .woocommerce-cart table.shop_table tr td::before {
        content: attr(data-title) ": " !important;
        font-weight: 500 !important;
        color: #666 !important;
        font-family: 'Outfit', sans-serif !important;
        display: inline-block !important;
        float: none !important;
        margin-right: 8px !important;
    }

    /* Hide labels for thumbnail, name, actions, and remove */
    .woocommerce-cart table.shop_table tr td.product-thumbnail::before,
    .woocommerce-cart table.shop_table tr td.product-name::before,
    .woocommerce-cart table.shop_table tr td.product-remove::before,
    .woocommerce-cart table.shop_table tr td.actions::before {
        display: none !important;
    }

    /* Quantity input wrapper alignment */
    .woocommerce-cart table.shop_table tr td.product-quantity .quantity {
        display: inline-flex !important;
        vertical-align: middle !important;
    }

    .woocommerce-cart table.shop_table td.actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        width: 100% !important;
        padding: 16px 0 !important;
    }

    .woocommerce-cart table.shop_table td.actions .coupon {
        width: 100% !important;
        display: flex !important;
        gap: 10px !important;
    }

    .woocommerce-cart table.shop_table td.actions .coupon input#coupon_code {
        width: 60% !important;
        margin: 0 !important;
    }

    .woocommerce-cart table.shop_table td.actions .coupon button[name="apply_coupon"] {
        width: 40% !important;
        margin: 0 !important;
    }

    .woocommerce-cart table.shop_table td.actions button[name="update_cart"] {
        width: 100% !important;
    }

    .elixira-cross-sells-grid {
        grid-template-columns: 1fr !important;
    }

    .woocommerce-cart .cart-collaterals .cart_totals {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        box-sizing: border-box !important;
    }

    .woocommerce-cart .cart-collaterals .cart_totals table.shop_table {
        width: 100% !important;
    }
}
