/* «Карта продуктов» (/products): холст Claude Design «Карта продуктов МСБ-Лизинг», проход 3
   (_local-private/design/product-map/build-v3.mjs). Каркас и шапка — как у посадочной (.landing). */

.products {
  --pm-ease: cubic-bezier(.22, 1, .36, 1);
  --pm-cols: 64px minmax(0, 1fr) 132px 132px 156px 36px;
  --pm-row-hover: #F9FAF7; /* не из утверждённого дизайна портала: фон строки при наведении из холста */
  padding-bottom: 36px;
}

.products__home {
  text-decoration: none;
}

.products__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.products__main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- Заголовок ---------- */
.products__intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  padding-top: 8px;
  animation: pm-rise .5s var(--pm-ease) both;
}

.products__titles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.products__title {
  font-family: var(--font-heading);
  font-size: 44px;
  line-height: 48px;
  font-weight: 700;
  letter-spacing: -.035em;
}

.products__lead {
  font-size: 17px;
  line-height: 26px;
  color: var(--ink2);
}

/* ---------- Скачать карту продуктов ---------- */
.pm-dl {
  height: 48px;
  padding: 0 16px 0 6px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line2);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .15s, background-color .15s;
}

.pm-dl:hover {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--title-muted);
}

.pm-dl:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--line2), 0 0 0 3px var(--bg), 0 0 0 5px var(--acc);
}

.pm-dl:active {
  background: var(--emerald-wash);
  box-shadow: inset 0 0 0 1px rgba(11, 171, 132, .3);
}

.pm-dl__ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--emerald-wash);
  color: var(--emerald);
  transition: background-color .15s, color .15s;
}

.pm-dl:hover .pm-dl__ic,
.pm-dl:active .pm-dl__ic,
.pm-dl.is-load .pm-dl__ic {
  background: var(--acc);
  color: var(--on-acc);
}

.pm-dl.is-load .pm-dl__ic svg {
  animation: pm-nudge 1s var(--pm-ease) infinite;
}

.pm-dl__t {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.pm-dl__t b {
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
}

.pm-dl__t span {
  font-size: 12px;
  line-height: 16px;
  color: var(--ink3);
}

@keyframes pm-nudge {
  50% { transform: translateY(2px); }
}

@keyframes pm-rise {
  from { opacity: 0; transform: translateY(14px); }
}

/* ---------- Список ---------- */
.pm-map {
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: pm-rise .55s .08s var(--pm-ease) both;
}

.pm-list {
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 29, 36, .04), 0 1px 2px rgba(16, 63, 69, .05);
}

.pm-lhead {
  display: grid;
  grid-template-columns: var(--pm-cols);
  column-gap: 16px;
  align-items: center;
  height: 44px;
  padding: 0 20px 0 24px;
  color: var(--ink4);
  box-shadow: inset 0 -1px 0 var(--line);
}

.pm {
  position: relative;
  scroll-margin-top: 16px;
}

.pm-list .pm + .pm {
  box-shadow: inset 0 1px 0 var(--line);
}

.pm-h {
  font: inherit;
}

.pm-head {
  width: 100%;
  display: grid;
  grid-template-columns: var(--pm-cols);
  column-gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 12px 20px 12px 24px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s;
}

.pm-head:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: -4px;
  border-radius: 16px;
}

.pm-no {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink4);
  transition: color .2s;
}

.pm-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pm-name {
  font-family: var(--font-heading);
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  transition: color .15s;
}

.pm-cat {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink3);
}

.pm-cat--mob {
  display: none;
}

.pm-v {
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink);
}

.pm-v.is-none {
  font-weight: 400;
  color: var(--ink4);
}

.pm-chev {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--ink2);
  transition: background-color .2s, color .2s;
}

.pm-chev svg {
  transition: transform .36s var(--pm-ease);
}

.pm.is-open .pm-chev {
  background: var(--acc);
  color: var(--on-acc);
}

.pm.is-open .pm-chev svg {
  transform: rotate(180deg);
}

.pm.is-open .pm-name {
  color: var(--acc);
}

.pm.is-open .pm-no {
  color: var(--emerald);
}

@media (hover: hover) {
  .pm-list .pm:hover .pm-head {
    background: var(--pm-row-hover);
  }

  .pm-list .pm:hover .pm-chev {
    background: var(--emerald-wash);
    color: var(--acc);
  }

  .pm-list .pm.is-open:hover .pm-chev {
    background: var(--acc);
    color: var(--on-acc);
  }
}

