/* --- Shopping Cart Section --- */
.shopping-cart-section {
    padding: 60px 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
}

.cart-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Desktop Grid Layout (4 Columns) */
.cart-header,
.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1.2fr 1fr;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.cart-header {
    padding-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.cart-item {
    padding: 30px 0;
}

/* Item Meta Wrapper (Magic property for responsiveness) */
/* Desktop වලදී මෙම div එක නොමැති ගානට ක්‍රියාකර අතුලත ඇති div 3, ප්‍රධාන grid එකට එකතු වේ */
.item-meta {
    display: contents;
}

/* Product Column (Image + Details) */
.col-product {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-img {
    width: 90px;
    height: 110px;
    object-fit: cover;
    background-color: #f7f7f7;
    border-radius: 4px;
}

.item-details h3 {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
    text-transform: uppercase;
    line-height: 1.4;
    max-width: 350px;
}

.item-color {
    font-size: 15px;
    color: #888;
    margin-bottom: 8px;
}

.btn-remove {
    background: none;
    border: none;
    font-size: 13px;
    color: #888;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.btn-remove:hover {
    color: #e74c3c;
}

/* Price & Total Columns */
.col-price,
.col-total {
    font-size: 16px;
    color: #111;
    font-weight: 600;
}

/* Align the meta columns on the right like a table */
.cart-header .col-price,
.cart-header .col-total,
.cart-item .col-price,
.cart-item .col-total {
    justify-self: end;
    text-align: right;
}

.cart-header .col-qty,
.cart-item .col-qty {
    justify-self: center;
    text-align: center;
}

/* Quantity Selector Box */
.qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 35px;
    background-color: #fff;
}

.qty-btn {
    background: none;
    border: none;
    width: 30px;
    font-size: 16px;
    cursor: pointer;
    color: #555;
}

.qty-input {
    width: 35px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    pointer-events: none;
    /* User type කිරීම වැළැක්වීමට */
}

/* --- Cart Summary (Bottom Right) --- */
.cart-summary-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 40px;
}

.cart-summary {
    width: 100%;
    max-width: 450px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 15px;
    color: #666;
}

.summary-label {
    flex: 1;
    padding-right: 16px;
}

.summary-value {
    color: #111;
    font-weight: 600;
    min-width: 160px;
    text-align: right;
}

.subtotal-row {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 10px;
    font-size: 20px;
    color: #111;
    font-weight: 700;
}

/* Blue Checkout Button */
.btn-checkout {
    width: 100%;
    padding: 18px;
    background-color: #2d68f6;
    /* Vibrant Blue */
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(45, 104, 246, 0.3);
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background-color: #1b52d8;
    box-shadow: 0 6px 20px rgba(45, 104, 246, 0.4);
}

.view-cart-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #111;
    text-decoration: underline;
    font-weight: 600;
}

/* --- Mobile Responsiveness (The Magic) --- */

@media (max-width: 768px) {
    .hidden-mobile {
        display: none;
        /* Mobile වලදී Headings අවශ්‍ය නැත */
    }

    .cart-item {
        display: flex;
        /* Grid වෙනුවට Flex භාවිතා වේ */
        flex-direction: column;
        gap: 20px;
        padding: 25px 0;
    }

    /* Desktop වලදී නොපෙනී තිබුණු wrapper එක දැන් Flex row එකක් වේ */
    .item-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: #fcfcfc;
        padding: 15px;
        border-radius: 6px;
        border: 1px solid #eee;
    }

    .col-price::before,
    .col-total::before {
        content: attr(data-label);
        /* Mobile වලදී මිලට ඉස්සරහින් "Price:" ලෙස පෙන්වීමට */
        display: block;
        font-size: 14px;
        color: #888;
        margin-bottom: 4px;
    }

    .col-qty::before {
        content: attr(data-label);
        display: block;
        font-size: 14px;
        color: #888;
        margin-bottom: 4px;
        text-align: center;
    }

    .cart-summary-wrapper {
        justify-content: center;
        /* Mobile වලදී Summary එක මැදට ගනී */
    }

    .cart-summary {
        max-width: 100%;
        /* Mobile වලදී 100% පළල ගනී */
    }
}