/* ==========================================================================
   Cart page (markup: storefront/cart.blade.php, storefront/partials/cart-switcher
   and storefront/cart/_*.blade.php, behaviour: js/storefront/cart-page.js).
   The bill, notices, loading and error parts are also used by the checkout review.

   Colours
     page #F4F2F8 · cards #FFFFFF · lines #F2EFF6 / #ECE8F3
     ink #1C1530 · deep purple #2A1052 · muted #6A6080 · labels #5E5670
     pink (actions) #D91E5B, dark #B0124A, soft #FFF0F5
     soft purple #F1ECFB / #5B21B6 · green #15803D on #E8F7EE
   ========================================================================== */

.store--cart {
    background: #F4F2F8;
}

.store--cart .store__main {
    max-width: 640px;
    padding: 12px 12px calc(104px + env(safe-area-inset-bottom));
    gap: 0;
}

/* ---------- Header: back · My cart · shop, then the cart switcher ---------- */

.cart-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 8px 12px 12px;
    border-bottom: 1px solid #ECE8F3;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-header__row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-header__back {
    width: 40px;
    height: 40px;
    margin-left: -6px;
    flex-shrink: 0;
    border-radius: 20px;
    color: #1C1530;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-header__back:hover {
    background: #F4F2F8;
}

.cart-header__back .icon {
    width: 22px;
    height: 22px;
    stroke-width: 2.4;
}

.cart-header__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cart-header__title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    color: #1C1530;
}

.cart-header__sub {
    font-size: 12px;
    color: #6A6080;    overflow-wrap: break-word;
}

/* Cart pills (look: components/cart-switcher.css) run edge to edge under the title */
.cart-header .cart-switcher {
    margin: 0 -12px;
    padding: 0 12px;
}

/* ---------- Page states ---------- */

