/* Список запроса: кнопки «в список», счётчик в шапке, боковая панель с формой. Логика — assets/js/rfq.js */

/* ---------- ячейка карточки с кнопкой «+» ---------- */
.pc-cell { position: relative; display: flex; min-width: 0; }
.pc-cell[hidden] { display: none; }
.pc-cell > .pc { flex: 1 1 auto; min-width: 0; }
.pc-add, .rfq-mini {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; flex: none;
  border: 1px solid var(--line-2); background: rgba(8,9,11,.78); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .3s var(--ease-soft), border-color .3s var(--ease-soft), transform .4s var(--ease-out);
}
.pc-add { position: absolute; top: 26px; right: 26px; z-index: 2; }
.pc-add::after { content: ""; position: absolute; inset: -5px; }             /* зона нажатия 48 px */
.pc-add i, .rfq-mini i { position: relative; width: 14px; height: 14px; }
.pc-add i::before, .pc-add i::after, .rfq-mini i::before, .rfq-mini i::after {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .4s var(--ease-out), width .3s var(--ease-out);
}
.pc-add i::after, .rfq-mini i::after { transform: rotate(90deg); }
.pc-add:hover, .rfq-mini:hover { border-color: rgba(255,90,31,.7); background: rgba(255,90,31,.16); }
.pc-add:active, .rfq-mini:active { transform: scale(.94); }
.pc-add.is-in, .rfq-mini.is-in { background: var(--orange-ink); border-color: transparent; }
/* в списке: вместо «плюса» галочка */
.pc-add.is-in i::before, .rfq-mini.is-in i::before { opacity: 0; }
.pc-add.is-in i::after, .rfq-mini.is-in i::after { left: 4px; top: 0; width: 6px; height: 11px; border-radius: 0; background: none;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: none; }
.pc-add:focus-visible, .rfq-mini:focus-visible, .rfq-btn:focus-visible, .rfq__x:focus-visible, .rfq__link:focus-visible,
.rfq-qty button:focus-visible, .rfq-it__del:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 2px; }

/* на странице товара: вторая кнопка рядом с «Запросить цену» */
.rfq-toggle [data-on], .rfq-toggle.is-in [data-off] { display: none; }
.rfq-toggle.is-in [data-on] { display: inline; }
.rfq-toggle.is-in { border-color: rgba(255,90,31,.55); background: rgba(255,90,31,.1); }
.pp-bar .rfq-mini { margin-left: auto; }
.pp-bar .rfq-mini + .btn { margin-left: -6px; }
@media (min-width: 961px) { .pp-bar .rfq-mini { margin-left: 0; } }

/* типовой комплект на странице решения */
.sol-kit__add { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 22px; }
.sol-kit__add span { color: var(--text-2); font-size: 14px; max-width: 46ch; }

/* ---------- счётчик в шапке ---------- */
.rfq-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 8px 0 14px; border-radius: 999px; cursor: pointer; flex: none;
  border: 1px solid rgba(255,90,31,.45); background: rgba(255,90,31,.1); color: #fff; font: 700 14px/1 var(--f-body);
  transition: background .3s var(--ease-soft), border-color .3s var(--ease-soft);
}
.rfq-btn[hidden] { display: none; }
.rfq-btn:hover { background: rgba(255,90,31,.2); border-color: rgba(255,90,31,.8); }
.rfq-btn svg { width: 17px; height: 17px; color: var(--orange-3); }
.rfq-btn b { min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: var(--orange-ink); font: 600 12px/1 var(--f-mono); }
body > .rfq-btn { position: fixed; right: 16px; bottom: 16px; z-index: 60; }
/* на главной шапка плотная: только значок и число */
.header__actions .rfq-btn span { display: none; }
.header__actions .rfq-btn { padding-left: 11px; gap: 7px; }
@media (max-width: 760px) {
  /* на телефоне счётчик встаёт на место кнопки «Запросить цену» */
  html.has-rfq .tp-header .btn--primary { display: none; }
  .tp-header .rfq-btn { margin-left: auto; }
}

