:root {
    /* Uses the same variables as your homepage.css for consistency */
    --primary-font: 'Vazirmatn', sans-serif;
    --secondary-font: 'Playfair Display', serif;
    --primary-color: #333;
    --secondary-color: #f4f4f4;
    --accent-color: #C5BBAE;
}

/* --- Main Page Layout --- */
.page-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.page-title {
    font-family: var(--secondary-font);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* --- Cart Layout --- */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 for items, 1/3 for summary */
    gap: 2rem;
    align-items: start;
}

/* --- Cart Items List --- */
.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image img {
    width: 100px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cart-item-details {
    flex-grow: 1;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}
.item-name:hover {
    color: var(--accent-color);
}

.item-price {
    color: #666;
    margin: 0.5rem 0;
}

.item-quantity-form {
    display: flex;
    align-items: center;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.5rem;
    margin-left: 0.5rem;
    font-family: var(--primary-font);
}

.btn-update {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: var(--primary-font);
}
.btn-update:hover {
    background-color: #e0e0e0;
}

.cart-item-total {
    text-align: left;
}

.item-total-price {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.btn-remove {
    background: none;
    border: none;
    color: #aaa;
    text-decoration: underline;
    cursor: pointer;
    font-family: var(--primary-font);
}
.btn-remove:hover {
    color: red;
}

/* --- Order Summary Box --- */
.order-summary {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1.5rem;
    position: sticky;
    top: 120px;
}

.order-summary h2 {
    font-family: var(--secondary-font);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.summary-row, .summary-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.summary-row span {
    color: #555;
}

.summary-total {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    font-weight: 700;
    font-size: 1.2rem;
}

.btn-checkout {
    display: block;
    width: 100%;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    text-align: center;
    padding: 1rem;
    border-radius: 5px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.btn-checkout:hover {
    background-color: #000;
}


/* --- Empty Cart Styles --- */
.empty-cart {
    text-align: center;
    padding: 5rem 0;
    border-top: 1px solid #eee;

    /* --- ADDED THESE LINES --- */
    grid-column: 1 / -1; /* This is the key fix. It tells the element to span all columns of its parent grid container if it were there. This forces it to take the full width. */
    width: 100%;       /* Explicitly set the width */
    margin: 0 auto;    /* Center the block itself */
}

.empty-cart p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* --- Responsive for Mobile --- */
@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr; /* Stack on top of each other */
    }

    .cart-item {
        flex-wrap: wrap; /* Allow items to wrap on small screens */
        position: relative;
    }

    .cart-item-image {
        flex-basis: 100px;
    }

    .cart-item-total {
        position: absolute;
        top: 1.5rem;
        left: 0;
    }
}

.quantity-selector {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden; /* Helps contain the button/input styles */
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    -moz-appearance: textfield; /* Firefox */

}
.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;

}


.quantity-btn {
    border: none;
     flex: 0 0 40px;
    font-size: 1.5rem;
    padding: 0 1rem;
    cursor: pointer;
    flex: 1;
    background-color: var(--accent-color);
}