:root {
  --ink: #141821;
  --muted: #6a645c;
  --line: #d9d3c9;
  --paper: #f6f3ee;
  --soft: #ebe6de;
  --brand: #e63927;
  --brand-dark: #b82a1b;
  --brand-lite: #ff5a4a;
  --accent: #0f766e;
  --deep: #141821;
  --shadow: none;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --gutter: max(clamp(18px, 4vw, 64px), calc((100vw - 1280px) / 2));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Onest", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* ===== Шапка ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 52px;
}

/* Старая разметка логотипа — для страниц, где шапку ещё не обновили */
.brand-mark {
  display: grid;
  grid-template-columns: auto 18px auto;
  align-items: center;
  min-width: 78px;
  height: 42px;
  padding: 0 9px;
  color: #ffffff;
  background: var(--ink);
  font-weight: 800;
}

.brand-mark i {
  display: block;
  height: 3px;
  background: var(--brand);
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  font-size: 18px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 600;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
}

.site-nav a:hover {
  color: var(--brand);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.nav-catalog-btn {
  min-height: 42px;
  padding: 0 20px;
  font-size: 14px;
}

/* ===== Кнопки: срезанные углы, как в логотипе ===== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% 100%,
    10px 100%,
    0 calc(100% - 10px)
  );
  transition: background-color 0.15s ease, color 0.15s ease;
}

.button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -6px;
}

.button-primary {
  color: #ffffff;
  background: var(--brand);
}

.button-primary:hover {
  background: var(--brand-dark);
}

.button-secondary {
  color: #ffffff;
  background: var(--ink);
}

.button-secondary:hover {
  color: #ffffff;
  background: var(--brand);
}

/* ===== Типографика ===== */

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5.6vw, 80px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
}

.hl {
  color: var(--brand);
}

.hero-text,
.section-heading p,
.split p,
.category-card p {
  color: var(--muted);
}

/* ===== Главный экран ===== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  column-gap: clamp(32px, 5vw, 88px);
  row-gap: clamp(40px, 5vw, 72px);
  padding: clamp(40px, 6vw, 88px) var(--gutter) 0;
  background: var(--paper);
}

.hero-content {
  align-self: center;
  min-width: 0;
}

.hero-text {
  max-width: 56ch;
  margin: 28px 0 0;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-search-panel {
  align-self: center;
  min-width: 0;
  padding: clamp(24px, 3vw, 36px);
  color: #ffffff;
  background: var(--ink);
  border-top: 6px solid var(--brand);
  clip-path: polygon(
    0 0,
    calc(100% - 28px) 0,
    100% 28px,
    100% 100%,
    28px 100%,
    0 calc(100% - 28px)
  );
}

.hero-search-title {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.hero-search {
  display: flex;
}

.hero-search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: #fbf9f6;
  font-family: var(--mono);
  font-size: 15px;
}

.hero-search input:focus {
  outline: 3px solid var(--brand);
  outline-offset: -3px;
  border: 0;
}

.hero-search .button {
  flex: 0 0 auto;
  min-height: 54px;
  clip-path: none;
}

.hero-search-note {
  margin: 28px 0 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.hero-cats {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-cats li {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-cats button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 4px;
  border: 0;
  color: #ffffff;
  background: transparent;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.hero-cats button::after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--brand);
}

.hero-cats button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.hero-cats button:focus-visible {
  outline-color: #ffffff;
  outline-offset: -3px;
}

.hero-facts {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.hero-facts li {
  display: grid;
  gap: 2px;
  padding: 22px 24px 28px 0;
}

.hero-facts li + li {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.hero-facts strong {
  font-size: 18px;
  font-weight: 800;
}

.hero-facts span {
  color: var(--muted);
}

/* ===== Секции ===== */

.section {
  padding: clamp(56px, 8vw, 104px) var(--gutter);
}

.section-muted {
  background: var(--soft);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 40px;
}

.section-heading-text {
  margin: 16px 0 24px;
  max-width: 56ch;
}

/* Марки: колесо из двух бегущих рядов */

