.sv-cart {
    position: fixed;
    inset: 0;

    box-sizing: border-box;
    width: 960px;
    max-width: calc(100% - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);

    margin: auto;
    padding: 27px;

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;

    border: 3px solid #f5f5f5;
    border-radius: 16px;

    color: #424242;
    background: #ffffff;

    font-family: Inter, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.sv-cart:not([open]),
.sv-cart [hidden] {
    display: none !important;
}

.sv-cart::backdrop {
    background: rgb(0 0 0 / 50%);
    animation: sv-cart-backdrop 180ms ease-out;
}

.sv-cart.is-closing::backdrop {
    animation: sv-cart-backdrop 160ms ease-in reverse;
}

.sv-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 30px;
}

.sv-cart__header h2 {
    margin: 0;
    color: #000000;

    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
}

.sv-cart__close,
.sv-cart__quantity-button,
.sv-cart__remove-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;

    color: #0093ee;
    background: transparent;
    cursor: pointer;

    transition:
            color 180ms ease-out,
            background-color 180ms ease-out,
            opacity 180ms ease-out;
}

.sv-cart__close {
    width: 24px;
    height: 24px;
    color: #000000;
}

.sv-cart__icon {
    display: block;
    flex: 0 0 auto;

    width: 20px;
    height: 20px;

    background: currentColor;

    -webkit-mask: var(--sv-cart-icon) center / contain no-repeat;
    mask: var(--sv-cart-icon) center / contain no-repeat;
}

.sv-cart__icon--close {
    width: 24px;
    height: 24px;

    --sv-cart-icon: url("/images/icons/feather/x-7f906449fd078f0746ee2a2798ca836b.svg");
}

.sv-cart__icon--minus {
    --sv-cart-icon: url("/images/icons/feather/minus-circle-cb1fba3840003807d9cbf8b41fa14c52.svg");
}

.sv-cart__icon--plus {
    -webkit-mask:
            url("/images/icons/feather/minus-circle-cb1fba3840003807d9cbf8b41fa14c52.svg")
            center / contain no-repeat,
            url("/images/icons/feather/plus-circle-deaa78db5127810362cab9ba9ef9db78.svg")
            center / contain no-repeat;

    mask:
            url("/images/icons/feather/minus-circle-cb1fba3840003807d9cbf8b41fa14c52.svg")
            center / contain no-repeat,
            url("/images/icons/feather/plus-circle-deaa78db5127810362cab9ba9ef9db78.svg")
            center / contain no-repeat;
}

.sv-cart__icon--remove {
    --sv-cart-icon: url("/images/icons/feather/x-circle-ad5c339b5aeb648fdca31b8095dfbc92.svg");
}

.sv-cart__body,
.sv-cart__content {
    position: relative;
    min-width: 0;
}

.sv-cart__content {
    min-height: 150px;
}

.sv-cart__table-wrap {
    max-width: 100%;
    min-width: 0;

    overflow-x: auto;
    overscroll-behavior-x: contain;

    scrollbar-width: thin;
    scrollbar-color: #0093ee #e8f6ff;
}

.sv-cart__table {
    width: 100%;
    min-width: 800px;

    border-collapse: collapse;
    table-layout: fixed;
}

.sv-cart__table tr {
    display: grid;

    grid-template-columns:
        64px minmax(220px, 1fr) 110px 108px 110px 24px;

    align-items: start;
    column-gap: 10px;
}

.sv-cart__table th,
.sv-cart__table td {
    box-sizing: border-box;
    min-width: 0;
    padding: 12px 0;
    border: 0;

    text-align: left;
    vertical-align: top;
}

.sv-cart__table thead {
    color: #000000;
    background: #f5f5f5;
}

.sv-cart__table th {
    padding-top: 14px;
    padding-bottom: 14px;
    font-weight: 400;
}

.sv-cart__table .sv-cart__photo {
    grid-column: 1;
    text-align: center;
}

.sv-cart__table .sv-cart__name {
    grid-column: 2;
}