/* ---------- панель ---------- */
.rfq { position: fixed; inset: 0; z-index: 600; }
.rfq[hidden] { display: none; }
.rfq__shade { position: absolute; inset: 0; background: rgba(4,5,6,.62); opacity: 0; transition: opacity .32s var(--ease-soft);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.rfq__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%); display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1) 40%); border-left: 1px solid var(--line-2);
  box-shadow: -40px 0 80px -30px rgba(0,0,0,.8); transform: translateX(28px); opacity: 0;
  transition: transform .42s var(--ease-out), opacity .3s var(--ease-soft);
}
.rfq__panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,90,31,.7), transparent); }
.rfq.is-on .rfq__shade { opacity: 1; }
.rfq.is-on .rfq__panel { transform: none; opacity: 1; }
html.rfq-open, html.rfq-open body { overflow: hidden; }

.rfq__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: calc(26px + env(safe-area-inset-top, 0px)) 22px 16px; }
.rfq__eyebrow { display: block; margin-bottom: 8px; font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--orange-3); }
.rfq__head h2 { margin: 0; font: 700 26px/1.1 var(--f-display); letter-spacing: -.03em; color: #fff; }
.rfq__x { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: #fff; cursor: pointer; transition: background .3s, border-color .3s; }
.rfq__x:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
.rfq__x svg { width: 16px; height: 16px; }

.rfq__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 22px; }
.rfq__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rfq-it { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 30px; align-items: center; gap: 12px; padding: 10px 8px 10px 10px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.rfq-it__pic { width: 56px; height: 56px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.rfq-it__pic img, .rfq-it__pic span { width: 88%; height: 88%; object-fit: contain; background-repeat: no-repeat; }
.rfq-it__t { min-width: 0; display: grid; gap: 4px; }
.rfq-it__n { font: 600 13px/1.25 var(--f-mono); color: #fff; overflow-wrap: anywhere; }
a.rfq-it__n:hover { color: var(--orange-3); }
.rfq-it__t span { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rfq-it__t em { font: 500 11.5px/1.2 var(--f-mono); font-style: normal; color: var(--orange-3); }
.rfq__rrp { font-size: 12.5px; line-height: 1.4; color: var(--text-2); }
.rfq__rrp[hidden] { display: none; }
.rfq-qty { display: flex; align-items: center; height: 36px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(8,9,11,.6); }
.rfq-qty button { width: 32px; height: 34px; border: 0; background: none; color: var(--text-2); font: 500 18px/1 var(--f-body); cursor: pointer; border-radius: 999px; }
.rfq-qty button:hover { color: #fff; }
.rfq-qty input { width: 34px; height: 34px; padding: 0; border: 0; background: none; color: #fff; text-align: center; font: 600 13px/1 var(--f-mono); outline: none; }
.rfq-it__del { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; transition: color .3s, background .3s; }
.rfq-it__del:hover { color: #fff; background: rgba(255,255,255,.08); }
.rfq-it__del svg { width: 13px; height: 13px; }

.rfq__empty, .rfq__done { display: none; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px; border-radius: 18px; border: 1px dashed var(--line-2); }
.rfq__empty b, .rfq__done b { font: 700 18px/1.2 var(--f-display); color: #fff; }
.rfq__empty p, .rfq__done p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.rfq__done { border: 1px solid rgba(61,220,151,.4); background: rgba(61,220,151,.08); }
.rfq.is-empty .rfq__empty { display: flex; }
.rfq.is-empty .rfq__fields, .rfq.is-empty .rfq__foot, .rfq.is-empty .rfq__list { display: none; }
.rfq.is-sent .rfq__done { display: flex; }
.rfq.is-sent .rfq__empty { display: none; }

.rfq__fields { display: grid; gap: 10px; }
.rfq__fields h3 { margin: 0 0 2px; font: 700 16px/1.2 var(--f-display); color: #fff; }
.rfq__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rfq__fields .field textarea { min-height: 72px; }
.rfq__fields .consent { margin-top: 4px; }
.rfq .field .is-bad, .rfq .field input.is-bad { border-color: #e5383b !important; }

.rfq__foot { flex: none; display: grid; gap: 12px; padding: 14px 22px calc(18px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: rgba(8,9,11,.72); }
.rfq__sum { display: flex; align-items: center; gap: 14px; }
.rfq__total { margin-right: auto; font: 600 13px/1 var(--f-mono); color: #fff; }
.rfq__link { border: 0; background: none; padding: 4px 0; color: var(--text-2); font: 500 13px/1 var(--f-body); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.rfq__link:hover { color: #fff; }
.rfq__err { display: none; padding: 11px 13px; border-radius: 12px; background: rgba(229,56,59,.1); border: 1px solid rgba(229,56,59,.4); color: #ffc2c3; font-size: 13.5px; }
.rfq.is-error .rfq__err { display: block; }
.rfq__foot .btn { width: 100%; }
.rfq__foot .btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* ---------- короткое уведомление ---------- */
.rfq-toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 90; transform: translate(-50%, 14px); opacity: 0;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 18px; border-radius: 999px;
  background: rgba(19,22,26,.96); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -18px rgba(0,0,0,.9);
  color: #fff; font-size: 14px; transition: transform .4s var(--ease-out), opacity .3s var(--ease-soft);
}
.rfq-toast[hidden] { display: none; }
.rfq-toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.rfq-toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rfq-toast button { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--orange-ink); color: #fff; font: 700 13px/1 var(--f-body); cursor: pointer; }
body:has(.pp-bar) .rfq-toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 560px) {
  .pc-add { top: 22px; right: 22px; }
  .rfq__head { padding-inline: 16px; }
  .rfq__body { padding-inline: 16px; }
  .rfq__foot { padding-inline: 16px; }
  .rfq__panel { border-left: 0; }
  .rfq-it { grid-template-columns: 48px minmax(0, 1fr) auto 28px; gap: 10px; }
  .rfq-it__pic { width: 48px; height: 48px; }
  .rfq-it__n { font-size: 12px; }
  .rfq-qty button { width: 28px; }
  .rfq-qty input { width: 28px; }
  .rfq-toast span { max-width: 46vw; }
}
@media (prefers-reduced-motion: reduce) {
  .rfq__panel, .rfq__shade, .rfq-toast, .pc-add, .rfq-mini, .pc-add i::before, .pc-add i::after { transition: none; }
}

/* ---------- корзина: значок вместо «плюса», итог заказа ---------- */
.pc-add i, .rfq-mini i { width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h2.3l2.2 11h10.2l2-7.5H6.6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='9.3' cy='19.2' r='1.6'/%3E%3Ccircle cx='16.8' cy='19.2' r='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h2.3l2.2 11h10.2l2-7.5H6.6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='9.3' cy='19.2' r='1.6'/%3E%3Ccircle cx='16.8' cy='19.2' r='1.6'/%3E%3C/svg%3E") center / contain no-repeat; }
.pc-add i::before, .pc-add i::after, .rfq-mini i::before, .rfq-mini i::after { display: none; }
.pc-add.is-in i, .rfq-mini.is-in i {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.btn--primary.rfq-toggle.is-in { background: rgba(255,90,31,.14); border: 1px solid rgba(255,90,31,.65); box-shadow: none; }
.btn--primary.rfq-toggle.is-in::before { display: none; }
.rfq__rrp { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 12px; }
.rfq__rrp span { font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rfq__rrp b { font: 700 24px/1 var(--f-display); letter-spacing: -.02em; color: #fff; white-space: nowrap; }
.rfq__rrp small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.45; }
.rfq-it__t em { color: #fff; }

/* миниатюра из общего листа (демо) */
.rfq-it__pic svg { width: 88%; height: 88%; display: block; }
