/* Main Content Styles */
.main-content {
    padding-top: 100px;
    flex: 1; /* This ensures the content takes up available space */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the content horizontally */
    padding: 50px; /* Add padding to the content */
    background-color: var(--background-light);
}

/* Cart Container */
.cart-container h1 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 2.5em; /* Adjust size instead of using scale */
    font-family: "Amarante", serif;
    
}

/* Remove up/down arrows from number input */
.no-arrows {
    -moz-appearance: textfield;
}

.no-arrows::-webkit-outer-spin-button,
.no-arrows::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinner::-webkit-inner-spin-button, 
.no-spinner::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cart Item Styles */
.cart-item {
    display: flex;
    align-items: center;
    background-color: var(--background-white);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid var(--divider-color);
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 20px;
}

.cart-item .item-info {
    flex-grow: 1;
}

.cart-item .item-info h2 {
    margin: 0;
    font-size: 1.2em;
    color: var(--text-color);
}

.cart-item .item-info p {
    margin: 5px 0;
    color: var(--text-light);
}

.cart-item .item-info .price {
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    color: var(--primary-color);
}

.cart-item .item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cart-item .item-actions button {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border: none;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cart-item .item-actions button:hover {
    background-color: var(--primary-dark);
}

.cart-item .remove-button {
    position: absolute;
    top: 5px;
    right: 10px;
    color: var(--text-on-primary);
    border: none;
    border-radius: 5px;
    padding: 5px 5px;
    cursor: pointer;
    transition: background-color 0.5s ease;
}

.cart-item .remove-button:hover {

}

/* Cart Summary */
.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 15px 20px;
    background-color: var(--background-white);
    color: var(--text-color);
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.cart-summary p {
    font-size: 1.1em;
    font-weight: 500;
    margin: 0;
    color: var(--text-color);
}

.cart-summary p span {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--primary-color);
}

/* Checkout Button */
.checkout-button {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.checkout-button:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Empty Cart Message */
.empty-cart-message {
    text-align: center;
    margin-top: 20px;
    font-size: 1.2em;
}

.empty-cart-message p {
    margin: 0;
    color: var(--text-light);
}

.empty-cart-image {
    display: block;
    width: 250px;
    height: auto;
    margin: 20px auto;
}

.discover-food-button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.discover-food-button:hover {
    background-color: var(--primary-dark);
    color: var(--text-on-primary);
}

.cart-item {
    transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
}

.cart-item.removing {
    opacity: 0;
    filter: blur(10px);
    transform: scale(0.9);
}

/* Modal Overlay (Blurry Background) */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(5px);
    z-index: 999;
    display: none;
}

/* Popup Modal */
#confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 300px;
    z-index: 1000;
    display: none;
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.modal-buttons button {
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
}

#confirm-remove {
    background: var(--error-red);
    color: var(--text-on-primary);
}

#cancel-remove {
    background: var(--disabled-color);
    color: var(--text-color);
}

/* Active Modal */
#confirm-modal.active,
#modal-overlay.active {
    display: block;
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: var(--text-on-primary);
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Coupon Toggle Button */
.coupon-toggle {
    margin: 20px 0;
    text-align: center;
}

#toggle-coupon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-on-primary);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;

    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

#toggle-coupon:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark));
    transform: translateY(-2px);

}

#toggle-coupon:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#toggle-coupon i {
    transition: transform 0.3s ease;
}

/* Rotate arrow when expanded */
#toggle-coupon.expanded i {
    transform: rotate(180deg);
}

/* Coupon Section Animation */
.coupon-section {
    margin: 10px auto;
    padding: 0 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
}

.coupon-section.expanded {
    max-height: 300px; /* Adjust based on content height */
    opacity: 1;
    padding: 20px;
}

/* Coupon Input Field */
#coupon-code {
    padding: 14px;
    width: calc(100% - 28px);
    border: 2px solid rgba(134, 168, 115, 0.3);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    text-align: center;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

#coupon-code:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(134, 168, 115, 0.4);
    background: var(--background-white);
}

/* Coupon Buttons */
.coupon-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

#apply-coupon, #remove-coupon {
    flex: 1;
    padding: 14px 0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 140px;
    position: relative;
    overflow: hidden;
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Apply Coupon Button */
#apply-coupon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-on-primary);
}

#apply-coupon:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark));
    box-shadow: 0 6px 12px rgba(134, 168, 115, 0.4);
    transform: translateY(-2px);
}