.sv-cart__table .sv-cart__price {
    grid-column: 3;
}

.sv-cart__table .sv-cart__quantity {
    grid-column: 4;
}

.sv-cart__table .sv-cart__sum {
    grid-column: 5;
}

.sv-cart__table .sv-cart__remove {
    grid-column: 6;
}

.sv-cart__photo img {
    display: block;

    width: 64px;
    height: 64px;

    object-fit: contain;
}

.sv-cart__photo svg {
    display: inline-block;
    color: #0093ee;
}

.sv-cart__name a {
    color: #424242;
    text-decoration: none;
    overflow-wrap: anywhere;

    transition: color 180ms ease-out;
}

.sv-cart__price,
.sv-cart__sum {
    white-space: nowrap;
}

.sv-cart__quantity-control {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

.sv-cart__quantity-button,
.sv-cart__remove-button {
    width: 24px;
    height: 24px;
}

.sv-cart__remove-button {
    border-radius: 50%;
}

.sv-cart__quantity-input {
    box-sizing: border-box;

    width: 44px;
    min-width: 0;
    height: 24px;

    margin: 0;
    padding: 0 2px;

    border: 1px solid transparent;
    border-radius: 8px;

    color: #424242;
    background: transparent;

    font: inherit;
    text-align: center;

    appearance: textfield;
    -moz-appearance: textfield;
}

.sv-cart__quantity-input::-webkit-inner-spin-button,
.sv-cart__quantity-input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.sv-cart__quantity-input:focus {
    border-color: #0093ee;
    outline: 2px solid #e8f6ff;
}

/*
 * Розділювач встановлення обладнання.
 */

.sv-cart__table .sv-cart__installation-row {
    border-top: 1px solid #e8f6ff;
}

.sv-cart__table .sv-cart__installation-price {
    grid-column: 3 / 6;
    color: #757575;
}

.sv-cart__offer {
    display: flex;
    align-items: center;
    gap: 16px;

    margin-top: 30px;
    padding: 24px;

    border-radius: 24px;

    color: #0093ee;
    background: #e8f6ff;
}

.sv-cart__offer > svg {
    flex: 0 0 32px;
}

.sv-cart__offer p {
    flex: 1 1 auto;

    min-width: 0;
    margin: 0;

    font-size: 16px;
    line-height: 24px;
}

.sv-cart__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    box-sizing: border-box;

    max-width: 100%;
    min-height: 36px;

    margin: 0;
    padding: 7px 15px;

    border: 1px solid transparent;
    border-radius: 20px;

    color: #0093ee;
    background: #e8f6ff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;

    text-align: center;
    text-decoration: none;
    cursor: pointer;

    transition:
            color 180ms ease-out,
            background-color 180ms ease-out,
            border-color 180ms ease-out;
}

.sv-cart__offer > .sv-cart__button {
    flex: 0 0 auto;

    border-color: rgb(238 106 0 / 20%);
    background: transparent;
}

.sv-cart__footer > .sv-cart__button {
    border-color: rgb(238 106 0 / 20%);
}

.sv-cart__button--primary {
    color: #ffffff;
    background: #0093ee;
}

.sv-cart__arrow {
    display: block;
    flex: 0 0 16px;

    width: 16px;
    height: 16px;

    background: currentColor;

    -webkit-mask:
            url("/images/icons/category-arrow-circle-right-108e708090425cc357a8bbe11386d3d1.svg")
            center / contain no-repeat;

    mask:
            url("/images/icons/category-arrow-circle-right-108e708090425cc357a8bbe11386d3d1.svg")
            center / contain no-repeat;
}

.sv-cart__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    margin-top: 30px;
}

.sv-cart__summary {
    display: flex;
    align-items: center;
    gap: 20px;

    padding: 20px;

    border-radius: 24px;
    background: #e8f9f5;
}

.sv-cart__total {
    color: #000000;

    font-size: 24px;
    font-weight: 700;
    line-height: 32px;

    white-space: nowrap;
}

