/*
 * Cart card (Magento_Theme/templates/html/sr-mcart.phtml, web/js/satrunner-cart.js), modelled on unit1gear.com's
 * cart. Below 1024px it grows out of the floating header pill (like the menu card); on Desktop it hangs under the
 * bar on the right, 400px wide, in the same frosted glass. Docs: docs/cart.html.
 * Selectors start with .page-wrapper where they meet Luma's styles-l.css, which loads after this file.
 */

/* Luma's mini cart dropdown is replaced by the card */
.page-wrapper .page-header .minicart-wrapper .block-minicart {
    display: none !important;
}

.page-wrapper .sr-mcart[hidden] {
    display: none;
}

.page-wrapper .sr-mcart:not([hidden]) {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-height: calc(100vh - 84px);
    max-height: calc(100dvh - 84px);
    color: #0d0d0d;
    animation: sr-mcart-in 0.48s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-wrapper .sr-mcart:focus {
    outline: 0;
}

@keyframes sr-mcart-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ---------- Title ---------- */
.sr-mcart__head {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 20px 12px;
}

.page-wrapper .sr-mcart .sr-mcart__title {
    margin: 0;
    color: #0d0d0d;
    font-family: 'Barlow', sans-serif;
    font-size: 2.4rem;
    font-weight: 500;
    line-height: 1.32;
    letter-spacing: 0.01em;
}

/* × on Desktop only; below 1024px the pill's menu button is the cross */
.page-wrapper .sr-mcart .sr-mcart__close {
    display: none;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    margin: -4px -8px -4px 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: #0d0d0d;
    cursor: pointer;
    transition: opacity 0.15s;
}

.page-wrapper .sr-mcart .sr-mcart__close:hover {
    opacity: 0.7;
}

.sr-mcart__close svg {
    width: 20px;
    height: 20px;
}

/* ---------- Free-shipping progress ---------- */
.page-wrapper .sr-mcart .sr-mcart__progress:not([hidden]) {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px 16px;
}

.sr-mcart__progress-text {
    margin: 0;
    color: #5d5d5d;
    font-size: 1.6rem;
    line-height: 1.5;
    text-align: center;
}

.sr-mcart__progress[data-reached='true'] .sr-mcart__progress-text {
    color: #006400;
}

.sr-mcart__progress-track {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(13, 13, 13, 0.05);
}

.sr-mcart__progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #0d0d0d;
    transition: width 0.48s cubic-bezier(0.16, 1, 0.3, 1);
}

.sr-mcart__progress[data-reached='true'] .sr-mcart__progress-fill {
    background: #006400;
}

/* ---------- Items (scroll between title and subtotal) ---------- */
.sr-mcart__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sr-mcart__items,
.sr-mcart__upsells-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sr-mcart__items {
    padding: 0 20px;
}

.page-wrapper .sr-mcart .sr-mcart__item {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 16px 0;
    overflow: hidden;
    transition: opacity 0.16s ease;
}

/* Remove: dimmed while the shop confirms, then folded away; shakes if it fails */
.sr-mcart__item.is-busy {
    opacity: 0.5;
    pointer-events: none;
}

.page-wrapper .sr-mcart .sr-mcart__item.is-folding {
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transition: max-height 0.28s ease, padding 0.28s ease, opacity 0.2s ease;
}

.sr-mcart__item.is-shaking,
.sr-mcart__upsell.is-shaking {
    animation: sr-mcart-shake 0.45s ease;
}

@keyframes sr-mcart-shake {
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.sr-mcart__image,
.sr-mcart__upsell-image {
    display: block;
    flex: none;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
}

.sr-mcart__image {
    width: 72px;
    height: 72px;
}

.sr-mcart__image img,
.sr-mcart__upsell-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.sr-mcart__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.sr-mcart__top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.sr-mcart__info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.page-wrapper .sr-mcart .sr-mcart__name,
.page-wrapper .sr-mcart .sr-mcart__upsell-name {
    color: #0d0d0d;
    font-family: 'Barlow', sans-serif;
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
}

.page-wrapper .sr-mcart a.sr-mcart__name:hover,
.page-wrapper .sr-mcart a.sr-mcart__upsell-name:hover {
    color: #f26a21;
}

/* The chosen options as a labelled list (owner, 4 November 2026), as in the checkout's summary: labels right-aligned
   in one column with a colon, values left-aligned beside them */
.sr-mcart__options {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 2px 8px;
    margin: 4px 0 0;
    font-size: 1.2rem;
    line-height: 1.9rem;
}

.sr-mcart__options dt {
    margin: 0;
    color: #6e6e73;
    font-weight: 400;
    text-align: right;
}

.sr-mcart__options dt:empty {
    display: none;
}

.sr-mcart__options dt::after {
    content: ':';
}

.sr-mcart__options dd {
    margin: 0;
    color: #1f2328;
    text-align: left;
    overflow-wrap: anywhere;
}

.sr-mcart__options dt:empty + dd {
    grid-column: 1 / -1;
}

.sr-mcart__sku {
    margin: 0;
    color: #5d5d5d;
    font-size: 1.2rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
}

/* Bottom row: unit price left, quantity right (under the remove button) */
.sr-mcart__bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
}

