/* =============================
   Global Styles
   ============================= */
:root {
    --menu-bg: #f5f7fa;
    --menu-text: #333;
    --menu-header-gradient-start: #667eea;
    --menu-header-gradient-end: #764ba2;
    --menu-header-text: #fff;
    --search-bg: #fff;
    --search-icon: #667eea;
    --search-text: #333;
    --search-placeholder: #999;
    --search-shadow: rgba(102, 126, 234, 0.15);
    --category-btn-bg: #fff;
    --category-btn-border: #e0e0e0;
    --category-btn-text: #666;
    --category-btn-hover-border: #667eea;
    --category-btn-hover-text: #667eea;
    --category-title: #667eea;
    --card-bg: #fff;
    --card-shadow: rgba(102, 126, 234, 0.1);
    --card-hover-shadow: rgba(102, 126, 234, 0.2);
    --item-name: #333;
    --item-description: #666;
    --item-price: #667eea;
    --placeholder-bg: #f0f0f0;
    --placeholder-icon: #aaa;
    --no-results-icon: #ddd;
    --no-results-text: #666;
    --no-results-hint: #999;
    --modal-bg: #fff;
    --modal-text: #333;
    --modal-header-bg: #f8f9fa;
    --cart-item-bg: #fff;
    --cart-item-shadow: rgba(0, 0, 0, 0.08);
    --cart-item-hover-shadow: rgba(0, 0, 0, 0.12);
    --scrollbar-track: #f0f0f0;
    --scrollbar-thumb: linear-gradient(135deg, #667eea, #764ba2);
}

[data-theme="dark"] {
    --menu-bg: #1a1a2e;
    --menu-text: #e4e4e7;
    --menu-header-gradient-start: #667eea;
    --menu-header-gradient-end: #764ba2;
    --menu-header-text: #fff;
    --search-bg: #0f3460;
    --search-icon: #a78bfa;
    --search-text: #e4e4e7;
    --search-placeholder: #9ca3af;
    --search-shadow: rgba(167, 139, 250, 0.15);
    --category-btn-bg: #0f3460;
    --category-btn-border: #1a1a2e;
    --category-btn-text: #e4e4e7;
    --category-btn-hover-border: #a78bfa;
    --category-btn-hover-text: #a78bfa;
    --category-title: #a78bfa;
    --card-bg: #0f3460;
    --card-shadow: rgba(167, 139, 250, 0.1);
    --card-hover-shadow: rgba(167, 139, 250, 0.2);
    --item-name: #e4e4e7;
    --item-description: #9ca3af;
    --item-price: #a78bfa;
    --placeholder-bg: #1a1a2e;
    --placeholder-icon: #6b7280;
    --no-results-icon: #374151;
    --no-results-text: #9ca3af;
    --no-results-hint: #6b7280;
    --modal-bg: #0f3460;
    --modal-text: #e4e4e7;
    --modal-header-bg: #1a1a2e;
    --cart-item-bg: #16213e;
    --cart-item-shadow: rgba(0, 0, 0, 0.3);
    --cart-item-hover-shadow: rgba(0, 0, 0, 0.5);
    --scrollbar-track: #1a1a2e;
    --scrollbar-thumb: linear-gradient(135deg, #a78bfa, #c084fc);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--menu-bg);
    margin: 0;
    color: var(--menu-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =============================
   Container & Header
   ============================= */
.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.menu-header {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--menu-header-gradient-start), var(--menu-header-gradient-end));
    color: var(--menu-header-text);
    border-radius: 15px;
    margin-bottom: 30px;
}

.menu-header h1 {
    margin: 0;
    font-size: 2.5rem;
}

/* =============================
   Search Bar
   ============================= */
.search-container {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    max-width: 600px;
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--search-bg);
    border-radius: 50px;
    padding: 12px 20px;
    box-shadow: 0 4px 20px var(--search-shadow);
    transition: all 0.3s ease;
}

.search-box i.fas {
    color: var(--search-icon);
    font-size: 1.2rem;
    margin-right: 12px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--search-text);
    background: transparent;
}

.search-box input::placeholder {
    color: var(--search-placeholder);
}

.search-box .clear-btn {
    background: var(--search-icon);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box .clear-btn:hover {
    background: var(--menu-header-gradient-end);
    transform: scale(1.1);
}

/* =============================
   Category Filter (Horizontal)
   ============================= */
.categories-filter-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 15px 5px;
    margin-bottom: 30px;
    scrollbar-width: thin;
    scrollbar-color: var(--search-icon) var(--scrollbar-track);
}

.categories-filter-container::-webkit-scrollbar {
    height: 6px;
}

.categories-filter-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 10px;
}

.categories-filter-container::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

