/* Cart page (cartitem.aspx), inside DWCMaster.master. The whole cart (item rows, order
   summary, empty message) is HTML returned by cartitem.aspx/BindCartDetails and put into
   #dvCartDetails by script, so it is styled through the class names that method emits
   (.shopping-cart, .column-labels, .product, .product-*, .cart-summery-right, .totals-item ...).
   Shared colours come from css/beyoung-theme.css */

.cart-page
{
    padding: 8px 0 50px;
    font-family: var(--by-font);
    color: var(--by-text);
}

.cart-page .cart-container
{
    width: auto;
    max-width: 1172px;
    margin: 0 auto;
    padding: 0 16px;
}

.cart-head
{
    margin: 14px 0 24px;
}

.cart-title
{
    margin: 0;
    padding: 0;
    font-family: var(--by-font);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.3px;
    line-height: 1.25;
    color: var(--by-text);
}

.cart-title:after
{
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin-top: 12px;
    border-radius: 3px;
    background: var(--by-gradient);
}

/* ---------- Layout: items on the left, order summary on the right ---------- */
.cart-page #dvCartDetails
{
    display: flex;
    align-items: flex-start;
}

.cart-page #dvCartDetails > .col-sm-9
{
    flex: 1 1 0;
    float: none;
    width: auto;
    min-width: 0;
    padding: 0;
}

.cart-page #dvCartDetails > .cart-summery-right
{
    flex: 0 0 340px;
    position: -webkit-sticky;
    position: sticky;
    top: 124px;
    float: none;
    width: 340px;
    margin: 0 0 0 26px;
    padding: 0;
}

/* ---------- Item list ---------- */
.cart-page .shopping-cart
{
    min-height: 0;
    height: auto;
    margin: 0;
    border: 1px solid var(--by-border-soft);
    border-radius: var(--by-radius-lg);
    background: #fff;
    box-shadow: 0 4px 14px rgba(63, 20, 86, 0.07);
    overflow: hidden;
}

.cart-page .shopping-cart hr, .cart-page .shopping-cart .clear
{
    display: none;
}

/* the header row and every item row share one column grid */
.cart-page .column-labels, .cart-page .product
{
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 104px 96px 44px 112px;
    grid-column-gap: 16px;
    align-items: center;
    padding: 16px 20px;
}

.cart-page .column-labels > *, .cart-page .product > *
{
    float: none;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.cart-page .column-labels
{
    height: auto;
    padding-top: 13px;
    padding-bottom: 13px;
    border: 0;
    border-bottom: 1px solid var(--by-border-soft);
    background: #faf7fc;
}

.cart-page .column-labels label
{
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--by-text-muted);
}

.cart-page .column-labels .product-image
{
    visibility: hidden;
}

.cart-page .column-labels .product-quantity,
.cart-page .column-labels .product-removal
{
    text-align: center;
}

.cart-page .column-labels .product-line-price, .cart-page .product .product-line-price
{
    text-align: right;
}

.cart-page .product
{
    border-bottom: 1px solid var(--by-border-soft);
}

.cart-page .product:last-child
{
    border-bottom: 0;
}

.cart-page .product .product-image img
{
    display: block;
    width: 68px;
    height: 68px;
    padding: 4px;
    border: 1px solid var(--by-border-soft);
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
}

.cart-page .product .product-title
{
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--by-text);
}

.cart-page .product .product-description:empty
{
    display: none;
}

.cart-page .product .product-price
{
    font-size: 14px;
    color: var(--by-text-muted);
}

.cart-page .product .product-quantity
{
    text-align: center;
}

