.basket-page {
    margin: 0 auto;
    padding-bottom: 56px;
}

.basket-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.basket-progress span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.basket-progress span:not(:last-child)::after {
    content: "";
    width: 36px;
    height: 1px;
    background: #cbd5e1;
}

.basket-progress .active {
    color: #0f172a;
}

.basket-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.basket-heading h1 {
    margin: 0;
    color: #0f172a;
    font-size: 32px;
    line-height: 1.1;
}

.basket-heading__prefix {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.basket-link {
    color: #0f5f7a;
    font-weight: 700;
    text-decoration: none;
}

.basket-status {
    margin-bottom: 18px;
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #075985;
    padding: 10px 12px;
    font-weight: 600;
}

.basket-empty {
    display: flow-root;
    text-align: center;
}

.basket-empty p {
    margin: 0 0 20px;
    color: #64748b;
}

.basket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.basket-lines {
    display: grid;
    gap: 12px;
}

.basket-line {
    display: grid;
    grid-template-columns: 104px minmax(220px, 1fr) 120px 180px 120px 36px;
    align-items: center;
    gap: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 14px;
}

.basket-line__image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #f8fafc;
    color: #94a3b8;
    overflow: hidden;
    text-decoration: none;
}

.basket-line__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.basket-line__details h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
}

.basket-line__details h2 a {
    color: #0f172a;
    text-decoration: none;
}

.basket-line__details p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
}

.basket-line__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.basket-badge {
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 700;
}

.basket-line__notes {
    white-space: pre-line;
}

.basket-line__price,
.basket-line__total {
    display: grid;
    gap: 4px;
}

.basket-line__price span,
.basket-line__total span,
.basket-line__qty label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.basket-line__price strong,
.basket-line__total strong {
    color: #0f172a;
    font-size: 16px;
}

.basket-line__qty {
    display: grid;
    gap: 5px;
}

.basket-line__qty div {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 8px;
}

.basket-line__qty input {
    min-width: 0;
    border: 1px solid #cbd5e1;
    padding: 7px 8px;
}

.basket-line__qty button {
    min-width: 0;
    padding: 7px 10px;
}

.basket-line__remove button {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
}

.basket-line__remove button:hover {
    color: #b91c1c;
}

.basket-summary {
    position: sticky;
    top: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 20px;
}

.basket-summary h2 {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 20px;
}

.basket-summary dl {
    display: grid;
    gap: 10px;
    margin: 0 0 20px;
}

.basket-summary dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.basket-summary dt {
    color: #64748b;
    font-weight: 600;
}

.basket-summary dd {
    margin: 0;
    color: #0f172a;
    font-weight: 800;
}

.basket-summary__checkout {
    width: 100%;
    margin-bottom: 8px;
}

.basket-summary__clear {
    width: 100%;
    color: #64748b;
    text-decoration: none;
}

@media (max-width: 1100px) {
    .basket-layout {
        grid-template-columns: 1fr;
    }

    .basket-summary {
        position: static;
    }
}

@media (max-width: 820px) {
    .basket-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .basket-line {
        grid-template-columns: 84px minmax(0, 1fr) 32px;
        align-items: start;
    }

    .basket-line__price,
    .basket-line__qty,
    .basket-line__total {
        grid-column: 2 / 4;
    }

    .basket-line__remove {
        grid-column: 3;
        grid-row: 1;
    }
}

/* Order-backed basket parity layout. Keep this after the original basket
   rules so the table view cannot inherit the old card image sizing. */
.basket-heading__actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.basket-heading__actions form {
    margin: 0;
}

