/**
 * Copyright © MageWeb. All rights reserved.
 * See LICENSE.txt for license details.
 *
 * MageWeb cart drawer. Colours, radii and sizes are custom properties: override them on
 * .mw-cart in the theme instead of editing this file. The drawer inherits the theme's font.
 */

.mw-cart {
    --mw-cart-width: 480px;
    --mw-cart-width-desktop: 500px;
    /* Share of the screen the drawer may cover; below 100% the page stays visible beside it. */
    --mw-cart-screen-share: 90vw;
    --mw-cart-screen-share-desktop: 100vw;
    --mw-cart-gutter: 16px;
    --mw-cart-gutter-desktop: 20px;
    --mw-cart-bg: #fff;
    --mw-cart-fg: #1a1a1a;
    --mw-cart-muted: #6b6b6b;
    --mw-cart-faint: #9a9a9a;
    --mw-cart-detail: #8b8b8b;
    --mw-cart-border: #e6e6e6;
    --mw-cart-radius: 8px;
    --mw-cart-image-bg: #f3f2ee;
    --mw-cart-image-size: 65px;
    --mw-cart-image-size-desktop: 85px;
    --mw-cart-primary-bg: #1a1a1a;
    --mw-cart-primary-fg: #fff;
    --mw-cart-save: #1d7a45;
    --mw-cart-special: #c8102e;
    --mw-cart-error: #b3261e;
    --mw-cart-progress: #1d7a45;
    --mw-cart-backdrop: rgba(0, 0, 0, 0.4);
    --mw-cart-duration: 300ms;
    --mw-cart-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dialog shell: a full-height panel on the inline end of the screen */

dialog.mw-cart {
    box-sizing: border-box;
    position: fixed;
    inset: 0 0 0 auto;
    width: min(var(--mw-cart-screen-share), var(--mw-cart-width));
    max-width: 100vw;
    height: 100%;
    max-height: 100%;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--mw-cart-bg);
    color: var(--mw-cart-fg);
    font: inherit;
    line-height: 1.4;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform var(--mw-cart-duration) var(--mw-cart-ease);
}

dialog.mw-cart[open] {
    display: flex;
}

dialog.mw-cart[data-state="open"] {
    transform: translateX(0);
}

[dir="rtl"] dialog.mw-cart {
    inset: 0 auto 0 0;
    margin: 0 auto 0 0;
    transform: translateX(-100%);
}

[dir="rtl"] dialog.mw-cart[data-state="open"] {
    transform: translateX(0);
}

dialog.mw-cart::backdrop {
    background: var(--mw-cart-backdrop);
    opacity: 0;
    transition: opacity var(--mw-cart-duration) ease;
}

dialog.mw-cart[data-state="open"]::backdrop {
    opacity: 1;
}

html.mw-cart-locked {
    overflow: hidden;
    padding-inline-end: var(--mw-cart-scrollbar, 0);
}

.mw-cart *,
.mw-cart *::before,
.mw-cart *::after {
    box-sizing: border-box;
}

/* Neutralise theme element styles (Luma styles bare buttons, inputs, links and list items)
   so the drawer looks the same on every theme. */

.mw-cart .mw-cart-button,
.mw-cart .mw-cart-button:hover,
.mw-cart .mw-cart-button:focus,
.mw-cart .mw-cart-button:active {
    box-shadow: none;
    text-shadow: none;
}

.mw-cart .mw-cart-item,
.mw-cart .mw-cart-rec {
    margin: 0;
}

.mw-cart dt,
.mw-cart dd {
    font-weight: inherit;
}

.mw-cart button {
    line-height: 1;
    vertical-align: middle;
}

.mw-cart .mw-cart-qty__input:focus,
.mw-cart .mw-cart-coupon__input:focus {
    box-shadow: none;
}

