/* --- General Cart Page Styles --- */
.cart-page-main {
    background-color: #0a0a0a; /* Or your chosen product page bg */
    color: #ddd;
    min-height: 70vh; /* Ensure it takes up decent screen space even if empty */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.cart-page-title {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 30px;
    font-weight: 500;
    text-align: right;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Items take 2/3, summary takes 1/3 */
    gap: 40px;
}

/* --- Cart Items Column --- */
.cart-items-column {
    background-color: #121212; /* Slightly different shade for item list area */
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.cart-items-header {
    display: grid;
    grid-template-columns: 3fr 1.5fr 1.5fr 1.5fr 0.5fr; /* Adjust column proportions */
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    font-size: 0.9rem;
    color: #aaa;
    font-weight: 500;
    text-align: right;
}
.header-product { grid-column: 1 / 2; text-align: right; }
.header-price { grid-column: 2 / 3; text-align: center; }
.header-quantity { grid-column: 3 / 4; text-align: center; }
.header-subtotal { grid-column: 4 / 5; text-align: center; }
.header-actions { grid-column: 5 / 6; text-align: center; }


.cart-item {
    display: grid;
    grid-template-columns: 3fr 1.5fr 1.5fr 1.5fr 0.5fr; /* Match header */
    gap: 15px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #222; /* Darker separator */
}
.cart-item:last-child {
    border-bottom: none;
}

.item-product {
    display: flex;
    align-items: center;
    gap: 20px;
}
.item-image-link {
    display: block;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}
.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #333;
}
.item-info {
    text-align: right;
}
.item-name {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
    transition: color 0.3s;
}
.item-name:hover {
    color: #D4AF37;
}
.item-variant-info {
    font-size: 0.85rem;
    color: #888;
}

.item-price, .item-subtotal {
    text-align: center;
    color: #ccc;
    font-size: 0.95rem;
}
.item-subtotal {
    font-weight: 500;
    color: #D4AF37;
}

/* Quantity Selector (re-using from product page with slight adjustments) */
.item-quantity {
    display: flex;
    justify-content: center; /* Center the quantity form */
}
.quantity-update-form {
    display: flex;
    align-items: center;
}
.quantity-btn {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #D4AF37;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.quantity-btn:hover {
    background-color: #383838;
}
.quantity-input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: 1px solid #444;
    background-color: #1a1a1a;
    color: #fff;
    margin: 0 5px;
    -moz-appearance: textfield;
    border-radius: 3px;
}
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.item-actions {
    text-align: center;
}
.remove-item-btn {
    background: transparent;
    border: none;
    color: #777;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}
.remove-item-btn:hover {
    color: #D4AF37; /* Gold on hover */
}
.remove-item-btn svg {
    display: block; /* Helps with alignment */
}


/* --- Cart Summary Column --- */
.cart-summary-column {
    /* Sticky summary (optional, can be tricky with footers) */
    /* position: sticky;
    top: 90px; /* Navbar height + some padding */
}
.summary-box {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}
.summary-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 25px;
    text-align: right;
    font-weight: 500;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #bbb;
}
.summary-item.total {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}
.summary-item.total span:last-child {
    color: #D4AF37;
}
.summary-divider {
    border: 0;
    height: 1px;
    background-color: #333;
    margin: 20px 0;
}

.promo-code-form {
    display: flex;
    margin-top: 25px;
    margin-bottom: 15px;
}
.promo-input {
    /*flex-grow: 1;*/
    background: #101010;
    border: 1px solid #444;
    padding: 10px 15px;
    color: #fff;
    font-family: 'Vazirmatn', sans-serif;
    border-radius: 4px 0 0 4px; /* Adjust for RTL */
    border-left: none; /* For RTL */
}
.btn-luxury.btn-apply-promo {
    padding: 10px 20px;
    border-radius: 0 4px 4px 0; /* Adjust for RTL */
    font-size: 0.9rem;
    background-color: #D4AF37;
    color: #0a0a0a;
    white-space: nowrap;
}
.btn-luxury.btn-apply-promo:hover {
    background-color: #c09b30;
}
.promo-message {
    font-size: 0.85rem;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}