.basket-table {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.basket-table__head,
.basket-table__row {
    display: grid;
    grid-template-columns: minmax(390px, 2fr) 110px 180px 145px 145px 36px;
    align-items: center;
    gap: 16px;
}

.basket-table__head {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.basket-table--cost-centres .basket-table__head,
.basket-table--cost-centres .basket-table__row {
    grid-template-columns: minmax(280px, 2fr) minmax(160px, 1fr) 90px 120px 120px 120px 36px;
}

.basket-table .basket-line__qty.is-enhanced {
    grid-template-columns: 30px minmax(35px, 1fr) 30px;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.basket-line__qty.is-enhanced input,
.basket-line__qty.is-enhanced button {
    background: #fff;
    color: inherit;
    border: 0;
    min-width: 0;
    padding: 8px 0;
    text-align: center;
}
.basket-line__qty.is-enhanced input { appearance: textfield; }
.basket-line__qty.is-enhanced input::-webkit-inner-spin-button,
.basket-line__qty.is-enhanced input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.basket-line__qty.is-enhanced button { font-size: 20px; }
.basket-line__qty [hidden] { display: none !important; }

.basket-table__head span:first-child {
    text-align: left;
}

.basket-table__row {
    min-height: 128px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.basket-table__row:last-child {
    border-bottom: 0;
}

.basket-table__item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.basket-table .basket-line__image {
    width: 96px;
    height: 96px;
    aspect-ratio: auto;
}

.basket-table__status {
    color: #166534;
    font-weight: 600;
    text-align: center;
}

.basket-table .basket-line__qty {
    display: grid;
    grid-template-columns: minmax(60px, 1fr) auto;
    gap: 8px;
}

.basket-money {
    display: grid;
    gap: 3px;
    text-align: right;
}

.basket-money strong,
.basket-money span {
    white-space: nowrap;
}

.basket-money small,
.basket-summary small {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.basket-tools-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 28px;
    align-items: start;
    margin-top: 24px;
}

.basket-tools-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.basket-tool-card {
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 22px;
}

.basket-tool-card h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.basket-tool-card p {
    color: #64748b;
}

.basket-promo-form,
.basket-quick-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.basket-quick-add {
    grid-template-columns: minmax(0, 1fr) 78px auto;
    margin-bottom: 14px;
}

.basket-promo-form input,
.basket-quick-add input,
.basket-cost-centre select,
.basket-action-panel input {
    min-width: 0;
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 10px 12px;
}

.basket-promotion-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    border-left: 4px solid #0ea5a8;
    background: #e6f7fa;
    padding: 12px;
}

.basket-promotion-applied > div {
    display: grid;
    gap: 3px;
}

.basket-cost-centre {
    display: grid;
    gap: 7px;
    margin-bottom: 18px;
}

.basket-cost-centre label {
    font-weight: 700;
}

.basket-cost-centre--line {
    max-width: 260px;
    margin: 10px 0 0;
}

.basket-action-panel {
    margin-bottom: 10px;
    border: 1px solid #cbd5e1;
}

.basket-action-panel summary {
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 700;
    text-align: center;
}

.basket-action-panel form {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
}

@media (max-width: 1200px) {
    .basket-table--cost-centres .basket-table__row {
        grid-template-columns: minmax(240px, 2fr) minmax(140px, 1fr) 110px 100px 100px 30px;
    }
    .basket-table__head {
        display: none;
    }

    .basket-table__row {
        grid-template-columns: minmax(320px, 1fr) 170px 135px 135px 36px;
    }

    .basket-table__status {
        display: none;
    }
}

@media (max-width: 900px) {
    .basket-table--cost-centres .basket-table__row { grid-template-columns: 1fr 36px; }
    .basket-table .basket-cost-centre--line { grid-column: 1 / 3; }
    .basket-tools-layout,
    .basket-tools-column {
        grid-template-columns: 1fr;
    }

    .basket-summary {
        position: static;
    }

    .basket-table__row {
        grid-template-columns: 1fr 36px;
    }

    .basket-table__item,
    .basket-table .basket-line__qty,
    .basket-money {
        grid-column: 1 / 3;
    }

    .basket-table .basket-line__remove {
        grid-column: 2;
        grid-row: 1;
    }
}

@media (max-width: 600px) {
    .basket-heading__actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .basket-table__item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .basket-table .basket-line__image {
        width: 72px;
        height: 72px;
    }

    .basket-quick-add {
        grid-template-columns: 1fr 72px;
    }

    .basket-quick-add button {
        grid-column: 1 / 3;
    }
}