.mw-cart .mw-cart-link,
.mw-cart .mw-cart-link:visited,
.mw-cart .mw-cart-link:hover,
.mw-cart .mw-cart-item__name,
.mw-cart .mw-cart-item__name:visited,
.mw-cart .mw-cart-rec__name,
.mw-cart .mw-cart-rec__name:visited {
    color: inherit;
}

.mw-cart a.mw-cart-button--primary,
.mw-cart a.mw-cart-button--primary:visited,
.mw-cart a.mw-cart-button--primary:hover {
    color: var(--mw-cart-primary-fg);
    text-decoration: none;
}

.mw-cart .mw-cart__panel {
    display: flex;
    outline: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* With a sticky summary only the body scrolls, and the summary stays in view */

dialog.mw-cart--sticky .mw-cart__panel {
    overflow: hidden;
}

dialog.mw-cart--sticky .mw-cart__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mw-cart .mw-cart__body {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    padding: 0 var(--mw-cart-gutter);
}

.mw-cart .mw-cart-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mw-cart .mw-cart-icon {
    display: block;
    flex: none;
}

/* Buttons and links */

.mw-cart .mw-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.mw-cart .mw-cart-button:disabled,
.mw-cart .mw-cart-button[aria-disabled="true"] {
    cursor: default;
    opacity: 0.35;
}

.mw-cart .mw-cart-button:focus-visible,
.mw-cart .mw-cart-link:focus-visible,
.mw-cart .mw-cart-qty__input:focus-visible,
.mw-cart .mw-cart-coupon__input:focus-visible {
    outline: 2px solid var(--mw-cart-fg);
    outline-offset: 2px;
}

.mw-cart .mw-cart-button--icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.mw-cart .mw-cart-button--icon:not(:disabled):hover {
    background: rgba(0, 0, 0, 0.05);
}

.mw-cart .mw-cart-button--primary {
    min-height: 52px;
    padding: 0 24px;
    border-radius: 4px;
    background: var(--mw-cart-primary-bg);
    color: var(--mw-cart-primary-fg);
    font-weight: 600;
}

.mw-cart .mw-cart-button--primary:hover {
    opacity: 0.9;
}

.mw-cart .mw-cart-button--secondary {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--mw-cart-fg);
    border-radius: 4px;
    font-weight: 600;
}

.mw-cart .mw-cart-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* Header */

.mw-cart .mw-cart__header {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px var(--mw-cart-gutter);
    border-bottom: 1px solid var(--mw-cart-border);
}

.mw-cart .mw-cart__title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
}

.mw-cart .mw-cart__count {
    margin-inline-start: 4px;
    color: var(--mw-cart-muted);
    font-size: 15px;
    font-weight: 400;
}

.mw-cart .mw-cart__displayed {
    margin: 8px var(--mw-cart-gutter) 0;
    color: var(--mw-cart-muted);
    font-size: 13px;
}

/* Free delivery and promotions */

.mw-cart .mw-cart-delivery {
    flex: none;
    margin: 12px var(--mw-cart-gutter) 0;
}

.mw-cart .mw-cart-delivery__message {
    margin: 0 0 8px;
    font-size: 14px;
}

.mw-cart .mw-cart-delivery[data-qualified="true"] .mw-cart-delivery__message {
    color: var(--mw-cart-save);
    font-weight: 600;
}

.mw-cart .mw-cart-delivery__track {
    height: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: var(--mw-cart-border);
}

.mw-cart .mw-cart-delivery__bar {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--mw-cart-progress);
    transition: width 400ms var(--mw-cart-ease);
}

.mw-cart .mw-cart-promo {
    flex: none;
    margin: 12px var(--mw-cart-gutter) 0;
    padding: 10px 12px;
    border-radius: var(--mw-cart-radius);
    background: var(--mw-cart-image-bg);
    font-size: 14px;
}

.mw-cart .mw-cart-cms {
    padding: 16px 0 0;
}

/* Empty cart */

.mw-cart .mw-cart__empty {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px var(--mw-cart-gutter);
    color: var(--mw-cart-faint);
    text-align: center;
}

