/* RemTeh gamepad + console mobile repair layer.
   Loaded only for /remont-gamepadov* and /remont-konsoli*. */

@media (max-width: 700px) {
  /* The sticky header already exposes callback/phone on mobile.
     Remove the duplicate floating control so it cannot cover primary CTAs. */
  .rt-fc-toggle {
    display: none !important;
  }

  .rt-fc-panel {
    display: none !important;
  }

  /* Helix applies desktop negative row margins to breadcrumbs on phones.
     Keep the full path visible and allow long current-page labels to wrap. */
  section#sp-breadcrumb > .row {
    width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  section#sp-breadcrumb ol.breadcrumb {
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 12px !important;
    padding-left: 12px !important;
    overflow: visible !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
  }

  section#sp-breadcrumb ol.breadcrumb > li {
    min-width: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  /* Make horizontally scrollable section navigation discoverable. */
  .gpv5-nav-inner,
  .gp7__navInner,
  .cb27-nav-inner,
  .gph-nav-inner,
  .rc3-nav-inner {
    padding-right: 16px !important;
    padding-bottom: 3px !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(86, 162, 255, .8) transparent !important;
    -webkit-overflow-scrolling: touch;
  }

  .gpv5-nav-inner > a,
  .gp7__navInner > a,
  .cb27-nav-inner > a,
  .gph-nav-inner > a,
  .rc3-nav-inner > a {
    min-height: 44px;
    scroll-snap-align: start;
  }

  .gpv5-nav-inner::-webkit-scrollbar,
  .gp7__navInner::-webkit-scrollbar,
  .cb27-nav-inner::-webkit-scrollbar,
  .gph-nav-inner::-webkit-scrollbar,
  .rc3-nav-inner::-webkit-scrollbar {
    display: block !important;
    height: 3px !important;
  }

  .gpv5-nav-inner::-webkit-scrollbar-thumb,
  .gp7__navInner::-webkit-scrollbar-thumb,
  .cb27-nav-inner::-webkit-scrollbar-thumb,
  .gph-nav-inner::-webkit-scrollbar-thumb,
  .rc3-nav-inner::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(86, 162, 255, .8);
  }

  /* Buttons must wrap instead of overflowing on long Russian labels. */
  .gpv5-btn,
  .gp7__btn,
  .cb27-btn,
  .gph-btn,
  .rc3-btn {
    max-width: 100%;
    min-height: 52px;
    white-space: normal;
    text-align: center;
  }

  .gpv5 h1,
  .gpv5 h2,
  .gp7 h1,
  .gp7 h2,
  .cb27 h1,
  .cb27 h2,
  .gph h1,
  .gph h2,
  .rc3 h1,
  .rc3 h2 {
    overflow-wrap: anywhere;
  }

  /* Console pages: turn the 760px service table into readable cards. */
  body .cb27 .cb27-table-wrap {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  body .cb27 .cb27-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
  }

  body .cb27 .cb27-table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  body .cb27 .cb27-table tbody,
  body .cb27 .cb27-table tr,
  body .cb27 .cb27-table td {
    display: block !important;
    width: 100% !important;
  }

  body .cb27 .cb27-table tbody {
    display: grid !important;
    gap: 12px !important;
  }

  body .cb27 .cb27-table tr {
    padding: 18px !important;
    overflow: hidden;
    border: 1px solid var(--cb-line) !important;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(25, 47, 76, .06);
  }

  body .cb27 .cb27-table td {
    padding: 11px 0 0 !important;
    border: 0 !important;
    white-space: normal !important;
  }

  body .cb27 .cb27-table td:first-child {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 14px !important;
    align-items: center !important;
    padding-top: 0 !important;
    font-size: 17px;
  }

  body .cb27 .cb27-table td:nth-child(2),
  body .cb27 .cb27-table td:nth-child(3) {
    margin-top: 11px;
    padding-top: 11px !important;
    border-top: 1px solid var(--cb-line) !important;
  }

  body .cb27 .cb27-table td:nth-child(2)::before,
  body .cb27 .cb27-table td:nth-child(3)::before {
    display: block;
    margin-bottom: 4px;
    color: var(--cb-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  body .cb27 .cb27-table td:nth-child(2)::before {
    content: "Что проверяем";
  }

  body .cb27 .cb27-table td:nth-child(3)::before {
    content: "Стоимость";
  }

  /* Older gamepad pages: the 720px table lacked the card breakpoint. */
  body .gp7 .gp7__tableWrap {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  body .gp7 .gp7__table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
  }

  body .gp7 .gp7__table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  body .gp7 .gp7__table tbody,
  body .gp7 .gp7__table tr,
  body .gp7 .gp7__table td {
    display: block !important;
    width: 100% !important;
  }

  body .gp7 .gp7__table tbody {
    display: grid !important;
    gap: 12px !important;
  }

  body .gp7 .gp7__table tr {
    padding: 17px 16px !important;
    border: 1px solid #d3dce8 !important;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(25, 47, 76, .06);
  }

  body .gp7 .gp7__table td {
    padding: 7px 0 !important;
    border: 0 !important;
    white-space: normal !important;
  }

  body .gp7 .gp7__table td::before {
    display: block !important;
    margin-bottom: 3px !important;
    color: #697686 !important;
    content: attr(data-label);
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .07em;
    text-transform: uppercase;
  }

  body .gp7 .gp7__table td:not([data-label]):nth-child(1)::before {
    content: "Работа";
  }

  body .gp7 .gp7__table td:not([data-label]):nth-child(2)::before {
    content: "Детали / срок";
  }

  body .gp7 .gp7__table td:not([data-label]):nth-child(3)::before {
    content: "Стоимость";
  }

  body .gp7 .gp7__table td:last-child {
    color: #142238;
    font-size: 19px;
    font-weight: 850;
  }

  /* Stick comparison: replace the intentional 1040px mobile table. */
  body .gph .gph-compare-wrap {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  body .gph .gph-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
  }

  body .gph .gph-table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }

  body .gph .gph-table tbody,
  body .gph .gph-table tr,
  body .gph .gph-table th,
  body .gph .gph-table td {
    display: block !important;
    width: 100% !important;
  }

  body .gph .gph-table tbody {
    display: grid !important;
    gap: 12px !important;
  }

  body .gph .gph-table tr {
    padding: 18px !important;
    border: 1px solid #344255 !important;
    border-radius: 13px;
    background: #091522;
  }

  body .gph .gph-table tbody th {
    margin: 0 0 8px !important;
    padding: 0 0 12px !important;
    border: 0 !important;
    border-bottom: 1px solid #344255 !important;
    color: #fff;
    font-size: 17px;
  }

  body .gph .gph-table td {
    padding: 9px 0 !important;
    border: 0 !important;
    color: #c5cfdb;
  }

  body .gph .gph-table td::before {
    display: block;
    margin-bottom: 3px;
    color: #9fc4ff;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  body .gph .gph-table td:nth-child(2)::before {
    content: "Потенциометры";
  }

  body .gph .gph-table td:nth-child(3)::before {
    content: "Обычный стик";
  }

  body .gph .gph-table td:nth-child(4)::before {
    content: "Hall";
  }

  body .gph .gph-table td:nth-child(5)::before {
    content: "TMR";
  }

  /* The page's inline <=620px rule accidentally turns choice cards into
     horizontal flex rows, making their contents overlap on phones. */
  body .gph .gph-choice {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body .gph .gph-choice article,
  body .gph .gph-choice article:nth-child(3) {
    display: block !important;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-left: 0 !important;
  }

  body .gph .gph-choice article > * {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  body .cb27 .cb27-table tr,
  body .gp7 .gp7__table tr,
  body .gph .gph-table tr {
    padding: 15px !important;
  }

  .gpv5 h1,
  .gp7 h1,
  .cb27 h1,
  .gph h1,
  .rc3 h1 {
    font-size: clamp(34px, 10.5vw, 42px) !important;
  }
}
