/* --- Core Styling for .cart-page container (Highest Specificity) --- */
.cart-page {
    margin-top: 80px;
    padding: 40px 0;
    background-color: #ffffff; /* User Requested: White Background */
    color: #000000;    /* User Requested: Black Content */
}

/* --- Scoped General Elements --- */
.cart-page .section-title {
    margin-bottom: 30px;
    font-size: 0.5rem;
    font-weight: 700;
    color: #000000;
}

/* --- Scoped Messages --- */
.cart-page .alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 1rem;
}

.cart-page .alert-info {
    background-color: #e6f7ff;
    color: #00566b;
    border: 1px solid #91d5ff;
}

.cart-page .alert-danger {
    background-color: #fff1f0;
    color: #cf1322;
    border: 1px solid #ffa39e;
}

.cart-page .empty-cart-message {
    padding: 50px 0;
    border: 1px solid #e0e0e0;
    background-color: #f9f9f9;
}

/* --- Scoped Cart Layout (Flexbox) --- */
.cart-page .cart-layout {
    display: flex;
    gap: 30px; 
    align-items: flex-start;
}

/* --- Scoped Cart Items List --- */
.cart-page .cart-items-list {
    flex-grow: 1;
    min-width: 60%;
}

.cart-page .cart-item-card {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border: 1px solid #e0e0e0;
}

.cart-page .cart-items-list .cart-item-card:last-child {
    border-bottom: none;
}

.cart-page .item-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    margin-right: 20px;
}

.cart-page .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #000000; 
}

.cart-page .item-details {
    flex-grow: 1;
    min-width: 150px;
}

.cart-page .item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.cart-page .item-variant, .cart-page .item-price, .cart-page .item-sku {
    font-size: 0.9rem;
    color: #333;
    margin: 0;
}

/* --- Scoped Quantity and Price Columns --- */
.cart-page .item-quantity,
.cart-page .item-subtotal {
    width: 120px;
    text-align: center;
    flex-shrink: 0;
}

.cart-page .cart-quantity-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #000000;
    text-align: center;
    background-color: #ffffff;
    color: #000000;
}

.cart-page .line-total-display {
    font-weight: bold;
    font-size: 1.1rem;
    display: block;
    margin-top: 5px;
}

.cart-page .item-actions {
    width: 100px;
    text-align: right;
    flex-shrink: 0;
}

/* --- Scoped Cart Summary Sidebar --- */
.cart-page .cart-summary-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky; 
    top: 20px; 
}

.cart-page .summary-box {
    border: 1px solid #000000;
    padding: 20px;
    background-color: #f7f7f7;
}

.cart-page .summary-box h2 {
    font-size: 1.5rem;
    margin-top: 0;
}

.cart-page .summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1rem;
}

.cart-page .total-line {
    font-size: 1.2rem;
    font-weight: 700;
    border-top: 1px dashed #333;
    padding-top: 10px;
    margin-top: 15px;
}

/* --- Scoped Buttons --- */
.cart-page .btn {
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    display: inline-block;
}

.cart-page .btn-primary, .cart-page .place-order-btn {
    background-color: #000000; 
    color: #ffffff;
    border-color: #000000;
    width: 100%; 
    margin-top: 15px;
}

.cart-page .btn-primary:hover, .cart-page .place-order-btn:hover {
    background-color: #333333;
}

.cart-page .btn-danger {
    background-color: #ffffff;
    color: #cc0000;
    border-color: #cc0000;
    font-size: 0.8rem;
    padding: 5px 10px;
}

.cart-page .btn-danger:hover {
    background-color: #ffcccc;
    color: #cc0000;
}

.cart-page .security-text {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 10px;
}

/* --- Scoped Responsive Adjustments --- */
@media (max-width: 992px) {
    .cart-page .cart-layout {
        flex-direction: column;
    }

    .cart-page .cart-summary-sidebar {
        width: 100%;
        position: static;
        margin-top: 30px;
    }
}

@media (max-width: 600px) {
    .cart-page .cart-item-card {
        flex-wrap: wrap;
        text-align: center;
        padding: 15px 0;
    }

    .cart-page .item-image {
        width: 80px;
        height: 80px;
        margin: 0 10px 10px 0;
    }

    .cart-page .item-details {
        flex-basis: 100%;
        text-align: left;
    }
    
    .cart-page .item-quantity,
    .cart-page .item-subtotal,
    .cart-page .item-actions {
        width: 33%;
        margin-top: 10px;
    }

    .cart-page .item-actions {
        text-align: center;
    }
}