.mw-cart .mw-cart__empty-title {
    margin: 0;
    color: var(--mw-cart-fg);
    font-size: 20px;
    font-weight: 600;
}

.mw-cart .mw-cart__empty .mw-cart-button--primary {
    min-width: 220px;
}

/* Product rows */

.mw-cart .mw-cart__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mw-cart .mw-cart-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--mw-cart-border);
    transition: opacity 150ms ease;
}

.mw-cart .mw-cart-item[data-busy="true"] {
    opacity: 0.55;
}

.mw-cart .mw-cart-item__image {
    display: block;
    flex: none;
    width: var(--mw-cart-image-size);
    height: var(--mw-cart-image-size);
    overflow: hidden;
    border: 1px solid var(--mw-cart-border);
    border-radius: var(--mw-cart-radius);
    background: var(--mw-cart-bg);
}

.mw-cart .mw-cart-item__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mw-cart .mw-cart-item__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.mw-cart .mw-cart-item__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mw-cart .mw-cart-item__name {
    min-width: 0;
    color: inherit;
    font-size: 14px;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.mw-cart a.mw-cart-item__name:hover {
    text-decoration: underline;
}

.mw-cart .mw-cart-price {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px 8px;
    margin: 0;
    font-size: 14px;
    text-align: end;
    white-space: nowrap;
}

.mw-cart .mw-cart-price--stacked {
    flex-direction: column;
    align-items: flex-end;
}

.mw-cart .mw-cart-price__original {
    color: var(--mw-cart-faint);
    font-size: 14px;
}

.mw-cart .mw-cart-item__options {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    margin: 0;
    color: var(--mw-cart-detail);
    font-size: 12px;
}

.mw-cart .mw-cart-item__options div {
    display: flex;
    gap: 0 4px;
}

/* Options share one line: "Size: S, Color: Green" */
.mw-cart .mw-cart-item__options div:not(:last-child)::after {
    content: ",";
    margin-inline-start: -4px;
}

.mw-cart .mw-cart-item__options dt,
.mw-cart .mw-cart-item__options dd {
    margin: 0;
    font-weight: 400;
}

.mw-cart .mw-cart-item__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}

.mw-cart .mw-cart-item__remove {
    color: var(--mw-cart-muted);
}

.mw-cart .mw-cart-item__message {
    margin: 0;
    color: var(--mw-cart-error);
    font-size: 13px;
}

/* Quantity controls */

.mw-cart .mw-cart-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mw-cart .mw-cart-qty__step {
    width: 32px;
    height: 32px;
}

