:root {
    --primary-color: #50876c;
    --primary-light: #d4f7a6;
    --secondary-color: #2ed573;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #1e272e;
    --text-muted: #808e9b;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header & Navigation */
.header {
    background: var(--card-bg);
    padding: 1.5rem 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

#brandName {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.table-info {
    background: var(--bg-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border: 1px solid #eee;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    background: #f9f9f9;
}

.categories-wrapper {
    overflow-x: auto;
    margin: 0 -1rem;
    padding: 0 1rem;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    /* Indicates it can be dragged */
    user-select: none;
    /* Prevents text selection while dragging */
}

.categories-wrapper:active {
    cursor: grabbing;
}

/* Custom Thin Scrollbar */
.categories-wrapper::-webkit-scrollbar {
    height: 3px;
    /* Very thin scrollbar */
}

.categories-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.categories-wrapper::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}

.categories-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.categories {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0 0.8rem 0;
    flex-wrap: nowrap;
    width: max-content;
    min-width: calc(100% + 1px);
    padding-right: 2rem;
    /* Add extra space at the end to ensure the last item is fully visible */
}

.category-btn {
    padding: 0.6rem 1.25rem;
    border: 1px solid #eee;
    background: white;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-main);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(80, 135, 108, 0.25);
}

/* Main Content */
.menu-container {
    padding: 1.5rem 1rem 5rem;
}

.menu-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

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

/* Menu Item Card */
.menu-item {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.menu-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.item-img-container {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background-color: #f1f2f6;
    /* Light gray background by default */
}

.item-img.is-placeholder {
    object-fit: contain;
    padding: 20px;
    background: white;
}

.zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: var(--transition);
}

.item-img-container:hover .zoom-overlay {
    opacity: 1;
}

.item-img-container:hover .item-img {
    transform: scale(1.1);
}

.item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge.veg {
    color: #2ecc71;
}

.badge.nonveg {
    color: #e74c3c;
}

.item-details {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
}

.add-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.add-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Cart FAB */
.cart-fab {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px rgba(255, 71, 87, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
}

.cart-fab:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--text-main);
    color: white;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    transition: 0.4s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    border-radius: 12px;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .cart-sidebar {
        width: 400px;
    }
}

/* Cart Item Decorations */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.cart-item-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f1f2f6;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
}

.cart-item-actions button {
    border: none;
    background: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-actions span {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox Styling */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.open {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.lightbox.open img {
    transform: scale(1);
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 25px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    font-weight: 300;
    line-height: 1;
}

.item-img-container {
    cursor: zoom-in;
}