.sv-cart__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;

    padding: 24px 0;
    text-align: center;
}

.sv-cart__empty > svg {
    color: #0093ee;
}

.sv-cart__empty h3 {
    margin: 0;
    color: #000000;

    font-size: 20px;
    line-height: 28px;
}

.sv-cart__empty p {
    max-width: 420px;
    margin: 0;
}

.sv-cart__busy {
    position: absolute;
    z-index: 2;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 150px;
    padding: 16px;

    border-radius: 16px;
    background: rgb(255 255 255 / 80%);
}

.sv-cart__busy .catalog-async__loader {
    position: static;
}

.sv-cart__spinner {
    background: currentColor;

    -webkit-mask:
            url("/images/icons/feather/loader-5aa4085de72bbea60e7b70f6e061bbe7.svg")
            center / contain no-repeat;

    mask:
            url("/images/icons/feather/loader-5aa4085de72bbea60e7b70f6e061bbe7.svg")
            center / contain no-repeat;
}

.sv-cart__error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-top: 24px;
    padding: 16px;

    border-radius: 16px;

    color: #a52d35;
    background: #fff3f3;
}

.sv-cart__error p {
    min-width: 0;
    margin: 0;
}

.sv-cart__sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    margin: -1px;
    padding: 0;
    overflow: hidden;

    clip-path: inset(50%);
    white-space: nowrap;

    border: 0;
}

.sv-cart button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.sv-cart :is(button, a):focus-visible {
    outline: 2px solid #0093ee;
    outline-offset: 3px;
}

/*
 * Видалення товару або встановлення:
 * таке саме наведення, як в оформленні замовлення.
 */

@media (hover: hover) {
    .sv-cart .sv-cart__remove-button:not(:disabled):not(
        [aria-disabled="true"]
    ):hover {
        color: #ffffff;
        background: var(--sv-interaction-hover, #ee6a00);
    }
}

@media (hover: hover) and (pointer: fine) {
    .sv-cart :is(
        .sv-cart__close,
        .sv-cart__quantity-button,
        .sv-cart__name a
    ):not(:disabled):hover {
        color: #ee6a00;
    }

    .sv-cart__button:not(:disabled):hover {
        color: #ee6a00;
        border-color: #ee6a00;
    }

    .sv-cart__button--primary:not(:disabled):hover {
        color: #ffffff;
        background: #ee6a00;
    }
}

@media (max-width: 767px) {
    .sv-cart__table {
        min-width: 760px;
    }

    .sv-cart__table tr {
        grid-template-columns:
            24px 64px 140px 110px 108px 110px;
    }

    .sv-cart__table .sv-cart__remove {
        grid-column: 1;
        grid-row: 1;
    }

    .sv-cart__table .sv-cart__photo {
        grid-column: 2;
        grid-row: 1;
    }

    .sv-cart__table .sv-cart__name {
        grid-column: 3;
        grid-row: 1;
    }

    .sv-cart__table .sv-cart__price {
        grid-column: 4;
        grid-row: 1;
    }

    .sv-cart__table .sv-cart__quantity {
        grid-column: 5;
        grid-row: 1;
    }

    .sv-cart__table .sv-cart__sum {
        grid-column: 6;
        grid-row: 1;
    }

    .sv-cart__table .sv-cart__installation-price {
        grid-column: 4 / 7;
        grid-row: 1;
    }

    .sv-cart__offer {
        flex-wrap: wrap;
    }

    .sv-cart__offer p {
        flex-basis: calc(100% - 48px);
    }

    .sv-cart__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }

    .sv-cart__summary {
        box-sizing: border-box;
        width: 100%;

        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
    }

    .sv-cart__error {
        align-items: flex-start;
        flex-direction: column;
    }
}

@keyframes sv-cart-backdrop {
    from {
        background: rgb(0 0 0 / 0%);
    }

    to {
        background: rgb(0 0 0 / 50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sv-cart,
    .sv-cart *,
    .sv-cart::backdrop {
        animation: none !important;
        transition: none !important;
    }
}