.mw-cart .mw-cart-qty__input {
    width: 52px;
    height: 38px;
    margin: 0;
    padding: 0 4px;
    border: 1px solid var(--mw-cart-border);
    border-radius: var(--mw-cart-radius);
    background: var(--mw-cart-bg);
    color: var(--mw-cart-detail);
    font: inherit;
    font-size: 14px;
    line-height: normal;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.mw-cart .mw-cart-qty__input::-webkit-outer-spin-button,
.mw-cart .mw-cart-qty__input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.mw-cart .mw-cart-qty--input .mw-cart-qty__input {
    width: 64px;
}

/* Plus / minus: one rounded box holding minus, the quantity and plus */
.mw-cart .mw-cart-qty--plus_minus {
    gap: 0;
    height: 42px;
    padding: 0 3px;
    border: 1px solid var(--mw-cart-border);
    border-radius: 10px;
    background: var(--mw-cart-bg);
}

.mw-cart .mw-cart-qty--plus_minus:focus-within {
    border-color: var(--mw-cart-muted);
}

.mw-cart .mw-cart-qty--plus_minus .mw-cart-qty__step {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.mw-cart .mw-cart-qty--plus_minus .mw-cart-qty__input,
.mw-cart .mw-cart-qty--plus_minus .mw-cart-qty__input:focus {
    width: 40px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.mw-cart .mw-cart-qty--plus_minus .mw-cart-qty__input:focus-visible {
    outline: none;
}

.mw-cart .mw-cart-qty__arrows {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mw-cart .mw-cart-qty__arrow {
    width: 24px;
    height: 18px;
    border: 1px solid var(--mw-cart-border);
    border-radius: 4px;
}

/* Recommendations */

.mw-cart .mw-cart-recs {
    --mw-cart-recs-gap: 12px;
    --mw-cart-recs-visible: var(--mw-cart-recs-mobile, 1);
    margin-top: auto;
    padding: 24px 0 16px;
}

.mw-cart .mw-cart-recs__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.mw-cart .mw-cart-recs__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.mw-cart .mw-cart-recs__arrows {
    display: flex;
    gap: 8px;
}

.mw-cart .mw-cart-recs__arrow {
    width: 40px;
    height: 40px;
    border: 1px solid var(--mw-cart-border);
    border-radius: 50%;
}

.mw-cart .mw-cart-recs__arrow:not(:disabled) {
    border-color: var(--mw-cart-muted);
}

[dir="rtl"] .mw-cart .mw-cart-recs__arrow .mw-cart-icon {
    transform: scaleX(-1);
}

.mw-cart .mw-cart-recs__track {
    display: flex;
    gap: var(--mw-cart-recs-gap);
    margin: 0 calc(var(--mw-cart-gutter) * -1);
    padding: 0 var(--mw-cart-gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--mw-cart-gutter);
    scrollbar-width: none;
    list-style: none;
}

.mw-cart .mw-cart-recs__track::-webkit-scrollbar {
    display: none;
}

/* Each card leaves part of the next one showing, so it is clear the row scrolls. */
.mw-cart .mw-cart-rec {
    display: flex;
    flex: 0 0 calc((100% - var(--mw-cart-recs-gap) * var(--mw-cart-recs-visible)) / (var(--mw-cart-recs-visible) + 0.45));
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--mw-cart-border);
    border-radius: var(--mw-cart-radius);
    scroll-snap-align: start;
}

.mw-cart .mw-cart-rec__image {
    display: block;
    flex: none;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--mw-cart-image-bg);
}

.mw-cart .mw-cart-rec__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.mw-cart .mw-cart-rec__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mw-cart .mw-cart-rec__name {
    display: -webkit-box;
    overflow: hidden;
    color: inherit;
    font-size: 14px;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mw-cart .mw-cart-rec__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 8px;
    margin: 0;
    font-size: 14px;
}

.mw-cart .mw-cart-rec__price[data-special="true"] .mw-cart-rec__final {
    color: var(--mw-cart-special);
}

.mw-cart .mw-cart-rec__original {
    color: var(--mw-cart-faint);
    font-size: 14px;
}

.mw-cart .mw-cart-rec__from {
    color: var(--mw-cart-muted);
}

.mw-cart .mw-cart-rec__choose {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    align-self: flex-start;
    margin-top: 2px;
    font-size: 13px;
    text-decoration: none;
}

.mw-cart .mw-cart-rec__choose:hover {
    text-decoration: underline;
}

[dir="rtl"] .mw-cart .mw-cart-rec__choose .mw-cart-icon {
    transform: scaleX(-1);
}

.mw-cart .mw-cart-rec__message {
    margin: 2px 0 0;
    color: var(--mw-cart-error);
    font-size: 12px;
}

.mw-cart .mw-cart-rec__add {
    flex: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--mw-cart-fg);
    border-radius: 50%;
}

.mw-cart .mw-cart-rec__add:not(:disabled):hover {
    background: var(--mw-cart-primary-bg);
    color: var(--mw-cart-primary-fg);
}

.mw-cart .mw-cart-recs__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.mw-cart .mw-cart-recs__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: var(--mw-cart-border);
    cursor: pointer;
    transition: width 200ms ease, background-color 200ms ease;
}

