/* MasterFresok — всплывающий калькулятор на главной */
html.mfhc-lock, html.mfhc-lock body { overflow: hidden !important; }
.mfhc { --a: var(--theme-base-color, #62B5F8); --t: #1f2328; --m: #6b7480; --l: #e3e6ea; --bg: #f6f4f0;
  position: fixed; inset: 0; z-index: 2900; background: rgba(20, 22, 26, .55); display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; transition: opacity .18s; font-size: 14px; line-height: 1.4; color: var(--t); }
.mfhc[hidden] { display: none; }
.mfhc.in { opacity: 1; }
.mfhc *, .mfhc *::before, .mfhc *::after { box-sizing: border-box; }
.mfhc__box { width: min(1080px, 100%); height: min(860px, 100%); background: #fff; border-radius: 16px; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); outline: none; transform: translateY(8px); transition: transform .2s; }
.mfhc.in .mfhc__box { transform: none; }

.mfhc__top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--l); flex: none; }
.mfhc__ttl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mfhc__title { font-size: 19px; font-weight: 700; }
.mfhc__steps { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: st; }
.mfhc__steps li { counter-increment: st; display: flex; align-items: center; gap: 6px; color: var(--m); font-size: 13px; margin: 0; padding: 0; }
.mfhc__steps li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #eef0f3; font-weight: 700; font-size: 12px; }
.mfhc__steps li.on { color: var(--t); font-weight: 600; }
.mfhc__steps li.on::before { background: var(--a); color: #fff; }
.mfhc__icon { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--t); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.mfhc__icon[hidden] { display: none; }
.mfhc__icon:hover { background: #f1f2f4; }

.mfhc__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 24px; -webkit-overflow-scrolling: touch; }
.mfhc__step[hidden], .mfhc__pane[hidden] { display: none; }

.mfhc__tabs { display: flex; gap: 4px; background: #f1f2f4; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.mfhc__tabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 10px 8px; font: inherit; font-weight: 600; color: var(--m); cursor: pointer; }
.mfhc__tabs button.on { background: #fff; color: var(--t); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

.mfhc__search { display: flex; align-items: center; gap: 8px; height: 46px; border: 1px solid #cfd4da; border-radius: 10px; padding: 0 12px; color: var(--m); margin: 0 0 12px; }
.mfhc__search:focus-within { border-color: var(--a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 20%, transparent); }
.mfhc__search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; font: inherit; font-size: 16px; color: var(--t); background: transparent; height: 100%; padding: 0 !important; box-shadow: none !important; }

.mfhc__chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: thin; }
.mfhc__chips[hidden] { display: none; }
.mfhc__chip { flex: none; border: 1px solid var(--l); background: #fff; border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer;
  color: var(--t); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mfhc__chip.on { border-color: var(--a); background: color-mix(in srgb, var(--a) 12%, #fff); box-shadow: inset 0 0 0 1px var(--a); }
.mfhc__chip--c { text-transform: lowercase; }
.mfhc__chip--c i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }

.mfhc__lbl { font-weight: 600; margin: 10px 0 8px; color: var(--t); }
.mfhc__lbl:empty { display: none; }
.mfhc__row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; }
.mfhc__row .mfhc__card { flex: 0 0 140px; }
.mfhc__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 12px; }
.mfhc__card { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font: inherit; color: var(--t); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mfhc__ph { display: block; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #eef0f2; position: relative; }
.mfhc__ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.mfhc__card:hover .mfhc__ph img { transform: scale(1.04); }
.mfhc__card:focus-visible .mfhc__ph { box-shadow: 0 0 0 3px var(--a); }
.mfhc__nm { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mfhc__load, .mfhc__empty, .mfhc__err { grid-column: 1 / -1; padding: 30px 10px; text-align: center; color: var(--m); }
.mfhc__err { color: #b23a3a; }
.mfhc__lnk { border: 0; background: none; padding: 0; font: inherit; color: var(--a); text-decoration: underline; cursor: pointer; }

.mfhc__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 10px;
  border: 1px solid #cfd4da; background: #fff; font: inherit; font-weight: 600; color: var(--t); cursor: pointer; }
.mfhc__btn--main { background: var(--a); border-color: var(--a); color: #fff; }
.mfhc__btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.mfhc__more { display: flex; margin: 18px auto 0; }
.mfhc__more[hidden] { display: none; }

.mfhc__drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 34px 16px;
  border: 2px dashed #c9cfd6; border-radius: 14px; background: var(--bg); cursor: pointer; color: var(--m); transition: border-color .15s, background .15s; }
.mfhc__drop svg { color: var(--a); margin-bottom: 4px; }
.mfhc__drop b { color: var(--t); font-size: 16px; }
.mfhc__drop small { margin-top: 6px; font-size: 12.5px; }
.mfhc__drop.over, .mfhc__drop:hover { border-color: var(--a); background: color-mix(in srgb, var(--a) 6%, #fff); }
.mfhc__drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mfhc__drop--sm { flex-direction: row; gap: 10px; padding: 14px 16px; margin: 12px 0 16px; justify-content: flex-start; text-align: left; }
.mfhc__drop--sm b { font-size: 14px; }
.mfhc__drop--sm.ok { border-style: solid; border-color: #1e8e5a; }
.mfhc__notes { margin: 16px 0 0; padding: 0 0 0 20px; color: var(--m); }
.mfhc__notes li { margin: 4px 0; }
.mfhc__status { margin-top: 12px; }
.mfhc__status.err { color: #c03434; }
.mfhc__p { margin: 0 0 12px; color: var(--m); max-width: 680px; }
.mfhc__ta { width: 100%; border: 1px solid #cfd4da; border-radius: 10px; padding: 12px; font: inherit; font-size: 16px; resize: vertical; min-height: 100px; outline: none; margin-top: 4px; }
.mfhc__ta:focus { border-color: var(--a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 20%, transparent); }

/* шаг 2 */
.mfhc__sel { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); margin-bottom: 14px; }
.mfhc__sel img, .mfhc__ph0 { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: #e8e6e1; }
.mfhc__ph0 { display: inline-flex; align-items: center; justify-content: center; color: var(--a); }
.mfhc__sel-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mfhc__sel-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mfhc__sel-t span { font-size: 12.5px; color: var(--m); }
.mfhc__sel-t a { color: var(--a); }
.mfhc .ok { color: #1e8e5a; } .mfhc .warn { color: #b8730c; } .mfhc .bad { color: #c03434; }

.mfhc .mfk { margin: 0; --mfk-accent: var(--theme-base-color, #62B5F8) !important; }
.mfhc .mfk-box { border: 0; padding: 0; }
.mfhc .mfk-head { display: none; }
.mfhc .mfk-left { top: 0; }
.mfhc-nobasket [data-a="basket"] { display: none !important; }
.mfhc-nobasket .mfk-act { grid-template-columns: 1fr; }
.mfhc-noimg .mfk-crop, .mfhc-noimg .mfk-tones-lbl, .mfhc-noimg .mfk-tones { display: none !important; }
.mfhc-noimg .mfk-sk { cursor: default; pointer-events: none; }
.mfhc__wa { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 14px; border-radius: 999px; background: #25d366; color: #fff !important;
  text-decoration: none !important; font-weight: 600; }

@media (max-width: 767px) {
  .mfhc { padding: 0; align-items: stretch; }
  .mfhc__box { width: 100%; height: 100%; border-radius: 0; transform: none; }
  .mfhc__top { padding: 8px 8px 8px 14px; gap: 6px; }
  .mfhc__ttl { gap: 2px 10px; }
  .mfhc__title { font-size: 16px; }
  .mfhc__steps li { font-size: 12px; }
  .mfhc__steps li::before { width: 18px; height: 18px; font-size: 11px; }
  .mfhc__body { padding: 12px 14px calc(20px + env(safe-area-inset-bottom)); }
  .mfhc__tabs button { font-size: 12.5px; padding: 9px 4px; line-height: 1.2; }
  .mfhc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .mfhc__row .mfhc__card { flex-basis: 116px; }
  .mfhc__drop { padding: 26px 14px; }
}
@media (prefers-reduced-motion: reduce) { .mfhc, .mfhc__box, .mfhc__ph img { transition: none; } }
