/* MasterFresok — новая карточка товара. Видна только при html.mfcard-on (?newcard=1). Стили калькулятора — mfcalc.css */
.mfc { display: none; }
html.mfcard-on .mfc { display: block; }
html.mfcard-on .catalog-detail__top-info,
html.mfcard-on .catalog-detail__mfcalc { display: none !important; }

.mfc.mfk { margin: 8px 0 32px; font-size: 15px; }
.mfc-modal { --mfk-accent: #307fdd; --mfk-text: #23262b; --mfk-muted: #6b7480; --mfk-line: #e2e5e9; --mfk-bg: #f6f7f9; --mfk-err: #d23b3b; --mfk-ok: #1e8e5a; --mfk-r: 10px; }

.mfc-head { margin-bottom: 18px; }
.mfc-title { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.mfc-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--mfk-muted); font-size: 14px; }
.mfc-ok { color: var(--mfk-ok); font-weight: 600; }
.mfc-muted { color: var(--mfk-muted); font-weight: 400; }
.mfc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 32px; align-items: start; }

/* вкладки-переключатели */
.mfc-views, .mfc-seg { display: inline-flex; background: #f1f3f6; border-radius: 12px; padding: 4px; gap: 4px; max-width: 100%; }
.mfc-views button, .mfc-seg button { border: 0; background: transparent; color: #4b5563; font: inherit; font-weight: 700; font-size: 14px;
  height: 40px; padding: 0 16px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.mfc-views button.on, .mfc-seg button.on { background: #fff; color: var(--mfk-text); box-shadow: 0 1px 3px rgba(17,24,39,.12); }
.mfc-views { margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.mfc-views::-webkit-scrollbar { display: none; }
.mfc-modes { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-bottom: 18px; }
.mfc-modes[hidden], .mfc-kinds[hidden] { display: none; }
.mfc-kinds { margin-bottom: 10px; }

/* сцена */
.mfc-stage { position: relative; background: var(--mfk-bg); border-radius: 18px; height: 560px; overflow: hidden; }
.mfc-pane { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mfc-pane[hidden] { display: none; }
.mfc .mfc-sk { flex: 1 1 auto; width: 100%; min-height: 0; background: transparent; border-radius: 0; padding: 24px 24px 44px 52px; align-items: center; }
.mfc .mfc-sk .mfk-sk-dw { bottom: 16px; }
.mfc .mfc-sk .mfk-sk-dh { left: 20px; }
.mfc-hint { flex: none; padding: 0 16px 14px; color: var(--mfk-muted); font-size: 13px; text-align: center; line-height: 1.35; }
.mfc-seams { position: absolute; inset: 0; pointer-events: none; }
.mfc-seams i { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed rgba(255,255,255,.95); box-shadow: 0 0 0 .5px rgba(17,24,39,.35); }
.mfc-pane--layout img, .mfc-pane--slide img, .mfc-pane--wallimg img, .mfc-pane--room img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.mfc-pane--room img { width: 100%; height: 100%; object-fit: cover; }
.mfc-pane--zoom img { width: 100%; height: 100%; object-fit: none; object-position: 50% 40%; }
.mfc-cap { position: absolute; left: 14px; bottom: 14px; background: rgba(255,255,255,.94); border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.mfc-cap[hidden] { display: none; }
.mfc-arr { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.94); box-shadow: 0 2px 8px rgba(17,24,39,.18); display: grid; place-items: center; color: var(--mfk-text); }
.mfc-arr--l { left: 12px; } .mfc-arr--r { right: 12px; }
.mfc-arr[hidden] { display: none; }

/* лента миниатюр */
.mfc-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.mfc-thumbs[hidden] { display: none; }
.mfc-thumbs button { flex: 0 0 66px; height: 88px; padding: 3px; border-radius: 9px; border: 1px solid var(--mfk-line); background: #fff; cursor: pointer; }
.mfc-thumbs button.on { border-color: var(--mfk-accent); box-shadow: inset 0 0 0 1px var(--mfk-accent); }
.mfc-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* инструменты кадра и цвета */
.mfc-tools { position: relative; margin-top: 18px; }
.mfc-tools-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mfc-tools-row .mfk-note { margin: 0; text-align: left; flex: 1 1 200px; }
.mfc-crop { font-weight: 700; }
.mfc .mfc-tones { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.mfc-locked .mfc-tools-in { opacity: .38; pointer-events: none; filter: grayscale(.4); }
.mfc-lock { position: absolute; inset: -6px; display: flex; align-items: center; justify-content: center; }
.mfc-lock[hidden] { display: none; }
.mfc-lock > div { background: #fff; border: 1px solid #dfe3e8; border-radius: 12px; padding: 10px 10px 10px 18px; box-shadow: 0 8px 24px rgba(17,24,39,.10);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: calc(100% - 24px); }
.mfc-lock span { font-size: 14px; line-height: 1.35; }
.mfc-lock .mfk-btn { flex: none; white-space: nowrap; border-color: var(--mfk-accent); color: var(--mfk-accent); font-weight: 700; }

/* панель расчёта */
.mfc-panel { border: 1px solid #e3e7ec; border-radius: 18px; padding: 24px; box-shadow: 0 10px 30px rgba(17,24,39,.06); background: #fff; position: sticky; top: 90px; }
.mfc-panel .mfk-lbl:first-child { margin-top: 0; }
.mfc-sub { font-size: 12.5px; color: var(--mfk-muted); margin-top: 6px; }
.mfc-sub[hidden] { display: none; }
.mfc-ready .mfc-sub { margin: 0 0 8px; }
.mfc-ready { margin-bottom: 4px; }
.mfc-ready[hidden] { display: none; }
.mfc-offers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mfc-offers button { min-height: 46px; border-radius: 10px; border: 1px solid #dfe3e8; background: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px; color: var(--mfk-text); }
.mfc-offers button.on { border-color: var(--mfk-accent); background: color-mix(in srgb, var(--mfk-accent) 7%, #fff); box-shadow: inset 0 0 0 1px var(--mfk-accent); }
.mfc-row { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; }
.mfc-row .mfk-lbl { margin: 0; }
.mfc-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: #1f5fae; text-decoration: underline; cursor: pointer; }
.mfc-link[hidden] { display: none; }
.mfc-mats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mfc-mat { display: flex; align-items: center; gap: 8px; text-align: left; padding: 7px 10px 7px 7px; min-height: 58px; border-radius: 10px; border: 1px solid #dfe3e8;
  background: #fff; font: inherit; color: var(--mfk-text); cursor: pointer; }
.mfc-mat.wide { grid-column: 1 / -1; }
.mfc-mat.on { border-color: var(--mfk-accent); background: color-mix(in srgb, var(--mfk-accent) 7%, #fff); box-shadow: inset 0 0 0 1px var(--mfk-accent); }
.mfc-mat.off { opacity: .55; }
.mfc-mat img, .mfc-mat > i { flex: none; width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--mfk-bg); }
.mfc-mat span { min-width: 0; }
.mfc-mat b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.mfc-mat small { display: block; font-size: 12px; color: #4b5563; margin-top: 2px; }
.mfc .mfk-mdesc { font-size: 12.5px; color: var(--mfk-muted); margin-top: 8px; }
.mfc .mfk-mdesc:empty { display: none; }
.mfc .mfk-srv { display: flex; flex-direction: column; gap: 6px; }
.mfc-stock { margin-top: 18px; display: flex; align-items: center; gap: 8px; color: var(--mfk-ok); font-weight: 600; font-size: 14px; }
.mfc-stock i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mfc .mfk-sum { margin-top: 10px; }
.mfc-buy { width: 100%; margin-top: 14px; min-height: 54px !important; font-size: 17px; font-weight: 700; border-radius: 12px !important; }
.mfc-phone { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 12px; }
.mfc-phone input { height: 42px !important; font-size: 15px !important; }
.mfc-links { margin-top: 16px; border-top: 1px solid #edf0f3; padding-top: 6px; display: flex; flex-direction: column; }
.mfc-lnk { display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--mfk-text) !important; text-decoration: none !important; font-size: 14px; }
.mfc-lnk svg { flex: none; color: var(--mfk-accent); }
.mfc-lnk span { flex: 1; }
.mfc-lnk em { color: #9aa3ad; font-style: normal; }
.mfc-msg { position: relative; margin-top: 10px; }
.mfc-msg[hidden] { display: none; }
.mfc-designer { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px;
  border: 1px solid #cfe9d8; background: #f3fbf6; color: #17723f; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.mfc-msgpop { position: absolute; left: 0; right: 0; bottom: 54px; z-index: 5; background: #fff; border: 1px solid #dfe3e8; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(17,24,39,.16); padding: 8px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.mfc-msgpop[hidden] { display: none; }
.mfc-ms { height: 42px; display: grid; place-items: center; border-radius: 9px; font-weight: 700; font-size: 14px; text-decoration: none !important; }
.mfc-ms--wa { color: #17723f !important; background: #f3fbf6; }
.mfc-ms--tg { color: #1f6fae !important; background: #eef6fc; }
.mfc-ms--max { color: #5b3cc4 !important; background: #f4f1fd; }
.mfc-bar { display: none; }

/* заявка */
.mfc-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(20,22,26,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mfc-modal-box { width: 440px; max-width: 100%; background: #fff; border-radius: 16px; padding: 18px 20px 20px; box-shadow: 0 20px 50px rgba(17,24,39,.25);
  display: flex; flex-direction: column; gap: 10px; color: var(--mfk-text); font-size: 14px; }
.mfc-modal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mfc-modal-top b { font-size: 18px; }
.mfc-modal p { margin: 0; color: #4b5563; }
.mfc-modal label span { display: block; font-size: 12px; color: var(--mfk-muted); margin-bottom: 3px; }
.mfc-modal input, .mfc-modal textarea { width: 100%; box-sizing: border-box; border: 1px solid #cfd4da; border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 16px; }
.mfc-modal input { height: 44px; }
.mfc-modal small { color: var(--mfk-muted); font-size: 12px; }
.mfc-modal .mfk-btn { min-height: 48px; font-weight: 700; }

@media (hover: hover) {
  .mfc-thumbs button:hover:not(.on), .mfc-offers button:hover:not(.on), .mfc-mat:hover:not(.on) { border-color: #b8c0ca; }
  .mfc-lnk:hover span { text-decoration: underline; }
}

@media (max-width: 1100px) {
  .mfc-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 24px; }
  .mfc .mfc-tones { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mfc-stage { height: 480px; }
}
@media (max-width: 860px) {
  .mfc-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .mfc-panel { position: static; padding: 0; border: 0; box-shadow: none; }
  .mfc-title { font-size: 23px; }
  .mfc-head { margin-bottom: 12px; }
  .mfc-views { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); width: 100%; }
  .mfc-views button { padding: 0 6px; font-size: 13px; height: 36px; }
  .mfc-stage { height: 300px; border-radius: 12px; margin: 0 -4px; }
  .mfc .mfc-sk { padding: 12px 12px 34px 38px; }
  .mfc .mfc-sk .mfk-sk-dw { bottom: 10px; }
  .mfc .mfc-sk .mfk-sk-dh { left: 10px; }
  .mfc-hint { font-size: 12px; padding-bottom: 8px; }
  .mfc-thumbs button { flex-basis: 48px; height: 64px; padding: 2px; }
  .mfc .mfc-tones { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .mfc .mfc-tones::-webkit-scrollbar { display: none; }
  .mfc .mfc-tones .mfk-tone { flex: 0 0 72px; }
  .mfc-lock > div { flex-direction: column; align-items: stretch; text-align: center; padding: 12px; }
  .mfc-offers button { min-height: 44px; font-size: 13px; }
  .mfc-buy { display: none !important; }
  .mfc-bar { display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: #fff;
    border-top: 1px solid #e7eaee; box-shadow: 0 -6px 18px rgba(17,24,39,.06); padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .mfc-bar > div { flex: 1; min-width: 0; }
  .mfc-bar small { display: block; font-size: 12px; color: var(--mfk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mfc-bar b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
  .mfc-bar .mfk-btn { height: 50px; padding: 0 22px; border-radius: 12px; font-size: 16px; font-weight: 700; }
  html.mfcard-on body { padding-bottom: 76px; }
  .mfc-msgpop { grid-auto-flow: row; }
}
@media (max-width: 400px) {
  .mfc-offers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mfc-phone { grid-template-columns: 1fr; }
}
.mfc [data-k="srvWrap"] .mfk-lbl { margin-top: 18px; }
.mfc-title[hidden] { display: none; }

/* кнопка «Кадр» прямо на сцене */
.mfc-cropfab { position: absolute; right: 14px; top: 14px; z-index: 2; height: 38px; padding: 0 14px; border-radius: 19px; border: 0;
  background: rgba(255,255,255,.95); box-shadow: 0 2px 10px rgba(17,24,39,.18); display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--mfk-text); cursor: pointer; }
.mfc-cropfab[hidden] { display: none; }
.mfc-thumbs-lbl { display: none; }
.mfc-pane[data-pane="wall"] { position: absolute; }
@media (max-width: 860px) {
  /* порядок на телефоне: вкладки → сцена → цвет → расчёт → лента картинок */
  .mfc-left { display: contents; }
  .mfc-views { order: 1; margin-bottom: 0; }
  .mfc-stage { order: 2; height: auto; }
  .mfc-tools { order: 3; margin-top: 0; }
  .mfc-panel { order: 4; }
  .mfc-thumbs { order: 5; margin-top: 4px; }
  .mfc-grid { gap: 12px; }
  .mfc-crop, .mfc-tools-row { display: none; }
  .mfc-tools .mfk-lbl { margin: 0 0 6px; font-size: 14px; }
  .mfc-cropfab { right: 10px; top: 10px; height: 34px; padding: 0 12px; font-size: 13px; }
  .mfc-thumbs-lbl { display: block; order: 5; font-weight: 700; margin-top: 8px; }
  .mfc-thumbs { order: 6; }
}
