/*
 * Full cart page (/cart/view): item list, order summary, empty state and the phone checkout bar.
 * Every rule sits under .cart2 so the rest of the site is unaffected.
 */

.cart2 {
    --cart2-ink: #0b0f17;
    --cart2-muted: #5b6577;
    --cart2-soft: #8a94a6;
    --cart2-line: #e3e8f0;
    --cart2-surface: #f5f7fb;
    --cart2-red: #e11d2a;
    --cart2-red-hover: #c4121e;
    --cart2-green: #15803d;

    padding: 28px 0 56px;
    background: var(--cart2-surface);
    color: var(--cart2-ink);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    min-height: 60vh;
}

.cart2 [hidden] {
    display: none !important;
}

/* Breadcrumb and heading */
.cart2__crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--cart2-soft);
}

.cart2__crumbs a {
    color: var(--cart2-muted);
    text-decoration: none;
}

.cart2__crumbs a:hover {
    color: var(--cart2-red);
}

.cart2__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    margin-bottom: 18px;
}

.cart2__title {
    margin: 0;
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cart2-ink);
}

.cart2__count {
    font-size: 15px;
    color: var(--cart2-muted);
}

.cart2__alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #ffe08a;
    border-radius: 14px;
    background: #fff8e1;
    color: #7a5b00;
    font-size: 14px;
}

.cart2__alert svg {
    flex: 0 0 auto;
    margin-top: 2px;
}

/* Two columns on desktop, one column below 992px */
.cart2__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

/* Empty cart: the single card is centred instead of leaving the summary column empty */
.cart2__layout.is-empty {
    grid-template-columns: minmax(0, 680px);
    justify-content: center;
}

/* Item list card */
.cart2__items {
    min-width: 0;
    padding: 6px 24px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(11, 15, 23, 0.04), 0 10px 30px -18px rgba(11, 15, 23, 0.18);
}

.cart2__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cart2__item {
    position: relative;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 220px 40px;
    grid-template-areas: 'thumb info controls remove';
    align-items: center;
    gap: 18px;
    padding: 22px 0;
    border-bottom: 1px solid var(--cart2-line);
    transition: opacity 0.2s ease;
}

.cart2__item:last-child {
    border-bottom: 0;
}

.cart2__item.is-removing {
    opacity: 0.45;
    pointer-events: none;
}

.cart2__item.is-busy .cart2__controls {
    opacity: 0.6;
}

.cart2__item.is-unavailable {
    opacity: 0.6;
}

.cart2__warn--row {
    grid-column: 1 / -1;
    margin: 0 0 4px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff8e1;
    color: #7a5b00;
    font-size: 13px;
}

.cart2__thumb {
    grid-area: thumb;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    padding: 10px;
    border: 1px solid var(--cart2-line);
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f8 100%);
}

.cart2__thumb img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart2__info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cart2__name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cart2-ink);
    text-decoration: none;
}

.cart2__name:hover {
    color: var(--cart2-red);
}

.cart2__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    font-size: 14px;
}

.cart2__price .price {
    font-weight: 700;
    color: var(--cart2-ink);
}

.cart2__mrp {
    color: var(--cart2-soft);
    text-decoration: line-through;
}

.cart2__stock {
    width: max-content;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: var(--cart2-green);
    font-size: 12px;
    font-weight: 600;
}

.cart2__stock--out {
    background: #fdecec;
    color: var(--cart2-red);
}

/* Controls: stepper and line total */
.cart2__controls {
    grid-area: controls;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.cart2__stepper {
    display: inline-flex;
    align-items: center;
    height: 42px;
    border: 1px solid #d9e0ea;
    border-radius: 999px;
    background: #ffffff;
    overflow: hidden;
}

.cart2__stepper button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cart2-ink);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cart2__stepper button:hover:not(:disabled) {
    background: #f1f4f9;
    color: var(--cart2-red);
}

.cart2__stepper button:disabled {
    color: #c3cad6;
    cursor: not-allowed;
}

.cart2__stepper input.js-qty-num {
    width: 44px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cart2-ink);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    box-shadow: none;
}

.cart2__line {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.cart2__qty-note {
    font-size: 12px;
    color: var(--cart2-soft);
}

.cart2__line .cart-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--cart2-ink);
    white-space: nowrap;
}

.cart2__remove {
    grid-area: remove;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--cart2-soft);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cart2__remove:hover,
.cart2__remove:focus-visible {
    background: #fdecec;
    color: var(--cart2-red);
}

/* Footer links under the list */
.cart2__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0 14px;
    border-top: 1px solid var(--cart2-line);
}

.cart2__link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cart2-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.cart2__link:hover {
    color: var(--cart2-red);
}

.cart2__link--danger:hover {
    color: var(--cart2-red);
}

/* Summary card */
.cart2__summary {
    position: sticky;
    top: 104px;
    padding: 24px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(11, 15, 23, 0.04), 0 10px 30px -18px rgba(11, 15, 23, 0.18);
}

