.cart-page {
    padding: 56px 5% 80px;
    background:
        radial-gradient(circle at top left, rgba(61, 126, 84, 0.12), transparent 34%),
        var(--cream);
}

.cart-container {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.cart-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.cart-eyebrow {
    display: inline-block;
    margin-bottom: 5px;
    color: var(--green-700);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cart-heading h1 {
    color: var(--green-900);
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.08;
}

.cart-heading p {
    margin-top: 8px;
    color: var(--text-muted);
}

.cart-back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 17px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--green-800);
    background: #fff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.cart-alert {
    margin-bottom: 18px;
    padding: 14px 17px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 650;
}

.cart-alert-success {
    color: #1f6537;
    border-color: #b9dec4;
    background: #eaf7ee;
}

.cart-alert-error {
    color: #8a3434;
    border-color: #efc1c1;
    background: #fceeee;
}

.cart-alert-info {
    color: #315b6c;
    border-color: #c5dde7;
    background: #edf7fb;
}

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

.cart-products,
.cart-summary,
.cart-empty {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.cart-products {
    overflow: hidden;
}

.cart-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 22px;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.cart-item-warning {
    background: #fffaf5;
}

.cart-item-image {
    height: 135px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-image-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--green-600);
    font-size: 2.3rem;
}

.cart-item-main {
    min-width: 0;
}

.cart-item-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.cart-item-name {
    color: var(--green-900);
    text-decoration: none;
    font-size: 1.12rem;
    font-weight: 800;
}

.cart-item-name:hover {
    text-decoration: underline;
}

.cart-item-unit-price {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cart-item-total {
    flex-shrink: 0;
    color: var(--green-800);
    font-size: 1.15rem;
}

.cart-stock-message {
    margin-top: 15px;
    color: var(--green-700);
    font-size: 0.88rem;
    font-weight: 650;
}

.cart-stock-error {
    color: var(--danger);
}

.cart-item-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
}

.cart-quantity-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.cart-quantity-control input {
    width: 92px;
    height: 43px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.cart-remove-button,
.cart-clear-button {
    border: 0;
    color: var(--danger);
    background: transparent;
    cursor: pointer;
    font-weight: 750;
}

.cart-remove-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 0;
}

.cart-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    background: var(--green-50);
}

.cart-primary-button,
.cart-secondary-button,
.cart-checkout-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 19px;
    border: 0;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.cart-primary-button,
.cart-checkout-button {
    color: #fff;
    background: var(--green-800);
}

.cart-secondary-button {
    color: #fff;
    background: var(--green-700);
}

.cart-summary {
    position: sticky;
    top: 110px;
    padding: 26px;
}

.cart-summary h2 {
    margin-bottom: 21px;
    color: var(--green-900);
}

.cart-summary-row,
.cart-summary-total {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.cart-summary-row {
    padding: 11px 0;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.cart-summary-row strong {
    color: var(--text);
    text-align: right;
}

.cart-summary-total {
    align-items: center;
    padding: 22px 0;
    color: var(--green-900);
    font-size: 1.12rem;
    font-weight: 800;
}

.cart-summary-total strong {
    font-size: 1.38rem;
}

.cart-summary-note,
.cart-summary-warning {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.84rem;
}

.cart-summary-note {
    color: #42634c;
    background: var(--green-50);
}

.cart-summary-warning {
    color: #8a3434;
    background: var(--danger-bg);
}

.cart-checkout-button {
    width: 100%;
}

.cart-checkout-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.cart-security-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 17px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.cart-empty {
    min-height: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 45px 24px;
    text-align: center;
}

.cart-empty-icon {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    color: var(--green-700);
    background: var(--green-100);
    font-size: 2rem;
}

.cart-empty h2 {
    color: var(--green-900);
    font-size: 1.75rem;
}

.cart-empty p {
    max-width: 470px;
    margin: 8px 0 22px;
    color: var(--text-muted);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--green-900);
    border-radius: 999px;
    color: var(--green-900);
    background: #dff0b8;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 650px) {
    .cart-page {
        padding: 36px 4% 60px;
    }

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

    .cart-item {
        grid-template-columns: 95px minmax(0, 1fr);
        gap: 14px;
        padding: 18px;
    }

    .cart-item-image {
        height: 95px;
    }

    .cart-item-title-row,
    .cart-item-actions,
    .cart-list-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .cart-item-total {
        font-size: 1rem;
    }

    .cart-list-footer,
    .cart-secondary-button {
        width: 100%;
    }
}
