/* Customer menu page. Mobile-first; content width capped for tablets/desktop. */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(12px + env(safe-area-inset-top)) 0 20px;
  overflow: hidden;
}
.hero-cover {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 0.4s ease;
}
.hero-cover.has-image { opacity: 1; }
.hero-cover.has-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.25) 0%, var(--bg) 100%);
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.hero-top { display: flex; justify-content: flex-end; min-height: 44px; }
.hero-top .icon-btn { background: var(--surface); background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(8px); }

.brand { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.logo-wrap {
  flex: none; width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow); border: 2px solid var(--surface);
}
.logo { width: 100%; height: 100%; object-fit: cover; }
.brand-text { min-width: 0; }
.cafe-name { font-size: clamp(26px, 7vw, 34px); font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tagline { color: var(--text-2); margin-top: 4px; font-size: 15px; }
.sk-title { display: block; width: 200px; height: 30px; }

.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; font-size: 14px; color: var(--text-2); }
.status-row:empty { display: none; }
.badge-open, .badge-closed {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.badge-open { color: var(--success); background: rgba(60, 196, 109, 0.14); background: color-mix(in srgb, var(--success) 14%, transparent); }
.badge-closed { color: var(--danger); background: rgba(224, 80, 70, 0.14); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.badge-open::before, .badge-closed::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hours-link { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

.quick-actions { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.quick-actions::-webkit-scrollbar { display: none; }
.quick-actions:empty { display: none; }
.quick-actions .btn { flex: none; min-height: 40px; padding: 0 14px; font-size: 14px; background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent); }

/* ---------- Banner (saved menu / offline) ---------- */
.banner {
  max-width: var(--maxw); margin: 0 auto 8px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--warning-bg); color: var(--warning-text);
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
}
@media (max-width: 792px) { .banner { margin-left: var(--gutter); margin-right: var(--gutter); } }
.banner button { flex: none; background: none; border: 1px solid currentColor; color: inherit; border-radius: 999px; padding: 4px 12px; font-weight: 600; cursor: pointer; }

/* ---------- Sticky search + tabs ---------- */
.sticky-bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.sticky-bar.stuck { border-bottom-color: var(--border); }
.sticky-inner { max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gutter) 0; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 14px; width: 19px; height: 19px; color: var(--text-3); pointer-events: none; }
#search {
  width: 100%; height: 46px; padding: 0 44px 0 42px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 16px; /* 16px stops iOS zoom */
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
#search::-webkit-search-cancel-button { display: none; }
#search::placeholder { color: var(--text-3); }
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#clearSearch { position: absolute; right: 6px; }

.cat-tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 0 8px; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter);
  scroll-padding: 0 var(--gutter);
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none; height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--text-2); font-weight: 600; font-size: 14.5px; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cat-tab:hover { color: var(--text); background: var(--surface-2); }
.cat-tab[aria-current='true'] { background: var(--accent); color: var(--on-accent); }
.cat-tab .count { opacity: 0.6; font-weight: 500; margin-left: 4px; font-size: 13px; }