.cart2__summary-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: var(--cart2-ink);
}

.cart2__rows {
    margin: 0;
}

.cart2__rows > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 9px 0;
}

.cart2__rows dt {
    font-size: 14px;
    font-weight: 500;
    color: var(--cart2-muted);
}

.cart2__rows dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--cart2-ink);
    text-align: right;
    white-space: nowrap;
}

.cart2__rows dd.is-muted {
    font-weight: 500;
    color: var(--cart2-soft);
}

.cart2__rows dd.is-saving {
    color: var(--cart2-green);
}

.cart2__saving {
    margin: 10px 0 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ecfdf3;
    color: var(--cart2-green);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.cart2__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 14px 0 18px;
    padding-top: 16px;
    border-top: 1px dashed #d9e0ea;
}

.cart2__total span {
    font-size: 15px;
    font-weight: 600;
    color: var(--cart2-muted);
}

.cart2__total strong {
    font-size: 24px;
    font-weight: 700;
    color: var(--cart2-ink);
    white-space: nowrap;
}

.cart2__trust {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--cart2-muted);
}

.cart2__trust li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart2__trust svg {
    flex: 0 0 auto;
    color: var(--cart2-green);
}

/* Buttons */
.cart2__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.cart2__btn:active {
    transform: scale(0.98);
}

.cart2__btn--primary {
    background: var(--cart2-red);
    color: #ffffff;
    box-shadow: 0 14px 24px -14px rgba(225, 29, 42, 0.75);
}

.cart2__btn--primary:hover {
    background: var(--cart2-red-hover);
    color: #ffffff;
}

.cart2__btn--wide {
    width: 100%;
}

.cart2__btn:focus-visible,
.cart2__link:focus-visible,
.cart2__stepper button:focus-visible,
.cart2__remove:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

/* Empty state */
.cart2__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 64px 16px 56px;
    text-align: center;
}

.cart2__empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff1f1 0%, #fde3e4 100%);
    color: var(--cart2-red);
}

.cart2__empty-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--cart2-ink);
}

.cart2__empty-text {
    max-width: 380px;
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--cart2-muted);
}

.cart2__empty .cart2__btn {
    min-width: 220px;
}

/* Phone checkout bar: sits above the site's bottom tab bar */
.cart2__mobilebar {
    display: none;
}

/* Tablet and phone: one column, summary below the list */
@media (max-width: 991.98px) {
    .cart2 {
        padding-bottom: 150px;
    }

    .cart2__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .cart2__summary {
        position: static;
    }

    .cart2__item {
        grid-template-columns: 96px minmax(0, 1fr) 36px;
        grid-template-areas:
            'thumb info remove'
            'thumb controls controls';
        gap: 10px 16px;
        padding: 18px 0;
    }

    .cart2__thumb {
        width: 96px;
        height: 96px;
    }

    .cart2__controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .cart2__line {
        align-items: flex-end;
    }

    .cart2__mobilebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 58px;
        z-index: 900;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        background: #ffffff;
        border-top: 1px solid var(--cart2-line);
        box-shadow: 0 -14px 30px -20px rgba(11, 15, 23, 0.35);
    }

    .cart2__mobilebar-total {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .cart2__mobilebar-total span {
        font-size: 12px;
        color: var(--cart2-muted);
    }

    .cart2__mobilebar-total strong {
        font-size: 18px;
        font-weight: 700;
        color: var(--cart2-ink);
        white-space: nowrap;
    }

    .cart2__mobilebar .cart2__btn {
        min-width: 150px;
        min-height: 48px;
    }
}

/* Phones */
@media (max-width: 575.98px) {
    .cart2 {
        padding-top: 18px;
    }

    .cart2__items {
        padding: 4px 16px;
        border-radius: 16px;
    }

    .cart2__summary {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .cart2__item {
        grid-template-columns: 84px minmax(0, 1fr) 36px;
    }

    .cart2__thumb {
        width: 84px;
        height: 84px;
        border-radius: 14px;
    }

    .cart2__name {
        font-size: 15px;
    }

    .cart2__stepper {
        height: 40px;
    }

    .cart2__stepper button {
        width: 38px;
    }

    .cart2__empty {
        padding: 48px 8px 40px;
    }

    .cart2__empty .cart2__btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cart2__item,
    .cart2__btn,
    .cart2__stepper button,
    .cart2__remove {
        transition: none !important;
    }
}

/* style.css carries an older cart list block (ul.cart-items, li.cart-item) and a fixed width for
   .js-qty-wrapper. Reset both for the new page. */
.cart2 ul.cart2__list.cart-items {
    padding: 0;
}

.cart2 ul.cart2__list.cart-items > li.cart2__item.cart-item {
    padding: 22px 0;
    border-top: 0;
    border-bottom: 1px solid var(--cart2-line);
}

.cart2 ul.cart2__list.cart-items > li.cart2__item.cart-item:last-child {
    border-bottom: 0;
}

.cart2 .cart2__stepper.js-qty-wrapper {
    width: auto;
}