.mw-cart .mw-cart-recs__dot[aria-current="true"] {
    width: 24px;
    background: var(--mw-cart-fg);
}

/* Summary */

.mw-cart .mw-cart__summary {
    flex: none;
    padding: 12px var(--mw-cart-gutter) max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--mw-cart-border);
    background: var(--mw-cart-bg);
}

.mw-cart .mw-cart-coupon {
    margin-bottom: 12px;
    font-size: 14px;
}

.mw-cart .mw-cart-coupon__applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mw-cart .mw-cart-coupon__form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.mw-cart .mw-cart-coupon__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--mw-cart-border);
    border-radius: 4px;
    background: var(--mw-cart-bg);
    color: inherit;
    font: inherit;
    line-height: normal;
}

.mw-cart .mw-cart-coupon__message {
    margin: 8px 0 0;
    color: var(--mw-cart-save);
}

.mw-cart .mw-cart-coupon__message[data-error="true"] {
    color: var(--mw-cart-error);
}

.mw-cart .mw-cart-totals {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.mw-cart .mw-cart-totals__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
}

.mw-cart .mw-cart-totals__row dt,
.mw-cart .mw-cart-totals__row dd {
    margin: 0;
}

/* Long discount names wrap; amounts always stay on one line. */
.mw-cart .mw-cart-totals__row dt {
    min-width: 0;
    overflow-wrap: anywhere;
}

.mw-cart .mw-cart-totals__row dd {
    flex: none;
    text-align: end;
    white-space: nowrap;
}

.mw-cart .mw-cart-totals__row--shipping dd[data-pending="true"] {
    color: var(--mw-cart-muted);
}

.mw-cart .mw-cart-totals__row--grand {
    font-weight: 600;
}

.mw-cart .mw-cart-totals__row--shipping {
    align-items: center;
}

.mw-cart .mw-cart-totals__row--shipping dt {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--mw-cart-muted);
}

.mw-cart .mw-cart-totals__row--savings {
    color: var(--mw-cart-save);
}

.mw-cart .mw-cart__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 12px;
}

.mw-cart .mw-cart-button--checkout {
    min-height: 56px;
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mw-cart .mw-cart__cart-link {
    align-self: center;
    font-size: 16px;
}

/* Desktop */

@media (min-width: 768px) {
    .mw-cart {
        --mw-cart-width: var(--mw-cart-width-desktop);
        --mw-cart-screen-share: var(--mw-cart-screen-share-desktop);
        --mw-cart-gutter: var(--mw-cart-gutter-desktop);
        --mw-cart-image-size: var(--mw-cart-image-size-desktop);
    }

    .mw-cart .mw-cart__header {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .mw-cart .mw-cart__count {
        font-size: 16px;
    }

    .mw-cart .mw-cart-item {
        gap: 20px;
        padding: 18px 0;
    }

    .mw-cart .mw-cart-item__body {
        gap: 8px;
    }

    .mw-cart .mw-cart-qty__input {
        width: 58px;
        height: 40px;
    }

    .mw-cart .mw-cart-recs__arrow {
        width: 48px;
        height: 48px;
    }

    .mw-cart .mw-cart-rec {
        gap: 16px;
        padding: 14px;
    }

    .mw-cart .mw-cart-rec__image {
        width: 104px;
        height: 104px;
    }

    .mw-cart .mw-cart-rec__add {
        width: 64px;
        height: 64px;
    }

    .mw-cart .mw-cart__actions {
        gap: 16px;
        margin-top: 16px;
    }

    .mw-cart .mw-cart-button--checkout {
        min-height: 72px;
        font-size: 19px;
    }

}

@media (prefers-reduced-motion: reduce) {
    dialog.mw-cart,
    dialog.mw-cart::backdrop,
    .mw-cart .mw-cart-delivery__bar,
    .mw-cart .mw-cart-recs__dot {
        transition: none;
    }

    .mw-cart .mw-cart-recs__track {
        scroll-behavior: auto;
    }
}
