:root {
    --ym-primary: #ff6b35;
    --ym-primary-dark: #e5532a;
    --ym-ink: #1a1a2e;
    --ym-muted: #6b7280;
    --ym-bg: #f7f7f9;
    --ym-card: #ffffff;
    --ym-border: #ececf0;
    --ym-radius: 16px;
    --ym-radius-sm: 10px;
    --ym-shadow: 0 4px 16px rgba(20, 20, 40, 0.08);
    --ym-shadow-lg: 0 -8px 30px rgba(20, 20, 40, 0.18);
    font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ym-bg);
    color: var(--ym-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

body { padding-bottom: 90px; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; touch-action: manipulation; }

img { max-width: 100%; display: block; }

/* ---------- Announcement banner ---------- */

.ym-announcement {
    background: var(--ym-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 10px 36px;
    position: relative;
}

.ym-announcement-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    opacity: .85;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
}

/* ---------- Header ---------- */

.ym-cover {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, var(--ym-primary), var(--ym-primary-dark));
    background-size: cover;
    background-position: center;
}

/* Subtle scrim so the cover→panel transition reads as intentional rather than
   an abrupt cut, and any future content placed on the photo stays legible. */
.ym-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.22) 100%);
    pointer-events: none;
}

.ym-cover-lang {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 30;
}

/* ---------- Profile row (hero-style panel overlapping the cover, avatar poking above it) ---------- */

.ym-profile-row {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 18px 16px 14px;
    margin-top: -64px;
    background: var(--ym-card);
    border-radius: 22px 22px 0 0;
    box-shadow: var(--ym-shadow-lg);
    animation: ym-rise 280ms ease-out both;
}

.ym-profile-avatar {
    width: 88px;
    height: 88px;
    margin-top: -44px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--ym-card);
    box-shadow: var(--ym-shadow);
    background: var(--ym-card);
    flex-shrink: 0;
    animation: ym-rise 280ms 60ms ease-out both;
}

@keyframes ym-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ym-profile-row, .ym-profile-avatar { animation: none; }
}

.ym-profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    /* Primary is restaurant-customizable (Design settings) - a soft shadow keeps
       the letter legible even if an owner picks a light/bright brand color. */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    background: var(--ym-primary);
}

.ym-profile-info {
    min-width: 0;
    padding-bottom: 2px;
}

.ym-profile-name {
    font-size: 19px;
    font-weight: 800;
    color: var(--ym-ink);
    margin: 0;
    line-height: 1.25;
}

.ym-profile-tagline {
    font-size: 13px;
    color: var(--ym-muted);
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ym-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ym-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: var(--ym-shadow);
    transition: transform 150ms ease-out;
}

.ym-icon-btn:active {
    transform: scale(0.92);
}

.ym-lang-menu {
    position: absolute;
    top: 52px;
    right: 0;
    background: var(--ym-card);
    border-radius: var(--ym-radius-sm);
    box-shadow: var(--ym-shadow);
    border: 1px solid var(--ym-border);
    min-width: 160px;
    z-index: 50;
    display: none;
    overflow: hidden;
}

.ym-lang-menu.show { display: block; }

.ym-lang-menu a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
}

.ym-lang-menu a.active { color: var(--ym-primary); font-weight: 600; }
.ym-lang-menu a:hover { background: var(--ym-bg); }

/* ---------- Search ---------- */

.ym-search-wrap { padding: 12px 14px 0; }

.ym-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ym-card);
    border: 1px solid var(--ym-border);
    border-radius: 999px;
    padding: 10px 16px;
    box-shadow: var(--ym-shadow);
}

.ym-search input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 15px;
    background: transparent;
    color: var(--ym-ink);
}

.ym-search .bx { font-size: 18px; color: var(--ym-muted); }

/* ---------- Category nav ---------- */

.ym-cat-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 14px 14px 4px;
    scrollbar-width: none;
}

.ym-cat-nav::-webkit-scrollbar { display: none; }

.ym-cat-pill {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--ym-card);
    border: 1px solid var(--ym-border);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.ym-cat-pill.active {
    background: var(--ym-ink);
    color: #fff;
    border-color: var(--ym-ink);
}