/* Раскрытие: высота через grid-template-rows 0fr → 1fr, содержимое проявляется со сдвигом. */
.pm-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .36s var(--pm-ease);
}

.pm.is-open .pm-body {
  grid-template-rows: 1fr;
}

.pm-clip {
  min-height: 0;
  overflow: hidden;
}

.pm-inner {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s, transform .36s var(--pm-ease);
}

.pm.is-open .pm-inner {
  opacity: 1;
  transform: none;
  transition-delay: .06s;
}

/* ---------- Раскрытый продукт: слева изображение, справа описание и условия строками ---------- */
.pg {
  display: grid;
  grid-template-columns: 384px minmax(0, 1fr);
  column-gap: 56px;
  /* Воздух сверху и снизу: изображение по центру высоты текстовой колонки, текст отходит от шапки строки. */
  align-items: center;
  padding: 16px 56px 24px 104px;
}

.pg-a {
  display: flex;
  flex-direction: column;
}

.pg-pic {
  display: block;
  width: 384px;
  height: 211px;
  margin: 0 0 0 -8px;
  object-fit: contain;
  object-position: left center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .32s .08s, transform .5s .08s var(--pm-ease);
}

.pm.is-open .pg-pic {
  opacity: 1;
  transform: none;
}

.pg-r {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pg-lead {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 20px;
}

/* «Подать заявку» — лёгкая текстовая кнопка внизу справа раскрытого продукта. */
.pg-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  box-shadow: inset 0 1px 0 var(--line);
}

.pg-apply {
  height: 36px;
  padding: 0 4px 0 14px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--acc);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line2);
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, box-shadow .2s, color .2s;
}

.pg-apply__ic {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--emerald-wash);
  color: var(--acc);
  transition: background-color .2s, color .2s, transform .28s var(--pm-ease);
}

.pg-apply:hover {
  color: var(--acc);
  background: var(--emerald-wash);
  box-shadow: inset 0 0 0 1px rgba(11, 171, 132, .3);
}

.pg-apply:hover .pg-apply__ic {
  background: var(--acc);
  color: var(--on-acc);
  transform: translateX(2px);
}

.pg-apply:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--line2), 0 0 0 3px var(--surface), 0 0 0 5px var(--acc);
}

.pg-apply:active {
  background: var(--emerald-wash);
}

.pg-text {
  max-width: 720px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink2);
  text-wrap: pretty;
}

.pg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pg-chip {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--ink2);
  background: var(--panel);
  white-space: nowrap;
}

.pm-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  column-gap: 24px;
  padding: 13px 0;
  box-shadow: inset 0 1px 0 var(--line);
}

.pm-row > h4 {
  margin: 0;
  line-height: 20px;
  color: var(--ink3);
}

.pm-li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink2);
}

.pm-li + .pm-li {
  margin-top: 6px;
}

.pm-li b {
  font-weight: 500;
  color: var(--ink);
}

.pm-li.is-empty {
  color: var(--ink4);
}

.pm-mk {
  width: 18px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-mk--dot::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: var(--emerald);
}

.pm-mk--pro {
  color: var(--emerald);
}

/* Brick для ограничений и стоп-факторов — решение владельца для карты продуктов (расширяет правило «только ошибки»). */
.pm-mk--lim {
  color: var(--brand-brick);
}

