/*nested2.css*/
/* ============================================================
   ENTERPRISE MENU BROWSE - AMAZON/UBER EATS STYLE
   Single source of truth - no conflicts
   ============================================================ */

.menu-browse-container {
    background: #f5f5f7;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* ============================================================
   TOP BAR: Breadcrumb + Search
   ============================================================ */
.menu-top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Breadcrumb */
.menu-breadcrumb {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}
.menu-breadcrumb::-webkit-scrollbar { display: none; }

.breadcrumb-item {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.breadcrumb-item:hover { background: #f1f3f5; border-color: #adb5bd; }
.breadcrumb-item.active {
    background: var(--menu-primary-color);
    color: white;
    border-color: var(--menu-primary-color);
    font-weight: 600;
    cursor: default;
}
.breadcrumb-item i { font-size: 0.8rem; }

.breadcrumb-separator {
    color: #adb5bd;
    font-size: 1rem;
    flex-shrink: 0;
    margin: 0 2px;
    font-weight: 300;
}

/* Mini Search */
.menu-search-mini { position: relative; }

/* "Prices updated on ..." under the top bar (menu_nested3.html) */
.menu-prices-updated {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 16px 0;
    padding: 4px 12px;
    font-size: 0.8rem;
    color: #146c43;
    background: #e8f5ee;
    border-radius: 999px;
    width: fit-content;
    margin-inline: auto;
}
.menu-prices-updated i { font-size: 0.85em; }
.menu-search-mini i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 0.85rem;
    z-index: 1;
}
.menu-search-mini input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border-radius: 22px;
    border: 1px solid #dee2e6;
    background: #f1f3f5;
    font-size: 0.85rem;
}
.menu-search-mini input:focus {
    background: white;
    border-color: var(--menu-primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.1);
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.menu-content-area { padding: 16px; }

.section-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.item-count-badge {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 400;
}

/* ============================================================
   ROOT CATEGORY GRID (also used by subcategories)
   ============================================================ */
.category-grid,
.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Shared card styles for BOTH root and subcategory */
.category-grid-card,
.subcategory-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}
.category-grid-card:active,
.subcategory-card:active { transform: scale(0.97); }

/* Shared image container */
.grid-card-image,
.subcat-image-container {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    flex-shrink: 0;
}
.grid-card-image img,
.subcat-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Shared icon fallback */
.grid-card-icon,
.subcat-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--menu-primary-color);
    background: rgba(220,53,69,0.05);
}

/* Shared overlay */
.grid-card-overlay,
.subcat-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}
.grid-card-count,
.subcat-count-badge {
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Shared body */
.grid-card-body,
.subcat-info {
    padding: 12px;
}
.grid-card-title,
.subcat-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 4px 0;
}
.grid-card-desc,
.subcat-desc {
    font-size: 0.75rem;
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Subcategory chips (root cards only) */
.grid-card-subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.subcat-chip {
    padding: 3px 8px;
    background: #f1f3f5;
    border-radius: 10px;
    font-size: 0.7rem;
    color: #495057;
}
.subcat-chip.more {
    background: var(--menu-primary-color);
    color: white;
}

/* ============================================================
   ITEMS LIST
   ============================================================ */
.items-section { margin-bottom: 16px; }
.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Item Row */
.menu-item-row {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #f0f0f0;
    align-items: center;
}
.menu-item-row:active { transform: scale(0.98); }

.item-row-image {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #f1f3f5;
}
.item-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.item-row-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--menu-primary-color);
    background: rgba(220,53,69,0.05);
}
.popular-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
}

.item-row-info { flex: 1; min-width: 0; }
.item-row-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 2px 0;
}
.item-row-desc {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.item-row-price {
    font-weight: 700;
    color: #198754;
    font-size: 0.9rem;
}
.item-row-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 6px;
}
.tag.spicy { background: #fff5f5; color: #dc3545; }
.tag.time { background: #f0f9ff; color: #0dcaf0; }
.tag.kcal { background: #f8f9fa; color: #6c757d; }

.item-row-action { flex-shrink: 0; }
.btn-add-round {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--menu-primary-color);
    color: white;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-add-round:active { transform: scale(0.9); }

/* ============================================================
   RESPONSIVE
   The card is a phone-width column on every device (~425px), so
   categories stay in 2 columns at every screen size. The old
   768px / 1200px media queries switched to 3 / 4 columns by
   WINDOW width and squeezed the cards on laptops.
   ============================================================ */
.category-grid,
.subcategories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