/* ---------- Category sections / product grid ---------- */

.ym-section { padding: 18px 14px 0; }

.ym-section-title { font-size: 18px; font-weight: 700; margin: 0 0 10px; }

.ym-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 480px) {
    .ym-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 720px) {
    .ym-grid { grid-template-columns: repeat(4, 1fr); }
}

.ym-card {
    background: var(--ym-card);
    border-radius: var(--ym-radius);
    overflow: hidden;
    box-shadow: var(--ym-shadow);
    border: 1px solid var(--ym-border);
    text-align: left;
    width: 100%;
    padding: 0;
    /* Explicit flex column so the grid stretching shorter cards to match a
       taller row-mate can never visually shift the image - the image is
       pinned to the top and only the body grows to absorb the extra space. */
    display: flex;
    flex-direction: column;
}

.ym-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--ym-bg);
    flex-shrink: 0;
}

.ym-card-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ym-border);
    font-size: 32px;
}

.ym-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }

.ym-card-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ym-card-desc {
    font-size: 12px;
    color: var(--ym-muted);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ym-card-price {
    font-weight: 700;
    font-size: 15px;
    color: var(--ym-ink);
}

.ym-card-price .ym-strike {
    text-decoration: line-through;
    color: var(--ym-muted);
    font-weight: 400;
    font-size: 12px;
    margin-right: 4px;
}

.ym-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.ym-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--ym-bg);
    color: var(--ym-muted);
}

.ym-badge.popular { background: #fff1e6; color: var(--ym-primary-dark); }
.ym-badge.new { background: #e8f7ee; color: #1b8a4f; }
.ym-badge.chef { background: #f1ecfb; color: #6c4bd1; }
.ym-badge.best { background: #fef3e0; color: #b8860b; }
.ym-badge.sold-out { background: #fdeaea; color: #c92a2a; }

.ym-card.is-sold-out { opacity: 0.55; }

.ym-empty { text-align: center; color: var(--ym-muted); padding: 60px 20px; }
.ym-empty .bx { font-size: 40px; display: block; margin-bottom: 8px; }

/* ---------- Product detail bottom sheet ---------- */

.ym-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 30, 0.5);
    z-index: 90;
    display: none;
}

.ym-sheet-backdrop.show { display: block; }

.ym-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--ym-card);
    border-radius: 22px 22px 0 0;
    box-shadow: var(--ym-shadow-lg);
    z-index: 91;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.28s ease;
}

.ym-sheet.show { transform: translateY(0); }

.ym-sheet-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.ym-sheet-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 2;
}

.ym-sheet-body { padding: 18px; }
.ym-sheet-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.ym-sheet-price { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.ym-sheet-desc { color: var(--ym-muted); font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.ym-sheet-meta { display: flex; gap: 16px; font-size: 13px; color: var(--ym-muted); margin-bottom: 12px; flex-wrap: wrap; }
.ym-sheet-meta span { display: flex; align-items: center; gap: 4px; }
.ym-sheet-section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--ym-muted); margin: 14px 0 6px; }
.ym-allergen-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ym-allergen-chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--ym-bg); border: 1px solid var(--ym-border); }

/* ---------- Floating action buttons ---------- */

.ym-fab-stack {
    position: fixed;
    right: 14px;
    bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 60;
}

.ym-fab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--ym-ink);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--ym-shadow-lg);
}

.ym-fab.ym-fab-primary { background: var(--ym-primary); }
.ym-fab .bx { font-size: 16px; }

.ym-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ym-ink);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.ym-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */

.ym-footer {
    text-align: center;
    padding: 24px 14px 10px;
    color: var(--ym-muted);
    font-size: 12px;
}

.ym-footer a { color: var(--ym-primary); font-weight: 600; }

.ym-contact-row {
    text-align: center;
    padding: 0 14px;
    color: var(--ym-muted);
    font-size: 13px;
}

.ym-contact-line {
    margin-bottom: 4px;
}

.ym-contact-line i {
    margin-right: 4px;
    vertical-align: middle;
}

.ym-contact-line a {
    color: var(--ym-muted);
}

.ym-social-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ym-social-row a {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--ym-card);
    border: 1px solid var(--ym-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
