.cart-page {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.cart-main h1,
.cart-summary h2 {
    margin: 0 0 18px;
    color: #111;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cart-item,
.cart-summary,
.cart-empty-box {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    padding: 20px;
    box-sizing: border-box;
}

.cart-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.cart-item-image-link {
    display: block;
    text-decoration: none;
}

.cart-item-image-wrap {
    position: relative;
    width: 120px;
    flex-shrink: 0;
}

.cart-item-image {
    display: block;
    width: 120px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    background: #f5f5f5;
}

.cart-item-image-wrap .discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: red;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    z-index: 2;
    line-height: 1;
}

.cart-item-body {
    min-width: 0;
}

.cart-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.cart-item-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    text-decoration: none;
    line-height: 1.25;
    min-width: 0;
    word-break: break-word;
}

.cart-item-title:hover {
    text-decoration: underline;
}

.cart-remove-btn {
    background: transparent;
    border: none;
    color: #b42318;
    cursor: pointer;
    font-weight: 600;
    padding: 2px 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.cart-remove-btn:hover {
    text-decoration: underline;
}

.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #666;
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
}

.cart-item-meta span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.cart-status {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 14px;
    max-width: 100%;
}

.cart-status.AVAILABLE {
    background: #eef7ee;
    color: #266c2b;
}

.cart-status.LOW_STOCK,
.cart-status.QUANTITY_LIMITED {
    background: #fff5e6;
    color: #9a6400;
}

.cart-status.OUT_OF_STOCK {
    background: #fdecec;
    color: #b42318;
}

.cart-item-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.cart-update-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-qty-input {
    width: 84px;
    padding: 10px 12px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.cart-qty-input:focus {
    border-color: #111;
}

.cart-update-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 10px;
    padding: 11px 14px;
    background: #f3f3f3;
    color: #111;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s ease;
}

.cart-update-btn:hover {
    background: #e9e9e9;
}

.cart-price-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
    min-width: 120px;
}

.cart-item-price-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cart-item-price-box .old-price {
    color: #888;
    text-decoration: line-through;
    font-size: 14px;
}

.cart-item-price-box .new-price {
    font-weight: 700;
    font-size: 16px;
    color: #111;
}

.cart-line-total {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

.cart-summary {
    position: sticky;
    top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #111;
}

.summary-row.total {
    border-top: 1px solid #ececec;
    padding-top: 14px;
    margin-top: 14px;
    font-size: 20px;
    font-weight: 700;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    box-sizing: border-box;
}

.primary-btn {
    background: #111;
    color: #fff;
}

.primary-btn:hover {
    opacity: 0.94;
}

.primary-btn.disabled {
    background: #b9b9b9;
    pointer-events: none;
}

.secondary-btn {
    background: #f3f3f3;
    color: #111;
}

.secondary-btn:hover {
    background: #eaeaea;
}

.secondary-btn.small {
    padding: 10px 14px;
}

.primary-btn.full {
    width: 100%;
    margin-top: 10px;
}

.secondary-link {
    display: inline-block;
    margin-top: 14px;
    color: #111;
    text-decoration: none;
    font-weight: 600;
}

.secondary-link:hover {
    text-decoration: underline;
}

.link-danger {
    background: none;
    border: none;
    color: #b42318;
    cursor: pointer;
}

.summary-warning,
.cart-alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    line-height: 1.45;
    font-size: 14px;
}

.summary-warning,
.cart-alert.error {
    background: #fdecec;
    color: #b42318;
}

.cart-alert.success {
    background: #eef7ee;
    color: #266c2b;
}

.cart-alert.info {
    background: #eef3ff;
    color: #1d4ed8;
}

.cart-empty-box {
    text-align: center;
    padding: 40px 24px;
}

.cart-empty-box h2 {
    margin: 0 0 10px;
    color: #111;
}

.cart-empty-box p {
    margin: 0 0 18px;
    color: #666;
}

@media (max-width: 900px) {
    .cart-page {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 640px) {
    .cart-page {
        margin: 20px auto;
        padding: 0 14px;
        gap: 18px;
    }

    .cart-item,
    .cart-summary,
    .cart-empty-box {
        padding: 16px;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cart-item-image-wrap {
        width: 100%;
    }

    .cart-item-image {
        width: 100%;
        height: 220px;
    }

    .cart-item-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cart-item-title {
        font-size: 18px;
    }

    .cart-item-actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .cart-update-box {
        width: 100%;
    }

    .cart-qty-input {
        width: 100%;
    }

    .cart-update-btn {
        width: 100%;
    }

    .cart-price-box {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    .cart-item-price-box {
        justify-content: flex-start;
    }

    .cart-line-total {
        font-size: 18px;
    }

    .summary-row.total {
        font-size: 18px;
    }
}