/* ==========================================================================
   TENGRI FUNDING — PRINT STYLESHEET
   Подключается с media="print": на экран не влияет. Цель — читаемый документ
   для публичных информационных страниц: каталог, правила, FAQ, документы,
   тарифы программ, фирменные экраны ошибок.
   ========================================================================== */

@page {
  margin: 14mm 12mm;
}

@media print {
  html,
  body {
    background: #fff !important;
    color: #000 !important;
    color-scheme: light;
    font-size: 11pt;
    line-height: 1.45;
  }

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Навигация, служебные слои и фиксированные элементы в печати не нужны. */
  .skip,
  .site-head,
  .site-header,
  .site-foot,
  .footer,
  .nav-toggle,
  .theme-toggle,
  .lang-dropdown,
  .profile-menu,
  .mobile-nav,
  .mobile-menu,
  .compare-tray,
  .tf-toasts,
  .tf-top,
  .tf-progress,
  .tf-offline,
  .cc-banner,
  .cookie-settings-link,
  .status-screen__actions,
  .breadcrumbs,
  .crumbs,
  .hero-scene,
  .hero-front,
  .hero-back,
  .dashboard,
  .platform-controls,
  .platform-caption,
  .final-cta,
  .js-off-note,
  .registration-closed,
  svg.symbols {
    display: none !important;
  }

  /* Все компоненты печатаются чёрным по белому: заливки, градиенты и
     декоративные фоновые изображения снимаются одним правилом.
     :not(#…) поднимает специфичность выше компонентных правил темы, которые
     задают белый текст через !important (кнопки, активные фильтры). */
  body *:not(#tf-print-plate),
  body *:not(#tf-print-plate)::before,
  body *:not(#tf-print-plate)::after {
    background-color: transparent !important;
    background-image: none !important;
    color: #000 !important;
  }

  body {
    background: #fff !important;
  }

  h1,
  h2,
  h3,
  h4,
  .lead,
  .pill,
  .badge,
  .muted,
  .tiny,
  .eyebrow,
  .price,
  .product__balance,
  .tf-catalog__note,
  .tf-catalog__count {
    color: #000 !important;
  }

  h1,
  h2,
  h3,
  h4 {
    break-after: avoid;
    page-break-after: avoid;
    color: #000 !important;
  }

  h1 {
    font-size: 20pt;
  }
  h2 {
    font-size: 15pt;
  }
  h3 {
    font-size: 12.5pt;
  }

  p,
  li,
  dd,
  dt,
  td,
  th {
    orphans: 3;
    widows: 3;
  }

  /* Контейнеры печатаются во всю ширину листа, без внутренних отступов. */
  .container,
  .wrap,
  .narrow {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  main {
    padding: 0 !important;
  }

  .section {
    padding: 0 0 12mm !important;
    border: 0 !important;
  }

  /* Карточки, блоки и строки таблиц не разрываются между листами. */
  .card,
  .product,
  .faq-item,
  .account-stat,
  .status-screen__card,
  .tf-catalog__cards > * {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #b8b8b8 !important;
    border-radius: 0 !important;
    padding: 4mm !important;
    margin: 0 0 4mm !important;
  }

  /* Строки характеристик и списки без заливки разделяются линиями. */
  .specs li,
  .rule-list li,
  .plain li,
  .faq-item,
  .product__foot,
  .page-head {
    border-color: #b8b8b8 !important;
  }

  .specs li {
    border-bottom: 1px solid #d8d8d8 !important;
    padding: 2mm 0 !important;
  }

  .page-head {
    padding-top: 0 !important;
  }

  .btn,
  .button,
  .seg,
  .chip,
  .pill,
  .badge,
  .tf-catalog__tab {
    border: 1px solid #b8b8b8 !important;
    border-radius: 0 !important;
    padding: 1.5mm 3mm !important;
    text-decoration: none !important;
  }

  .grid-3,
  .tf-catalog__cards,
  .specs,
  .detail {
    display: block !important;
  }

  ul,
  ol {
    padding-left: 6mm;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  /* Адрес ссылки печатается рядом: на бумаге переход невозможен. */
  main a[href^="/"]::after,
  main a[href^="https://"]::after {
    content: " (" attr(href) ")";
    font-size: 8.5pt;
    font-weight: 400;
    color: #444;
    word-break: break-all;
  }

  /* Адрес печатается только у текстовых ссылок, но не у кнопок и фильтров. */
  main a[href^="#"]::after,
  main a.btn::after,
  main a.button::after,
  main a.seg::after,
  main a.chip::after,
  main a.pill::after,
  main a.tf-catalog__tab::after,
  main a.crumbs__link::after {
    content: "" !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9.5pt;
  }

  th,
  td {
    border: 1px solid #b8b8b8 !important;
    padding: 2mm !important;
    color: #000 !important;
    background: #fff !important;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
    height: auto !important;
  }

  .brand__logo-img,
  .brand__logo {
    filter: none !important;
  }

  /* Баннеры и плашки теряют заливку, но сохраняют смысл сообщения. */
  .alert,
  .badge,
  .pill,
  .status-screen__code {
    border: 1px solid #b8b8b8 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .tf-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