/* Remove Coupon Button */
#remove-coupon {
    background: linear-gradient(135deg, var(--error-red), var(--error-red-dark));
    color: var(--text-on-primary);
    display: none; /* Initially hidden */
}

#remove-coupon:hover {
    background: linear-gradient(135deg, var(--error-red-dark), var(--error-red-dark));
    box-shadow: 0 6px 12px rgba(211, 47, 47, 0.4);
    transform: translateY(-2px);
}

/* Button Click Effect */
#apply-coupon:active, #remove-coupon:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Coupon Message Styles */
.coupon-message {
    margin-top: 15px;
    font-size: 15px;
    font-weight: bold;
    padding: 14px;
    border-radius: 12px;
    display: none; /* Hidden by default */
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Success Message */
.coupon-message.success {
    background: rgba(232, 245, 233, 0.9);
    color: #2e7d32;
    border-color: #c8e6c9;
    display: block;
}

/* Error Message */
.coupon-message.error {
    background: rgba(255, 235, 238, 0.9);
    color: var(--error-red);
    border-color: #ffcdd2;
    display: block;
}

/* Info Message */
.coupon-message.info {
    background: rgba(227, 242, 253, 0.9);
    color: #1565c0;
    border-color: #bbdefb;
    display: block;
}



/* Enhanced Quantity Controls - No JS Changes Needed */
.item-info p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0;
}

.item-info .quantity-action,
.item-info .increment {
    width: 34px;
    height: 34px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background-color: white;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.item-info .quantity-action:hover,
.item-info .increment:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.item-info .quantity-action:active,
.item-info .increment:active {
    transform: translateY(0);
}

.item-info .quantity-input {
    width: 50px;
    height: 36px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 4px;
    -moz-appearance: textfield;
    transition: border-color 0.3s ease;
}

.item-info .quantity-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(134, 168, 115, 0.2);
}

.item-info .quantity-input::-webkit-outer-spin-button,
.item-info .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Special style for remove action */
.item-info .quantity-action[innerHTML="🗑️"] {
    color: #ff4444;
    border-color: #ff4444;
    background-color: white;
}

.item-info .quantity-action[innerHTML="🗑️"]:hover {
    background-color: #ff4444;
    color: white;
}

/* Micro-interaction for button press */
.item-info .quantity-action::after,
.item-info .increment::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.item-info .quantity-action:active::after,
.item-info .increment:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .item-info .quantity-action,
    .item-info .increment {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .item-info .quantity-input {
        width: 42px;
        height: 32px;
        font-size: 15px;
    }
}




/* --- Notun Sticky Cart Summary Style --- */

/* Shudhu boro screen-er jonno (Desktop/Tablet) */
@media (min-width: 992px) {
    .cart-layout {
        display: flex;
        flex-direction: row;
        align-items: flex-start; /* Column-guli jeno opor theke shuru hoy */
        gap: 30px; /* Duti column-er majhe faka jayga */
        width: 100%;
        max-width: 1200px; /* Apnar site-er main width */
        margin: 0 auto;
    }

    .cart-items-column {
        flex: 2; /* Bestseller column-take beshi jayga deoya (e.g., 66%) */
    }

    .cart-sidebar {
        flex: 1; /* Sidebar-ke kom jayga deoya (e.g., 33%) */
        position: sticky;
        top: 120px; /* Header-er por koto-ta niche theke atke thakbe */
        width: 100%;
    }
}

/* Choto screen-e (Mobile) shob kichu ager motoi lomba-lombi thakbe */
@media (max-width: 991px) {
    .cart-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .cart-sidebar {
        width: 100%;
        margin-top: 20px;
    }
}







/* =================================
   SKELETON LOADER FOR CART ITEMS
   ================================= */
.cart-item-skeleton {
    display: flex;
    align-items: center;
    background-color: var(--background-white);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--divider-color);
    gap: 20px;
}

.cart-item-skeleton .skeleton-image {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    flex-shrink: 0; /* Prevents the image from shrinking */
}

.cart-item-skeleton .skeleton-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item-skeleton .skeleton-line {
    height: 18px;
    border-radius: 4px;
}

.cart-item-skeleton .skeleton-line.title {
    width: 80%;
}

.cart-item-skeleton .skeleton-line.price {
    width: 40%;
}

.cart-item-skeleton .skeleton-line.quantity {
    width: 60%;
}