.brand-section {
  overflow: hidden;
  padding: clamp(24px, 3vw, 40px) 0;
  color: #ffffff;
  background: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wheel {
  display: grid;
  gap: clamp(4px, 0.8vw, 10px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.wheel-row {
  display: flex;
  width: max-content;
  animation: wheelLeft 70s linear infinite;
}

.wheel-row.is-reverse {
  animation-name: wheelRight;
  animation-duration: 80s;
}

.wheel:hover .wheel-row {
  animation-play-state: paused;
}

.wheel-track {
  display: flex;
  flex: 0 0 auto;
}

.wheel-track span {
  display: inline-flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 34px);
  padding-right: clamp(20px, 2.4vw, 34px);
  color: #ffffff;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.wheel-track span::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--brand);
}

.wheel-row.is-outline .wheel-track span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
}

@keyframes wheelLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes wheelRight {
  from {
    transform: translateX(-50%);
  }

  to {
    transform: translateX(0);
  }
}

/* Категории */

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.category-card {
  min-height: 220px;
  padding: 28px 24px;
  background: var(--paper);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.category-card::before {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  margin-bottom: 52px;
  background: var(--brand);
}

.category-card p {
  margin: 10px 0 0;
}

.category-card:hover {
  color: #ffffff;
  background: var(--ink);
}

.category-card:hover p {
  color: rgba(255, 255, 255, 0.72);
}

.category-card:focus-visible {
  outline-offset: -3px;
}

/* Подбор */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.split > div {
  min-width: 0;
}

.split h2 + p {
  max-width: 52ch;
  margin: 20px 0 0;
}

.steps {
  display: grid;
}

.step {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--ink);
}

.step:last-child {
  border-bottom: 1px solid var(--ink);
}

.step span {
  color: var(--brand);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.step p {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 500;
}

.section-dark {
  color: #ffffff;
  background: var(--ink);
}

.section-dark.split p {
  color: rgba(255, 255, 255, 0.72);
}

.section-dark .step {
  border-top-color: rgba(255, 255, 255, 0.3);
}

.section-dark .step:last-child {
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.section-dark .step p {
  color: #ffffff;
}

/* Заявки */

.order-section {
  background: var(--soft);
}

.forms-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(22px, 3vw, 36px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
}

.form-card button[type="submit"] {
  align-self: flex-start;
  margin-top: auto;
}

.form-card.is-sending {
  opacity: 0.76;
  pointer-events: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #b9b2a7;
  border-radius: 0;
  color: var(--ink);
  background: #fbf9f6;
  font: inherit;
  font-weight: 400;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(230, 57, 40, 0.25);
  border-color: var(--ink);
}

.field-invalid {
  border-color: var(--brand);
}

.error-message {
  min-height: 18px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Контакты */

.contacts {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: clamp(40px, 5vw, 64px);
  color: #ffffff;
  background: var(--ink);
}

.contacts h2 {
  color: #ffffff;
}

.slogan {
  max-width: 36ch;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
}

address {
  display: grid;
  gap: 10px;
  align-content: start;
  font-style: normal;
  font-weight: 600;
}

address a {
  text-decoration: none;
}

address a[href^="tel"] {
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 800;
  line-height: 1.1;
}

address a:hover {
  text-decoration: underline;
}

address span {
  color: rgba(255, 255, 255, 0.66);
}

/* Подвал */

.site-footer {
  display: grid;
  gap: 20px;
  padding: 0 var(--gutter) 32px;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 600;
}

.footer-brand {
  display: inline-flex;
}

.footer-brand img {
  display: block;
  width: auto;
  height: 40px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
}

.footer-legal span[aria-hidden="true"] {
  color: rgba(255, 255, 255, 0.28);
}

/* ===== Адаптив ===== */

@media (max-width: 1000px) {
  .menu-toggle {
    display: inline-block;
    flex: 0 0 auto;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    gap: 0;
    padding: 8px var(--gutter) 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a:not(.button) {
    padding: 14px 0;
    border-top: 1px solid var(--line);
  }

  .nav-catalog-btn {
    margin-top: 12px;
  }

  .hero,
  .split,
  .forms-layout {
    grid-template-columns: 1fr;
  }

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


  .contacts {
    display: grid;
    align-items: start;
  }
}

@media (max-width: 600px) {
  .brand-logo {
    height: 44px;
  }

  .hero-actions .button {
    width: 100%;
  }

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

  .hero-facts li,
  .hero-facts li + li {
    padding: 18px 0;
    border-left: 0;
  }

  .hero-facts li + li {
    border-top: 1px solid var(--line);
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 0;
  }

  .category-card::before {
    margin-bottom: 28px;
  }


  .step {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .step span {
    font-size: 38px;
  }

  .site-footer {
    gap: 14px;
  }
}


/* ===== Catalog modal ===== */

.catalog-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.catalog-modal.is-open {
  display: block;
}

.catalog-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.82);
}

.catalog-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, 94vw);
  height: min(820px, 92vh);
  margin: 4vh auto 0;
  background: var(--deep);
  color: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.catalog-modal-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.catalog-modal-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}

.catalog-modal-title strong {
  font-size: 18px;
}

.catalog-modal-title span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.catalog-search {
  flex: 1 1 auto;
}

.catalog-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.catalog-search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.catalog-search input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(225, 61, 47, 0.2);
}

.catalog-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.catalog-close:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.catalog-modal-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}

