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

:root {
    --bg: #FAFAF7;
    --fg: #1A1A1A;
    --muted: #6B6B6B;
    --border: rgba(0,0,0,0.08);
    --card: #FFFFFF;
}

html.dark {
    --bg: #0F0E0C;
    --fg: #F5F1E8;
    --muted: #A8A8A8;
    --border: rgba(255,255,255,0.08);
    --card: #1A1918;
}

html.dark { color-scheme: dark; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--fg);
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.serif { font-family: 'Playfair Display', Georgia, serif; }

.menu-app { min-height: 100vh; }

/* HEADER */
.public-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.public-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.public-logo { height: 40px; width: auto; }
.public-header-title { flex: 1; }
.public-header-title h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.public-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}
.theme-toggle:hover { background: var(--border); }

.public-search-row {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.public-search-row input[type="search"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--fg);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}
.public-search-row input[type="search"]:focus { border-color: var(--primary); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
    padding: 8px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--fg);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.filters button:hover { border-color: var(--primary); }
.filters button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* CATEGORY NAV */
.category-nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 73px;
    background: var(--bg);
    z-index: 40;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.nav-link {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    background: var(--card);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.nav-link:hover { border-color: var(--primary); color: var(--primary); }

/* MAIN */
.public-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}
.category-section { margin-bottom: 56px; scroll-margin-top: 140px; }
.category-title {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.01em;
}

/* PRODUCTS */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
@media (min-width: 768px) {
    .products-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

.product-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    transition: all 0.25s ease;
    cursor: pointer;
}
.product-card:hover {
    background: color-mix(in srgb, var(--fg) 4%, transparent);
    transform: translateY(-1px);
}
.product-img {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border);
}
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.product-card:hover .product-img img { transform: scale(1.08); }

.product-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 6px;
}
.product-head h3 {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}
.price {
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 17px;
    white-space: nowrap;
}
.product-desc {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 10px;
    font-weight: 500;
}
.product-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
    margin-top: auto;
}

/* FOOTER */
.public-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.public-footer a {
    color: var(--primary);
    text-decoration: none;
    margin-left: 12px;
}

/* HOME */
.home-header {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px 40px;
    text-align: center;
}
.home-logo { height: 60px; margin-bottom: 20px; }
.home-header h1 { font-size: 40px; margin-bottom: 8px; }
.home-header p { color: var(--muted); }
.home-pos-grid {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    gap: 20px;
}
.pos-card {
    background: var(--card);
    padding: 28px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.pos-card h2 { font-size: 26px; margin-bottom: 6px; }
.pos-card > p { color: var(--muted); margin-bottom: 16px; }
.pos-menus { display: flex; flex-wrap: wrap; gap: 10px; }
.menu-link {
    display: inline-block;
    padding: 12px 20px;
    background: var(--fg);
    color: var(--bg);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.menu-link:hover { background: var(--primary); color: white; }
.menu-link small { display: block; font-size: 11px; opacity: 0.7; margin-top: 2px; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 15px;
}
.empty-state a { color: var(--primary); font-weight: 600; text-decoration: none; }

@media (max-width: 600px) {
    .category-title { font-size: 26px; }
    .product-img { width: 80px; height: 80px; }
    .product-head h3 { font-size: 16px; }
    .public-header-title h1 { font-size: 18px; }
    .home-header h1 { font-size: 32px; }
}