.sr-mcart__qty {
    flex: none;
    color: #5d5d5d;
    font-size: 1.6rem;
    line-height: 1.5;
}

.sr-mcart__price,
.sr-mcart__upsell-price {
    margin: 0;
    color: #0d0d0d;
    font-size: 1.6rem;
    line-height: 1.5;
}

.page-wrapper .sr-mcart .sr-mcart__remove {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: #0d0d0d;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.page-wrapper .sr-mcart .sr-mcart__remove:hover {
    background: rgba(13, 13, 13, 0.06);
}

.sr-mcart__remove .sr-icon {
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: url('../images/icons/trash.svg') center / 16px 16px no-repeat;
    mask: url('../images/icons/trash.svg') center / 16px 16px no-repeat;
}

.sr-mcart__empty:not([hidden]) {
    display: block;
    padding: 20px;
}

.sr-mcart__empty p {
    margin: 0;
    color: #5d5d5d;
    font-size: 1.6rem;
    line-height: 1.5;
}

/* ---------- These are a good fit ---------- */
.page-wrapper .sr-mcart .sr-mcart__upsells:not([hidden]) {
    display: block;
    padding: 16px 20px 0;
}

.page-wrapper .sr-mcart .sr-mcart__upsells-title {
    margin: 0 0 4px;
    color: #0d0d0d;
    font-family: 'Barlow', sans-serif;
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.32;
}

.page-wrapper .sr-mcart .sr-mcart__upsell {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 0;
}

.sr-mcart__upsell-image {
    width: 56px;
    height: 56px;
}

.sr-mcart__upsell-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.page-wrapper .sr-mcart .sr-mcart__upsell-name {
    font-size: 2rem;
}

.page-wrapper .sr-mcart .sr-mcart__upsell-action {
    flex: none;
    margin: 0;
    padding: 4px 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: #5d5d5d;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}

.page-wrapper .sr-mcart .sr-mcart__upsell-action:hover {
    color: #0d0d0d;
}

.page-wrapper .sr-mcart .sr-mcart__upsell-action.is-loading {
    opacity: 0.4;
    cursor: default;
}

/* ---------- Subtotal and checkout ---------- */
.page-wrapper .sr-mcart .sr-mcart__foot:not([hidden]) {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: 12px;
    padding: 20px 20px 20px;
    border-top: 1px solid rgba(13, 13, 13, 0.08);
}

.sr-mcart__subtotal {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
}

.sr-mcart__subtotal-label {
    color: #5d5d5d;
    font-size: 1.6rem;
    line-height: 1.5;
}

.sr-mcart__subtotal-value {
    color: #0d0d0d;
    font-family: 'Barlow', sans-serif;
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.32;
    transition: opacity 0.2s ease;
}

/* Subtotal waits while the cart changes */
.sr-mcart__foot.is-loading .sr-mcart__subtotal-value {
    opacity: 0.3;
}

.page-wrapper .sr-mcart .sr-mcart__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
    width: 100%;
    min-height: 52px;
    padding: 16px 20px;
    border-radius: 999px;
    background: #0d0d0d;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    transition: opacity 0.15s;
}

.page-wrapper .sr-mcart .sr-mcart__checkout:hover {
    color: #ffffff;
    opacity: 0.85;
}

.sr-mcart__checkout svg {
    width: 16px;
    height: 16px;
}

.page-wrapper .sr-mcart a:focus-visible,
.page-wrapper .sr-mcart button:focus-visible {
    outline: 2px solid #f26a21;
    outline-offset: 2px;
}

/* ---------- Page behind: dimmed, blurred, not scrolling (the backdrop is added by the script) ---------- */
.sr-mcart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

