/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #c0392b;
    --primary-dark: #96281b;
    --secondary: #2c3e50;
    --accent: #e74c3c;
    --bg: #fafafa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #ecf0f1;
    --whatsapp: #25D366;
    --whatsapp-dark: #128C7E;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
}

.restaurant-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.tagline {
    font-size: 0.95rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.delivery-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(4px);
}

/* Category Navigation */
.category-nav {
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    padding: 12px 0;
}

.nav-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-scroll::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Menu Grid */
.menu-section {
    padding: 24px 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Menu Card */
.menu-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
}

.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    margin-right: 8px;
}

.item-description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
    flex-grow: 1;
}

.item-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(192, 57, 43, 0.1);
    color: var(--primary);
    margin-bottom: 8px;
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: var(--primary);
    color: white;
}

.qty-btn:disabled {
    border-color: var(--border);
    color: var(--border);
    cursor: not-allowed;
}

.qty-btn:disabled:hover {
    background: white;
    color: var(--border);
}

.qty-value {
    font-size: 1rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.add-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-btn:hover {
    background: var(--primary-dark);
}

.add-btn.added {
    background: var(--whatsapp);
}

/* Cart FAB */
.cart-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 200;
    transition: transform 0.2s ease;
    animation: bounce 2s infinite;
}

.cart-fab:hover {
    transform: scale(1.1);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.cart-icon {
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--whatsapp);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.order-item-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-item-qty {
    font-size: 0.85rem;
    color: var(--text-light);
}

.order-item-price {
    font-weight: 700;
    color: var(--primary);
}

.remove-item {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.whatsapp-btn {
    width: 100%;
    padding: 14px;
    background: var(--whatsapp);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.whatsapp-btn:hover {
    background: var(--whatsapp-dark);
}

.whatsapp-icon {
    width: 22px;
    height: 22px;
}

/* Empty cart */
.empty-cart {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
}

.empty-cart-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .header {
        padding: 20px 0;
    }

    .logo-wrapper {
        width: 80px;
        height: 80px;
    }

    .logo {
        width: 65px;
        height: 65px;
    }

    .restaurant-name {
        font-size: 1.5rem;
    }

    .nav-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    .cart-fab {
        bottom: 16px;
        left: 16px;
        width: 54px;
        height: 54px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .container {
        padding: 0 24px;
    }
}

@media (min-width: 1025px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .modal {
        border-radius: 20px;
        margin-bottom: 40px;
    }

    .modal-overlay {
        align-items: center;
    }

    .header {
        padding: 32px 0;
    }

    .logo-wrapper {
        width: 120px;
        height: 120px;
    }

    .logo {
        width: 95px;
        height: 95px;
    }

    .restaurant-name {
        font-size: 2.2rem;
    }
}

/* Section Title */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}
