@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --container: 1536px;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #eceef1;
  --text: #191c1e;
  --muted: #525f73;
  --primary: #111111;
  --accent: #ba1a1a;
  --r1: 10px;
  --r2: 16px;
  --r3: 24px;
  --sh-sm: 0 10px 24px rgba(25, 28, 30, 0.07);
  --sh-md: 0 16px 32px rgba(25, 28, 30, 0.1);
}

html,
body {
  margin: 0;
  padding: 0;
  /* Резиновый отскок (rubber-band) при овер-скролле на iOS Safari — во время
     этого отскока браузер временно рассинхронизирует композитинг
     position:fixed/sticky элементов с реальным вьюпортом, отсюда мигание и
     "отклеивание" верхнего и нижнего баров у самого верха/низа страницы. */
  overscroll-behavior-y: none;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.container {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
}

.topbar,
.topbar *,
.topbar-sticky,
.topbar-sticky *,
.topbar-side-menu,
.topbar-side-menu *,
.topbar-mobile,
.topbar-mobile *,
.mobile-tabbar,
.mobile-tabbar *,
.footer,
.footer *,
.fab-search,
.fab-search * {
  box-sizing: border-box;
}

.topbar a,
.footer a {
  color: inherit;
  text-decoration: none;
}

.topbar img,
.footer img {
  max-width: 100%;
  display: block;
}

.topbar .icon,
.footer .icon,
.fab-search .icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar .icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.topbar .logo-link img,
.topbar-sticky .logo-link img,
.footer .logo-link img {
  height: 32px;
  width: auto;
}

.topbar {
  position: relative;
  z-index: 95;
  background: #fff;
  box-shadow: var(--sh-sm);
}

.topbar__topline,
.topbar__navline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar__topline {
  min-height: 82px;
  padding: 12px 0;
}

.topbar__navline {
  min-height: 66px;
  border-top: 1px solid #e5e8ec;
  align-items: flex-start;
  padding-top: 10px;
  padding-bottom: 10px;
}

.topbar__brand,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__brand {
  gap: 16px;
}

.topbar__slogan {
  margin: 0;
  max-width: 410px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.topbar-action-btn {
  border: none;
  background: transparent;
  border-radius: var(--r1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.topbar-action-btn .icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  stroke: none;
  flex: 0 0 auto;
}

.topbar-action-btn span {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
}

.topbar-action-btn--solid {
  background: var(--text);
  color: #fff;
}

.topbar-action-btn--solid .icon,
.topbar-action-btn--solid span {
  color: #fff;
  fill: currentColor;
}

.topbar-action-btn--catalog {
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
}

.topbar-action-btn--catalog:hover {
  color: #fff !important;
  background: #a71616;
}

.topbar-market-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 40px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topbar-market-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.topbar-market-btn img {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: cover;
}

/* Логотип Яндекс Маркета — без подложки-плитки, поэтому вписываем целиком */
.topbar-market-btn--ym img {
  object-fit: contain;
}

.topbar-phone {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar-phone:hover {
  color: var(--accent);
}

.topbar__menu-row {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 14px;
}

.topbar__menu-row .ferrus-menu {
  min-width: 0;
}

.topbar__menu-row .ferrus-menu--header {
  gap: 24px;
  flex-wrap: wrap;
}

.topbar__menu-row .ferrus-menu__link {
  min-height: 30px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text);
  font-weight: 700;
}

.topbar__menu-row .ferrus-menu__item.is-selected .ferrus-menu__link::after {
  bottom: -10px;
}

.topbar-search-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #d7dbe0;
  border-radius: 12px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.topbar-search-btn:hover {
  color: var(--accent);
  border-color: #bfc6ce;
}

.topbar-search-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--bx-admin-offset, 0px);
  z-index: 205;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: var(--sh-sm);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topbar-search-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.topbar-search-panel__form {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-search-panel__form input {
  width: 100%;
  height: 44px;
  border: 1px solid #d7dbe0;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  padding: 0 14px;
  outline: none;
}

.topbar-search-panel__form input:focus {
  border-color: #b9bec6;
}

.topbar-search-panel__form button {
  width: 44px;
  height: 44px;
  border: 1px solid #d7dbe0;
  border-radius: 10px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
}

.topbar-search-panel__form button:hover {
  border-color: #b9bec6;
  color: var(--accent);
}

.topbar-search-panel__form button .icon {
  width: 20px;
  height: 20px;
}

.topbar-search-panel .icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-catalog-dropdown {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--catalog-dropdown-top, calc(var(--bx-admin-offset, 0px) + var(--main-topbar-height, 148px)));
  z-index: 170;
  padding-top: 2px;
  display: none;
}

.topbar-catalog-dropdown.is-open {
  display: block;
}

.topbar-catalog-dropdown .container {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--sh-md);
  border: 1px solid #e5e8ec;
  max-height: min(70vh, 620px);
  overflow: auto;
}

.topbar-catalog-dropdown__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 22px;
  padding: 18px;
}

