/* Layout and Base Styles */
html, body {
    /* height: 100%; */
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#app-container {
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    flex-shrink: 0;
    /* position: sticky; */
    top: 0;
}

.menu-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

.footer {
    flex-shrink: 0;
    /* position: sticky; */
    bottom: 0;
    background-color: #FFF5F5;
}

/* Menu Items */
.menu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    will-change: transform;
}

.menu-scroll {
    max-height: 100%;
    overflow-y: auto;
}

.menu-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 10px;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background-color: #4B556B;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quantity Controls */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 3px;
}

.quantity-btn {
    width: 18px;
    height: 18px;
    font-size: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.15s ease;
}

.quantity-display {
    min-width: 18px;
    text-align: center;
    font-size: 12px;
}

/* Focus Styles */
button:focus-visible,
.btn:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px var(--primary-color-dark) !important;
}

/* Category Buttons */
.category-btn {
    flex: 0 0 auto;
    background-color: #FFEBEE;
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
}

.category-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* Scrollbar Hide */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

/* Smooth scroll for categories */
#sidebar-categories {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

#sidebar-categories::-webkit-scrollbar {
    width: 6px;
}

#sidebar-categories::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-categories::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

/* Option Buttons */
.option-btn {
    border: 1px solid var(--primary-color);
    border-radius: 16px;
    padding: 2px 8px;
    font-size: 10px;
    margin-right: 2px;
    margin-bottom: 2px;
    cursor: pointer;
    white-space: nowrap;
}

.option-btn.selected {
    background-color: var(--primary-color);
    color: white;
}

.option-group {
    margin-bottom: 10px;
}

.option-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.readonly-tier {
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: #4b5563;
}

/* Line clamp utility for grid layout */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Grid layout improvements */
.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

/* List layout (old style) */
.menu-items.list-layout {
    display: block;
}

.menu-items.list-layout .menu-item {
    display: flex;
    margin-bottom: 16px;
}

.menu-items.list-layout .menu-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
}

.menu-items.list-layout .menu-item .item-content {
    flex: 1;
    min-width: 0;
}

.menu-items.list-layout .item-header {
    text-align: left;
    margin-bottom: 8px;
}

.menu-items.list-layout .item-header h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.menu-items.list-layout .item-header p {
    font-size: 14px;
    line-height: 1.4;
}

.menu-items.list-layout .option-group {
    margin-bottom: 12px;
}

.menu-items.list-layout .option-btn {
    font-size: 12px;
    padding: 4px 10px;
    margin-right: 6px;
    margin-bottom: 6px;
}

/* Search overlay styling */
#search-overlay {
    z-index: 1000;
}

/* Ensure search overlay has same styling and behavior as header */
#search-overlay.header {
    display: none; /* Hidden by default */
    flex-shrink: 0; /* Same as header */
}

#search-overlay.header:not(.hidden) {
    display: flex; /* Show when not hidden */
}

/* Mobile Support */
@supports (-webkit-touch-callout: none) {
    #app-container {
        height: -webkit-fill-available;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .menu-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    #categories-bottom-sheet {
        max-height: 100vh;
    }

    #categories-bottom-sheet .bg-white {
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    #categories-bottom-sheet .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Typography */
p {
    line-height: 1.3;
}

