/* ================================================================
   OrderLocal HomeDash — Public CSS v2
   Two-column: scrollable restaurant sidebar + food item grid
   ================================================================ */

/* ── Reset & Container ───────────────────────────────── */

.ohd-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: transparent;
    color: var(--ohd-text, #191919);
    max-width: 100%;
    padding: 0;
}

.ohd-dashboard * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Compact Search Bar ─────────────────────────────── */

.ohd-search-bar {
    padding: 16px 24px;
    display: flex;
    justify-content: center;
}

.ohd-search-wrap {
    position: relative;
    width: 100%;
    max-width: 480px;
}

.ohd-search-icon {
    position: absolute !important;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px !important;
    height: 18px !important;
    max-width: none !important;
    max-height: none !important;
    color: #999;
    pointer-events: none;
}

.ohd-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1px solid #d4d4d4;
    border-radius: 50px;
    font-size: 14px;
    background: #ffffff;
    color: #191919;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ohd-search-input:focus {
    border-color: var(--ohd-primary, #e65100);
    box-shadow: 0 0 0 3px rgba(230,81,0,0.12), 0 0 24px rgba(230,81,0,0.08);
}

.ohd-search-input::placeholder {
    color: #9ca3af;
}

/* ── Two-Column Layout ───────────────────────────────── */

.ohd-main-layout {
    display: flex;
    gap: 0;
    min-height: 60vh;
    max-height: 800px;
    background: #ffffff;
    border-radius: 12px;
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ── LEFT: Restaurant Sidebar ────────────────────────── */

.ohd-sidebar {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid #f0f0f0;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.ohd-sidebar-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-shrink: 0;
}

.ohd-sidebar-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--ohd-text, #191919);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ohd-sidebar-count {
    font-size: 12px;
    color: var(--ohd-meta, #767676);
}

.ohd-restaurant-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px;
}

.ohd-restaurant-list::-webkit-scrollbar {
    width: 4px;
}

.ohd-restaurant-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* ── Restaurant Card (Sidebar) ───────────────────────── */

.ohd-restaurant-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
    border: 2px solid transparent;
}

.ohd-restaurant-card:hover {
    background: #ffffff;
    border-color: #f0f0f0;
}

.ohd-restaurant-card.active {
    background: #ffffff;
    border-color: var(--ohd-primary, #e65100);
    box-shadow: 0 0 0 1px var(--ohd-primary, #e65100);
}

.ohd-rc-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}

.ohd-rc-img-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--ohd-primary, #e65100), var(--ohd-accent, #ff6b35));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.ohd-rc-info {
    flex: 1;
    min-width: 0;
}

.ohd-rc-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ohd-text, #191919);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ohd-rc-meta {
    font-size: 11px;
    color: var(--ohd-meta, #767676);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.ohd-rc-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: #e8f5e9;
    color: #2e7d32;
}

.ohd-rc-badge.delivery {
    background: #fff3e0;
    color: #e65100;
}

.ohd-rc-product-count {
    font-size: 11px;
    color: var(--ohd-meta, #767676);
    margin-top: 1px;
}

/* ── RIGHT: Main Content Area ────────────────────────── */

.ohd-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.ohd-content-header {
    padding: 16px 20px 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
}

.ohd-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ohd-text, #191919);
}

.ohd-section-count {
    font-size: 13px;
    color: var(--ohd-meta, #767676);
}

/* ── Chevron Scroll Buttons ─────────────────────────── */

.ohd-chevrons {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.ohd-chevron {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

.ohd-chevron:hover {
    background: #f7f7f7;
    color: #191919;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
}

.ohd-chevron:active {
    transform: scale(0.95);
}

/* ── Category Pills ────────────────────────────────── */

.ohd-categories {
    padding: 4px 20px 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.ohd-categories::-webkit-scrollbar {
    display: none;
}

.ohd-cat-pill {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #f7f7f7;
    color: var(--ohd-text, #191919);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.ohd-cat-pill:hover {
    background: #fff3e0;
    color: #191919;
}

.ohd-cat-pill.active {
    background: var(--ohd-primary, #e65100);
    color: #ffffff;
    border-color: var(--ohd-primary, #e65100);
}

/* ── Food Item Grid ────────────────────────────────── */

.ohd-food-grid {
    flex: 1;
    padding: 0 20px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-content: start;
    overflow-y: auto;
    min-height: 200px;
}

/* ── Food Item Card ────────────────────────────────── */

.ohd-food-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    min-height: 280px;
}

.ohd-food-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: var(--ohd-primary, #e65100);
}

.ohd-food-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 ratio */
    background: #f7f7f7;
    overflow: hidden;
}

.ohd-food-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ohd-food-img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff5f0, #ffe8e0);
    color: var(--ohd-primary, #e65100);
    font-size: 32px;
}

.ohd-food-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.ohd-food-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ohd-text, #191919);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ohd-food-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--ohd-primary, #e65100);
    margin-top: 2px;
}

.ohd-food-restaurant {
    font-size: 11px;
    color: var(--ohd-meta, #767676);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Loading ───────────────────────────────────────── */

.ohd-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--ohd-meta, #767676);
    font-size: 14px;
}

/* ── Empty State ───────────────────────────────────── */

.ohd-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ohd-meta, #767676);
    grid-column: 1 / -1;
}

.ohd-empty svg {
    color: #d1d5db;
    margin-bottom: 12px;
}

.ohd-empty h3 {
    font-size: 16px;
    color: var(--ohd-text, #191919);
    margin-bottom: 6px;
}

.ohd-empty p {
    font-size: 13px;
    max-width: 320px;
    margin: 0 auto;
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 1024px) {
    .ohd-sidebar {
        width: 240px;
        min-width: 240px;
    }
    .ohd-food-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .ohd-food-body {
        padding: 8px 10px 10px;
    }
    .ohd-food-name {
        font-size: 12px;
    }
    .ohd-food-price {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .ohd-chevrons {
        display: none !important;
    }
    .ohd-main-layout {
        flex-direction: column;
        border-radius: 16px;
        box-shadow: none;
    }
    .ohd-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }
    .ohd-restaurant-list {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 12px;
        gap: 8px;
    }
    .ohd-restaurant-card {
        flex-shrink: 0;
        width: 160px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px;
    }
    .ohd-content-header {
        padding: 12px 12px 4px;
    }
    .ohd-categories {
        padding: 4px 12px 8px;
    }
    .ohd-food-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 12px 12px;
    }
    .ohd-search-bar {
        padding: 12px 16px;
    }
    .ohd-section-title {
        font-size: 17px;
    }
}
