/* Cart — Figma 401:2841 / 401:2686 / 401:2728 */

body.medagg-body.medagg-body--cart {
    --bb-navy: #003670;
    --bb-ink: #2d3748;
    --bb-muted: #718096;
    --bb-line: #e2e8f0;
    --bb-font: "Schibsted Grotesk", "Inter", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bb-navy);
    color: var(--bb-ink);
    font-family: var(--bb-font);
}

body.medagg-body.medagg-body--cart-empty {
    background: #fff;
}

.medagg-body--cart .medagg-main {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 0;
    background: transparent;
}

@media (max-width: 767px) {
    .medagg-body--cart .medagg-v2-header {
        background: #fff;
    }

    .medagg-body--cart .medagg-v2-city {
        border: 0;
        background: #f7fafc;
        box-shadow: inset 0 0 0 1px #e2e8f0;
    }

    .medagg-body--cart .medagg-v2-city__select {
        color: #2d3748;
    }

    .medagg-body--cart .medagg-v2-city__chevron {
        filter: invert(1);
    }

    .medagg-body--cart .medagg-v2-burger span {
        background: #2d3748;
    }
}

.medagg-body--cart-empty .medagg-v2-header {
    background: #fff;
}

.medagg-body--cart-empty .medagg-v2-city {
    border: 0;
    background: #f7fafc;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.medagg-body--cart-empty .medagg-v2-city__select {
    color: #2d3748;
}

.medagg-body--cart-empty .medagg-v2-city__chevron {
    filter: invert(1);
}

.medagg-body--cart-empty .medagg-v2-burger span {
    background: #2d3748;
}