.promo-message.success { background-color: rgba(76, 175, 80, 0.2); color: #4CAF50;}
.promo-message.error { background-color: rgba(244, 67, 54, 0.2); color: #F44336;}


.btn-luxury.btn-checkout {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 25px;
    background-color: #D4AF37;
    color: #0a0a0a;
}
.btn-luxury.btn-checkout:hover {
    background-color: #c09b30;
}
.continue-shopping-link {
    display: block;
    text-align: center;
    color: #D4AF37;
    text-decoration: none;
    margin-top: 20px;
    font-size: 0.9rem;
}
.continue-shopping-link:hover {
    text-decoration: underline;
}

/* --- Empty Cart Message --- */
.empty-cart-message {
    text-align: center;
    padding: 80px 20px;
    background-color: #121212;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}
.empty-cart-message svg {
    margin-bottom: 25px;
    opacity: 0.5;
}
.empty-cart-message h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 15px;
}
.empty-cart-message p {
    color: #aaa;
    margin-bottom: 30px;
    font-size: 1rem;
}
.empty-cart-message .btn-luxury {
    padding: 12px 30px;
}


/* --- Suggested Products (Re-using product page styles if applicable) --- */
.suggested-products-section {
    padding: 60px 0 0 0; /* Add padding top */
    margin-top: 50px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}
/* Re-use .section-title and .related-products-grid from product_page.css */
/* If not imported or shared, copy those styles here */
.suggested-products-section .section-title { /* Assuming .section-title styles are global or copied */
    text-align: center;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 40px;
    font-weight: 500;
    position: relative;
    padding-bottom: 15px;
}
.suggested-products-section .section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: #D4AF37;
}
/* .related-products-grid styles copied from product_page.css if needed */


/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr; /* Stack columns on tablet/mobile */
    }
    .cart-summary-column {
        margin-top: 30px;
        /* position: static; /* Remove sticky if it was applied */
    }
    .cart-items-header {
        /* Hide some headers on smaller screens or use icons */
        font-size: 0.8rem;
    }
    .cart-items-header .header-price,
    .cart-items-header .header-subtotal {
        /* display: none; /* Example: hide for simplicity */
    }
    .cart-item {
        /* Adjust grid for stacked view or simpler columns */
        grid-template-columns: auto 1fr auto; /* Image, Info+Qty, Price+Remove */
        gap: 10px;
        align-items: flex-start; /* Align items to top */
    }
    .item-product { grid-column: 1 / 2; flex-direction: column; align-items: flex-start; gap: 10px;}
    .item-image-link { width: 60px; height: 60px; }
    .item-info { width: 100%;}
    .item-name { font-size: 0.9rem; }

    .item-price { display: none; /* Hide original unit price column */ }
    .item-quantity { grid-column: 2 / 3; justify-content: flex-end; padding-top:5px; } /* Qty next to info */
    .item-subtotal { grid-column: 3 / 4; text-align: right; padding-top:5px; font-weight: bold;}
    .item-actions {
        grid-column: 3 / 4; /* Place remove under subtotal */
        justify-self: end;
        padding-top: 10px;
    }
}

@media (max-width: 767px) {
    .cart-page-title {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    .cart-items-column {
        padding: 15px;
    }
    .cart-items-header {
       display: none; /* Simpler to hide headers completely on small mobile */
    }
    .cart-item {
        grid-template-columns: 60px 1fr; /* Image | Rest of content */
        column-gap: 15px;
        row-gap: 10px; /* Add row gap */
        padding: 15px 0;
    }
    .item-product {
        grid-column: 1 / 2; /* Image */
        grid-row: 1 / 3; /* Span two rows if needed */
        margin: 0;
    }
    .item-image-link {
        width: 60px; height: 60px;
    }
    .item-info {
        grid-column: 2 / 3; /* Info */
        grid-row: 1 / 2;
    }
    .item-quantity {
        grid-column: 2 / 3; /* Quantity */
        grid-row: 2 / 3;
        justify-content: flex-start; /* Align left under info */
        padding-top: 0;
    }
    .item-subtotal {
        grid-column: 2 / 3; /* Subtotal */
        grid-row: 3 / 4; /* New row */
        text-align: right; /* Align right */
        padding-top: 5px;
        font-size: 1rem;
    }
    .item-actions {
        grid-column: 1 / 3; /* Span full width under everything */
        grid-row: 4 / 5; /* New row */
        text-align: right; /* Or center */
        padding-top: 10px;
        border-top: 1px solid #2a2a2a;
        margin-top: 10px;
    }

    .summary-box {
        padding: 20px;
    }
    .summary-title {
        font-size: 1.3rem;
    }
}