/* Savar Care вэб: хэл сонгогч, хүртээмжийн самбар, WCAG 2.1 AA суурь дүрмүүд (бүх хуудсанд нэг файл) */

/* --- Гарын удирдлага: тод focus, алгасах холбоос --- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #3B3FD0;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
  border-radius: 6px;
}
.st-skip {
  position: fixed; left: 16px; top: 16px; z-index: 1000; transform: translateY(-200%);
  padding: 12px 18px; border-radius: 12px; background: #17161C; color: #fff; font-weight: 600;
  transition: transform .15s;
}
.st-skip:focus { transform: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Цэсний товчнууд --- */
.st-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 10px; }
/* Холбоосууд лого ба баруун талын товчнуудын яг дунд */
.nav .wrap > .nav-links, .nav .bar > .links { margin-left: auto; }
.st-pop { position: relative; }
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  background: transparent; color: inherit; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s;
}
.st-btn:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.st-btn svg { flex: none; }
.st-btn[aria-expanded="true"] { background: color-mix(in srgb, currentColor 10%, transparent); }

/* --- Унжих хэсэг (хэл) ба самбар: сайтын карт загвар (бүх хуудсанд нэг ижил, цайвар) --- */
.st-menu, .st-panel {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 200;
  background: #fff; color: #17161C; border: 1px solid rgba(23, 22, 28, .08);
  border-radius: 24px; box-shadow: 0 1px 2px rgba(23, 22, 28, .04), 0 24px 56px -20px rgba(45, 48, 140, .35);
  text-align: left; letter-spacing: normal; font-family: Inter, system-ui, sans-serif;
}
.st-menu[hidden], .st-panel[hidden] { display: none; }
.st-menu { list-style: none; margin: 0; padding: 8px; min-width: 210px; }
.st-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: 14px; color: #17161C; font-weight: 500; font-size: 15px;
}
.st-menu a:hover { background: #F4F4F8; }
.st-menu a[aria-current="true"] { background: #EEF0FE; color: #3F43B8; font-weight: 600; }
.st-menu a small { color: #5D5D6B; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.st-menu a[aria-current="true"] small { color: #3F43B8; }

.st-panel { width: min(360px, calc(100vw - 24px)); padding: 22px; }
.st-panel .st-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.st-panel .st-head-l { display: flex; align-items: center; gap: 12px; }
.st-panel h2 { font-family: "Inter Tight", Inter, system-ui, sans-serif; font-weight: 700; letter-spacing: -.01em; font-size: 20px; margin: 0; line-height: 1.2; }
.st-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px; background: #EEF0FE; color: #4246C8;
  display: grid; place-items: center;
}
.st-ico svg { width: 20px; height: 20px; }
.st-panel .st-close { width: 40px; height: 40px; min-width: 40px; padding: 0; border: 0; background: #F4F4F8; color: #17161C; }
.st-panel .st-close:hover { background: #EBEBF2; }
.st-panel .st-label { font-size: 13px; font-weight: 600; color: #5D5D6B; margin-bottom: 10px; display: block; }
.st-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: #F4F4F8; }
.st-sizes button {
  height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: #4A4A57;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, color .15s;
}
.st-sizes button:hover { color: #17161C; }
.st-sizes button[aria-pressed="true"] {
  background: #fff; color: #3F43B8; border-color: rgba(91, 95, 224, .45);
  box-shadow: 0 1px 2px rgba(23, 22, 28, .06), 0 4px 12px -4px rgba(45, 48, 140, .25);
}
.st-opts { display: grid; gap: 8px; margin-top: 16px; }
.st-switch {
  display: flex; width: 100%; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 12px; border-radius: 16px; border: 1px solid rgba(23, 22, 28, .08); background: #fff; color: #17161C;
  font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, border-color .15s;
}
.st-switch:hover { background: #FAFAFC; }
.st-switch[aria-checked="true"] { background: #F6F6FE; border-color: rgba(91, 95, 224, .35); }
.st-switch .st-ico { width: 36px; height: 36px; border-radius: 11px; }
.st-switch .st-ico svg { width: 18px; height: 18px; }
.st-switch .st-text { flex: 1; }
.st-switch .st-track {
  flex: none; width: 44px; height: 26px; border-radius: 999px; background: #E6E6EE; border: 1.5px solid #8A8A9E;
  position: relative; transition: background .15s, border-color .15s;
}
.st-switch .st-track::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px; border-radius: 50%; background: #6B6B7E;
  transition: transform .15s, background .15s;
}
.st-switch[aria-checked="true"] .st-track { background: #5B5FE0; border-color: #5B5FE0; }
.st-switch[aria-checked="true"] .st-track::after { transform: translateX(18px); background: #fff; }
.st-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #EDEDF2; }
.st-reset {
  flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent;
  color: #3F43B8; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.st-reset:hover { background: #EEF0FE; }
.st-panel .st-note { font-size: 12px; color: #5D5D6B; margin: 0; line-height: 1.4; }

@media (max-width: 900px) {
  .st-tools { margin-right: 6px; gap: 4px; }
  .st-btn { padding: 0 10px; }
  .st-btn .st-code { display: none; }
  .st-panel, .st-menu { position: fixed; right: 12px; left: 12px; top: 84px; width: auto; }
}

/* --- Сонголт: холбоосыг тодруулах, мөр хоорондын зай --- */
html[data-links="on"] a:not(.st-btn):not(.btn):not(.nav-cta):not(.logo) {
  text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
}
html[data-links="on"] p, html[data-links="on"] li, html[data-links="on"] dd, html[data-links="on"] summary {
  line-height: 1.8 !important; word-spacing: .12em; letter-spacing: .02em;
}

/* --- Сонголт: хөдөлгөөн зогсоох --- */
html[data-motion="reduce"] { scroll-behavior: auto !important; }
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: .001s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
  transition-duration: .001s !important; transition-delay: 0s !important;
}
html[data-motion="reduce"] .reveal { opacity: 1 !important; transform: none !important; }

/* --- Сонголт: өндөр контраст (цайвар хуудсууд) --- */
html[data-contrast="high"] {
  --ink: #000; --muted: #1F1F26; --subtle: #2B2B33; --line: rgba(0, 0, 0, .45);
  --primary: #2E2FA8; --primary-ink: #1E1F7A;
}
html[data-contrast="high"] body { background: #fff; color: #000; }
html[data-contrast="high"] :where(p, li, span, small, dd, summary, label) { color: inherit; }
html[data-contrast="high"] .eyebrow, html[data-contrast="high"] .tag { color: #000 !important; background: #fff !important; border: 2px solid #000 !important; }
html[data-contrast="high"] :where(.card, .box, .term, .wcard, .doc, details, .price, .pk, input, select, textarea, .dd-btn) { border-color: #000 !important; }
html[data-contrast="high"] :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 4px solid #000; box-shadow: 0 0 0 8px #FFD400; }

/* Хамтран ажиллах хуудас (бараан дэвсгэр) */
html[data-contrast="high"] body.dark {
  --bg: #000; --bg2: #000; --panel: #0A0A0A; --line: rgba(255, 255, 255, .6);
  --ink: #fff; --muted: #fff; --subtle: #F2F2F2; --primary-2: #C9CBFF;
  --light: #fff; --lightink: #000; --lightmuted: #1F1F26;
  background: #000; color: #fff;
}
html[data-contrast="high"] body.dark :where(.card, .glass, .chip, .wcard, .term, details, input, select, textarea, .dd-btn) { border-color: #fff !important; }
html[data-contrast="high"] body.dark :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 4px solid #FFD400; box-shadow: 0 0 0 8px #000; }

/* --- Том текст (125–200%): цэс багтахгүй тул гар утасны цэс рүү шилжинэ --- */
html[data-ts] .logo, .nav .logo { white-space: nowrap; }
html[data-ts] .nav-links, html[data-ts] .nav .links, html.nav-compact .nav-links, html.nav-compact .nav .links { display: none !important; }
html[data-ts] .menu-btn, html.nav-compact .menu-btn { display: inline-flex !important; }
html[data-ts] .nav .nav-cta, html[data-ts] .nav .btn { display: none !important; }
html[data-ts] .mobile-menu.open, html.nav-compact .mobile-menu.open { display: grid !important; gap: 4px; padding: 8px 20px 14px; }
html[data-ts] .mobile-menu a, html.nav-compact .mobile-menu a { padding: 12px 0; font-weight: 600; border-bottom: 1px solid var(--line); }
html[data-ts] .mobile-menu a:last-child, html.nav-compact .mobile-menu a:last-child { border: 0; }
html[data-ts] body.dark .mobile-menu.open, html.nav-compact body.dark .mobile-menu.open { max-width: 1180px; margin: 8px auto 0; border-radius: 20px; background: rgba(16, 20, 42, .97); border: 1px solid var(--line); }

/* Цэсийн мөр өөрийн хэмжээгээрээ үлдэнэ (багтахгүй болохоос сэргийлж), харин нээгддэг цэс томорно */
.nav { --ts: 1; --ts-h: 1; }
.nav .mobile-menu { --ts: var(--ts-root, 1); }
/* Том текстэд урт үг, багана нарийн дэлгэцэнд багтах ёстой */
html[data-ts] :where(main, footer) * { min-width: 0; }
html[data-ts] :where(h1, h2, h3, h4, p, li, a, span, b, summary, dd, dt, label, small) { overflow-wrap: anywhere; }
html[data-ts] :where(.switch, .stores, .hero-ctas, .actions, .cta-row) { flex-wrap: wrap; }

/* Гадаад хэлний хуудсанд: апп монгол хэлтэй гэсэн тэмдэглэл (нүүрний утаснуудын доор) */
.st-app-note {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; max-width: calc(100% - 32px);
  margin: 16px auto 0; padding: 8px 14px; border-radius: 999px; background: #EEF0FE; color: #3F43B8;
  font-size: calc(14px * var(--ts, 1)); font-weight: 500; text-align: center; line-height: 1.4;
}
.st-app-note svg { flex: none; }

/* Цэсний холбоосоор очиход гарчиг хөвөгч цэсний ард орохгүй */
section[id], [id].term, main [id]:target { scroll-margin-top: 100px; }
