/* Хоологчийн хуудас — гар утас эхэнд */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.pub {
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 100% 0%, #FCE1E1 0%, transparent 60%),
    radial-gradient(90% 50% at 0% 10%, #FFF3E6 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
.sv { max-width: 560px; margin: 0 auto; padding: max(var(--s-5), env(safe-area-inset-top)) var(--s-4) 140px; }
.sv-center { min-height: 100dvh; display: grid; place-items: center; padding-bottom: var(--s-6); }

.sv-head { padding: var(--s-3) var(--s-1) var(--s-5); }
.sv-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--fs-lg); margin-bottom: var(--s-5); }
.sv-brand img { border-radius: 0; object-fit: contain; }
.sv-loc { margin-left: auto; font-size: var(--fs-xs); font-weight: 700; padding: 5px 10px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.03em; }
.sv-sub { color: var(--muted); font-weight: 600; margin-top: 6px; }
.sv-chip { display: inline-block; margin-top: var(--s-4); padding: 8px 16px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-weight: 700; font-size: var(--fs-sm); }
.sv-meals { display: flex; gap: 6px; margin-top: var(--s-4); padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); width: fit-content; max-width: 100%; overflow-x: auto; }
.sv-meals a { padding: 8px 14px; border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.sv-meals a.is-active { background: var(--ink); color: #fff; }

.sv-flash { margin-bottom: var(--s-4); padding: 12px 16px; border-radius: var(--r); font-weight: 600; background: var(--bad-soft); color: var(--bad); }
.sv-flash-success { background: var(--good-soft); color: var(--good); }

/* ---- Хаалттай үеийн хуваарь ---- */
.sv-schedule { list-style: none; margin: var(--s-3) 0 0; padding: 6px; width: min(340px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sv-schedule li { display: flex; justify-content: space-between; gap: var(--s-4); padding: 10px 14px; border-radius: var(--r); font-weight: 600; color: var(--ink-2); }
.sv-schedule li b { font-variant-numeric: tabular-nums; }
.sv-schedule li.is-next { background: var(--brand-soft); color: var(--brand-ink); }

/* ---- Хоолны карт ---- */
.sv-form { display: grid; gap: var(--s-4); }
.hp { position: absolute; left: -9999px; }
.dish {
  background: var(--surface); border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-2);
  transition: border-color var(--t), box-shadow var(--t);
}
.dish[data-rating="3"] { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.dish[data-rating="2"] { border-color: color-mix(in srgb, var(--avg) 55%, transparent); }
.dish[data-rating="1"] { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.dish-media { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.dish-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.dish[data-rating] .dish-media img { transform: scale(1.03); }
.dish-body { padding: var(--s-4) var(--s-4) var(--s-4); }
.dish-cat { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-ink); }
.dish-name { font-size: var(--fs-xl); font-weight: 800; margin: 2px 0 var(--s-4); letter-spacing: -.02em; }

/* ---- 3 сонголт ---- */
.rate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.rate-opt { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rate-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rate-opt > span { pointer-events: none; }
.rate-opt {
  display: grid; justify-items: center; gap: 2px; padding: 12px 4px 10px; border-radius: var(--r);
  background: var(--surface-2); border: 2px solid transparent;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.rate-opt:active { transform: scale(.95); }
.rate-face { font-size: 2.1rem; line-height: 1.1; filter: grayscale(.35); transition: transform var(--t) var(--spring), filter var(--t); }
.rate-label { font-weight: 700; font-size: var(--fs-sm); color: var(--ink-2); }
.rate-opt:has(input:focus-visible) { outline: 3px solid var(--brand-soft); outline-offset: 2px; }
.rate-opt:has(input:checked) .rate-face { transform: scale(1.18) rotate(-6deg); filter: none; }
.rate-good:has(input:checked) { background: var(--good-soft); border-color: var(--good); }
.rate-avg:has(input:checked)  { background: var(--avg-soft);  border-color: var(--avg); }
.rate-bad:has(input:checked)  { background: var(--bad-soft);  border-color: var(--bad); }
.rate-good:has(input:checked) .rate-label { color: var(--good); }
.rate-avg:has(input:checked) .rate-label  { color: #A87300; }
.rate-bad:has(input:checked) .rate-label  { color: var(--bad); }
/* :has дэмжихгүй хөтөчид JS class нэмнэ */
.rate-opt.is-on .rate-face { transform: scale(1.18) rotate(-6deg); filter: none; }
.rate-good.is-on { background: var(--good-soft); border-color: var(--good); }
.rate-avg.is-on  { background: var(--avg-soft);  border-color: var(--avg); }
.rate-bad.is-on  { background: var(--bad-soft);  border-color: var(--bad); }

/* ---- Сэтгэгдэл: Дундаж / Муу үед нээгдэнэ ---- */
.dish-comment { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t-slow) var(--ease), opacity var(--t); }
.dish-comment > div { overflow: hidden; }
.dish-comment textarea { margin-top: var(--s-3); min-height: 64px; background: var(--surface-2); border-color: transparent; }
.js .dish-comment { grid-template-rows: 0fr; opacity: 0; }
.js .dish[data-rating="2"] .dish-comment, .js .dish[data-rating="1"] .dish-comment { grid-template-rows: 1fr; opacity: 1; }

/* ---- Нэмэлт асуулт ---- */
.sv-questions { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: grid; gap: var(--s-5); }
.q-text { font-weight: 700; margin-bottom: var(--s-3); }
.req { color: var(--bad); }
.rate-sm .rate-face { font-size: 1.6rem; }
.rate-sm .rate-opt { padding: 8px 4px; }

/* ---- Доод самбар ---- */
.sv-bar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(528px, calc(100% - 24px)); display: flex; align-items: center; gap: var(--s-3);
  padding: 10px 10px 10px 16px; border-radius: var(--r-pill);
  background: rgb(255 255 255 / .82); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgb(255 255 255 / .7); box-shadow: var(--shadow-3); z-index: 10;
}
.sv-bar .btn { margin-left: auto; }
.sv-progress { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--fs-sm); color: var(--ink-2); }
.sv-ring { --p: 0; width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--line) 0); mask: radial-gradient(circle 10px, transparent 98%, #000 100%); -webkit-mask: radial-gradient(circle 10px, transparent 98%, #000 100%); transition: --p var(--t); }
.sv-bar .btn.pulse { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(216 50 58 / .45); } 50% { box-shadow: 0 0 0 10px rgb(216 50 58 / 0); } }

/* ---- Төлөв (хоосон / дууссан / баярлалаа) ---- */
.state { text-align: center; padding: var(--s-7) var(--s-4); display: grid; justify-items: center; gap: var(--s-3); }
.state-emoji { font-size: 4rem; line-height: 1; }
.state h1 { font-size: var(--fs-2xl); font-weight: 800; }
.state h2 { font-size: var(--fs-xl); font-weight: 800; }
.state p { color: var(--muted); max-width: 32ch; }
.check-anim { width: 112px; height: 112px; }
.check-anim circle { fill: var(--good-soft); stroke: var(--good); stroke-width: 4; stroke-dasharray: 214; stroke-dashoffset: 214; animation: draw .6s var(--ease) forwards; }
.check-anim path { fill: none; stroke: var(--good); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .4s .45s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.thanks h1 { animation: rise .5s .6s var(--ease) both; }
.thanks p, .thanks .btn { animation: rise .5s .75s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---- Scroll reveal (IntersectionObserver, AOS-гүй хөнгөн хувилбар) ---- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (min-width: 640px) {
  .sv { padding-top: var(--s-7); }
}

/* ---- Заал / Боолт сонгох ---- */
.sv-choose .sv-head { padding-bottom: var(--s-4); }
.choose-grid { display: grid; gap: var(--s-4); }
.choose-card {
  display: flex; align-items: center; gap: var(--s-4); padding: var(--s-5) var(--s-4);
  border-radius: var(--r-lg); background: var(--surface); border: 2px solid var(--line);
  box-shadow: var(--shadow-2); text-decoration: none; color: var(--ink);
  transition: transform var(--t-fast) var(--ease), border-color var(--t), box-shadow var(--t);
}
.choose-card:hover { border-color: var(--brand); box-shadow: var(--shadow-3); }
.choose-card:active { transform: scale(.98); }
.choose-icon { font-size: 2.8rem; line-height: 1; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--brand-soft); flex: none; }
.choose-boolt .choose-icon { background: #E8EAFB; }
.choose-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.choose-text b { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; }
.choose-text small { color: var(--muted); font-weight: 600; }
.choose-text em { font-style: normal; font-size: var(--fs-sm); font-weight: 700; margin-top: 4px; }
.choose-open { color: var(--good); }
.choose-closed { color: var(--muted); }
.choose-arrow { font-size: 1.6rem; color: var(--brand); font-weight: 800; }
.sv-home img { border-radius: 0; }
.sv-svc { font-weight: 800; }
.sv-svc-boolt { background: #E8EAFB; border-color: #D3D6F5; }
.sv-switch { display: inline-block; margin-bottom: var(--s-3); padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; color: var(--ink-2); }

.choose-logo { display: block; width: 190px; height: auto; margin: 0 auto var(--s-3); }
.sv-choose .sv-head { text-align: center; }
