:root {
  --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--apple-font);
}

html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
h6,
main b,
main strong {
  font-weight: 500;
}

.brand b,
.footer-brand {
  font-weight: 500;
  letter-spacing: -0.01em;
}

.topline,
.brand small,
.eyebrow,
.kicker,
.hero-trust span,
.product-body > small,
.stats-row span,
.social-login-divider,
.footer-grid h3,
.footer-bottom {
  text-transform: none;
  letter-spacing: normal;
}

.topline {
  font-size: 12px;
}

.main-nav,
.account-link,
.cart-button,
.search-panel button,
.primary-button,
.secondary-button,
.filter,
.product-bottom > a,
.field label,
.choice label,
.chat-launch,
.social-login-button {
  font-weight: 500;
}

.main-nav {
  font-size: 14px;
}

.hero h1,
.section-title,
.page-hero h1 {
  font-family: var(--apple-font);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.hero h1 {
  font-size: clamp(50px, 6.5vw, 88px);
}

.section-title {
  margin-top: 14px;
  font-size: clamp(42px, 5vw, 70px);
}

.page-hero h1 {
  font-size: clamp(42px, 5.5vw, 70px);
}

.eyebrow,
.kicker {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hero-trust b,
.stats-row b,
.bonus-card strong,
.price-large b,
.drawer-total,
.summary-lines .total {
  font-weight: 500;
}

/* Главная страница: чистые однотонные поверхности без градиентов. */
.hero::before {
  display: none;
  background: none;
}

.hero {
  background: #071228;
}

.loyalty {
  background: #123f9c;
}

.wholesale-price-card {
  background: #071228;
}

/* Красная плашка SAPSAN поверх главной фотографии остаётся отключённой. */
.hero-media::after {
  content: none;
  display: none;
}

/* Чёткие изображения без 3D, масштабирования, фильтров и GPU-сглаживания. */
.hero-grid,
.hero-copy,
.hero-media,
.hero-media img,
.product-card,
.product-card:hover,
.product-card .product-image,
.product-card .product-body,
.product-card .product-image img,
.product-card:hover .product-image img,
.feature-media,
.feature-media img,
.about-media,
.about-media img {
  transform: none;
  will-change: auto;
  filter: none;
  opacity: 1;
}

.hero-media img,
.product-image img,
.feature-media img,
.about-media img,
.product-gallery-main img {
  image-rendering: auto;
  backface-visibility: visible;
}

.hero-media img {
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.product-card {
  border-color: rgba(7, 18, 40, 0.08);
  box-shadow: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.product-card:hover {
  border-color: rgba(7, 18, 40, 0.16);
  box-shadow: 0 16px 40px rgba(7, 18, 40, 0.1);
}

.product-body > small,
.product-badge {
  font-weight: 400;
  letter-spacing: normal;
}

.product-body h3 {
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.product-body > p,
.product-rating {
  font-weight: 400;
}

.product-bottom b,
.product-bottom > a {
  font-weight: 500;
}

.primary-button,
.secondary-button,
.filter,
.round-button,
.account-link,
.cart-button,
.chat-launch {
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.filter:hover,
.round-button:hover,
.account-link:hover,
.cart-button:hover,
.chat-launch:hover {
  transform: none;
}

/* Компактная кнопка вопроса без AI-иконки. */
.chat-launch {
  right: 18px;
  bottom: 18px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(3, 9, 20, 0.18);
  font-size: 12px;
  line-height: 1;
}

.chat-launch:hover {
  background: #102345;
  box-shadow: 0 12px 32px rgba(3, 9, 20, 0.22);
}

.chat-launch span {
  display: none;
}

.chat-box {
  right: 18px;
  bottom: 66px;
}

/* Управляемая из админки цветовая схема и типографика. */
body {
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
}

.site-head,
.search-panel,
.product-card,
.content-card,
.panel,
.drawer-panel,
.chat-box,
.chat-messages .bot,
.account-menu a,
.account-stat,
.order-row,
.choice-row span,
.field input,
.field select,
.field textarea {
  background-color: var(--surface);
}

.search-suggestions,
.catalog-filters,
.review-card,
.policy-card,
.social-login-button,
.telegram-login-wrap {
  background-color: var(--surface);
  border-color: var(--line);
}

.search-suggestions a:hover,
.search-suggestions a.active,
.recently-viewed,
.reviews-section {
  background-color: var(--paper);
}

.site-head,
.search-panel,
.product-card,
.panel,
.field input,
.field select,
.field textarea,
.choice-row span {
  border-color: var(--line);
}

.hero,
.feature,
.page-hero,
.referral-box,
.filter.active,
.cart-button {
  background-color: var(--navy);
}

.loyalty {
  background-color: var(--blue);
}

.wholesale-price-card {
  background: var(--navy);
}

.primary-button,
.search-panel button,
.steps i,
.chat-box form button,
.chat-messages .user,
.referral-link button {
  background-color: var(--blue);
  border-color: var(--blue);
}

.cta-band,
.product-badge.sale,
.cart-button span {
  background-color: var(--red);
}

.round-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
}

.search-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.hero-choose-button {
  color: #fff;
  background: var(--hero-cta);
  border-color: var(--hero-cta);
  box-shadow: 0 10px 24px rgba(3, 9, 20, 0.22);
}

.hero-choose-button:hover {
  background: var(--hero-cta);
  border-color: var(--hero-cta);
  box-shadow: 0 13px 30px rgba(3, 9, 20, 0.28);
}

.size-help-button {
  color: #fff;
  background: var(--size-cta);
  border-color: var(--size-cta);
  box-shadow: 0 10px 24px rgba(3, 9, 20, 0.18);
}

.size-help-button:hover {
  color: #fff;
  background: var(--size-cta);
  border-color: var(--size-cta);
  box-shadow: 0 13px 30px rgba(3, 9, 20, 0.24);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Размер шрифта меняется одной настройкой: все значения ниже зависят от rem. */
.topline,
.product-body > p,
.product-rating,
.field label,
.choice label,
.form-note,
.chat-launch,
.chat-messages p,
.drawer-item h4,
.summary-item p {
  font-size: 0.75rem;
}

.main-nav,
.account-link,
.cart-button,
.search-panel button,
.primary-button,
.secondary-button,
.filter,
.product-bottom > a,
.footer-grid a,
.footer-grid span,
.footer-grid p,
.chat-box input,
.chat-box button {
  font-size: 0.8125rem;
}

.product-body h3 {
  font-size: 1.25rem;
}

.product-bottom b {
  font-size: 1.125rem;
}

.site-footer {
  padding: 64px 0 24px;
  color: #cbd5e1;
  background: var(--footer-bg);
}

.footer-grid {
  grid-template-columns: 1.35fr repeat(3, minmax(150px, 1fr));
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
  text-align: left;
}

.footer-grid > div {
  width: 100%;
  align-items: flex-start;
}

.footer-grid p {
  max-width: 310px;
  margin: 0;
  text-align: left;
}

.footer-grid h3 {
  font-size: 0.875rem;
}

.footer-grid a,
.footer-grid span,
.footer-grid p {
  font-size: 0.9375rem;
}

.social-links {
  justify-content: flex-start;
}

.footer-bottom {
  justify-content: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  text-align: left;
  font-size: 0.8125rem;
}

.footer-bottom a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chat-launch {
  color: #fff;
  background: var(--chat-bg);
  border-color: rgba(255, 255, 255, 0.18);
}

.chat-launch:hover {
  background: var(--chat-bg);
}

.chat-head {
  background: var(--chat-bg);
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 47px;
    line-height: 1.02;
  }

  .section-title {
    font-size: clamp(38px, 11vw, 52px);
  }

  .chat-launch {
    right: 12px;
    bottom: 12px;
    min-height: 36px;
    padding: 0 12px;
  }

  .chat-box {
    right: 12px;
    bottom: 58px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Персональное оформление выбранных частей сайта из админки. */
.site-block {
  font-family: var(--block-font, inherit);
  font-size: var(--block-size, inherit);
  text-align: var(--block-align, left);
  color: var(--block-text, inherit);
  background-color: var(--block-background);
}

.site-block h1,
.site-block h2,
.site-block h3,
.site-block .section-title,
.site-block .footer-brand {
  color: var(--block-heading, inherit);
}

.site-block p,
.site-block li,
.site-block .feature-list span,
.site-block .steps span {
  color: var(--block-text);
}

.site-block[style*="--block-align:center"] .hero-actions,
.site-block[style*="--block-align:center"] .inline-actions {
  justify-content: center;
}

.site-block[style*="--block-align:right"] .hero-actions,
.site-block[style*="--block-align:right"] .inline-actions {
  justify-content: flex-end;
}

.block-inline-image {
  width: min(100%, 520px);
  max-height: 280px;
  display: block;
  margin: 22px 0;
  object-fit: cover;
  border-radius: 20px;
}

.block-card-image {
  width: 100%;
  max-height: 190px;
  display: block;
  margin: 0 0 24px;
  object-fit: cover;
  border-radius: 18px;
}

.block-wide-image {
  width: 100%;
  max-height: 300px;
  display: block;
  margin: 0 0 30px;
  object-fit: cover;
  border-radius: 24px;
}

.cta-inline-image {
  width: 130px;
  height: 130px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 22px;
}

.footer-custom-image {
  width: 118px;
  height: 70px;
  object-fit: contain;
  border-radius: 12px;
}

/* Шаги подбора размера: цифра и первая строка стоят на одной линии. */
.steps div {
  align-items: start;
}

.steps p {
  margin: 0;
}

.steps b {
  min-height: 32px;
  display: flex;
  align-items: center;
  line-height: 1.25;
}

.steps span {
  display: block;
  margin-top: 3px;
}

/* Заметный переход в личный кабинет в бонусном блоке. */
.loyalty-account-link {
  color: var(--navy);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 10px 26px rgba(3, 9, 20, 0.22);
}

.loyalty-account-link:hover {
  color: var(--navy);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 13px 32px rgba(3, 9, 20, 0.28);
}

.loyalty-account-link span {
  margin-left: 7px;
  font-size: 1.1em;
}

.footer-grid > div {
  min-width: 0;
  align-items: flex-start;
}

.footer-grid h3 {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.footer-grid a,
.footer-grid span,
.footer-grid p {
  font-size: 0.875rem;
  line-height: 1.65;
}

.footer-brand {
  font-size: 1.625rem;
}

.footer-columns-1 {
  grid-template-columns: minmax(0, 520px);
}

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

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

.footer-columns-4 {
  grid-template-columns: 1.35fr repeat(3, minmax(150px, 1fr));
}

/* Корзина: больше окно, изображения и читаемый текст. */
.drawer-panel {
  width: min(610px, 100%);
  padding: 34px;
}

.drawer-head h2 {
  margin: 5px 0 0;
  font-size: 2.75rem;
  line-height: 1;
}

.drawer-head small {
  font-size: 0.8125rem;
}

.drawer-items {
  padding: 8px 0;
}

.drawer-custom-image {
  width: 100%;
  height: 125px;
  margin-top: 18px;
  object-fit: cover;
  border-radius: 18px;
}

.drawer-item {
  grid-template-columns: 92px minmax(0, 1fr) 34px;
  gap: 17px;
  padding: 18px 0;
  align-items: center;
}

.drawer-item img {
  width: 92px;
  height: 104px;
  border-radius: 13px;
}

.drawer-item h4 {
  margin-bottom: 7px;
  font-size: 1rem;
  line-height: 1.35;
}

.drawer-item p {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.drawer-item b {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.drawer-empty {
  padding: 75px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 1rem;
}

.drawer-total {
  font-size: 1.35rem;
}

/* Оформление заказа: крупнее товар и больше воздуха после оплаты. */
.checkout-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  gap: 34px;
}

.checkout-form > h2 {
  margin: 34px 0 18px;
  font-size: 1.55rem;
}

.checkout-form > h2:first-of-type {
  margin-top: 0;
}

.checkout-payment-choice {
  margin-bottom: 20px;
}

.payment-result-space,
[data-legal-fields]:not([hidden]) {
  margin: 6px 0 26px;
}

.order-summary {
  padding: 32px;
}

.order-summary > h2 {
  margin: 0;
  font-size: 1.75rem;
}

.summary-items {
  gap: 18px;
  margin: 24px 0;
}

.summary-item {
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.summary-item img {
  width: 86px;
  height: 100px;
  border-radius: 12px;
}

.summary-item p {
  font-size: 0.875rem;
  line-height: 1.5;
}

.summary-item > b {
  font-size: 0.9375rem;
}

.checkout-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 34px;
  align-items: center;
}

.checkout-hero-grid > img {
  width: 220px;
  height: 170px;
  object-fit: cover;
  border-radius: 22px;
}

.legal-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 25px 0;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.legal-consent input {
  width: auto;
  margin-top: 4px;
}

.legal-consent a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.optional-label,
.field-hint {
  color: var(--muted);
  font-weight: 400;
}

.field-hint {
  display: block;
  margin-top: 1px;
  font-size: 0.75rem;
}

.bonus-preview-button {
  min-height: 44px;
  width: 100%;
  padding: 10px 16px;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--navy);
  border-radius: 12px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.bonus-preview-button:hover {
  color: #fff;
  background: var(--navy);
}

.bonus-preview-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.bonus-preview-result {
  padding: 12px 14px;
  color: var(--ink);
  background: #f4f6fa;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.legal-document {
  max-width: 900px;
  margin: auto;
  font-size: 1rem;
  line-height: 1.85;
}

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

  .checkout-hero-grid {
    grid-template-columns: 1fr;
  }

  .checkout-hero-grid > img {
    width: min(100%, 480px);
    height: 220px;
  }
}

@media (max-width: 640px) {
  .drawer-panel {
    padding: 24px 18px;
  }

  .drawer-item {
    grid-template-columns: 76px minmax(0, 1fr) 30px;
    gap: 12px;
  }

  .drawer-item img {
    width: 76px;
    height: 88px;
  }

  .summary-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .summary-item img {
    width: 72px;
    height: 84px;
  }

  .summary-item > b {
    grid-column: 2;
  }
}

/* v12: прямоугольная главная фотография и полноценное избранное. */
.hero-media,
.hero-media img {
  border-radius: 22px;
}

.product-card {
  position: relative;
}

.favorite-button {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(7, 18, 40, 0.12);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(7, 18, 40, 0.12);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.favorite-button.active,
.product-favorite-button.active {
  color: #d51f3b;
  border-color: rgba(213, 31, 59, 0.24);
}

.favorite-link {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 23px;
  line-height: 1;
}

.favorite-link b {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--surface);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 500;
}

.product-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.product-title-row h1 {
  flex: 1;
}

.product-favorite-button {
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 14px;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.product-favorite-button span {
  font-size: 21px;
}

.product-favorite-button b {
  font-size: 12px;
  font-weight: 500;
}

.wholesale-price-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.delivery-intro {
  max-width: 850px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.75;
}

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.delivery-card {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.delivery-card > span {
  color: var(--blue);
  font-size: 12px;
}

.delivery-card h2 {
  margin: 18px 0 12px;
  font-size: 1.55rem;
  line-height: 1.2;
}

.delivery-card p {
  min-height: 118px;
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.delivery-card b {
  display: block;
  color: var(--navy);
  font-size: 0.9rem;
}

.delivery-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-top: 24px;
  padding: 24px 28px;
  color: #fff;
  background: var(--navy);
  border-radius: 22px;
  line-height: 1.6;
}

.delivery-note .primary-button {
  flex: none;
}

.favorites-empty {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.favorites-empty p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

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

  .delivery-card p {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .favorite-link {
    width: 39px;
    height: 39px;
  }

  .product-title-row {
    display: block;
  }

  .product-favorite-button {
    margin: 0 0 16px;
  }

  .delivery-note {
    align-items: stretch;
    flex-direction: column;
  }

  .wholesale-price-card {
    grid-template-columns: 1fr;
  }
}