/* ---------- Filters ---------- */
.filters {
  max-width: var(--maxw); margin: 4px auto 0; padding: 0 var(--gutter);
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.chip .diet { width: 13px; height: 13px; }
.chip .diet::after { width: 6px; height: 6px; }
.chip[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

.result-count { max-width: var(--maxw); margin: 10px auto 0; padding: 0 var(--gutter); color: var(--text-3); font-size: 14px; }
.result-count:empty { display: none; }

/* ---------- Menu ---------- */
.menu { max-width: var(--maxw); margin: 0 auto; padding: 4px var(--gutter) 24px; outline: none; }
.category { padding-top: 22px; scroll-margin-top: 112px; }
.category-head { margin-bottom: 10px; }
.category-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.category-desc { color: var(--text-3); font-size: 14px; margin-top: 2px; }
.dish-list { display: grid; gap: 10px; }
.dish-list > * { min-width: 0; } /* grid items must be allowed to shrink below long words */

.dish {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; text-align: left;
  transition: border-color 0.15s, transform 0.1s;
}
.dish:hover { border-color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.dish:active { transform: scale(0.995); }
.dish-body { flex: 1; min-width: 0; }
.dish-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.dish-meta:empty { display: none; }
.dish-name { font-size: 16.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; font-family: var(--font-heading); }
.dish-price { margin-top: 4px; font-weight: 700; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.dish-desc {
  margin-top: 6px; color: var(--text-2); font-size: 14px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dish-media {
  position: relative; flex: none; width: 104px; height: 104px;
  border-radius: 12px; overflow: hidden; background: var(--surface-2);
}
.dish-media img { width: 100%; height: 100%; object-fit: cover; }
.img-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3); }
.img-fallback svg { width: 36%; height: 36%; opacity: 0.6; }

.sold-out-label {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
}
.dish.sold-out .dish-name, .dish.sold-out .dish-price { color: var(--text-3); }
.dish.sold-out .dish-price { text-decoration: line-through; }
.dish.sold-out .dish-media img { filter: grayscale(1); opacity: 0.55; }

mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Compact list layout (setting): no photos, denser rows. */
html[data-layout='list'] .dish { padding: 12px 14px; }
html[data-layout='list'] .dish-media { display: none; }
html[data-layout='list'] .dish-list { gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
html[data-layout='list'] .dish { border: 0; border-radius: 0; border-bottom: 1px solid var(--border); background: transparent; }
html[data-layout='list'] .dish:last-child { border-bottom: 0; }
html[data-layout='list'] .dish-desc { -webkit-line-clamp: 1; line-clamp: 1; }

/* ---------- Empty / error states ---------- */
.state { text-align: center; padding: 48px 16px; color: var(--text-2); }
.state-icon { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.state h2 { font-size: 20px; color: var(--text); margin-bottom: 6px; }
.state p { max-width: 360px; margin: 0 auto 18px; }
.state .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Skeleton ---------- */
.loading { padding-top: 22px; display: grid; gap: 10px; }
.sk-heading { width: 140px; height: 24px; margin-bottom: 4px; }
.sk-card { display: flex; gap: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.sk-card > div:first-child { flex: 1; display: grid; gap: 10px; align-content: start; }
.sk-line { height: 13px; }
.w30 { width: 30%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; }
.sk-img { width: 104px; height: 104px; border-radius: 12px; flex: none; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--maxw); margin: 8px auto 0;
  padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); color: var(--text-3); font-size: 14px; text-align: center;
}
.site-footer:empty { display: none; }
.site-footer p + p { margin-top: 8px; }
.footer-note { white-space: pre-line; }
.footer-address { white-space: pre-line; color: var(--text-2); }
.powered { font-size: 12.5px; opacity: 0.8; }
.powered a { color: inherit; }

.to-top {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 15;
  box-shadow: var(--shadow);
}

/* ---------- Dish sheet ---------- */
.sheet-media { aspect-ratio: 4 / 3; background: var(--surface-2); }
.sheet-media img { width: 100%; height: 100%; object-fit: cover; }
.sheet-body { padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-body.no-media { padding-top: 52px; }
.sheet-title-row { display: flex; gap: 10px; align-items: flex-start; }
.sheet-title-row .diet { margin-top: 6px; }
.sheet-title { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sheet-tags:empty { display: none; }
.sheet-price { margin-top: 12px; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.variant-table { margin-top: 12px; display: grid; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.variant-row { display: flex; justify-content: space-between; padding: 10px 14px; font-variant-numeric: tabular-nums; }
.variant-row + .variant-row { border-top: 1px solid var(--border); }
.variant-row span:last-child { font-weight: 700; }
.sheet-section { margin-top: 18px; }
.sheet-section h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 6px; font-family: var(--font-body); }
.sheet-section p { color: var(--text-2); white-space: pre-line; }
.sheet-soldout { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.sheet-diet { margin-top: 12px; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }

.info-list { display: grid; gap: 4px; margin-top: 12px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: 0; }
.info-row.today { font-weight: 700; color: var(--accent-text); }
.wifi-box { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); }
.wifi-box dt { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.wifi-box dd { margin: 2px 0 10px; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.wifi-box dd:last-child { margin-bottom: 0; }
.wifi-pass { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.sheet-hint { margin-top: 14px; color: var(--text-3); font-size: 14px; }

.noscript { padding: 24px; text-align: center; }

@media (min-width: 700px) {
  .dish-media, .sk-img { width: 120px; height: 120px; }
  .cafe-name { font-size: 38px; }
}