.category-filter-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--category-btn-bg);
    border: 2px solid var(--category-btn-border);
    border-radius: 50px;
    font-weight: 600;
    color: var(--category-btn-text);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-filter-btn:hover {
    border-color: var(--category-btn-hover-border);
    color: var(--category-btn-hover-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--search-shadow);
}

.category-filter-btn.active {
    background: linear-gradient(135deg, var(--menu-header-gradient-start), var(--menu-header-gradient-end));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 20px var(--search-shadow);
}

/* =============================
   No Results Message
   ============================= */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--no-results-hint);
}

.no-results i {
    font-size: 4rem;
    color: var(--no-results-icon);
    margin-bottom: 20px;
}

.no-results p {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--no-results-text);
}

.no-results small {
    font-size: 0.95rem;
    color: var(--no-results-hint);
}

/* =============================
   Category Sections & Grid
   ============================= */
.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 1.8rem;
    color: var(--category-title);
    border-bottom: 3px solid var(--category-title);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* =============================
   Menu Item Card
   ============================= */
.menu-item {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--card-hover-shadow);
}

.menu-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
}

.menu-item-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: var(--item-name);
}

.menu-item-description {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: var(--item-description);
    min-height: 40px;
}

.menu-item-price {
    font-weight: 600;
    color: var(--item-price);
    font-size: 1rem;
}

.menu-item-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.menu-item-image .no-image-placeholder {
    width: 100%;
    height: 180px;
    background: var(--placeholder-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--placeholder-icon);
    font-size: 2rem;
}

.btn-add-cart {
    background: linear-gradient(135deg, var(--menu-header-gradient-start), var(--menu-header-gradient-end));
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 0 0 15px 15px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, var(--menu-header-gradient-end), var(--menu-header-gradient-start));
}

/* =============================
   Cart Float Button
   ============================= */
.cart-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #667eea;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: #fff;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* =============================
   Modal Styles (Cart & QR)
   ============================= */
.modal-content {
    background-color: var(--modal-bg);
    color: var(--modal-text);
}

.modal-header {
    background-color: var(--modal-header-bg);
    color: var(--modal-text);
    border-bottom: 1px solid var(--category-btn-border);
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    background-color: var(--modal-bg);
}

/* Cart Item Card inside Modal */
.cart-item-card {
    background: var(--cart-item-bg);
    border-radius: 12px;
    box-shadow: 0 3px 10px var(--cart-item-shadow);
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    margin-bottom: 10px;
}

.cart-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px var(--cart-item-hover-shadow);
}

/* Header of each cart item */
.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 15px 10px 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

[data-theme="dark"] .cart-item-header {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.05), rgba(192, 132, 252, 0.05));
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h6 {
    margin: 0 0 5px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--item-name);
}

.item-price {
    font-weight: 600;
    color: var(--item-price);
    font-size: 0.95rem;
}

.btn-remove-item {
    background: var(--card-bg);
    border: 1px solid var(--category-btn-border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--no-results-hint);
    padding: 0;
    margin-left: 10px;
}

.btn-remove-item:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
    transform: rotate(90deg);
}

/* Cart item body (quantity controls) */
.cart-item-body {
    padding: 0 15px 10px 15px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    background: linear-gradient(135deg, var(--menu-header-gradient-start), var(--menu-header-gradient-end));
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: linear-gradient(135deg, var(--menu-header-gradient-end), var(--menu-header-gradient-start));
    transform: scale(1.1);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--item-name);
}

/* Footer (subtotal) */
.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .cart-item-footer {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), rgba(192, 132, 252, 0.08));
    border-top: 1px solid rgba(167, 139, 250, 0.1);
}

.cart-item-footer-label {
    font-weight: 500;
    color: var(--item-description);
    font-size: 0.9rem;
}

.cart-item-subtotal {
    font-weight: 700;
    color: var(--item-price);
    font-size: 1.1rem;
}

/* Cart container styling */
.cart-container {
    --cart-color: #667eea;
    background: var(--cart-item-bg) !important;
    border-color: var(--cart-color) !important;
}

.cart-container.active {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.cart-header {
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-header:hover {
    opacity: 0.9;
}

.cart-name-input {
    transition: all 0.2s ease;
    color: var(--item-name) !important;
}

.cart-name-input:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 4px;
}

.cart-name-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 4px;
    outline: 1px solid rgba(255, 255, 255, 0.3);
}

/* =============================
   Responsive Adjustments
   ============================= */
@media (max-width: 768px) {
    .menu-header h1 {
        font-size: 2rem;
    }

    .search-box {
        padding: 10px 16px;
    }

    .search-box input {
        font-size: 0.95rem;
    }

    .categories-filter-container {
        padding: 10px 0;
        margin-bottom: 20px;
    }

    .category-filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }
}