@import url(/css/config.css);

/* cart.css */
.cart-section {
    padding: 3rem 0;
    padding-top: 7rem;
}

.cart-section h1 {
    text-align: center;
    font-family: var(--p);
    margin-bottom: 2rem;
    font-size: 30px;
    color: var(--dark);
}

/* Ensure consistent container styling */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}



.cart-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.cart-items {
    flex: 2;
    min-width: 300px;
}

.cart-summary {
    flex: 1;
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 10px;
    min-width: 300px;
    height: fit-content;
    position: sticky;
    top: 90px; /* Adjusted to account for header height */
}

.cart-summary h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-family: var(--p);
}

.summary-details {
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.summary-row.total {
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom: none;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background-color: #d43a65;
}

.continue-shopping-btn {
    display: block;
    text-align: center;
    color: var(--dark);
    font-family: var(--p);
    text-decoration: none;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.continue-shopping-btn:hover {
    color: var(--secondary);
}

/* Cart item styles */
.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-family: var(--p);
}

.cart-item-price {
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--secondary);
    font-family: var(--p);
}

.cart-item-actions {
    display: flex;justify-content: space-evenly;
    align-items: center;
    gap: 1rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.quantity-btn {
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.empty-cart-message {
    text-align: center;
    font-family: var(--p);
    padding: 3rem 0;
}

.empty-cart-message p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Responsive styles */
@media (max-width: 992px) {
    .cart-section {
        width: 100%; /* Remove hardcoded width */
        padding: 2rem 0;
        padding-top: 6rem;
    }

    .cart-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .cart-items {
        min-width: 100%;
    }

    .cart-summary {
        min-width: 100%;
        position: static;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .cart-container {
        flex-direction: column;
        gap: 1rem;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        flex-direction: column;
        width: 100%; /* Remove hardcoded width */
        gap: 1rem;
    }

    .cart-item-image {
        width: 100%;
        height: auto;
        max-height: 200px;
    }

    .cart-section h1 {
        font-size: 1.5rem; /* Adjusted for smaller screens */
    }

    .cart-item-title {
        font-size: 14px;
    }

    .cart-item-price {
        font-size: 12px;
    }

    .quantity-selector {
        width: fit-content;
    }

    .quantity-input {
        width: 35px;
    }

    .quantity-btn {
        width: 25px;
        height: 30px;
    }
    span {
    font-size: 12px;
    }
}

@media (max-width: 576px) {
    .cart-section {
        padding-top: 7rem;
    }

    .cart-section h1 {
        font-size: 14px;
    }

    .cart-summary {
        padding: 1rem;
        width: 250px;
    }

    .cart-summary h2 {
        font-size: 1.2rem;
    }
    .empty-cart-message p{
        font-size: 14px;
    }

    .summary-row {
        font-size: 14px;
    }
    .summary-row span{
        font-family: var(--p);
    }

    .summary-row.total {
        font-size: 1rem;
    }

    .checkout-btn,.continue-shopping-btn {
        padding: 0.8rem;
        font-size: 14px;
    }
}