/* General Styling */
body {
    font-family: 'Poppins', serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #FFDAB9, #FF6347);
    color: #3B2F2F;
}

/* Header Styling */
header {
    text-align: center;
    background-color: #8B4513;
    color: #FFF;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
}

/* Category Navigation */
.category-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 1rem;
    background-color: #FFDAB9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.category-nav-btn {
    padding: 0.8rem 1.5rem;
    background-color: #FF6347;
    color: #FFF;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
    font-family: 'Poppins', serif;
    font-size: 1rem;
}

.category-nav-btn:hover {
    transform: scale(1.1);
    background-color: #FF4500;
}

.category-nav-btn.active {
    background-color: #8B4513;
}

/* Menu Container */
.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Adaptive grid layout */
    gap: 2rem;
    justify-content: center;
}

/* Menu Item Card */
.menu-item {
    background-color: #FFF8DC;
    border-radius: 15px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

.menu-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.item-details {
    padding: 1rem;
    text-align: center;
}

.item-details h3 {
    margin: 0.5rem 0;
    color: #8B4513;
}

.item-details p {
    font-size: 0.9rem;
    color: #6B4226;
}

.price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #8B4513;
    margin: 1rem 0;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 1rem 0;
}

.quantity-btn {
    background-color: #FF6347;
    color: #FFF;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

.quantity-btn:hover {
    transform: scale(1.2);
}

.quantity-display {
    font-size: 1rem;
    font-weight: bold;
    color: #8B4513;
}

/* Add to Cart Button */
.add-to-cart {
    background-color: #FFDAB9;
    color: #8B4513;
    border: 2px solid #8B4513;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.add-to-cart:hover {
    background-color: #8B4513;
    color: #FFF;
}

/* Cart Icon */
.cart-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #FF6347;
    color: #FFF;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #FFF8DC;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    display: none; /* Hide by default */
    flex-direction: column;
    gap: 1.5rem;
    z-index: 1000;
}

.cart-modal.active {
    display: flex; /* Show when active */
}


.cart-modal h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
    color: #8B4513;
}

/* Cart Items Layout */
#cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #FFDAB9;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cart-item-name {
    flex: 3;
    font-size: 1rem;
    color: #6B4226;
    font-weight: bold;
}

.cart-item-quantity {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: #8B4513;
}

.cart-item-price {
    flex: 1;
    text-align: right;
    font-size: 1rem;
    color: #8B4513;
    font-weight: bold;
}

.remove-btn {
    flex: 0;
    background-color: #FF6347;
    color: #FFF;
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.remove-btn:hover {
    background-color: #FF4500;
    transform: scale(1.1);
}

/* Cart Footer */
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #8B4513;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #6B4226;
}

.cart-buttons {
    display: flex;
    gap: 1rem;
}

.checkout-btn,
.close-btn {
    background-color: #FF6347;
    color: #FFF;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.checkout-btn:hover,
.close-btn:hover {
    background-color: #8B4513;
    transform: scale(1.1);
}


/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    background-color: #8B4513;
    color: #FFF;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 1rem;
    }

    .menu-item {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}