/* ---------- Финальные аккордеоны ---------- */
.pm-special {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp {
  border-radius: 20px;
  overflow: hidden;
}

.sp .pm-head {
  grid-template-columns: 64px minmax(0, 1fr) 36px;
}

.sp-ic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-general {
  background: var(--dark);
  color: var(--dark-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 24px 48px -36px rgba(0, 29, 36, .6);
}

.sp-general .sp-ic {
  background: rgba(11, 171, 132, .18);
  color: var(--emerald);
}

.sp-general .pm-name,
.sp-general.is-open .pm-name {
  color: #FFFFFF;
}

.sp-general .pm-cat {
  color: var(--dark-muted);
}

.sp-general .pm-chev {
  background: rgba(244, 242, 242, .08);
  color: var(--dark-ink);
}

.sp-general.is-open .pm-chev {
  background: var(--emerald);
  color: var(--brand-deep);
}

.sp-general .pm-head:focus-visible {
  outline-color: var(--emerald);
}

.sp-stop {
  background: var(--err-bg);
  box-shadow: inset 0 0 0 1px rgba(243, 84, 26, .2);
}

.sp-stop .sp-ic {
  background: rgba(243, 84, 26, .12);
  color: var(--brand-brick);
}

.sp-stop .pm-name,
.sp-stop.is-open .pm-name {
  color: var(--err-text);
}

.sp-stop .pm-chev {
  background: rgba(243, 84, 26, .08);
  color: var(--err-text);
}

.sp-stop.is-open .pm-chev {
  background: var(--brand-brick);
  color: #FFFFFF;
}

@media (hover: hover) {
  .sp-general:hover .pm-head {
    background: rgba(255, 255, 255, .03);
  }

  .sp-general:hover .pm-chev {
    background: rgba(244, 242, 242, .14);
    color: #FFFFFF;
  }

  .sp-general.is-open:hover .pm-chev {
    background: var(--emerald);
    color: var(--brand-deep);
  }

  .sp-stop:hover .pm-head {
    background: rgba(243, 84, 26, .04);
  }

  .sp-stop:hover .pm-chev {
    background: rgba(243, 84, 26, .14);
    color: var(--err-text);
  }

  .sp-stop.is-open:hover .pm-chev {
    background: var(--brand-brick);
    color: #FFFFFF;
  }
}

.gp {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  padding: 0 56px 20px 104px;
}

.gp div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  box-shadow: inset 0 1px 0 var(--dark-line);
}

.gp dt {
  font-size: 13px;
  line-height: 18px;
  color: var(--dark-muted);
}

.gp dd {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  color: #FFFFFF;
}

/* Не из утверждённого дизайна портала: светлый Brick для предупреждения на тёмном Teal (из холста). */
.gp dd.is-warn {
  color: #FF9A73;
}

.gp-note {
  padding: 0 56px 28px 104px;
  font-size: 12px;
  line-height: 16px;
  color: var(--dark-muted);
}

.st {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  padding: 0 56px 28px 104px;
}

.st li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  box-shadow: inset 0 1px 0 rgba(243, 84, 26, .16);
  font-size: 14px;
  line-height: 21px;
  color: var(--ink2);
}

.st li b {
  font-weight: 600;
  color: var(--err-text);
}

/* ---------- Промежуточные ширины ---------- */
@media (max-width: 1199px) and (min-width: 900px) and (min-height: 501px), (max-width: 1199px) and (min-width: 1025px) {
  .products {
    --pm-cols: 48px minmax(0, 1fr) 96px 96px 120px 36px;
  }

  .pg {
    grid-template-columns: 288px minmax(0, 1fr);
    column-gap: 32px;
    padding: 0 32px 28px 88px;
  }

  .pg-pic {
    width: 288px;
    height: 158px;
  }

  .gp,
  .gp-note,
  .st {
    padding-left: 88px;
    padding-right: 32px;
  }
}