.catalog-modal-body.is-detail-view {
  grid-template-columns: minmax(0, 1fr);
}

.catalog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.catalog-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.catalog-cat-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.catalog-cat-btn.is-active {
  background: var(--brand);
  color: #ffffff;
}

.catalog-cat-count {
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11.5px;
  font-weight: 700;
}

.catalog-cat-btn.is-active .catalog-cat-count {
  background: rgba(255, 255, 255, 0.24);
}

.catalog-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 20px 20px;
  overflow-y: auto;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.catalog-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.catalog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(225, 61, 47, 0.5);
}

.catalog-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  overflow: hidden;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 8px,
    rgba(255, 255, 255, 0.02) 8px,
    rgba(255, 255, 255, 0.02) 16px
  );
}

.catalog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4f6f9;
}

.catalog-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.35);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}

.catalog-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--deep);
}

.catalog-card-cat {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-card-body h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  min-height: 38px;
}

.catalog-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.catalog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.catalog-card-price {
  font-weight: 800;
}

.catalog-card-stock {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

.catalog-card-stock.in-stock {
  background: rgba(15, 118, 110, 0.25);
  color: #6fe3d6;
}

.catalog-card-stock.out-stock {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}

.catalog-empty {
  padding: 40px 0;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.catalog-load-more {
  align-self: center;
  margin-top: 22px;
}

/* ===== Product detail view ===== */

.catalog-back {
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.catalog-back:hover {
  color: #ffffff;
}

.catalog-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 32px;
}

.catalog-detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalog-detail-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 360px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.catalog-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.35);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
}

.catalog-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.6);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.catalog-gallery-nav:hover {
  background: var(--brand);
}

.catalog-gallery-prev {
  left: 12px;
}

.catalog-gallery-next {
  right: 12px;
}

.catalog-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.catalog-thumb.is-active {
  border-color: var(--brand);
}

.catalog-detail-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalog-detail-info h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.catalog-detail-info .catalog-card-meta {
  gap: 4px;
  font-size: 13px;
}

.catalog-detail-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
}

.catalog-detail-price {
  font-size: 26px;
  font-weight: 800;
}

.catalog-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  margin: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

.catalog-qty-stepper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.catalog-qty-stepper button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}

.catalog-qty-stepper button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.catalog-qty-stepper span {
  min-width: 24px;
  text-align: center;
  font-size: 16px;
}

.catalog-wholesale-note {
  margin: 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
  line-height: 1.4;
}

.catalog-wholesale-note.is-active {
  background: rgba(15, 118, 110, 0.18);
  border-color: rgba(15, 118, 110, 0.4);
  color: #6fe3d6;
  font-weight: 700;
}

.catalog-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 2px;
  font-weight: 800;
  font-size: 15px;
}

.catalog-delivery-block {
  display: grid;
  gap: 8px;
  margin: 6px 0;
}

.catalog-delivery-btn {
  width: 100%;
}

.catalog-delivery-summary {
  margin: 0;
  padding: 10px 12px;
  background: rgba(15, 118, 110, 0.15);
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.5;
}

.catalog-card-wholesale {
  display: block;
  margin-top: 6px;
  color: #6fe3d6;
  font-size: 11.5px;
  font-weight: 700;
}

.catalog-email-label {
  display: grid;
  gap: 6px;
  margin: 4px 0;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
}

.catalog-email-label input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.catalog-email-label input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.catalog-email-label input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(225, 61, 47, 0.2);
}

.catalog-pay-btn {
  width: 100%;
}

.catalog-pay-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.catalog-pay-note {
  margin: 4px 0 0;
  padding: 12px 14px;
  background: rgba(15, 118, 110, 0.15);
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.5;
}

.catalog-pay-note a {
  color: #6fe3d6;
  font-weight: 700;
}