.cart-page .product .product-quantity input
{
    width: 76px;
    height: 40px;
    margin: 0;
    padding: 0 6px 0 10px;
    border: 1px solid var(--by-border);
    border-radius: var(--by-radius);
    background: #fff;
    font-family: var(--by-font);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: var(--by-text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cart-page .product .product-quantity input:focus
{
    border-color: var(--by-primary);
    box-shadow: var(--by-focus-ring);
}

.cart-page .product .product-removal
{
    text-align: center;
}

.cart-page .product .remove-product
{
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 15px;
    color: #8a7f94;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.cart-page .product .remove-product:hover
{
    background: var(--by-danger-bg);
    color: var(--by-danger);
}

.cart-page .product .product-line-price
{
    font-size: 15.5px;
    font-weight: 700;
    color: var(--by-primary);
}

/* ---------- Order summary ---------- */
/* The server writes "Continue Shopping" above the heading and puts the grand total outside
   the inner wrapper. The card is a flex column and the inner wrapper is dissolved
   (display: contents) so the rows can be ordered: heading, amounts, total, button. */
.cart-page .summery-right-in
{
    display: flex;
    flex-direction: column;
    float: none;
    width: auto;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--by-border-soft);
    border-radius: var(--by-radius-lg);
    background: #fff;
    box-shadow: 0 4px 14px rgba(63, 20, 86, 0.07);
}

.cart-page .total-summery
{
    display: contents;
}

.cart-page .total-and-price:empty
{
    display: none;
}

.cart-page .total-summery h4
{
    order: -1;
    margin: 0 0 6px;
    padding: 0 0 12px !important;
    border-bottom: 1px solid var(--by-border-soft);
    font-family: var(--by-font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .8px;
    color: var(--by-primary-dark);
}

.cart-page .totals-item
{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    float: none;
    width: auto;
    margin: 0;
    padding: 9px 0;
    border: 0;
    background: none;
}

.cart-page .totals-item:before, .cart-page .totals-item:after
{
    display: none;
}

.cart-page .totals-item label
{
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--by-text-soft);
}

.cart-page .totals-item .totals-value
{
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 14.5px;
    font-weight: 600;
    text-align: right;
    color: var(--by-text);
}

.cart-page .totals-item.totals-item-total
{
    order: 5;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--by-border-soft);
}

.cart-page .totals-item.totals-item-total label
{
    font-size: 16px;
    font-weight: 700;
    color: var(--by-text);
}

.cart-page .totals-item.totals-item-total .totals-value
{
    font-size: 22px;
    font-weight: 700;
    color: var(--by-primary);
}

/* buttons: "PLACE ORDER" is the main action, "Continue Shopping" the quiet one below it */
.cart-page .continue-shop
{
    display: block;
    float: none;
    width: auto;
    height: 52px;
    margin: 16px 0 0;
    padding: 0 16px;
    border: 0;
    border-radius: var(--by-radius);
    background: var(--by-primary);
    background-image: var(--by-gradient);
    box-shadow: 0 10px 22px rgba(142, 31, 122, 0.3);
    font-family: var(--by-font);
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: .6px;
    line-height: 52px;
    text-align: center;
    text-decoration: none;
    color: #fff !important;
    transition: box-shadow .15s ease, filter .15s ease, transform .15s ease;
}

.cart-page .continue-shop:hover, .cart-page .continue-shop:focus
{
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(142, 31, 122, 0.38);
    filter: brightness(1.08);
}

.cart-page #btnOrderPlace
{
    order: 10;
    display: block;
    float: none;
    width: auto;
    height: 46px;
    margin: 12px 0 0;
    padding: 0 16px;
    border: 0;
    border-radius: var(--by-radius);
    background: #fff;
    box-shadow: inset 0 0 0 1.5px var(--by-primary);
    font-family: var(--by-font);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 46px;
    text-align: center;
    color: var(--by-primary) !important;
    transition: background-color .15s ease;
}

.cart-page #btnOrderPlace:hover
{
    background: #f6eef5;
}

/* ---------- Empty cart ---------- */
.cart-page #dvCartDetails > .align-middle
{
    flex: 1 1 auto;
    padding: 56px 20px 26px;
    border: 1px dashed #cdb9d6;
    border-bottom: 0;
    border-radius: var(--by-radius-lg) var(--by-radius-lg) 0 0;
    background: #fff;
}

.cart-page #dvCartDetails > .align-middle h1
{
    margin: 0;
    font-family: var(--by-font);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .3px;
    line-height: 1.4;
}

.cart-page #dvCartDetails > .align-middle h1 i
{
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #f6eef5;
    font-size: 34px;
    line-height: 84px;
    color: var(--by-primary);
}

/* the "start shopping" block under the message is in the page markup and only shows for an empty cart */
.cart-empty-cta
{
    display: none;
    padding: 0 20px 52px;
    border: 1px dashed #cdb9d6;
    border-top: 0;
    border-radius: 0 0 var(--by-radius-lg) var(--by-radius-lg);
    background: #fff;
    text-align: center;
}

.cart-page #dvCartDetails:has(> .align-middle) + .cart-empty-cta
{
    display: block;
}

.cart-empty-cta p
{
    margin: 0 0 20px;
    font-family: var(--by-font);
    font-size: 15px;
    color: var(--by-text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px)
{
    .cart-page #dvCartDetails
    {
        display: block;
    }

    .cart-page #dvCartDetails > .cart-summery-right
    {
        position: static;
        width: auto;
        margin: 22px 0 0;
    }
}

@media (max-width: 767px)
{
    .cart-title
    {
        font-size: 24px;
    }

    .cart-page .column-labels
    {
        display: none;
    }

    /* each item: photo on the left, name + remove on top, then price, quantity and line total */
    .cart-page .product
    {
        grid-template-columns: 64px minmax(0, 1fr) auto;
        grid-template-areas:
            "img title rm"
            "img price total"
            "img qty   total";
        grid-column-gap: 14px;
        grid-row-gap: 6px;
        align-items: start;
        padding: 16px;
    }

    .cart-page .product .product-image
    {
        grid-area: img;
    }

    .cart-page .product .product-image img
    {
        width: 64px;
        height: 64px;
        margin: 0;
    }

    .cart-page .product .product-detailss
    {
        grid-area: title;
    }

    .cart-page .product .product-price
    {
        grid-area: price;
    }

    .cart-page .product .product-quantity
    {
        grid-area: qty;
        text-align: left;
    }

    .cart-page .product .product-quantity:before
    {
        content: none;
    }

    .cart-page .product .product-quantity input
    {
        margin: 2px 0 0;
    }

    .cart-page .product .product-removal
    {
        grid-area: rm;
        margin-top: -8px;
    }

    .cart-page .product .product-line-price
    {
        grid-area: total;
        align-self: end;
        padding-bottom: 8px;
    }

    .cart-page .product .product-line-price:before
    {
        content: none;
    }
}
