/* styles.css */
/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --dark-color: #2d3436;
    --light-color: #f9f9f9;
    --success-color: #6ab04c;
    --warning-color: #f0932b;
    --danger-color: #eb4d4b;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

/* Main content */
.main-content {
    margin-top: 80px;
    padding: 20px 0;
}

/* Restaurant list */
.restaurant-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.restaurant-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.restaurant-card:hover {
    transform: translateY(-5px);
}

.restaurant-logo {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.restaurant-info {
    padding: 15px;
}

.restaurant-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.restaurant-cuisine {
    color: #666;
    font-size: 0.9rem;
}

.restaurant-rating {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.stars {
    color: var(--warning-color);
    margin-right: 5px;
}

/* Menu page */
.menu-header {
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    padding: 60px 0 30px;
    position: relative;
}

.menu-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.menu-header-content {
    position: relative;
    z-index: 2;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.menu-categories {
    display: flex;
    overflow-x: auto;
    padding: 10px 0;
    margin: 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background-color: #fff;
    z-index: 10;
}

.menu-categories.sticky {
    position: sticky;
    top: 0;
    padding: 15px;
    box-shadow: var(--shadow);
}

.menu-categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 8px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.no-items {
    text-align: center;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    margin: 20px 0;
    color: #666;
    font-size: 1.1rem;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.menu-item {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.menu-item-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.menu-item-info {
    padding: 15px;
}

.menu-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.menu-item-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.menu-item-price {
    font-weight: 700;
    color: var(--primary-color);
}

.add-to-cart {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: var(--primary-color);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

/* Cart */
.cart-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    border: none;
    z-index: 99;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: #fff;
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-modal.active {
    opacity: 1;
    visibility: visible;
}

.cart-content {
    background-color: #fff;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cart-header {
    padding: 15px;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

.cart-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    flex-grow: 1;
    padding-right: 15px;
}

.cart-item-name {
    font-weight: 600;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity {
    margin: 0 10px;
    min-width: 20px;
    text-align: center;
}

.cart-footer {
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 700;
}

.checkout-btn {
    background-color: var(--success-color);
    color: #fff;
    border: none;
    width: 100%;
    padding: 12px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
}

/* Media Queries */
@media (max-width: 768px) {
    .restaurant-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .menu-items {
        grid-template-columns: 1fr;
    }

    .menu-header {
        padding: 50px 0 25px;
    }

    .cart-content {
        width: 95%;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: #fff;
    color: var(--dark-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    min-width: 250px;
    max-width: 350px;
    animation: slideInRight 0.3s, fadeOut 0.5s 2.5s forwards;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--secondary-color);
}

.toast-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.success .toast-icon {
    color: var(--success-color);
}

.error .toast-icon {
    color: var(--danger-color);
}

.warning .toast-icon {
    color: var(--warning-color);
}

.info .toast-icon {
    color: var(--secondary-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}