.catalog-card-buy {
  margin-top: 10px;
  min-height: 38px;
  font-size: 13px;
}

@media (max-width: 720px) {
  .catalog-detail-layout {
    grid-template-columns: 1fr;
  }

  .catalog-detail-main {
    height: 280px;
  }
}

@media (max-width: 860px) {
  .catalog-modal-panel {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .catalog-modal-header {
    flex-wrap: wrap;
  }

  .catalog-modal-body {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 140px;
  }

  .catalog-cat-btn {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Страница реквизитов ---- */
.requisites-page {
  min-height: 60vh;
  background: var(--soft);
}

.requisites-card {
  max-width: 820px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.requisites-group {
  margin: 0;
  padding: 8px clamp(18px, 3vw, 32px);
}

.requisites-group + .requisites-group {
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.requisites-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.4fr) minmax(0, 1fr);
  gap: 8px 24px;
  padding: 14px 0;
}

.requisites-row + .requisites-row {
  border-top: 1px solid var(--line);
}

.requisites-row dt {
  color: var(--muted);
  font-size: 14px;
}

.requisites-row dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.requisites-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 820px;
  margin: 24px auto 0;
}

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

.footer-row a:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 720px) {
  .requisites-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.site-nav a.button-primary,
.site-nav a.button-primary:hover {
  color: #ffffff;
}

/* Реквизиты: единая колонка для заголовка, карточки и кнопок */
.requisites-page .section-heading {
  max-width: 820px;
  margin: 0 auto 28px;
}

.requisites-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
}

.requisites-actions .button {
  min-height: 46px;
}

@media (max-width: 720px) {
  .requisites-actions .button {
    flex: 1 1 100%;
  }
}

/* ---- Публичная оферта ---- */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.offer-card {
  max-width: 820px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.offer-toc {
  padding: 22px clamp(18px, 3vw, 32px);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.offer-toc-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.offer-toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.offer-toc a {
  display: block;
  padding: 2px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.offer-toc a:hover {
  color: var(--brand);
}

.offer-body {
  padding: clamp(8px, 2vw, 16px) clamp(18px, 3vw, 32px) clamp(20px, 3vw, 32px);
}

.offer-section {
  padding-top: 28px;
  scroll-margin-top: 84px;
}

.offer-section + .offer-section {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.offer-section h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.25;
}

.offer-body p {
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.65;
}

.offer-body p.offer-sub {
  padding-left: 22px;
}

.offer-body ul {
  margin: 0 0 12px;
  padding-left: 42px;
  font-size: 15.5px;
  line-height: 1.65;
}

.offer-body li {
  margin-bottom: 4px;
}

.offer-note {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px !important;
  font-style: italic;
}

.offer-requisites {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 18px;
  background: var(--soft);
}

.offer-todo {
  padding: 1px 5px;
  background: #fff3bf;
  border-radius: 4px;
}

@media (max-width: 720px) {
  .offer-toc ol {
    grid-template-columns: 1fr;
  }

  .offer-body p.offer-sub {
    padding-left: 12px;
  }

  .offer-body ul {
    padding-left: 30px;
  }
}

/* ---- Правки под новый стиль ---- */
.footer-row a:hover {
  color: var(--brand-lite);
  text-decoration: underline;
}

.catalog-modal-panel,
.catalog-card,
.catalog-detail-main,
.catalog-thumb,
.catalog-cat-btn,
.catalog-close,
.catalog-qty-stepper button,
.catalog-pay-note,
.catalog-search input {
  border-radius: 0;
}

.catalog-card-meta strong {
  font-family: var(--mono);
  font-weight: 700;
}


/* ===== Страницы реквизитов и оферты ===== */

/* Старая шапка: подменяем квадратик на настоящий логотип, пока разметку не обновили */
.brand:has(.brand-mark) .brand-mark,
.brand:has(.brand-mark) .brand-copy {
  display: none;
}

.brand:has(.brand-mark)::before {
  content: "";
  display: block;
  width: 214px;
  height: 52px;
  background: url("ot-i-do-new-logo.svg") no-repeat left center / contain;
}

/* Одна поверхность страницы, без разноцветных зон внутри карточек */
.requisites-page,
.section-muted {
  background: var(--paper);
}

.requisites-card,
.offer-card {
  background: #fbf9f6;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
}

.requisites-group,
.requisites-group + .requisites-group {
  background: none;
}

.requisites-group + .requisites-group {
  border-top: 2px solid var(--ink);
}

.requisites-row + .requisites-row {
  border-top: 1px solid var(--line);
}

.requisites-row dt {
  color: var(--muted);
}

.requisites-row dd {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.requisites-actions {
  gap: 14px;
}

.offer-toc {
  background: none;
  border-bottom: 1px solid var(--line);
}

.offer-toc-title {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 18px;
  text-transform: none;
}

.offer-toc a:hover {
  color: var(--brand);
}

.offer-section + .offer-section {
  border-top-color: var(--line);
}

.offer-requisites {
  background: none;
  border-radius: 0;
}

.offer-note {
  color: var(--muted);
}

/* Тёмная кнопка не должна сливаться с тёмной модалкой каталога */
.catalog-modal .button-secondary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.catalog-modal .button-secondary:hover {
  background: var(--brand);
}

@media (max-width: 600px) {
  .brand:has(.brand-mark)::before {
    width: 181px;
    height: 44px;
  }
}

.site-nav a[aria-current="page"] {
  color: var(--brand);
}

/* Подвал прижат к низу на коротких страницах */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

/* ===== Каталог: окно в стиле панели поиска (красная полоса, срезанные углы) ===== */

.catalog-modal {
  --m-panel: #1c2230;
  --m-deep: #141821;
  --m-field: #0f131a;
  --m-edge: rgba(255, 255, 255, 0.12);
  --m-dim: rgba(255, 255, 255, 0.62);
  scrollbar-color: #3a4254 transparent;
  scrollbar-width: thin;
}

.catalog-modal *:focus-visible {
  outline: 2px solid var(--brand-lite);
  outline-offset: 2px;
}

.catalog-modal-backdrop {
  background: rgba(10, 12, 18, 0.82);
}

.catalog-modal.is-open .catalog-modal-backdrop {
  animation: modalFade 0.2s ease backwards;
}

.catalog-modal.is-open .catalog-modal-panel {
  animation: modalIn 0.28s ease backwards;
}

.catalog-modal-panel {
  padding-top: 6px;
  background: none;
  border-radius: 0;
  box-shadow: none;
}

/* Фон окна с красной полосой и срезанными углами лежит отдельным слоем:
   clip-path на самом окне обрезал бы виджет СДЭК, который открывается поверх */
.catalog-modal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--m-panel);
  border-top: 6px solid var(--brand);
  clip-path: polygon(
    0 0,
    calc(100% - 28px) 0,
    100% 28px,
    100% 100%,
    28px 100%,
    0 calc(100% - 28px)
  );
  pointer-events: none;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Шапка окна */

.catalog-modal-header {
  gap: 20px;
  padding: 18px 24px;
  background: none;
  border-bottom: 1px solid var(--m-edge);
}

.catalog-modal-title strong {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.catalog-modal-title strong::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--brand);
}

.catalog-modal-title span {
  padding-left: 18px;
  color: var(--m-dim);
  font-family: var(--mono);
  font-size: 12px;
}

.catalog-modal input,
.catalog-modal select,
.catalog-modal textarea {
  color: #ffffff;
  background: var(--m-field);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
}

.catalog-modal input::placeholder,
.catalog-modal textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.catalog-modal input:focus,
.catalog-modal select:focus,
.catalog-modal textarea:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(230, 57, 40, 0.35);
  outline-offset: 0;
}

.catalog-search input {
  min-height: 50px;
  padding-left: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239aa4b4' stroke-width='2.4' stroke-linecap='square'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
}

.catalog-close {
  width: 50px;
  height: 50px;
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  font-size: 24px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.catalog-close:hover {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

/* Категории */

.catalog-sidebar {
  gap: 2px;
  padding: 18px 12px 18px 0;
  border-right: 1px solid var(--m-edge);
}

.catalog-cat-btn {
  padding: 11px 14px;
  border-radius: 0;
  color: var(--m-dim);
  font-size: 14px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.catalog-cat-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.catalog-cat-btn.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 4px 0 0 var(--brand);
}

.catalog-cat-count {
  padding: 0;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.catalog-cat-btn.is-active .catalog-cat-count {
  color: var(--brand-lite);
  background: none;
}

.catalog-content {
  padding: 22px 24px 28px;
}

/* Карточки товаров */

.catalog-grid {
  gap: 16px;
}

.catalog-card {
  background: var(--m-deep);
  border: 0;
  border-radius: 0;
  clip-path: polygon(
    0 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% 100%,
    14px 100%,
    0 calc(100% - 14px)
  );
  transition: box-shadow 0.15s ease;
}

.catalog-card:hover {
  transform: none;
  box-shadow: inset 0 4px 0 var(--brand);
}

.catalog-card-image {
  background: #ece9e4;
}

.catalog-card-image img,
.catalog-detail-main img,
.catalog-thumb img {
  background: #ece9e4;
}

.catalog-card-placeholder,
.catalog-detail-placeholder {
  color: rgba(20, 24, 33, 0.35);
}

.catalog-card-body {
  gap: 8px;
  padding: 16px;
  background: var(--m-deep);
}

.catalog-card-cat {
  font-size: 11px;
  letter-spacing: 0.04em;
}

.catalog-card-body h4 {
  font-size: 14.5px;
  font-weight: 700;
}

.catalog-card-meta {
  color: var(--m-dim);
}

.catalog-card-meta strong {
  color: #ffffff;
}

.catalog-card-footer {
  border-top-color: var(--m-edge);
}

.catalog-card-price {
  font-size: 17px;
}

.catalog-card-stock {
  border-radius: 0;
}

.catalog-card-wholesale {
  color: #6fe3d6;
}

.catalog-card-buy {
  min-height: 42px;
}

.catalog-empty {
  color: var(--m-dim);
}

/* ===== Карточка товара ===== */

.catalog-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  min-height: 44px;
  margin-bottom: 22px;
  padding: 0 22px 0 18px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 15px;
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% 100%,
    10px 100%,
    0 calc(100% - 10px)
  );
  transition: background-color 0.15s ease;
}

.catalog-back:hover {
  color: #ffffff;
  background: var(--brand);
}

.catalog-detail-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.catalog-detail-gallery {
  gap: 12px;
}

.catalog-detail-main {
  height: clamp(300px, 46vh, 460px);
  background: #ece9e4;
  border: 0;
  border-radius: 0;
  clip-path: polygon(
    0 0,
    calc(100% - 22px) 0,
    100% 22px,
    100% 100%,
    22px 100%,
    0 calc(100% - 22px)
  );
}

.catalog-gallery-nav {
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: var(--m-deep);
  font-size: 24px;
  transition: background-color 0.15s ease;
}

.catalog-gallery-nav:hover {
  background: var(--brand);
}

.catalog-thumbs {
  gap: 10px;
}

.catalog-thumb {
  width: 72px;
  height: 72px;
  background: #ece9e4;
  border: 2px solid transparent;
  border-radius: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.catalog-thumb:hover {
  opacity: 1;
}

.catalog-thumb.is-active {
  border-color: var(--brand);
  opacity: 1;
}

/* Правая колонка: панель покупки */

.catalog-detail-info {
  position: relative;
  gap: 12px;
  padding: clamp(20px, 2.6vw, 30px);
  background: var(--m-deep);
  border-top: 4px solid var(--brand);
}

.catalog-detail-info::before,
.catalog-detail-info::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.catalog-detail-info::before {
  top: -4px;
  right: 0;
  background: linear-gradient(225deg, var(--m-panel) 15.5px, transparent 0);
}

.catalog-detail-info::after {
  bottom: 0;
  left: 0;
  background: linear-gradient(45deg, var(--m-panel) 15.5px, transparent 0);
}

.catalog-detail-info h3 {
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.catalog-detail-info .catalog-card-meta {
  gap: 6px;
  padding: 12px 0 4px;
  font-size: 13.5px;
}

.catalog-detail-price-row {
  margin: 6px 0 2px;
}

.catalog-detail-price {
  font-size: clamp(30px, 3.2vw, 38px);
  letter-spacing: -0.02em;
}

.catalog-qty-row {
  margin: 6px 0;
  padding: 14px 0;
  border-color: var(--m-edge);
}

.catalog-qty-stepper button {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 0;
  transition: background-color 0.15s ease;
}

.catalog-qty-stepper button:hover {
  color: #ffffff;
  background: var(--brand);
}

.catalog-qty-stepper span {
  min-width: 32px;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}

.catalog-wholesale-note {
  padding: 10px 14px;
  color: var(--m-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 0;
  border-left: 3px solid var(--brand);
  border-radius: 0;
}

.catalog-wholesale-note.is-active {
  color: #6fe3d6;
  background: rgba(15, 118, 110, 0.18);
  border-left-color: #2cb8a8;
}

.catalog-total-row {
  padding: 8px 0 4px;
  font-size: 17px;
}

.catalog-total-row > :last-child {
  font-size: 22px;
}

.catalog-modal label {
  gap: 6px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.catalog-modal .error-message {
  min-height: 0;
}

.catalog-modal .error-message:empty {
  display: none;
}

.catalog-delivery-block {
  gap: 10px;
  margin: 4px 0;
}

.catalog-delivery-summary,
.catalog-pay-note {
  color: rgba(255, 255, 255, 0.86);
  background: rgba(15, 118, 110, 0.16);
  border: 0;
  border-left: 3px solid #2cb8a8;
  border-radius: 0;
}

.catalog-email-label input {
  background: var(--m-field);
  border-color: rgba(255, 255, 255, 0.18);
}

.catalog-pay-btn,
.catalog-delivery-btn {
  min-height: 54px;
  font-size: 16px;
}

/* Адаптив окна */

@media (max-width: 860px) {
  .catalog-modal-panel::before {
    clip-path: none;
  }

  .catalog-sidebar {
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid var(--m-edge);
  }

  .catalog-content {
    padding: 18px 16px 24px;
  }

  .catalog-close {
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 720px) {
  .catalog-detail-layout {
    grid-template-columns: 1fr;
  }

  .catalog-detail-main {
    height: 280px;
  }
}

/* Кнопки «Купить» выровнены по низу карточек */
.catalog-card-body {
  flex: 1 1 auto;
}

.catalog-card-footer {
  margin-top: auto;
}

/* Фото остаются на экране, пока листается форма заказа */
@media (min-width: 721px) {
  .catalog-detail-gallery {
    position: sticky;
    top: 0;
  }
}

/* ===== Мобильный каталог: высота под панели Safari и понятные категории ===== */

@media (max-width: 860px) {
  .catalog-modal-panel {
    height: 100%;
    max-height: 100dvh;
  }

  .catalog-modal-body {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .catalog-modal-body.is-detail-view {
    grid-template-rows: minmax(0, 1fr);
  }

  .catalog-content {
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }

  /* Категории: горизонтальная лента, край обрезан затуханием, чтобы было видно, что она листается */
  .catalog-modal-title {
    flex: 1 0 100%;
  }

  .catalog-search {
    flex: 1 1 0;
    min-width: 0;
  }

  .catalog-sidebar {
    scroll-padding-left: 16px;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    max-height: none;
    padding: 12px 56px 12px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
  }

  .catalog-sidebar::-webkit-scrollbar {
    display: none;
  }

  .catalog-cat-btn {
    flex: 0 0 auto;
    gap: 10px;
    padding: 10px 14px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.07);
    scroll-snap-align: start;
  }

  .catalog-cat-btn.is-active {
    background: var(--brand);
    box-shadow: none;
  }

  .catalog-cat-btn.is-active .catalog-cat-count {
    color: #ffffff;
  }
}

/* Пометка в блоке каталога */
.section-heading .catalog-note {
  max-width: 56ch;
  margin: 0 0 24px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--soft);
  border-left: 3px solid var(--brand);
  font-size: 15px;
}

.catalog-note a {
  font-weight: 700;
}

.catalog-note a:hover {
  color: var(--brand);
}

/* ===== Карточка товара: «Назад» закреплена, листается только правая плашка ===== */

@media (min-width: 721px) {
  .catalog-content:has(.catalog-detail:not([hidden])) {
    overflow: hidden;
  }

  .catalog-detail:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .catalog-detail:not([hidden]) .catalog-back {
    flex: 0 0 auto;
  }

  .catalog-detail-layout {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
  }

  .catalog-detail-gallery {
    position: static;
    align-self: start;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .catalog-detail-main {
    height: clamp(260px, 46vh, 460px);
  }

  .catalog-detail-info {
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #3a4254 transparent;
  }

  /* Срезанные углы на прокручиваемой плашке уехали бы вместе с контентом */
  .catalog-detail-info::before,
  .catalog-detail-info::after {
    display: none;
  }
}

/* Кнопка «Назад» с непрозрачным фоном: на телефоне она прилипает к верху окна */
.catalog-back {
  background: #2b3346;
}

.catalog-back:hover {
  background: var(--brand);
}

@media (max-width: 720px) {
  .catalog-back {
    position: sticky;
    top: -18px;
    z-index: 4;
  }
}
