/* static/css/cart.css */

/* General Styles for Cart Page */
.cart-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cart-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2.5em;
    font-weight: bold;
}

.cart-items {
    margin-bottom: 30px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    margin-bottom: 15px;
    border-radius: 5px;
    padding: 15px;
    transition: box-shadow 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 20px;
    border: 1px solid #ddd;
}

.item-details {
    flex-grow: 1;
    margin-right: 20px;
}

.item-details h4 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: #333;
}

.item-details p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.item-price {
    font-size: 1.1em;
    font-weight: bold;
    color: #555;
    min-width: 100px; /* Ensure price column has consistent width */
    text-align: right;
}

.item-quantity {
    display: flex;
    align-items: center;
    margin: 0 20px;
    min-width: 120px; /* Ensure quantity control has consistent width */
}

.item-quantity button {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    color: #333;
    cursor: pointer;
    font-size: 1.1em;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.item-quantity button:hover {
    background-color: #e0e0e0;
}

.item-quantity input[type="number"] {
    width: 50px;
    text-align: center;
    margin: 0 8px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1em;
}

/* Hide spinner buttons for number input (optional, for cleaner look) */
.item-quantity input[type=number]::-webkit-inner-spin-button,
.item-quantity input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.item-quantity input[type=number] {
    -moz-appearance: textfield; /* Firefox */
}

.remove-item-btn {
    background: none;
    border: none;
    color: #d9534f;
    cursor: pointer;
    font-size: 1.3em;
    transition: color 0.2s ease;
}

.remove-item-btn:hover {
    color: #c9302c;
}

/* Cart Summary */
.cart-summary {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.summary-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #555;
}

.summary-section.total {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 20px;
}

.summary-section span {
    color: #333;
    font-weight: 500;
}

.summary-section.total span {
    color: #d9534f; /* Highlight total price */
    font-size: 1.2em;
}

.checkout-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background-color: #5cb85c; /* Green color for checkout */
    color: white;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 25px;
}

.checkout-btn:hover {
    background-color: #4cae4c;
}

/* Shipping Method Selection */
.shipping-methods {
    margin-top: 25px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f0f8ff; /* Light blue background for shipping */
    border-radius: 5px;
    border: 1px solid #e0efff;
}

.shipping-methods legend {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    padding: 0 5px;
}

.shipping-methods label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 1em;
    color: #555;
}

.shipping-methods input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.shipping-cost {
    font-weight: bold;
    color: #5cb85c; /* Green for shipping cost */
    margin-left: auto; /* Push cost to the right */
}

/* Empty Cart Message */
.empty-cart-message {
    text-align: center;
    padding: 50px 20px;
    color: #666;
    font-size: 1.2em;
}

.empty-cart-message p {
    margin-bottom: 20px;
}

.empty-cart-message a {
    color: #0275d8;
    text-decoration: none;
    font-weight: bold;
}

.empty-cart-message a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cart-container {
        margin: 20px auto;
        padding: 15px;
    }

    .cart-title {
        font-size: 2em;
    }

    .cart-item {
        flex-wrap: wrap;
        justify-content: flex-start;
        padding: 15px;
    }

    .cart-item img {
        width: 60px;
        height: 60px;
        margin-right: 15px;
    }

    .item-details h4 {
        font-size: 1.1em;
    }

    .item-price, .item-quantity {
        min-width: auto;
        margin-top: 10px;
    }
     .item-price {
        text-align: left;
        width: 45%; /* Allow price to take more space */
    }

    .item-quantity {
        width: 55%; /* Allow quantity to take more space */
        margin-left: 0;
        margin-right: 0;
        justify-content: flex-start; /* Align quantity controls to the left */
    }

    .item-quantity button {
        padding: 4px 8px;
        font-size: 1em;
    }

    .item-quantity input[type="number"] {
        width: 45px;
        margin: 0 6px;
    }

    .remove-item-btn {
        font-size: 1.1em;
        margin-left: 10px; /* Add a little space from quantity */
    }

    .cart-summary {
        margin-top: 25px;
        padding: 20px;
    }

    .summary-section {
        font-size: 1em;
    }

    .summary-section.total {
        font-size: 1.2em;
    }

    .checkout-btn {
        font-size: 1.1em;
        padding: 12px 15px;
    }

    .shipping-methods {
        margin-top: 20px;
        padding: 10px;
    }
    .shipping-methods label {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .cart-title {
        font-size: 1.8em;
    }

    .cart-item {
        flex-wrap: wrap;
        padding: 10px;
    }

    .cart-item img {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }

    .item-details {
        width: calc(100% - 70px); /* Adjust width to fit image and margin */
    }

    .item-details h4 {
        font-size: 1em;
        margin-bottom: 3px;
    }

    .item-price, .item-quantity {
        margin-top: 8px;
        font-size: 0.95em;
    }

    .item-quantity button {
        padding: 3px 6px;
        font-size: 0.9em;
    }

    .item-quantity input[type="number"] {
        width: 40px;
        margin: 0 4px;
        font-size: 0.9em;
    }

    .remove-item-btn {
        font-size: 1em;
    }

    .cart-summary {
        padding: 15px;
    }

    .summary-section {
        font-size: 0.95em;
    }

    .summary-section.total {
        font-size: 1.1em;
    }

    .checkout-btn {
        font-size: 1.1em;
        padding: 10px 12px;
    }
}