.topbar-catalog-dropdown__title {
  margin: 0 0 8px;
  display: inline-block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.topbar-catalog-dropdown__title:hover {
  color: var(--accent);
}

.topbar-catalog-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.topbar-catalog-dropdown li {
  margin: 0;
  padding: 0;
}

.topbar-catalog-dropdown li a {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.topbar-catalog-dropdown li a:hover {
  color: var(--text);
}

.topbar__burger {
  display: none;
  flex: 0 0 auto;
}

.topbar__right .bx-basket {
  margin: 0;
}

.ferrus-basket__link--side .badge {
  display: none !important;
}

.ferrus-basket__side-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  margin-left: 6px;
}

.topbar-side-menu {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
}

.topbar-side-menu.is-open {
  display: block;
}

.topbar-side-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 27, 0.42);
}

.topbar-side-menu__panel {
  position: absolute;
  top: 0;
  left: 0;
  width: min(86vw, 360px);
  height: 100%;
  background: #fff;
  box-shadow: 0 20px 40px rgba(25, 28, 30, 0.16);
  padding: 22px 18px 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.topbar-side-menu__close {
  width: 32px !important;
  height: 32px !important;
  margin-left: auto;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  color: var(--text);
  padding: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-side-menu__close .icon {
  display: none;
}

.topbar-side-menu__close::before,
.topbar-side-menu__close::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.topbar-side-menu__close::before {
  transform: rotate(45deg);
}

.topbar-side-menu__close::after {
  transform: rotate(-45deg);
}

.topbar-side-menu__content {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar-side-menu .icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-side-menu__logo {
  display: inline-flex;
  align-items: center;
}

.topbar-side-menu__logo img {
  height: 36px;
}

.topbar-side-menu__menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topbar-side-menu__menu .ferrus-menu--header {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.topbar-side-menu__menu .ferrus-menu__item {
  width: 100%;
  min-width: 0;
}

.topbar-side-menu__menu .ferrus-menu__link {
  width: 100%;
  min-height: 24px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 600;
  text-transform: none;
  justify-content: flex-start;
  white-space: normal;
  overflow-wrap: anywhere;
}

.topbar-side-menu__menu .ferrus-menu__link:hover {
  background: transparent;
  color: var(--accent);
}

.topbar-side-menu__menu .ferrus-menu__item.is-selected .ferrus-menu__link {
  color: var(--accent);
}

.topbar-side-menu__menu .ferrus-menu__item.is-selected .ferrus-menu__link::after {
  content: none;
}

.topbar-side-menu__catalog {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  justify-content: flex-start;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  transform: none !important;
}

.topbar-side-menu__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topbar-side-menu__actions .bx-basket {
  width: 100%;
}

.topbar-side-menu__actions .ferrus-basket {
  width: 100%;
  display: block;
}

.topbar-side-menu__actions .topbar-action-btn,
.topbar-side-menu__actions .ferrus-basket__link {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  justify-content: flex-start;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
  transform: none !important;
}

.topbar-side-menu__actions .ferrus-basket__link {
  background: #f4f6f8;
}

.topbar-side-menu__actions .topbar-action-btn span {
  display: inline !important;
}

.topbar-side-menu__contacts {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e5e8ec;
}

.topbar-side-menu__contacts a {
  color: var(--text);
  text-decoration: none;
}

.topbar-side-menu__contacts a:first-child {
  font-size: 1rem;
  font-weight: 700;
}

.topbar-side-menu__contacts a:last-child {
  color: var(--muted);
  font-size: 0.92rem;
}

.topbar-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 190;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: var(--sh-sm);
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.topbar-sticky.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.topbar-sticky__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-sticky .icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-sticky .icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #d7dbe0;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.topbar-sticky__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-sticky__burger {
  display: none;
}

.topbar-sticky__menu {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-sticky__menu .ferrus-menu--header {
  gap: 20px;
}

.topbar-sticky__menu .ferrus-menu__link {
  min-height: 28px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text);
  font-weight: 700;
}

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

.topbar-sticky__catalog {
  flex: 0 0 auto;
}

.topbar-sticky__search-wrap {
  flex: 0 1 300px;
  min-width: 0;
}

.topbar-inline-search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: var(--surface-2);
  border-radius: var(--r1);
  padding: 4px 4px 4px 16px;
}

.topbar__navline .topbar-inline-search {
  flex: 0 1 360px;
  width: 360px;
}

.topbar-inline-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  height: 40px;
  /* 16px, не меньше — та же причина, что у .topbar-mobile__search input:
     iOS Safari зумит страницу при фокусе на поле с шрифтом < 16px. Эта форма
     в первую очередь десктопная, но на планшетном touch-экране сработает тот
     же баг, если размер меньше порога. */
  font-size: 16px;
  color: var(--text);
}

.topbar-inline-search input:focus {
  outline: none;
}

.topbar-inline-search button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.topbar-inline-search .icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-icon-link {
  width: 40px;
  height: 40px;
  border: 1px solid #d7dbe0;
  border-radius: 12px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-icon-link .icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-icon-link:hover {
  border-color: #bfc6ce;
  color: var(--accent);
}

.topbar-icon-link img {
  width: 20px;
  height: 20px;
}

.topbar-phone-icon {
  display: none;
}

.page-main {
  min-height: calc(100vh - 340px);
  /* dvh — учитывает реальную высоту видимой области с адресной строкой Safari;
     на browsers без поддержки просто игнорируется, остаётся правило выше. */
  min-height: calc(100dvh - 340px);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #667085;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-top: 16px;
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs span {
  color: #191c1e;
}

.breadcrumbs .icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  flex: 0 0 auto;
}

@media (max-width: 767px) {
  .breadcrumbs {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .breadcrumbs .icon {
    display: none;
  }
}

@media (max-width: 600px) {
  .breadcrumbs {
    display: none;
  }
}

.footer {
  margin-top: 48px;
  padding-top: 66px;
  background: #f0f2f5;
  border-top: 1px solid #dfe3e8;
}

.footer__grid {
  display: grid;
  gap: 16px;
  margin-bottom: 34px;
  grid-template-columns: 1.2fr repeat(3, 1fr);
}

.footer__grid p {
  color: var(--muted);
  margin: 12px 0;
}

.footer__grid h4 {
  margin: 0 0 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #76777d;
}

.footer__grid a:not(.logo-link) {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.footer__grid a:not(.logo-link):hover {
  color: var(--text);
}

.footer__grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__grid li {
  margin: 0;
  padding: 0;
}

.footer .socials {
  display: flex;
  gap: 10px;
}

.footer .socials a {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #d2d7dc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer .socials a:hover {
  background: var(--primary);
  color: #fff;
}

.footer__bottom {
  border-top: 1px solid #d2d7dc;
  padding: 18px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer__bottom p {
  margin: 0;
  color: var(--muted);
}

.footer .payments {
  display: flex;
  gap: 12px;
}

.footer .payments img {
  width: 56px;
  height: 20px;
  opacity: 0.7;
}

.fab-search {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--sh-md);
  display: none;
}

@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/local/templates/ferrus/fonts/MaterialSymbolsOutlined.woff2") format("woff2");
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

@media (max-width: 1199px) {
  .topbar__slogan {
    max-width: 260px;
    font-size: 0.62rem;
  }

  .topbar-phone {
    font-size: 0.9rem;
  }

  .topbar__menu-row .ferrus-menu__link {
    font-size: 11px;
  }

  .topbar__burger {
    display: inline-flex;
  }

  .topbar__menu-row .ferrus-menu {
    display: none;
  }

  .topbar__navline {
    min-height: 60px;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .topbar-search-panel__form {
    min-height: 62px;
  }

  .topbar-search-panel__form input {
    height: 40px;
    font-size: 14px;
  }

  .topbar-search-panel__form button {
    width: 40px;
    height: 40px;
  }

  .topbar-catalog-dropdown {
    padding-top: 2px;
  }

  .topbar-catalog-dropdown__grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .topbar__topline {
    min-height: 74px;
  }

  .topbar-sticky__actions .topbar-market-btn {
    display: inline-flex;
  }

  .topbar__navline {
    min-height: 60px;
    gap: 10px;
  }

  .topbar__menu-row {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar__menu-row::-webkit-scrollbar {
    display: none;
  }

  .topbar__menu-row .ferrus-menu--header {
    gap: 16px;
  }

  .topbar__menu-row .ferrus-menu__link {
    font-size: 10px;
    letter-spacing: 0.07em;
  }

  .topbar-action-btn {
    padding: 8px 10px;
  }

  /*.topbar-action-btn span {*/
  /*  display: none;*/
  /*}*/

  .topbar-sticky__inner {
    min-height: 64px;
    gap: 12px;
    justify-content: space-between;
  }

  .topbar-sticky__left {
    flex: 0 1 auto;
  }

  .topbar-sticky__burger {
    display: inline-flex;
  }

  .topbar-sticky__actions {
    margin-left: auto;
  }

  .topbar-side-menu__panel {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 768px) {
  .topbar-action-btn span {
    display: inline;
  }
}

@media (max-width: 946px)
{
  .topbar-market-btn
  {
    width: 30px;
    height: 30px;
    max-width: 30px;
  }

  .topbar-market-btn img
  {
    width: 30px;
    height: 30px;
  }

  .topbar-phone-icon {
    display: inline-flex;
  }

  .topbar__slogan,
  .topbar-phone,
  .topbar-sticky__menu {
    display: none;
  }

  .topbar-icon-link
  {
    width: 30px!important;
    height: 30px!important;
    border-radius: 4px!important;
  }

  .topbar-icon-link img
  {
    width: 20px;
    height: 20px;
  }

  .topbar__right {
    gap: 10px;
  }

  .profile-data
  {
    padding: 8px 10px;
  }

  .profile-data .profile-text
  {
    display: none!important;
  }

  .ferrus-basket .badge
  {
    text-align: center;
    align-items: center;
    align-content: center;
  }
}

@media (max-width: 450px) {

  .topbar-market-btn
  {
    width: 25px;
    height: 25px;
    max-width: 25px;
  }

  .topbar-market-btn img
  {
    width: 25px;
    height: 25px;
  }

  .topbar-icon-link
  {
    width: 25px!important;
    height: 25px!important;
    border-radius: 4px!important;
  }

  .topbar-icon-link img
  {
    width: 15px;
    height: 15px;
  }

  .profile-data
  {
    padding: 6px!important;
  }
}
/* ---------- Юридические страницы (политики, согласия) ---------- */
.legal-page {
  padding: 40px 0 88px;
}

.legal-page__inner {
  max-width: 980px;
}

.legal-page__head {
  padding: clamp(28px, 3.5vw, 48px);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}

.legal-page__eyebrow {
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.legal-page__head h1 {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.legal-page__subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.legal-page__body {
  margin-top: 24px;
  padding: clamp(24px, 3.5vw, 48px);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  font-size: 16px;
  line-height: 1.7;
}

.legal-page__body h2 {
  margin: 40px 0 16px;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-transform: none;
}

.legal-page__body h2:first-child {
  margin-top: 0;
}

.legal-page__num {
  color: var(--accent);
  font-weight: 700;
}

.legal-page__body p {
  margin: 0 0 14px;
}

.legal-page__lead {
  color: var(--muted);
  font-size: 18px;
}

.legal-page__clause {
  padding-left: 8px;
}

.legal-page__published {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-3);
  color: var(--muted);
  font-size: 15px;
}

.legal-page__list {
  counter-reset: legal-item;
  margin: 16px 0 24px;
  padding: 0;
  list-style: none;
}

.legal-page__list > li {
  counter-increment: legal-item;
  position: relative;
  margin-bottom: 12px;
  padding-left: 42px;
}

.legal-page__list > li::before {
  content: counter(legal-item) ".";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.legal-page__sublist {
  counter-reset: legal-subitem;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.legal-page__sublist > li {
  counter-increment: legal-subitem;
  position: relative;
  margin-bottom: 8px;
  padding-left: 52px;
}

.legal-page__sublist > li::before {
  content: counter(legal-item) "." counter(legal-subitem) ".";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--muted);
  font-weight: 600;
}

.legal-page__bullets {
  margin: 12px 0 20px;
  padding-left: 22px;
  list-style: disc;
}

.legal-page__bullets > li {
  margin-bottom: 8px;
}

.legal-page__body a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.legal-page__body a:hover {
  text-decoration: underline;
}

.legal-page__table-wrap {
  margin: 20px 0 28px;
  overflow-x: auto;
  border-radius: var(--r2);
  border: 1px solid var(--surface-3);
}

.legal-page__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.legal-page__table th,
.legal-page__table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--surface-3);
  text-align: left;
  vertical-align: top;
}

.legal-page__table th {
  width: 32%;
  min-width: 190px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.legal-page__table tr:last-child th,
.legal-page__table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 767px) {
  .legal-page {
    padding: 24px 0 56px;
  }

  .legal-page__body {
    font-size: 15px;
  }

  .legal-page__list > li {
    padding-left: 34px;
  }

  .legal-page__sublist > li {
    padding-left: 44px;
  }
}

/* --- Формы обратной связи --- */

/* Ловушка для ботов: не показываем и убираем из потока и из озвучки. */
.form-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.form-status {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.4;
}

.form-status:empty {
  display: none;
}

.form-status--success {
  color: #1a7f42;
}

.form-status--error {
  color: #c0392b;
}

.form-consent {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.75;
}

.form-consent a {
  text-decoration: underline;
}

.js-validate-form button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* --- Страницы «Покупателям»: Доставка и Гарантии --- */
.buyers-page,
.buyers-page * {
  box-sizing: border-box;
}

.buyers-page {
  padding: 40px 0 90px;
  background: var(--bg, #f7f9fc);
  color: var(--text, #191c1e);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

.buyers-page__container {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
}

.buyers-page__head {
  margin-bottom: 28px;
}

.buyers-page__eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent, #ba1a1a);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.buyers-page__title {
  margin: 0 0 12px;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.buyers-page__subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--muted, #525f73);
  font-size: clamp(15px, 1.5vw, 18px);
}

.buyers-page__layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* левое меню между страницами */
.buyers-nav {
  position: sticky;
  top: 20px;
  padding: 18px;
  border-radius: var(--r3, 24px);
  background: var(--surface, #ffffff);
  box-shadow: var(--sh-sm, 0 10px 24px rgba(25, 28, 30, 0.07));
}

.buyers-nav__title {
  margin: 0 0 12px;
  padding: 0 10px;
  color: var(--muted, #525f73);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.buyers-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  margin-bottom: 6px;
  border-radius: var(--r2, 16px);
  color: var(--text, #191c1e);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.18s ease, color 0.18s ease;
}

.buyers-nav__link:last-child {
  margin-bottom: 0;
}

.buyers-nav__link:hover {
  background: var(--surface-3, #eceef1);
}

.buyers-nav__link.is-active {
  background: var(--accent, #ba1a1a);
  color: #ffffff;
}

.buyers-nav__link svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* контент */
.buyers-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.buyers-section {
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r3, 24px);
  background: var(--surface, #ffffff);
  box-shadow: var(--sh-sm, 0 10px 24px rgba(25, 28, 30, 0.07));
}

.buyers-section > h2 {
  margin: 0 0 18px;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.buyers-section p {
  margin: 0 0 14px;
}

.buyers-section p:last-child {
  margin-bottom: 0;
}

.buyers-lead {
  color: var(--muted, #525f73);
  font-size: clamp(15px, 1.4vw, 17px);
}

/* карточки-способы */
.buyers-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.buyers-cards--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.buyers-card {
  padding: 22px;
  border: 1px solid var(--surface-3, #eceef1);
  border-radius: var(--r2, 16px);
  background: var(--bg, #f7f9fc);
}

.buyers-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(186, 26, 26, 0.1);
  color: var(--accent, #ba1a1a);
}

.buyers-card__icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.buyers-card h3 {
  margin: 0 0 8px;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.buyers-card p {
  margin: 0;
  color: var(--muted, #525f73);
  font-size: 14px;
  line-height: 1.6;
}

/* список с галочками
   .buyers-section > ul — тот же вид для обычных списков, набранных
   в визуальном редакторе инфоблока (админу не нужно знать классы) */
.buyers-list,
.buyers-section > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.buyers-list li,
.buyers-section > ul > li {
  position: relative;
  padding-left: 34px;
}

.buyers-list li::before,
.buyers-section > ul > li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(186, 26, 26, 0.12);
  color: var(--accent, #ba1a1a);
  font-size: 12px;
  font-weight: 800;
}

/* нумерованные шаги
   .buyers-section > ol — тот же вид для обычного нумерованного списка из редактора */
.buyers-steps,
.buyers-section > ol {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.buyers-steps li,
.buyers-section > ol > li {
  position: relative;
  padding-left: 54px;
  min-height: 36px;
}

.buyers-steps li::before,
.buyers-section > ol > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent, #ba1a1a);
  color: #ffffff;
  font-weight: 800;
}

.buyers-steps li h3,
.buyers-section > ol > li h3 {
  margin: 0 0 4px;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.buyers-steps li p,
.buyers-section > ol > li p {
  margin: 0;
  color: var(--muted, #525f73);
  font-size: 14px;
}

.buyers-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent, #ba1a1a);
  border-radius: 8px;
  background: rgba(186, 26, 26, 0.06);
  color: var(--text, #191c1e);
  font-size: 14px;
}

/* CTA */
.buyers-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--r3, 24px);
  background: var(--primary, #111111);
  color: #ffffff;
}

.buyers-cta__text h2 {
  margin: 0 0 6px;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
}

.buyers-cta__text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

.buyers-cta__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.buyers-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 26px;
  border-radius: var(--r2, 16px);
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}

.buyers-cta__btn:hover {
  transform: translateY(-1px);
}

.buyers-cta__btn--accent {
  background: var(--accent, #ba1a1a);
  color: #ffffff;
}

.buyers-cta__btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

@media (max-width: 980px) {
  .buyers-page__layout {
    grid-template-columns: 1fr;
  }

  .buyers-nav {
    position: static;
    display: flex;
    gap: 8px;
  }

  .buyers-nav__title {
    display: none;
  }

  .buyers-nav__link {
    flex: 1;
    justify-content: center;
    margin: 0;
  }

  .buyers-cards,
  .buyers-cards--3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .buyers-page__container {
    width: min(100% - 28px, 1280px);
  }

  .buyers-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Мобильная шапка (бургер + лого + поиск + звонок) и нижняя таб-панель ---------- */
.topbar-mobile {
  display: none;
}

.mobile-tabbar {
  display: none;
}

@media (max-width: 767px) {
  .topbar,
  .topbar-sticky {
    display: none;
  }

  .topbar-mobile {
    display: block;
    /* fixed, а не sticky: sticky-элемент пересчитывает позицию в основном
       потоке относительно своего контейнера и на iOS Safari теряет
       синхронизацию с реальной видимой областью при анимации адресной
       строки и при овер-скролле — тот самый эффект "отклеивания". fixed
       всегда закреплён на вьюпорте, а компенсацию под анимацию адресной
       строки берёт на себя JS (visualViewport) в main.js. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    background: #fff;
    box-shadow: var(--sh-sm);
    padding: 10px 0;
  }

  /* Компенсация под топбар, ушедший из потока документа при position:fixed. */
  .page-main {
    padding-top: 120px;
  }

  .topbar-mobile__row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .topbar-mobile__icon-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid #d7dbe0;
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
  }

  .topbar-mobile__icon-btn .icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .topbar-mobile__icon-btn img {
    width: 20px;
    height: 20px;
  }

  .topbar-mobile__logo {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
  }

  .topbar-mobile__logo img {
    height: 28px;
    width: auto;
    max-width: 100%;
  }

  .topbar-mobile__search {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border-radius: var(--r1);
    padding: 4px 4px 4px 14px;
  }

  .topbar-mobile__search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    height: 42px;
    /* 16px, не меньше: iOS Safari сам зумит страницу при фокусе на поле, если
       шрифт < 16px, — из-за этого визуально "улетает" кнопка поиска. */
    font-size: 16px;
    color: var(--text);
  }

  .topbar-mobile__search input:focus {
    outline: none;
  }

  .topbar-mobile__search button {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--r1);
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .topbar-mobile__search .icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  .mobile-tabbar {
    display: flex;
    /* sticky пробовали вместо fixed — не помогло и давало дополнительный
       баг: у самого верха страницы при овер-скролле sticky-бар (как и
       sticky topbar-mobile) на iOS Safari мог целиком пропадать. Возврат
       к fixed + overscroll-behavior-y:none на html/body + JS-компенсация
       через visualViewport в main.js. */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 120;
    background: #fff;
    border-top: 1px solid #e5e8ec;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-tabbar__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 60px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
  }

  .mobile-tabbar__item .icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-tabbar__item.is-active {
    color: var(--accent);
  }

  .mobile-tabbar__icon-wrap {
    position: relative;
    display: inline-flex;
  }

  .mobile-tabbar__icon-wrap .badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
  }
}

/* ==========================================================================
   Страницы авторизации (/auth/, /login/ и любые страницы с NEED_AUTH).
   Шаблоны компонентов лежат в
   local/templates/ferrus/components/bitrix/system.auth.<форма>/.default/
   ВНИМАНИЕ: не писать в комментарии последовательность «звёздочка + слэш» —
   она закрывает комментарий и съедает следующее правило.
   ========================================================================== */

.auth-page,
.auth-page * {
  box-sizing: border-box;
}

/* Центрируем карточку блочными отступами, а не flex: у flex-элемента
   min-width: auto, из-за чего карточка не сжимается на узких экранах
   и вылезает за вьюпорт. */
.auth-page {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.auth-page__card {
  width: 100%;
  min-width: 0;
  max-width: 420px;
  margin: 0 auto;
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--r2);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}

.auth-page__card--wide {
  max-width: 580px;
}

.auth-page__eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.auth-page__title {
  margin: 0 0 8px;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.auth-page__lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.auth-page__messages:not(:empty) {
  margin-bottom: 14px;
}

.auth-page__messages p {
  margin: 0;
}

/* Битрикс отдаёт сообщения как <p><font class="errortext">…</font></p> */
.auth-page__messages .errortext,
.auth-page__messages .notetext,
.auth-page__messages .errortext-alert {
  display: block;
  margin: 0 0 8px;
  padding: 10px 13px;
  border-radius: var(--r1);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.45;
}

.auth-page__messages .errortext,
.auth-page__messages .errortext-alert {
  background: rgba(186, 26, 26, 0.08);
  color: var(--accent);
}

.auth-page__messages .notetext {
  background: rgba(72, 117, 44, 0.1);
  color: #48752c;
}

.auth-page__note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.auth-field--hidden {
  display: none;
}

.auth-field__caption {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.auth-field__req {
  color: var(--accent);
}

.auth-field__input,
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="tel"],
.auth-field input[type="password"],
.auth-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #dfe3ea;
  border-radius: var(--r1);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-field__input:focus,
.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.auth-form__captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-form__captcha img {
  border-radius: var(--r1);
  display: block;
}

.auth-form__captcha .auth-field__input {
  width: auto;
  flex: 1 1 140px;
}

/* Чекбокс «запомнить меня»: размер задаём явно, иначе он растягивается
   правилами вида «input { width: 100% }» из сторонних стилей */
.auth-form__remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
  cursor: pointer;
}

.auth-form__remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  flex: 0 0 15px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-form__consent {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.auth-form__consent a {
  color: var(--accent);
}

.auth-btn {
  width: 100%;
  min-height: 44px;
  padding: 11px 22px;
  border: 0;
  border-radius: var(--r1);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-btn:hover {
  background: #a71616;
  color: #fff;
  transform: translateY(-1px);
}

.auth-page__links {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-page__links a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(25, 28, 30, 0.2);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-page__links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 767px) {
  .auth-page {
    width: min(100% - 28px, var(--container));
    padding: 20px 0 44px;
  }

  .auth-form__grid {
    grid-template-columns: 1fr;
  }

  .auth-page__links {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Спиннер загрузки корзины: логотип вместо простого серого фона
   (стандартный компонент sale.basket.basket показывает пустой
   полупрозрачный оверлей #basket-items-list-overlay без индикатора).
   У #basket-items-list-container в кастомном шаблоне "ferrus" нет
   position:relative, поэтому оверлей (position:absolute) без этой
   правки растягивается на весь viewport вместо списка товаров. */
#basket-items-list-container {
  position: relative;
}

#basket-items-list-overlay,
.basket-items-list-item-overlay {
  background-color: rgba(255, 255, 255, .85);
}

#basket-items-list-overlay::after,
.basket-items-list-item-overlay::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  background: url("/local/templates/ferrus/images/favicon.png") center / contain no-repeat;
  animation: ferrusBasketLoaderSpin 1s linear infinite;
}

/* Спиннер загрузки на странице оформления заказа (bitrix:sale.order.ajax,
   шаблон bootstrap_v4): попап #loading_screen — стандартный компонент
   Bitrix, сам вставляет через JS картинку loader.gif внутрь себя при
   каждом startLoader(). Прячем её и на её месте показываем тот же
   вращающийся логотип, что и на первом шаге корзины (см. выше).
   Иконка — фиксированного размера 64x64 и висит на position:fixed
   относительно вьюпорта, а не растягивается на реальный (переменный)
   размер #loading_screen — иначе логотип раздувается на весь экран. */
#loading_screen img {
  visibility: hidden;
}

#loading_screen::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1151;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: url("/local/templates/ferrus/images/favicon.png") center / contain no-repeat;
  animation: ferrusBasketLoaderSpin 1s linear infinite;
}

@keyframes ferrusBasketLoaderSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Окно "Согласие пользователя" (компонент bitrix:main.userconsent.request,
   виджет BX.UserConsent) — классы main-user-consent-request-* уникальны
   для этого попапа и больше нигде на сайте не встречаются, поэтому стилим
   их напрямую здесь, без переопределения самого компонента (это надёжнее:
   переопределение шаблона компонента без копии его class.php однажды уже
   уронило сайт ошибкой "is not a component"). Красно-белая гамма сайта
   вместо стандартной зелёной кнопки, плюс более крупные скругления/тень. */
.main-user-consent-request-popup-cont {
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(25, 28, 30, 0.22);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.main-user-consent-request-popup-header {
  font: 700 22px/1.2 "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #191c1e;
}

.main-user-consent-request-popup-text {
  border-radius: 12px;
  border-color: #e8e9eb;
  color: #525f73;
}

.main-user-consent-request-popup-button {
  height: 48px;
  border-radius: 10px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.main-user-consent-request-popup-button:hover {
  transform: translateY(-1px);
}

.main-user-consent-request-popup-button-acc {
  background: #ba1a1a;
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(186, 26, 26, 0.24);
}

.main-user-consent-request-popup-button-acc:hover {
  background: #a71616;
  color: #ffffff;
}

.main-user-consent-request-popup-button-rej {
  background: #ffffff;
  color: #525f73;
  box-shadow: inset 0 0 0 1px #d7dbe0;
}

.main-user-consent-request-popup-button-rej:hover {
  background: #f7f9fc;
  color: #191c1e;
  box-shadow: inset 0 0 0 1px #ba1a1a;
}

/* Страница отмены заказа в личном кабинете (компонент
   bitrix:sale.personal.order.cancel) — вёрстка написана на классах
   Bootstrap (row/col/btn/form-control), которых на сайте нигде нет.
   Стилим их только внутри .bx-order-cancel — этот класс уникален для
   данной формы, так что на другие страницы правило не повлияет. */
.bx-order-cancel {
  max-width: 640px;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(25, 28, 30, 0.06);
  color: #191c1e;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.bx-order-cancel .row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -12px;
  margin-left: -12px;
}

.bx-order-cancel .col {
  flex: 1 0 0%;
  padding-right: 12px;
  padding-left: 12px;
}

.bx-order-cancel .mb-2 { margin-bottom: 8px; }
.bx-order-cancel .mb-3 { margin-bottom: 16px; }

.bx-order-cancel a {
  color: #ba1a1a;
  text-decoration: none;
}

.bx-order-cancel a:hover {
  text-decoration: underline;
}

.bx-order-cancel .text-danger {
  color: #ba1a1a;
}

.bx-order-cancel .form-group {
  margin-bottom: 16px;
}

.bx-order-cancel .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.bx-order-cancel .form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d7dbe0;
  border-radius: 10px;
  background: #ffffff;
  color: #191c1e;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.bx-order-cancel .form-control:focus {
  outline: none;
  border-color: #ba1a1a;
  box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.12);
}

.bx-order-cancel .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 4px 8px 4px 0;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.bx-order-cancel .btn-danger {
  background: #ba1a1a;
  color: #ffffff;
}

.bx-order-cancel .btn-danger:hover {
  background: #a71616;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.bx-order-cancel .btn-link {
  background: transparent;
  color: #525f73;
  padding: 12px 16px;
}

.bx-order-cancel .btn-link:hover {
  color: #191c1e;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .bx-order-cancel .btn {
    display: flex;
    width: 100%;
    margin: 4px 0;
  }
}

/* Анимация "улетающего в корзину" товара (local/templates/ferrus/js/main.js,
   flyProductToCart) — миниатюра товара летит от карточки/детальной страницы
   к иконке корзины в шапке (десктоп/sticky/мобильный таббар — в зависимости
   от того, что сейчас видно), плюс лёгкий "bump" на самой иконке. */
.ferrus-fly-to-cart {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(25, 28, 30, 0.28);
  pointer-events: none;
  opacity: 1;
  transform: translate(0, 0) scale(1);
  transition: transform 0.6s cubic-bezier(0.55, 0, 0.1, 1), opacity 0.6s ease 0.15s;
  will-change: transform, opacity;
}

.ferrus-fly-to-cart img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes ferrusCartBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  65% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.ferrus-cart-bump {
  animation: ferrusCartBump 0.4s ease;
}

/* Всплывающее сообщение об ошибке добавления в корзину (local/templates/ferrus/js/main.js,
   showBasketError) — раньше сбой добавления (например, товара нет в наличии)
   проходил полностью молча, кнопка выглядела нерабочей без объяснения причины. */
.ferrus-basket-error-tip {
  position: fixed;
  z-index: 10000;
  transform: translate(-50%, calc(-100% - 10px));
  background: #191c1e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 240px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(25, 28, 30, 0.28);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.ferrus-basket-error-tip.is-visible {
  opacity: 1;
}

.ferrus-basket-error-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #191c1e;
}

/* Личный кабинет — кнопка "Выйти" внизу страницы */
.personal-logout-row {
  margin: 16px 0 0;
  text-align: center;
}

.personal-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 36px;
  border: 1px solid var(--accent);
  border-radius: var(--r1);
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.personal-logout-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Личный кабинет — карточка "Сумма заказов" (прогресс до порога наценки) для оптовиков */
.wholesale-progress-card {
  max-width: 980px;
  margin: 0 auto 20px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--r2);
  box-shadow: var(--sh-sm);
}

.wholesale-progress-card-head {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.wholesale-progress-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.wholesale-progress-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--muted);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.wholesale-progress-info-tooltip {
  position: absolute;
  bottom: 130%;
  left: 0;
  transform: none;
  width: 240px;
  max-width: 70vw;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  visibility: hidden;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 20;
  pointer-events: none;
  white-space: normal;
}

.wholesale-progress-info:hover .wholesale-progress-info-tooltip,
.wholesale-progress-info:focus .wholesale-progress-info-tooltip,
.wholesale-progress-info:focus-within .wholesale-progress-info-tooltip {
  visibility: visible;
  opacity: 1;
}

.wholesale-progress-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.wholesale-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .2s ease;
}

.wholesale-progress-card-values {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* Личный кабинет — заявка на оптовое сотрудничество */
.ferrus-wholesale__card {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid #e5e8ec;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(25, 28, 30, 0.08);
}

.ferrus-wholesale__title {
  margin: 0 0 20px;
  color: #191c1e;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ferrus-wholesale__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

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

.ferrus-wholesale__field label {
  color: #5f6777;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ferrus-wholesale__field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #dbe1e8;
  border-radius: 12px;
  background: #fff;
  color: #191c1e;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ferrus-wholesale__field input:focus {
  outline: none;
  border-color: #ba1a1a;
  box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.12);
}

.ferrus-wholesale__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.ferrus-wholesale__actions button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: #ba1a1a;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ferrus-wholesale__actions button:hover {
  background: #a71616;
}

.ferrus-wholesale__messages {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #f5cbc4;
  border-radius: 12px;
  background: #fff6f4;
  color: #bc4131;
  font-weight: 600;
}

.ferrus-wholesale__note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d8e9df;
  border-radius: 12px;
  background: #f4faf7;
  color: #2f6a53;
  font-weight: 600;
}

@media (max-width: 767px) {
  .ferrus-wholesale__card {
    padding: 18px;
    border-radius: 14px;
  }

  .ferrus-wholesale__grid {
    grid-template-columns: 1fr;
  }

  .ferrus-wholesale__actions button {
    width: 100%;
  }

  .personal-logout-row {
    text-align: center;
  }
}