html.sr-mcart-open .sr-mcart-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* The page behind doesn't scroll. Lock only <html>: from 768px Luma's styles-l.css
   makes body 100% tall, so hiding body's overflow cut the page to one screen and it jumped to the top */
html.sr-mcart-open {
    overflow: hidden;
}

/* ---------- Below 1024px: the pill's menu button is the cross ---------- */
@media (max-width: 1023px) {
    html.sr-mcart-open .page-wrapper .page-header .sr-mnav-toggle .sr-mnav-toggle__menu {
        display: none;
    }

    html.sr-mcart-open .page-wrapper .page-header .sr-mnav-toggle .sr-mnav-toggle__close {
        display: block;
    }
}

/* ---------- Desktop: a card under the bar, on the right ---------- */
@media (min-width: 1024px) {
    html.sr-mcart-open .page-wrapper .page-header {
        z-index: 100;
    }

    .page-wrapper .sr-mcart:not([hidden]) {
        position: fixed;
        top: 88px;
        right: max(48px, calc((100% - 1372px) / 2));
        z-index: 100;
        width: 400px;
        max-height: calc(100vh - 108px);
        max-height: calc(100dvh - 108px);
        overflow: hidden;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.86);
        -webkit-backdrop-filter: blur(25px) saturate(1.8);
        backdrop-filter: blur(25px) saturate(1.8);
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), inset 0 0 20px rgba(255, 255, 255, 0.3);
    }

    .page-wrapper .sr-mcart .sr-mcart__close {
        display: grid;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-wrapper .sr-mcart:not([hidden]),
    .sr-mcart__item.is-shaking,
    .sr-mcart__upsell.is-shaking {
        animation: none;
    }

    .sr-mcart-backdrop,
    .sr-mcart__progress-fill,
    .page-wrapper .sr-mcart .sr-mcart__item.is-folding {
        transition: none;
    }
}

/* Cart page (Magento_Checkout/templates/cart/item/default.phtml): the options as the same labelled list as in the
   cart card and the checkout (owner, 4 November 2026); Luma's clearfix on the list would take a grid cell */
.cart.item .item-options {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 2px 8px;
    margin: 4px 0 0;
    font-size: 1.2rem;
    line-height: 1.9rem;
}

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

.cart.item .item-options dt {
    float: none;
    clear: none;
    margin: 0;
    color: #6e6e73;
    font-weight: 400;
    text-align: right;
}

.cart.item .item-options dt::after {
    content: ':';
}

.cart.item .item-options dd {
    float: none;
    margin: 0;
    color: #1f2328;
    text-align: left;
    overflow-wrap: anywhere;
}

/* Cart page (Magento_Checkout/templates/cart/item/default.phtml): SKU under the name and options */
.cart.item .sr-cart-sku {
    margin: 4px 0 0;
    color: #5d5d5d;
    font-size: 1.2rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
}

/* ---------- Cart rule warning (#sr-cart-warn, web/js/satrunner-cart-rules.js), in the theme modal on every page:
   the question, a grey note, "Alle Artikel entfernen" (theme.primary) and "Abbrechen" (theme.secondary) ---------- */
.sr-modal-dialog .sr-cart-warn .sr-cart-warn__question {
    margin: 0 0 8px;
    color: #1f2328;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.35;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__note {
    margin: 0;
    color: #555555;
    font-size: 1.6rem;
    line-height: 1.5;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 120px;
    min-height: 48px;
    margin: 0;
    padding: 0 24px;
    border: 1px solid #f26a21;
    border-radius: 999px;
    background: #f26a21;
    box-shadow: none;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__button:hover {
    border-color: #d95b17;
    background: #d95b17;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__button--secondary {
    border-color: #3b3a38;
    background: #3b3a38;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__button--secondary:hover {
    border-color: #000000;
    background: #000000;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__button:disabled {
    opacity: 0.6;
    cursor: default;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__button:focus-visible {
    outline: 3px solid rgba(242, 106, 33, 0.4);
    outline-offset: 4px;
}

.sr-modal-dialog .sr-cart-warn .sr-cart-warn__error {
    margin: 16px 0 0;
    color: #e02b27;
    font-size: 1.6rem;
}

@media (max-width: 448px) {
    .sr-modal-dialog .sr-cart-warn .sr-cart-warn__button {
        flex: 1 1 100%;
    }
}
