/**
 * Copyright © MageWeb. All rights reserved.
 * See LICENSE.txt for license details.
 *
 * MageWeb cart page additions. The rows and summary keep the theme's own styling; these rules
 * cover only what MageWeb adds. Override the custom properties in the theme to restyle.
 */

:root {
    --mw-cart-page-muted: #6b6b6b;
    --mw-cart-page-faint: #9a9a9a;
    --mw-cart-page-border: #e6e6e6;
    --mw-cart-page-save: #1d7a45;
    --mw-cart-page-progress: #1d7a45;
    --mw-cart-page-promo-bg: #f3f2ee;
    --mw-cart-page-radius: 8px;
}

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

.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;
}

/* Quantity controls */

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

.mw-cart-qty .control.qty {
    margin: 0;
}

.mw-cart-qty__input {
    width: 64px;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.mw-cart-qty .mw-cart-qty__step,
.mw-cart-qty .mw-cart-qty__arrow,
.mw-cart-qty .mw-cart-qty__step:hover,
.mw-cart-qty .mw-cart-qty__arrow:hover,
.mw-cart-qty .mw-cart-qty__step:focus,
.mw-cart-qty .mw-cart-qty__arrow:focus,
.mw-cart-qty .mw-cart-qty__step:active,
.mw-cart-qty .mw-cart-qty__arrow:active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
}

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

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

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

.mw-cart-qty .mw-cart-qty__arrow,
.mw-cart-qty .mw-cart-qty__arrow:hover,
.mw-cart-qty .mw-cart-qty__arrow:focus {
    width: 26px;
    height: 20px;
    border: 1px solid var(--mw-cart-page-border);
    border-radius: 4px;
}

.mw-cart-qty .mw-cart-qty__step:disabled,
.mw-cart-qty .mw-cart-qty__arrow:disabled {
    cursor: default;
    opacity: 0.35;
}

.mw-cart-qty .mw-cart-qty__step:focus-visible,
.mw-cart-qty .mw-cart-qty__arrow:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Automatic updates replace the update button once the page's JavaScript is running */

.mw-cart-auto-update [data-cart-item-update],
.mw-cart-auto-update .action.update {
    display: none;
}

.mw-cart-updating {
    opacity: 0.6;
    transition: opacity 150ms ease;
}

/* Prices */

.mw-cart-page-price {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0 8px;
}

.mw-cart-page-price__original {
    color: var(--mw-cart-page-faint);
    font-weight: 400;
}

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

/* Free delivery and promotions */

.mw-cart-page-notices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.mw-cart-page-delivery__message {
    margin: 0 0 8px;
}

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

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

.mw-cart-page-delivery__bar {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--mw-cart-page-progress);
}

.mw-cart-page-promo {
    margin: 0;
    padding: 12px 16px;
    border-radius: var(--mw-cart-page-radius);
    background: var(--mw-cart-page-promo-bg);
}

.mw-cart-page-cms {
    margin-top: 24px;
}

/* Free shipping, shown above the theme's totals on Luma */

.mw-cart-page-shipping {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
}

.mw-cart-page-shipping dt,
.mw-cart-page-shipping dd {
    margin: 0;
    font-weight: inherit;
}

.mw-cart-page-shipping dt {
    color: var(--mw-cart-page-muted);
}

/* Savings, shown under the theme's totals */

.mw-cart-page-savings {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    color: var(--mw-cart-page-save);
    font-weight: 600;
}

.mw-cart-page-savings dt,
.mw-cart-page-savings dd {
    margin: 0;
    font-weight: inherit;
}