.medagg-cart {
    box-sizing: border-box;
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 8px 16px calc(var(--medagg-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 132px);
}

.medagg-cart.is-empty {
    padding-bottom: calc(var(--medagg-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 32px);
}

.medagg-cart__layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.medagg-cart__main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 767px) {
    .medagg-body--cart .medagg-v2-header__cart img {
        filter: invert(1);
    }
}

.medagg-body--cart-empty .medagg-v2-header__cart img {
    filter: invert(1);
}

.medagg-body--cart .medagg-tabbar {
    border-top: 1px solid var(--bb-line, #e2e8f0);
}

.medagg-body--cart .medagg-tabbar__inner {
    max-width: none;
    width: 100%;
    height: 64px;
    min-height: 64px;
    padding: 0 16px;
}

.medagg-body--cart .medagg-tabbar__item {
    flex: 1 0 0;
    width: auto;
    min-width: 0;
    height: 34px;
    gap: 4px;
    color: var(--bb-muted, #718096);
    font-family: var(--bb-font, inherit);
    font-size: 10px;
    font-weight: 600;
}

.medagg-body--cart .medagg-tabbar__item.is-active {
    color: var(--bb-navy, #003670);
}

.medagg-body--cart .medagg-tabbar__icon,
.medagg-body--cart .medagg-tabbar__icon-wrap {
    width: 18px;
    height: 18px;
}

.medagg-body--cart .medagg-tabbar__icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.medagg-cart-card {
    box-sizing: border-box;
    padding: 16px 16px 8px;
    background: #fff;
    border-radius: 16px;
}

.medagg-cart-card__title {
    margin: 0 0 12px;
    color: var(--bb-navy);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

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

.medagg-cart-check--label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--bb-ink);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.medagg-cart-check__input {
    appearance: none;
    box-sizing: border-box;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid #ccd1d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.medagg-cart-check__input:checked {
    border-color: var(--bb-navy);
    background: var(--bb-navy);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M1.5 5.2 4.6 8.2 10.5 1.8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 10px;
}

.medagg-cart-check__input:disabled {
    cursor: default;
    opacity: 0.45;
}

.medagg-cart-trash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bb-navy);
    cursor: pointer;
}

.medagg-cart-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: start;
    padding: 12px 0;
    border-top: 1px solid #edf2f7;
    cursor: pointer;
}

.medagg-cart-item.is-na {
    opacity: 0.55;
    cursor: default;
}

.medagg-cart-item__name {
    color: var(--bb-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.medagg-cart-item__price {
    color: var(--bb-ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.medagg-cart-item--bundle {
    align-items: center;
}

.medagg-cart-item__badge {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 100px;
    background: #f9dfde;
    color: #c53030;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    vertical-align: middle;
}

.medagg-cart-bundle__items {
    padding: 0 0 8px 28px;
}

.medagg-cart-item--child .medagg-cart-item__name,
.medagg-cart-item--child .medagg-cart-item__price {
    font-size: 13px;
    font-weight: 400;
    color: #4a5568;
}

.medagg-cart-order {
    padding-bottom: 16px;
}

.medagg-cart-order .medagg-cart-sticky {
    margin-top: 4px;
}

.medagg-cart-order__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    color: var(--bb-ink);
    font-size: 15px;
}

.medagg-cart-order__row strong {
    font-weight: 700;
}

.medagg-cart-order__fees {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.medagg-cart-order__fee {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--bb-muted);
    font-size: 13px;
}

.medagg-cart-rec {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #edf2f7;
}

.medagg-cart-rec__name {
    color: var(--bb-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
}

.medagg-cart-rec__price {
    color: var(--bb-ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.medagg-cart-rec__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #edf2f7;
    color: var(--bb-navy);
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.medagg-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 72px 16px 32px;
}

.medagg-cart-empty__icon {
    display: inline-flex;
    margin-bottom: 20px;
}

.medagg-cart-empty__title {
    margin: 0 0 8px;
    color: var(--bb-navy);
    font-size: 22px;
    font-weight: 800;
}

.medagg-cart-empty__text {
    margin: 0 0 24px;
    max-width: 280px;
    color: var(--bb-muted);
    font-size: 14px;
    line-height: 1.45;
}

.medagg-cart-empty__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 12px 28px;
    border-radius: 100px;
    background: var(--bb-navy);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.medagg-cart.is-empty .medagg-cart-recs {
    margin-top: 8px;
    border: 1px solid var(--bb-line);
}

.medagg-cart-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--medagg-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    padding: 12px 16px 14px;
    background: #fff;
    box-shadow: 0 -8px 24px rgba(0, 54, 112, 0.08);
}

.medagg-cart-sticky__sum {
    margin: 0 0 10px;
    color: var(--bb-ink);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.medagg-cart-sticky__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 100px;
    background: var(--bb-navy);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.medagg-cart-sticky__btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.medagg-cart-modal[hidden] {
    display: none;
}

.medagg-cart-modal {
    position: fixed;
    inset: 0;
    z-index: 1600;
}

.medagg-cart-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 54, 112, 0.45);
}

.medagg-cart-modal__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-radius: 24px 24px 0 0;
}

.medagg-cart-modal__title {
    margin: 0;
    color: var(--bb-ink);
    font-size: 20px;
    font-weight: 800;
}

.medagg-cart-modal__text {
    margin: 0 0 12px;
    color: var(--bb-muted);
    font-size: 14px;
    line-height: 1.45;
}

.medagg-cart-modal__danger,
.medagg-cart-modal__cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.medagg-cart-modal__danger {
    border: 0;
    background: #e53e3e;
    color: #fff;
}

.medagg-cart-modal__cancel {
    border: 1px solid var(--bb-line);
    background: #fff;
    color: var(--bb-navy);
}

@media (min-width: 768px) {
    body.medagg-body.medagg-body--cart {
        --bb-container: 1200px;
    }

    .medagg-cart {
        width: min(var(--bb-container), calc(100% - 48px));
        padding: 24px 0 48px;
    }

    .medagg-cart__layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        align-items: start;
        gap: 20px;
    }

    .medagg-cart__main {
        grid-column: 1;
        grid-row: 1;
    }

    .medagg-cart__side {
        grid-column: 2;
        grid-row: 1 / span 3;
    }

    .medagg-cart-recs {
        grid-column: 1;
        grid-row: 2;
    }

    .medagg-cart-sticky {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: auto;
        margin-top: 16px;
        padding: 16px 0 4px;
        background: transparent;
        box-shadow: none;
        border-top: 1px solid #edf2f7;
    }

    .medagg-cart-sticky__sum {
        color: var(--bb-ink);
        text-align: left;
    }

    .medagg-body--cart .medagg-tabbar {
        display: none;
    }

    .medagg-cart-modal__panel {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: min(420px, calc(100% - 48px));
        transform: translate(-50%, -50%);
        border-radius: 24px;
        padding: 24px;
    }
}
