/* Подбор пищевого инвентаря — стили из макета (prototype/picker.src.html), префикс fip- */
.fip { --acc: #2980b9; --acc-d: #1f6b9c; --txt: #1b1b1b; --gr: #686868; --ok: #27ae60; --line: #e3e7eb; --bg: #fff;
  margin: 0; padding: 0 0 40px; box-sizing: border-box; font-size: 14px; color: var(--txt); line-height: 1.35; }
.fip *, .fip *::before, .fip *::after { box-sizing: border-box; }
.fip .fip-h1 { font-size: 28px; font-weight: 900; margin: 0 0 4px; line-height: 1.2; }
.fip-lead { color: var(--gr); margin: 0 0 14px; max-width: 820px; line-height: 1.45; }

/* Шаг 1–2: бренд и цвет зоны */
.fip-bar { position: sticky; top: var(--fip-top, 0px); z-index: 20; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.fip-step { display: flex; align-items: center; gap: 10px; }
.fip-step__n { width: 22px; height: 22px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fip-step__l { font-weight: 700; white-space: nowrap; }
.fip-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.fip-seg button { border: 0; background: #fff; padding: 8px 16px; font: inherit; cursor: pointer; color: var(--txt); }
.fip-seg button + button { border-left: 1px solid var(--line); }
.fip-seg button.is-on { background: var(--acc); color: #fff; font-weight: 700; }
.fip-seg small { opacity: .7; font-weight: 400; margin-left: 4px; }
.fip-sw { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fip-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c9cfd5; cursor: pointer; padding: 0; position: relative; }
.fip-dot.is-on { box-shadow: 0 0 0 2px var(--acc); }
.fip-dot.is-on::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; color: #fff; text-shadow: 0 0 2px #000; }
.fip-dot[disabled] { opacity: .25; cursor: default; }
.fip-any { border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.fip-any.is-on { border-color: var(--acc); color: var(--acc); font-weight: 700; }
.fip-zone { font-size: 12px; color: var(--gr); margin-left: 4px; min-width: 120px; }
.fip-search { flex: 1 1 200px; min-width: 180px; border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; font: inherit; }

.fip-layout { display: grid; grid-template-columns: 220px minmax(0,1fr) 340px; gap: 18px; margin-top: 16px; align-items: start; }

/* Шаг 3: типы инвентаря */
.fip-types { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 0; position: sticky; top: calc(var(--fip-top, 0px) + 84px); }
.fip-types__sec { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gr); padding: 10px 14px 4px; }
.fip-types button { display: flex; width: 100%; justify-content: space-between; gap: 8px; border: 0; background: none; text-align: left;
  padding: 7px 14px; font: inherit; cursor: pointer; color: var(--txt); border-left: 3px solid transparent; }
.fip-types button:hover { background: #f2f7fb; }
.fip-types button.is-on { border-left-color: var(--acc); background: #eaf3fa; font-weight: 700; color: var(--acc-d); }
.fip-types button[disabled] { color: #b5bbc1; cursor: default; background: none; }
.fip-types .n { color: var(--gr); font-weight: 400; font-size: 12px; }
.fip-types .tag { font-size: 10px; background: #fdf0d5; color: #8a5a00; border-radius: 3px; padding: 1px 4px; margin-left: 4px; font-weight: 700; }
.fip-types .inkit { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; background: var(--ok); color: #fff; border-radius: 9px; padding: 0 5px; margin-left: 4px; }

.fip-main { min-width: 0; }
.fip-main__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fip-main__head h2 { font-size: 20px; margin: 0; }
.fip-main__head .n { color: var(--gr); }
.fip-hint { background: #eaf3fa; border: 1px solid #cfe3f2; border-radius: 6px; padding: 8px 12px; color: #245f86; margin-bottom: 12px; font-size: 13px; }

/* Подбор ручки к насадке */
#fip-pair { scroll-margin-top: calc(var(--fip-top, 0px) + 140px); }
.fip-pair { background: #fff; border: 2px solid var(--acc); border-radius: 8px; padding: 12px 14px 14px; margin-bottom: 14px; }
.fip-pair__head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.fip-pair__head img { width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.fip-pair__head b { display: block; font-size: 15px; }
.fip-pair__head span { color: var(--gr); font-size: 13px; }
.fip-pair__x { margin-left: auto; border: 0; background: none; font-size: 22px; color: var(--gr); cursor: pointer; line-height: 1; }
.fip-pair__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fip-pair__sub { font-weight: 700; margin: 6px 0 8px; }
.fip-pair__row + .fip-pair__sub { margin-top: 14px; }
.fip-pair__row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.fip-pair__row .fip-card { flex: 0 0 190px; scroll-snap-align: start; }
.fip-pair__foot { display: flex; gap: 16px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--gr); flex-wrap: wrap; }
.fip-link { border: 0; background: none; color: var(--acc); cursor: pointer; font: inherit; padding: 0; text-decoration: underline dotted; }

/* Карточки моделей */
.fip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.fip-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.fip-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.07); }
.fip-card__img { position: relative; flex: none; width: 100%; aspect-ratio: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #fff; }
.fip-card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.fip-len { position: absolute; left: 0; bottom: 0; z-index: 1; display: inline-flex; align-items: center; gap: 3px;
  background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px 2px 4px;
  font-size: 12.5px; font-weight: 700; color: var(--txt); white-space: nowrap; }
.fip-len svg { width: 13px; height: 13px; color: var(--acc); flex: none; }
.fip-card__img .ph { width: 70%; aspect-ratio: 1; border-radius: 8px; opacity: .85; }
.fip-card__t { font-size: 13px; line-height: 1.3; min-height: 34px; color: var(--txt); text-decoration: none; }
.fip-card__t:hover { color: var(--acc); }
.fip-card__sku { font-size: 11px; color: var(--gr); }
.fip-card__sw { display: flex; flex-wrap: wrap; gap: 4px; }
.fip-card__sw .fip-dot { width: 18px; height: 18px; border-width: 1px; }
.fip-card__sw .fip-dot.is-on::after { font-size: 10px; }
.fip-card__p { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; }
.fip-card__p b { font-size: 16px; }
.fip-card__p span { font-size: 12px; }
.fip-ok { color: var(--ok); }
.fip-no { color: var(--gr); }
.fip-badge { position: absolute; z-index: 2; top: 8px; left: 8px; font-size: 11px; background: #fdf0d5; color: #8a5a00; border-radius: 3px; padding: 2px 6px; font-weight: 700; }
.fip-badge--match { background: #e3f5ea; color: #1d7a45; }
.fip-badge--warn { background: #f3f4f6; color: var(--gr); }
.fip-btn { border: 0; border-radius: 5px; background: var(--acc); color: #fff; font: inherit; font-weight: 700; padding: 8px 10px; cursor: pointer; }
.fip-btn:hover { background: var(--acc-d); }
.fip-btn--ghost { background: #fff; color: var(--acc); border: 1px solid var(--acc); }
.fip-btn--ghost:hover { background: #eaf3fa; }
.fip-btn--in { background: var(--ok); }
.fip-btn--in:hover { background: #1f8f4f; }
.fip-more { display: block; margin: 16px auto 0; }
.fip-more[hidden] { display: none; }
.fip-empty { padding: 40px; text-align: center; color: var(--gr); background: #fff; border: 1px dashed var(--line); border-radius: 8px; }

/* Набор */
.fip-kit { background: #fff; border: 1px solid var(--line); border-radius: 8px; position: sticky; top: calc(var(--fip-top, 0px) + 84px); max-height: calc(100vh - 100px - var(--fip-top, 0px)); display: flex; flex-direction: column; }
.fip-kit__head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 8px; }
.fip-kit__head b { font-size: 17px; }
.fip-kit__head span { color: var(--gr); font-size: 13px; }
.fip-kit__head .fip-link { margin-left: auto; font-size: 12px; color: var(--gr); }
.fip-kit__close { display: none; }
.fip-kit__body { overflow-y: auto; padding: 4px 0; flex: 1 1 auto; }
.fip-kit__empty { padding: 22px 16px; color: var(--gr); font-size: 13px; line-height: 1.5; }
.fip-zone-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px 4px; font-weight: 700; font-size: 13px; }
.fip-zone-h i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px #c9cfd5; flex: none; }
.fip-zone-h small { color: var(--gr); font-weight: 400; margin-left: auto; }
.fip-row { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 4px 8px; padding: 6px 14px; align-items: center; }
.fip-row--child { padding-left: 34px; position: relative; }
.fip-row--child::before { content: ""; position: absolute; left: 22px; top: -2px; width: 8px; height: 22px; border-left: 2px solid #cfe3f2; border-bottom: 2px solid #cfe3f2; border-bottom-left-radius: 6px; }
.fip-row img, .fip-row .ph { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; }
.fip-row__t { font-size: 12.5px; line-height: 1.25; }
.fip-row__p { font-size: 12px; color: var(--gr); }
.fip-del { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--gr); display: inline-flex; border-radius: 4px; }
.fip-del:hover { color: #c0392b; background: #fdecea; }
.fip-del svg { width: 16px; height: 16px; }
.fip-row__need { grid-column: 2 / 5; font-size: 12px; color: #8a5a00; background: #fdf6e6; border-radius: 4px; padding: 3px 8px; display: flex; justify-content: space-between; gap: 6px; }
.fip-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; }
.fip-qty button { border: 0; background: none; width: 22px; height: 24px; cursor: pointer; font-size: 15px; color: var(--gr); }
.fip-qty span { min-width: 20px; text-align: center; font-size: 13px; }
.fip-kit__foot { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.fip-warn { font-size: 12px; color: #8a5a00; background: #fdf6e6; border-radius: 4px; padding: 6px 8px; }
.fip-sum { display: flex; justify-content: space-between; font-size: 16px; }
.fip-sum b { font-size: 20px; }
.fip-kit__btns { display: flex; gap: 8px; }
.fip-kit__btns .fip-btn { flex: 1; }

.fip-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1b1b1b; color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10020; }
.fip-toast.is-on { opacity: .95; }

/* Мобильный набор — нижняя панель */
.fip-mbar { display: none; }
@media (max-width: 1100px) {
  .fip-layout { grid-template-columns: 200px minmax(0,1fr); }
  .fip-kit { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 100%); max-height: none; border-radius: 0; z-index: 10010; transform: translateX(100%); transition: transform .2s; box-shadow: -4px 0 20px rgba(0,0,0,.15); }
  .fip.kit-open .fip-kit { transform: none; }
  /* затемнение за открытым набором: клик по нему — клик по .fip, закрывает набор */
  .fip.kit-open::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10005; }
  .fip.kit-open .fip-mbar { display: none; }
  .fip .fip-kit__close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; margin: -6px -6px -6px 8px;
    border: 0; border-radius: 50%; background: #f0f2f4; color: var(--txt); font-size: 24px; line-height: 1; cursor: pointer; padding: 0; align-self: center; }
  .fip-kit__head > span + .fip-kit__close { margin-left: auto; }
  .fip-mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10000; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px; gap: 12px; align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
  .fip-mbar b { font-size: 16px; }
  .fip-mbar .fip-btn { margin-left: auto; }
}
@media (max-width: 700px) {
  .fip { padding: 0 0 100px; }
  .fip .fip-h1 { font-size: 22px; }
  .fip-layout { grid-template-columns: 1fr; }
  .fip-types { position: static; display: flex; overflow-x: auto; padding: 6px; gap: 6px; border-radius: 6px; }
  .fip-types__sec { display: none; }
  .fip-types button { flex: none; width: auto; border: 1px solid var(--line); border-radius: 16px; padding: 6px 12px; white-space: nowrap; }
  .fip-types button.is-on { border-color: var(--acc); }
  .fip-bar { position: static; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; }
  .fip-step { flex-wrap: wrap; gap: 8px; }
  .fip-seg { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; border: 0; border-radius: 0; overflow: visible; }
  .fip-seg button, .fip-seg button + button { flex: 1 1 auto; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; white-space: nowrap; }
  .fip-sw { width: 100%; }
  .fip-zone { width: 100%; margin-left: 0; min-width: 0; }
  .fip-search { flex: none; width: 100%; min-width: 0; box-sizing: border-box; }
  .fip-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
}

/* в теме: кнопки и поля без оформления темы */
.fip button { font-family: inherit; line-height: 1.2; text-transform: none; letter-spacing: normal; min-height: 0; box-shadow: none; }
.fip .fip-dot { box-shadow: 0 0 0 1px #c9cfd5; }
.fip .fip-dot.is-on { box-shadow: 0 0 0 2px var(--acc); }
.fip input.fip-search { height: auto; -webkit-appearance: none; appearance: none; background: #fff; }
.fip a.fip-card__t { text-decoration: none; }
.fip-btn[disabled] { opacity: .6; cursor: default; }
.fip-toast a { color: #8fd0ff; margin-left: 8px; }
.fip-toast.is-on { pointer-events: auto; }
.fip-loading { opacity: .6; }

/* текст для поисковиков под подбором */
.fip-seo { margin-top: 36px; max-width: 900px; line-height: 1.55; }
.fip-seo h2 { font-size: 20px; margin: 22px 0 8px; }
.fip-seo p { margin: 0 0 10px; }
.fip-seo__zones { list-style: none; padding: 0; margin: 0; columns: 2 320px; }
.fip-seo__zones li { display: flex; align-items: center; gap: 8px; padding: 3px 0; break-inside: avoid; }
.fip-seo__zones i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px #c9cfd5; flex: none; }
.fip-out { color: #c0392b; font-size: 12px; margin-top: 2px; }
.fip-card.is-target { box-shadow: 0 0 0 2px #2980b9; }