/* ---------- Телефон ---------- */
/* Телефон; невысокий горизонтальный экран до 1024 px — тоже мобильная раскладка. */
@media (max-width: 899px), (orientation: landscape) and (max-height: 500px) and (max-width: 1024px) {
  .products {
    padding-bottom: 0;
  }

  .products__nav {
    gap: 8px;
  }

  /* Рядом с логотипом помещаются обе кнопки: «Помощь» — только иконкой (подпись — в aria-label). */
  .products__help {
    width: 40px;
    padding: 0;
  }

  .products__help-label {
    display: none;
  }

  .products__nav .help-link:not(.products__help) {
    padding: 0 14px 0 10px;
  }

  .products__main {
    gap: 24px;
  }

  .products__intro {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 24px 20px 0;
  }

  .products__title {
    font-size: 32px;
    line-height: 36px;
  }

  .products__lead {
    font-size: 16px;
    line-height: 24px;
  }

  .products__count {
    display: none;
  }

  .pm-dl {
    width: 100%;
    height: 52px;
  }

  .pm-map {
    gap: 24px;
    padding: 0 12px;
  }

  .pm-list {
    border-radius: 20px;
  }

  .pm-lhead,
  .pm-v,
  .pm-cat--desk {
    display: none;
  }

  .pm-cat--mob {
    display: block;
    margin-top: 2px;
  }

  .pm-head,
  .sp .pm-head {
    grid-template-columns: 30px minmax(0, 1fr) 32px;
    column-gap: 10px;
    align-items: start;
    min-height: 64px;
    padding: 12px 14px 12px 16px;
  }

  .sp .pm-cat {
    margin-top: 2px;
  }

  .pm-no {
    font-size: 13px;
    line-height: 22px;
  }

  .pm-name {
    font-size: 16px;
    line-height: 22px;
  }

  .pm-chev {
    width: 32px;
    height: 32px;
    margin-top: -5px;
  }

  .pg {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
    padding: 8px 16px 16px;
  }

  .pg-pic {
    width: 100%;
    height: auto;
    aspect-ratio: 768 / 423;
    margin: 0;
    object-position: center;
  }

  .pg-lead {
    padding: 0 0 16px;
  }

  .pg-foot {
    padding-top: 14px;
  }

  /* На телефоне — во всю ширину, чтобы в неё было легко попасть пальцем. */
  .pg-apply {
    width: 100%;
    height: 44px;
    border-radius: 14px;
    justify-content: space-between;
    padding: 0 8px 0 16px;
  }

  .pg-text {
    font-size: 15px;
    line-height: 22px;
  }

  .pg-chip {
    height: auto;
    min-height: 26px;
    white-space: normal;
  }

  .pm-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
    padding: 12px 0;
  }

  .sp-ic {
    width: 28px;
    height: 28px;
    margin-top: -3px;
    border-radius: 9px;
  }

  .gp {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 16px 12px;
  }

  .gp div {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
  }

  .gp dt {
    max-width: 150px;
  }

  .gp dd {
    font-size: 14px;
    line-height: 20px;
    text-align: right;
  }

  .gp-note {
    padding: 0 16px 20px;
  }

  .st {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 16px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .products__intro,
  .pm-map {
    animation: none;
  }

  .pm-body,
  .pm-inner,
  .pg-pic,
  .pg-apply__ic,
  .pm-chev svg,
  .pm-head {
    transition: none;
  }

  .pm-dl.is-load .pm-dl__ic svg {
    animation: none;
  }
}

/* ---------- Короткие названия ---------- */
.pm-name__short {
  display: none;
}

/* Телефон в вертикальной ориентации: у длинных названий — короткий вариант в одну строку. */
@media (max-width: 599px) and (orientation: portrait) {
  .pm-name__full {
    display: none;
  }

  .pm-name__short {
    display: inline;
  }
}

/* ---------- Невысокий горизонтальный экран (телефон боком) ----------
   Мобильная раскладка списка, но раскрытый продукт — в две колонки: изображение не разрастается
   во всю ширину, текст не сжимается в узкую полосу. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1024px) {
  .products__header {
    height: 56px;
    padding: 12px 24px 0;
  }

  .products__header .logo {
    height: 36px;
  }

  .products__intro {
    flex-direction: row;
    align-items: flex-end;
    padding: 16px 24px 0;
  }

  .products__title {
    font-size: 30px;
    line-height: 34px;
  }

  .pm-dl {
    width: auto;
    height: 48px;
  }

  .pm-map {
    padding: 0 20px;
  }

  .pg {
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 24px;
    row-gap: 0;
    align-items: start;
    padding: 4px 20px 20px 56px;
  }

  .pg-pic {
    width: 220px;
    height: auto;
    margin: 0;
  }

  .pm-row {
    grid-template-columns: 120px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 0;
  }

  .pg-apply {
    width: auto;
    height: 40px;
    border-radius: 20px;
    justify-content: flex-start;
    padding: 0 4px 0 14px;
  }

  .gp {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    padding: 0 20px 12px 56px;
  }

  .gp div {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .gp dt {
    max-width: none;
  }

  .gp dd {
    text-align: left;
  }

  .gp-note {
    padding: 0 20px 20px 56px;
  }

  .st {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    padding: 0 20px 20px 56px;
  }
}

/* Узкий планшет (600–899 px): раскрытый продукт в две колонки, изображение не во всю ширину. */
@media (min-width: 600px) and (max-width: 899px) {
  .pg {
    grid-template-columns: 240px minmax(0, 1fr);
    column-gap: 28px;
    row-gap: 0;
    align-items: start;
    padding: 4px 20px 20px 56px;
  }

  .pg-pic {
    width: 240px;
    height: auto;
    margin: 0;
  }

  .pm-row {
    grid-template-columns: 120px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 0;
  }

  .pg-apply {
    width: auto;
    height: 40px;
    border-radius: 20px;
    justify-content: flex-start;
    padding: 0 4px 0 14px;
  }
}
