:root {
    --cart-container: min(1296px, calc(100vw - 48px));
    --cart-black: #18091D;
    --cart-grey: #7F7582;
    --cart-line: #E8E1EA;
    --cart-soft: #F3F1F4;
    --cart-orange: #FD5B03;
    --cart-indigo: #390894;
}

.cart-page {
    background: #F7F7F8;
}

.cart-shell {
    width: var(--cart-container);
    margin: 0 auto;
    padding: 72px 0 120px;
}

.cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 36px;
}

.cart-head h1,
.cart-shell h1 {
    margin: 0;
    color: var(--cart-black);
    font-size: 52px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.05em;
}

.cart-head a,
.cart-empty a,
.cart-summary a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    color: #fff;
    background: var(--cart-orange);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.cart-head a {
    color: var(--cart-black);
    background: #fff;
    border: 1px solid var(--cart-line);
}

.cart-head__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-clear {
    min-height: 48px;
    padding: 0 20px;
    color: #B42318;
    background: #fff;
    border: 1px solid rgba(180, 35, 24, .2);
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.cart-clear:hover {
    color: #fff;
    background: #B42318;
    border-color: #B42318;
    box-shadow: 0 16px 30px rgba(180, 35, 24, .18);
    transform: translateY(-1px);
}

.cart-clear:disabled,
.cart-clear.is-loading {
    opacity: .55;
    pointer-events: none;
}

.cart-head a:hover {
    border-color: rgba(57, 8, 148, .24);
    box-shadow: 0 18px 36px rgba(24, 9, 29, .08);
    transform: translateY(-1px);
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.cart-list {
    display: grid;
    gap: 16px;
}

.cart-item,
.cart-summary,
.cart-empty {
    background: #fff;
    border: 1px solid var(--cart-line);
    border-radius: 14px;
}

.cart-item {
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
    transition: opacity .18s ease, transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.cart-item.is-loading {
    opacity: .68;
    pointer-events: none;
}

.cart-item:hover {
    border-color: rgba(57, 8, 148, .18);
    box-shadow: 0 24px 48px rgba(24, 9, 29, .07);
}

.cart-item__image {
    min-height: 132px;
    display: grid;
    place-items: center;
    padding: 18px;
    background: #F9F8FA;
    border-radius: 12px;
}

.cart-item__image img {
    max-width: 100%;
    max-height: 116px;
    object-fit: contain;
}

.cart-item__content {
    min-width: 0;
}

.cart-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.cart-item__top h2 {
    max-width: 760px;
    margin: 0;
    color: var(--cart-black);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -0.03em;
}

.cart-item__top button {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    color: var(--cart-grey);
    background: var(--cart-soft);
    border: 0;
    border-radius: 10px;
    font-size: 24px;
    line-height: 1;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.cart-item__top button:hover {
    color: #fff;
    background: var(--cart-black);
    transform: translateY(-1px);
}

.cart-item__props {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
}

.cart-item__props div {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    color: var(--cart-grey);
    background: rgba(127, 117, 130, .08);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

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

.cart-item__props dt::after {
    content: ":";
}

.cart-item__bottom {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
    gap: 24px;
    align-items: end;
    margin-top: 34px;
}

.cart-item__price,
.cart-item__sum {
    display: grid;
    gap: 8px;
}

.cart-item__sum {
    text-align: right;
}

.cart-item__price span,
.cart-item__sum span,
.cart-summary > span,
.cart-summary p {
    color: var(--cart-grey);
    font-size: 13px;
    font-weight: 600;
}

.cart-item__price strong,
.cart-item__sum strong {
    color: var(--cart-black);
    font-size: 20px;
    font-weight: 700;
}

.cart-item__price strong.is-individual,
.cart-item__sum strong.is-individual {
    max-width: 240px;
    font-size: 15px;
    line-height: 1.3;
}

.cart-qty {
    display: inline-grid;
    grid-template-columns: 42px 58px 42px;
    overflow: hidden;
    border: 1px solid var(--cart-line);
    border-radius: 12px;
}

.cart-qty button,
.cart-qty input {
    height: 42px;
    color: var(--cart-black);
    background: #fff;
    border: 0;
    text-align: center;
}

.cart-qty button {
    color: var(--cart-grey);
    font-size: 20px;
    transition: color .18s ease, background .18s ease;
}

.cart-qty button:hover {
    color: #fff;
    background: var(--cart-black);
}

.cart-qty input {
    width: 58px;
    border-left: 1px solid var(--cart-line);
    border-right: 1px solid var(--cart-line);
    font-size: 16px;
    font-weight: 700;
    appearance: textfield;
}

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

.cart-summary {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 18px;
    padding: 28px;
}

.cart-summary h2 {
    margin: 0;
    color: var(--cart-black);
    font-size: 40px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.05em;
}

.cart-summary p {
    margin: -8px 0 8px;
}

.cart-summary a,
.cart-empty a {
    min-height: 56px;
}

.cart-summary a:hover,
.cart-empty a:hover {
    background: #ff6b16;
    box-shadow: 0 18px 36px rgba(253, 91, 3, .24);
    transform: translateY(-1px);
}

.cart-empty {
    max-width: 620px;
    padding: 42px;
}

.cart-empty h2 {
    margin: 0 0 14px;
    color: var(--cart-black);
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.04em;
}

.cart-empty p {
    margin: 0 0 28px;
    color: var(--cart-grey);
    font-size: 16px;
    line-height: 1.45;
}

.order-custom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.order-main,
.order-success,
.order-success__grid {
    display: grid;
    gap: 16px;
}

.order-card,
.order-summary,
.order-errors {
    background: #fff;
    border: 1px solid var(--cart-line);
    border-radius: 14px;
}

.order-card {
    padding: 30px;
}

.order-card h2,
.order-card h3 {
    margin: 0 0 24px;
    color: var(--cart-black);
    font-size: 28px;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.order-table {
    display: grid;
}

.order-table > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px 128px;
    gap: 18px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--cart-line);
}

.order-table > div:first-child {
    padding-top: 0;
}

.order-table > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.order-table p,
.order-table span,
.order-table strong {
    margin: 0;
}

.order-table p {
    color: var(--cart-black);
    font-size: 17px;
    line-height: 1.25;
}

.order-table span {
    color: var(--cart-grey);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.order-table strong {
    color: var(--cart-black);
    font-size: 18px;
    font-weight: 700;
    text-align: right;
}

.order-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.order-fields label,
.order-summary label {
    display: grid;
    gap: 8px;
}

.order-fields label[hidden] {
    display: none;
}

.order-fields__wide {
    grid-column: 1 / -1;
}

.order-fields span,
.order-summary label span {
    color: var(--cart-grey);
    font-size: 13px;
    font-weight: 600;
}

.order-fields input,
.order-fields textarea {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    color: var(--cart-black);
    background: #FAF9FB;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    outline: 0;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.order-fields textarea {
    min-height: 118px;
    padding-top: 15px;
    resize: vertical;
}

.order-fields input:focus,
.order-fields textarea:focus {
    background: #fff;
    border-color: rgba(57, 8, 148, .28);
    box-shadow: 0 0 0 4px rgba(57, 8, 148, .08);
}

.order-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.order-options label {
    position: relative;
}

.order-options input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.order-options span {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    color: var(--cart-black);
    background: #fff;
    border: 1px solid var(--cart-black);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.order-options input:checked + span {
    color: #fff;
    background: var(--cart-black);
    box-shadow: 0 16px 32px rgba(24, 9, 29, .12);
}

.order-options span:hover {
    transform: translateY(-1px);
}

.order-summary {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 18px;
    padding: 30px;
}

.order-summary > span,
.order-summary p {
    color: var(--cart-grey);
    font-size: 13px;
    font-weight: 600;
}

.order-summary h2 {
    margin: 0;
    color: var(--cart-black);
    font-size: 44px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.05em;
}

.order-summary p {
    margin: -8px 0 6px;
}

.order-summary label {
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 16px 0 4px;
    border-top: 1px solid var(--cart-line);
}

.order-summary input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--cart-orange);
}

.order-summary button {
    min-height: 58px;
    color: #fff;
    background: var(--cart-orange);
    border: 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.order-summary button:hover {
    background: #ff6b16;
    box-shadow: 0 18px 36px rgba(253, 91, 3, .24);
    transform: translateY(-1px);
}

.order-errors {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    padding: 20px 24px;
    color: #B42318;
    background: #FFF7F5;
    border-color: rgba(180, 35, 24, .18);
}

.order-errors p {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

.order-success__hero {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 32px;
    color: var(--cart-black);
    background: #fff;
    border: 1px solid var(--cart-line);
    border-radius: 14px;
}

.order-success__hero > span {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #21A957;
    border-radius: 18px;
    font-size: 32px;
    font-weight: 700;
}

.order-success__hero h2,
.order-success__hero p {
    margin: 0;
}

.order-success__hero h2 {
    color: var(--cart-black);
    font-size: 34px;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.order-success__hero p {
    max-width: 720px;
    margin-top: 12px;
    color: var(--cart-grey);
    font-size: 16px;
    line-height: 1.45;
}

.order-success__grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 24px;
}

.order-total {
    position: sticky;
    top: 104px;
}

.order-total > span,
.order-total p {
    display: block;
    margin: 0;
    color: var(--cart-grey);
    font-size: 13px;
    font-weight: 600;
}

.order-total h3 {
    margin: 10px 0 8px;
    font-size: 40px;
}

.order-payment-pill {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding: 16px;
    background: #FAF9FB;
    border-radius: 12px;
}

.order-payment-pill span {
    color: var(--cart-grey);
    font-size: 13px;
    font-weight: 600;
}

.order-payment-pill b {
    color: var(--cart-black);
    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .cart-layout,
    .order-custom,
    .order-success__grid {
        grid-template-columns: 1fr;
    }

    .cart-summary,
    .order-summary,
    .order-total {
        position: static;
    }
}

@media (max-width: 900px) {
    :root {
        --cart-container: calc(100vw - 32px);
    }

    .cart-shell {
        padding: 48px 0 80px;
    }

    .cart-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .cart-head__actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .cart-head h1,
    .cart-shell h1 {
        font-size: 38px;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 18px;
    }

    .cart-item__bottom {
        grid-template-columns: 1fr;
        gap: 18px;
        align-items: start;
    }

    .cart-qty {
        width: max-content;
        justify-self: start;
    }

    .cart-qty button {
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        padding: 0;
    }

    .cart-item__sum {
        text-align: left;
    }

    .order-card,
    .order-summary,
    .order-success__hero {
        padding: 22px;
    }

    .order-card h2,
    .order-card h3 {
        font-size: 24px;
    }

    .order-fields {
        grid-template-columns: 1fr;
    }

    .order-table > div {
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: start;
    }

    .order-table span,
    .order-table strong {
        text-align: left;
    }

    .order-options span {
        width: 100%;
        min-height: 46px;
        padding: 0 16px;
    }

    .order-options label {
        flex: 1 1 220px;
    }

    .order-summary h2 {
        font-size: 38px;
    }

    .order-success__hero {
        grid-template-columns: 1fr;
    }

    .order-success__hero h2 {
        font-size: 28px;
    }
}
