/* ---------- Доработки по ТЗ «Улучшение сайта» (09.11.2026) ---------- */

/* якорные разделы не прячутся под закреплённой шапкой */
[id] { scroll-margin-top: 112px; }
@media (max-width: 1024px) { [id] { scroll-margin-top: 92px; } }

/* единая отметка о ценах */
.price-stamp { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 0; font-size: 13px; line-height: 1.5; color: var(--text); }
.price-stamp .i { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.price-stamp a { color: var(--blue); }

/* «Все продукты» на телефоне */
.pgrid__all { display: none; }
@media (max-width: 640px) {
  .pgrid:not(.is-all) > li:nth-child(n+4) { display: none; }
  .pgrid__all { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 12px; border-radius: 14px;
    border: 1.5px solid rgba(52, 51, 154, .3); font-weight: 800; color: var(--blue); cursor: pointer; }
  .pgrid__all:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
}

/* FAQ-чат: со скриптом - подсказки и сообщения; без скрипта - список вопросов (он же для поисковиков) */
.js .fq-chat .fq-list { display: none; }
html:not(.js) .fq-chat .fq-live, html:not(.js) .fq-chat__side { display: none; }
html:not(.js) .fq-chat__win { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "body"; }
.fq-msg p { margin: 0; }
.fq-msg.fq-msg--bot p + .fq-cta, .fq-msg--bot .fq-cta { margin-top: 8px; }
.fq-cta { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-weight: 800; color: var(--blue); text-decoration: none; }
.fq-cta .i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.fq-cta:hover { text-decoration: underline; }
.fq-item { display: grid; gap: 8px; }
.fq-item > summary { list-style: none; cursor: pointer; margin-left: auto; }
.fq-item > summary::-webkit-details-marker { display: none; }

/* карточка партнёра: второстепенные показатели в «Подробнее» */
.pc { grid-row: span 8 !important; }
.pc__details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 14px; border-radius: 14px;
  background: #f6f7fc; font-size: 14px; font-weight: 800; color: var(--blue); cursor: pointer; }
.pc__details > summary::-webkit-details-marker { display: none; }
.pc__details > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s; }
.pc__details[open] > summary::after { transform: rotate(-135deg); }
.pc__details[open] > summary { margin-bottom: 12px; }
.pc__details > .pc__sec { margin-top: 12px; }
.pc__details > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* проекты: определение числа внедрений */
.pj-def { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 20px; padding: 14px 16px; border-radius: 16px; background: #f6f7fc; font-size: 14px; line-height: 1.55; color: var(--text); }
.pj-def .i { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--blue); stroke-width: 2; }