.cart-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-page [data-cart-summary] {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-page.is-updating [data-cart-summary] {
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.cart-page__loading {
    padding: 40px 0;
    text-align: center;
    color: #6A6080;
    font-weight: 600;
}

.cart-error,
.cart-empty {
    margin-top: 12px;
    padding: 32px 20px;
    border-radius: 16px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.cart-error__text,
.cart-empty__text {
    max-width: 320px;
    color: #6A6080;
    font-size: 14px;
}

.cart-empty__icon {
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background: #F1ECFB;
    color: #5B21B6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-empty__icon .icon {
    width: 30px;
    height: 30px;
}

.cart-empty__title {
    font-size: 18px;
    font-weight: 800;
    color: #1C1530;
}

/* ---------- White cards ---------- */

.cart-card {
    padding: 12px 14px;
    border-radius: 16px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-card__title {
    font-size: 15px;
    font-weight: 800;
    color: #1C1530;
}

/* ---------- How this cart comes (delivery card) ---------- */

.cart-how__main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-how__icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #F1ECFB;
    color: #5B21B6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-how__icon .icon {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.cart-how__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cart-how__title {
    font-size: 15px;
    font-weight: 800;
    color: #1C1530;
}

.cart-how__sub {
    font-size: 12px;
    color: #6A6080;
}

.cart-how__fee {
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 8px;
    background: #F4F2F8;
    color: #2A1052;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.cart-how__fee.is-free {
    background: #E8F7EE;
    color: #15803D;
}

/* Messages inside the delivery card */
.cart-message {
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.cart-message--nudge {
    background: #FFF7EB;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.cart-message__text {
    margin: 0;
    color: #7A4300;
}

.cart-message__bar {
    width: 100%;
    height: 5px;
    border: 0;
    border-radius: 3px;
    background: #FFE2B8;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.cart-message__bar::-webkit-progress-bar {
    background: #FFE2B8;
    border-radius: 3px;
}

.cart-message__bar::-webkit-progress-value {
    background: #F28C28;
    border-radius: 3px;
}

.cart-message__bar::-moz-progress-bar {
    background: #F28C28;
    border-radius: 3px;
}

.cart-message--free {
    background: #E8F7EE;
    color: #15803D;
}

.cart-message--info {
    background: #F4F2F8;
    color: #3D3550;
}

.cart-message--warning {
    background: #FFF0F5;
    color: #B0124A;
}

/* ---------- Notices (price changes, removed items) ---------- */

.cart-notice {
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px dashed #F2B8CB;
    background: #FFFFFF;
    color: #6B2A45;
    font-size: 13px;
}

.cart-notice__title {
    color: #B0124A;
}

.cart-notice__list {
    margin: 4px 0 0;
    padding-left: 18px;
}

/* ---------- Items ---------- */

.cart-lines {
    padding-top: 4px;
    padding-bottom: 4px;
    gap: 0;
}

.cart-lines__head {
    padding: 8px 0 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cart-lines__count {
    font-size: 13px;
    font-weight: 700;
    color: #6A6080;
}

.cart-lines__clear {
    padding: 4px 0;
    border: 0;
    background: none;
    color: #6A6080;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* "+ Add more items": back to the shop, under the last item */
.cart-lines__more {
    min-height: 48px;
    margin-top: 4px;
    border: 1.5px dashed var(--color-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.cart-lines__more:hover {
    background: #F7F4FC;
}

.cart-lines__clear:hover {
    color: #B0124A;
}

/* One item: photo · name, pack, price · stepper with "More" under it */
.cart-line {
    padding: 12px 0;
    border-top: 1px solid #F2EFF6;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.cart-line__media {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid #F0ECF5;
    background: #FAF9FC;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cart-line__img {
    width: 86%;
    height: 86%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.cart-line__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-line__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #1C1530;    overflow-wrap: break-word;
}

.cart-line__name a {
    color: inherit;
}

.cart-line__pack {
    font-size: 12px;
    color: #6A6080;
}

.cart-line__prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cart-line__total {
    font-size: 14px;
    font-weight: 800;
    color: #1C1530;
}

.cart-line__mrp {
    font-size: 12px;
    color: #9A90AE;
}

.cart-line__prices--hidden {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.cart-line__points {
    margin-top: 3px;
    align-self: flex-start;
}

.cart-line__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.cart-line__more {
    height: 24px;
    padding: 0 4px 0 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #6A6080;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
}

.cart-line__more:hover {
    background: #F4F2F8;
    color: #2A1052;
}

.cart-line__more .icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.6;
}

/* An item this type cannot take any more: faded, with "Move to Pickup cart" and "Remove" */
.cart-line--wrong {
    grid-template-columns: 56px minmax(0, 1fr);
    row-gap: 8px;
}

.cart-line--wrong .cart-line__media {
    opacity: 0.5;
}

.cart-line--wrong .cart-line__name,
.cart-line--wrong .cart-line__pack {
    color: #9A90AE;
}

.cart-line__wrong-tag {
    align-self: flex-start;
    margin-top: 3px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #FFF0F5;
    color: #B0124A;
    font-size: 11px;
    font-weight: 800;
}

.cart-line__fix {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cart-line__fix-move,
.cart-line__fix-remove {
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.cart-line__fix-move {
    border: 0;
    background: #2A1052;
    color: #FFFFFF;
    font-weight: 800;
}

.cart-line__fix-move:hover {
    background: #5B21B6;
}

.cart-line__fix-remove {
    border: 1px solid #E2DCEB;
    background: #FFFFFF;
    color: #6A6080;
    font-weight: 700;
}

.cart-line__fix-remove:hover {
    border-color: #B0124A;
    color: #B0124A;
}

/* ---------- Savings line ---------- */

.cart-savings {
    padding: 10px 14px;
    border-radius: 14px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.cart-savings__icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #E8F7EE;
    color: #15803D;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-savings__text {
    font-size: 13px;
    font-weight: 700;
    color: #15803D;
}

/* ---------- Points for the whole order ---------- */

.cart-points,
.cart-request {
    padding: 10px 14px;
    border-radius: 14px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.cart-points__icon,
.cart-request__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-points__icon {
    background: #FEF3C7;
    color: #B45309;
}

.cart-points__icon .icon {
    width: 18px;
    height: 18px;
    fill: #F59E0B;
    stroke: #B45309;
    stroke-width: 1.5;
}

.cart-points__text,
.cart-request__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cart-points__title,
.cart-request__title {
    font-size: 13px;
    font-weight: 800;
    color: #1C1530;
}

.cart-points__sub,
.cart-request__sub {
    font-size: 12px;
    color: #6A6080;
}

/* ---------- Hide prices add-on: items the shop prices later ---------- */

.cart-request__icon {
    background: #F1ECFB;
    color: #5B21B6;
}

.cart-request__icon .icon {
    width: 17px;
    height: 17px;
    stroke-width: 2.2;
}

/* ---------- Bill ---------- */

.cart-bill {
    padding: 14px;
    gap: 10px;
}

.cart-bill__rows {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.cart-bill__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

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

.cart-bill__row dt {
    color: #5E5670;
}

.cart-bill__row dd {
    font-weight: 600;
    color: #1C1530;
    text-align: right;
}

.cart-bill__row dd.is-free {
    color: #15803D;
    font-weight: 800;
}

.cart-bill__waive {
    font-size: 12px;
    font-weight: 500;
    color: #6A6080;
}

.cart-bill__row dd.is-request {
    color: #5B21B6;
    font-weight: 800;
}

.cart-bill__row--saving dd {
    color: #15803D;
}

.cart-bill__row--total {
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px dashed #E2DCEB;
    font-size: 15px;
}

.cart-bill__row--total dt,
.cart-bill__row--total dd {
    color: #1C1530;
    font-weight: 800;
}

.cart-bill__note {
    font-size: 12px;
    color: #6A6080;
}

/* ---------- "Also saved: Fast cart (2) · Pickup cart (1)" ---------- */

.cart-others {
    margin: 0;
    padding: 10px 14px;
    border-radius: 14px;
    background: #FFFFFF;
    color: #3D3550;
    font-size: 13px;
    line-height: 1.6;
}

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

.cart-others__link {
    padding: 0;
    border: 0;
    background: none;
    color: #5B21B6;
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: #D9CCF2;
    text-underline-offset: 3px;
    cursor: pointer;
}

.cart-others__link:hover {
    color: #2A1052;
}

/* ---------- Fixed bottom bar ---------- */

.cart-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    padding: 10px max(12px, calc((100% - 640px) / 2 + 12px)) calc(14px + env(safe-area-inset-bottom));
    background: #FFFFFF;
    box-shadow: 0 -4px 16px rgba(28, 21, 48, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-bar__amount {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cart-bar__total {
    font-size: 17px;
    font-weight: 800;
    color: #1C1530;
}

.cart-bar__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #6A6080;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-bar__proceed {
    height: 50px;
    flex-shrink: 0;
    padding: 0 18px 0 22px;
    border: 0;
    border-radius: 12px;
    background: #D91E5B;
    color: #FFFFFF;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.cart-bar__proceed:hover {
    background: #B0124A;
    color: #FFFFFF;
}

.cart-bar__proceed .icon {
    width: 18px;
    height: 18px;
    stroke-width: 3;
}

.cart-bar__proceed:disabled {
    background: #C9C2D6;
    cursor: not-allowed;
}

/* ---------- Delivery or pickup not as usual right now ---------- */

.cart-delivery-notice {
    padding: 10px 14px;
    border-radius: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.cart-delivery-notice--closed {
    background: #FFF0F5;
    color: #B0124A;
}

.cart-delivery-notice--later {
    background: #F1ECFB;
    color: #4C1D95;
}

.cart-delivery-notice__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cart-delivery-notice__text {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

/* ---------- Item sheet: move to another cart, remove ---------- */

.cart-sheet .sheet__panel {
    gap: 4px;
}

.cart-sheet__title {
    font-size: 15px;
    line-height: 1.3;
}

.cart-sheet__group {
    display: flex;
    flex-direction: column;
}

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

.cart-sheet__label {
    margin: 4px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #6A6080;
}

.cart-sheet__list {
    display: flex;
    flex-direction: column;
}

.cart-sheet__action {
    min-height: 54px;
    padding: 0 4px;
    border: 0;
    border-bottom: 1px solid #F2EFF6;
    background: none;
    color: #1C1530;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.cart-sheet__action:hover {
    background: #FAF9FC;
}

.cart-sheet__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #F1ECFB;
    color: #5B21B6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-sheet__icon .icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.cart-sheet__text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.cart-sheet__sub {
    font-size: 12px;
    font-weight: 500;
    color: #6A6080;
}

.cart-sheet__chevron {
    width: 16px;
    height: 16px;
    color: #9A90AE;
}

.cart-sheet__action--remove {
    margin-top: 4px;
    border-bottom: 0;
    color: #B0124A;
}

.cart-sheet__action--remove .cart-sheet__icon {
    background: #FFF0F5;
    color: #B0124A;
}