/* формы: кому уходят данные, ловушка для ботов */
.form-who { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #eef7f1; font-size: 13px; line-height: 1.5; color: #1f4d33; }
.form-who .i { width: 18px; height: 18px; flex: none; fill: none; stroke: #1f8a4c; stroke-width: 2; }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.field__opt { font-weight: 500; color: var(--text); }
.task-ex { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.task-ex__b { all: unset; cursor: pointer; padding: 8px 12px; min-height: 36px; box-sizing: border-box; border-radius: 999px; background: #f1f2fa; font-size: 13px; font-weight: 700; color: var(--blue); }
.task-ex__b:hover { background: #e4e6f7; }
.task-ex__b:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* подбор партнёра по шагам */
.mv-progress { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 13px; font-weight: 800; color: var(--text); }
.mv-progress span { margin-right: 8px; }
.mv-progress i { width: 48px; height: 6px; border-radius: 3px; background: #e4e6f2; transition: background-color .3s; }
.mv-progress i.is-on { background: var(--yellow); }
.mv-nav { display: flex; justify-content: space-between; gap: 12px; }
.mv-nav [hidden], #match-form .form-actions[hidden] { display: none; }
.mv-next { margin-left: auto; }
.btn--ghost { background: #fff; color: var(--blue); box-shadow: inset 0 0 0 1.5px rgba(52, 51, 154, .3); min-width: 140px; }
#match-form > fieldset:not([hidden]) { animation: mv-in .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes mv-in { from { opacity: 0; transform: translateX(14px); } }

/* подвал: на телефоне группы раскрываются */
.site-footer__acc > summary { list-style: none; }
.site-footer__acc > summary::-webkit-details-marker { display: none; }
.site-footer__acc nav { display: grid; gap: 0; }
@media (min-width: 641px) { .site-footer__acc > summary { pointer-events: none; } }
@media (max-width: 640px) {
  .site-footer__acc { border-top: 1px solid rgba(255, 255, 255, .12); }
  .site-footer__acc > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; }
  .site-footer__acc > summary::after { content: "+"; font-size: 20px; font-weight: 700; }
  .site-footer__acc[open] > summary::after { content: "−"; }
  .site-footer__acc > summary:focus-visible { outline: 3px solid var(--yellow); }
}

/* калькулятор: кнопка печати и вид при печати (только расчёт) */
.calc-print { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; font-size: 14px; font-weight: 800; color: var(--blue); cursor: pointer; }
.calc-print .i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.calc-print:hover { text-decoration: underline; }
.calc-print:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media print {
  body:has(.calc__receipt) * { visibility: hidden !important; }
  body:has(.calc__receipt) .calc__receipt, body:has(.calc__receipt) .calc__receipt *, body:has(.calc__receipt) .price-stamp-print { visibility: visible !important; }
  body:has(.calc__receipt) .calc__receipt { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none !important; color: #000 !important; background: #fff !important; }
  .calc-print, .calc__receipt .btn { display: none !important; }
}

.prv-pricebox { position: relative; }
.price-stamp--dark { grid-column: 1 / -1; order: 3; margin: 0; padding: 12px 40px; background: #12114a; color: rgba(255, 255, 255, .75); }
.price-stamp--dark a { color: #ffd200; }
.price-stamp--dark .i { stroke: #ffd200; }
@media (max-width: 640px) { .price-stamp--dark { padding: 12px 20px; } }

/* ---------- Финальная доработка (10.11.2026) ---------- */

/* калькулятор: выбранный продукт виден в заголовке шага, даже если его плитка ниже экрана */
.calc-step__sel { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.calc__est { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: #fff7d1; color: var(--ink); font-size: 13px; line-height: 1.45; }

/* пояснение под галочкой согласия */
.field--check .field__note { grid-column: 2; margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* подбор партнёра: пометка запроса демонстрации */
.match-req { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); color: var(--ink); font-size: 14px; line-height: 1.5; }
.match-req[hidden] { display: none; }
.match-req .i { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* демо: резервное состояние и карточка запроса демонстрации */
.demo-viewer__retry { all: unset; cursor: pointer; margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.demo-viewer__retry:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.demo-viewer__retry[hidden] { display: none; }
#demo-error .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
a.demo-pick { text-decoration: none; color: inherit; }

/* страница продукта без подтверждённых внедрений: текст и действия вместо нулевой статистики */
.prv-new { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; margin-top: 28px; padding: 26px 28px; border-radius: 20px; background: var(--soft); border: 1px solid var(--line); }
.prv-new__t { margin: 0; max-width: 620px; font-size: 18px; line-height: 1.5; font-weight: 700; color: var(--ink); }
.prv-new__acts { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 640px) {
  .prv-new { padding: 20px 18px; }
  .prv-new__acts, .prv-new__acts .btn { width: 100%; }
  .calc-step__sel { max-width: 50%; }
}

/* бейдж «Популярное» на карточке продукта: правый верхний угол, фирменный жёлтый, звёздочка и мягкое свечение */
.pcard__top .pcard__badge {
  position: absolute; top: 16px; right: 16px; z-index: 2; align-self: auto;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .02em; color: #1d1d3f;
  background: linear-gradient(135deg, #ffe14d, #ffd200); border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 8px 18px -8px rgba(200, 150, 0, .9), 0 0 0 4px rgba(255, 210, 0, .18);
  animation: badge-glow 2.6s ease-in-out infinite;
}
.pcard__top .pcard__badge::before { content: "★"; font-size: 13px; line-height: 1; color: #b86e00; }
@keyframes badge-glow { 50% { box-shadow: 0 8px 18px -8px rgba(200, 150, 0, .9), 0 0 0 7px rgba(255, 210, 0, .08); } }
@media (max-width: 640px) { .pcard__top .pcard__badge { top: 12px; right: 12px; font-size: 11px; padding: 6px 10px 6px 8px; } }
@media (prefers-reduced-motion: reduce) { .pcard__top .pcard__badge { animation: none; } }

/* первый экран: «Официальный представитель 1С» с логотипом 1С, без подложки */
.hero__rep { display: inline-flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 0;
  color: #ffd200; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; line-height: 1.3; }
.hero__rep-logo { width: 100px; height: 76px; flex: none; object-fit: contain; margin: -12px -6px -12px -8px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .35)); }
a.hero__rep:hover span { text-decoration: underline; text-underline-offset: 4px; }
a.hero__rep:focus-visible { outline: 3px solid #ffd200; outline-offset: 6px; border-radius: 8px; }
@media (max-width: 640px) { .hero__rep { gap: 10px; font-size: 11px; } .hero__rep-logo { width: 80px; height: 60px; } }

/* карточка продукта в узкой колонке (≈ до 420px): верх перестраивается по ширине самой карточки, ничего не налезает.
   Направление одной строкой сверху, картинка справа внизу, бейдж слева внизу. */
.pcard { container-type: inline-size; container-name: pcard; }
.pcard__price.is-unknown { white-space: nowrap; }
@container pcard (max-width: 420px) {
  .pcard__top { padding: 18px 18px 16px; min-height: 172px; }
  .pcard__top .pcard__chip { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; padding: 5px 10px; }
  .pcard__art { right: 10px; bottom: 10px; width: 45%; max-width: 150px; height: 108px; }
  .pcard__top .pcard__badge { top: auto; bottom: 14px; right: auto; left: 16px; font-size: 11px; padding: 6px 10px 6px 8px; }
  .pcard__body { padding: 16px 18px 20px; }
  .pcard__foot { flex-wrap: wrap; row-gap: 8px; }
}
