:root {
  --bg: #f5f5f5;
  --ink: #313233;
  --brand: #111111;
  --muted: #989999;
  --btn: #454545;
  --btn-hover: #3a3a3a;
  --pill: #ececed;
  --price: #e03131;
  --sale: #d9480f;
  --panel: #ffffff;
  --radius: 10px;
  --max: 920px;
  --shadow: 6px 6px 16px rgba(49, 50, 51, 0.1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  /* Скроллит ТОЛЬКО html. Нельзя ставить overflow-x: hidden на body/.app
     без overflow-y: тогда overflow-y становится auto и появляется ВТОРОЙ
     вертикальный скроллбар — страница сужается и шапка уезжает влево. */
  height: 100%;
  scrollbar-gutter: stable;
  overflow-x: hidden;
  overflow-y: scroll;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Roboto, "Helvetica Neue", Ubuntu, sans-serif;
}

body {
  min-height: 100%;
}

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

button,
input,
select {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app > .main {
  flex: 1 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 12px 8px;
  background: linear-gradient(180deg, #f5f5f5 70%, rgba(245, 245, 245, 0));
}

.menu-shell {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 5px 6px 5px 6px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  touch-action: pan-x;
}

.nav.is-dragging {
  cursor: grabbing;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px 0 10px;
  border-radius: 13px;
  white-space: nowrap;
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
  -webkit-user-drag: none;
  user-drag: none;
  transition: background 0.22s var(--ease), transform 0.22s var(--ease), color 0.22s var(--ease);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-icon-img {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: contain;
}

.nav-link:hover {
  background: #f3f3f3;
}

.nav-link.is-active {
  background: var(--pill);
}

.nav-link:active {
  transform: scale(0.96);
}

.nav-search {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  flex: 0 0 38px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.nav-search svg {
  width: 18px;
  height: 18px;
}

.nav-search:hover,
.nav-search.is-active {
  background: var(--pill);
}

.nav-search:active {
  transform: scale(0.96);
}

.nav-more {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex: 0 0 38px;
  transition: background 0.2s var(--ease);
}

.nav-more span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  margin: 0;
  background: var(--ink);
  border-radius: 2px;
  transform: translate(-50%, -50%) translateY(-6px);
  transition: transform 0.28s var(--ease), opacity 0.2s var(--ease), width 0.2s var(--ease);
}

.nav-more span:nth-child(2) {
  transform: translate(-50%, -50%);
}

.nav-more span:nth-child(3) {
  transform: translate(-50%, -50%) translateY(6px);
}

.nav-more:hover,
.nav-more.is-open {
  background: var(--pill);
}

.nav-more.is-open span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav-more.is-open span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.nav-more.is-open span:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

.sheet.is-open {
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.28);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}

.sheet.is-open .sheet-backdrop {
  opacity: 1;
}

.sheet-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 64px;
  max-width: var(--max);
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 8px;
  transform: translateY(-12px) scale(0.98);
  opacity: 0;
  transition: transform 0.32s var(--ease), opacity 0.28s var(--ease);
}

.sheet.is-open .sheet-panel {
  transform: none;
  opacity: 1;
}

.sheet-head {
  padding: 12px 14px 8px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.sheet-list a svg {
  width: 20px;
  height: 20px;
}

.sheet-list a:hover,
.sheet-list a.is-active {
  background: var(--pill);
}

.sheet-list a:active {
  transform: scale(0.98);
}

.main {
  padding: 6px 0 88px;
}

.main.is-out {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.main.is-in {
  opacity: 1;
  transform: none;
  animation: pageIn 0.38s var(--ease);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 12px 30px;
  animation: fadeUp 0.5s var(--ease) both;
}

.brand-mark {
  width: 88px;
  height: 88px;
  margin-bottom: 14px;
}

.brand-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #111;
}

.brand-sub {
  margin: 8px 0 0;
  max-width: 280px;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #143211;
}

.links {
  display: grid;
  gap: 10px;
}

.link-btn {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  min-height: 60px;
  padding: 4px 18px 4px 8px;
  background: var(--btn);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  opacity: 0;
  animation: fadeUp 0.42s var(--ease) forwards;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.links .link-btn:nth-child(1) { animation-delay: 0.04s; }
.links .link-btn:nth-child(2) { animation-delay: 0.08s; }
.links .link-btn:nth-child(3) { animation-delay: 0.12s; }
.links .link-btn:nth-child(4) { animation-delay: 0.16s; }
.links .link-btn:nth-child(5) { animation-delay: 0.2s; }
.links .link-btn:nth-child(6) { animation-delay: 0.24s; }
.links .link-btn:nth-child(7) { animation-delay: 0.28s; }
.links .link-btn:nth-child(8) { animation-delay: 0.32s; }
.links .link-btn:nth-child(n + 9) { animation-delay: 0.36s; }

.link-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(49, 50, 51, 0.16);
}

.link-btn:active {
  transform: scale(0.985);
  box-shadow: none;
}

.link-btn.is-sale {
  box-shadow: inset 0 0 0 2px var(--sale);
}

.link-thumb,
.link-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.link-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
}

.link-icon svg,
.link-thumb svg {
  width: 22px;
  height: 22px;
  color: #222;
}

.link-copy {
  text-align: center;
  padding: 0 8px;
}

.link-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.link-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}

.section-title {
  margin: 22px 0 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
}

.search-hero {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
}

.search-hero .field {
  flex: 1;
}

.search-go {
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}

.search-go:hover {
  background: var(--btn-hover);
}

.search-go:active {
  transform: scale(0.97);
}

.search-meta {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}

.product-cat {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: grid;
  gap: 10px;
  margin: 8px 0 22px;
}

.field {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 1px solid #dedede;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field:focus {
  border-color: #bbb;
  box-shadow: 0 0 0 4px rgba(49, 50, 51, 0.05);
}

.catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 18px;
}

.product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  opacity: 0;
  animation: fadeUp 0.4s var(--ease) forwards;
}

.catalog .product:nth-child(1) { animation-delay: 0.04s; }
.catalog .product:nth-child(2) { animation-delay: 0.08s; }
.catalog .product:nth-child(3) { animation-delay: 0.12s; }
.catalog .product:nth-child(4) { animation-delay: 0.16s; }
.catalog .product:nth-child(5) { animation-delay: 0.2s; }
.catalog .product:nth-child(6) { animation-delay: 0.24s; }
.catalog .product:nth-child(n + 7) { animation-delay: 0.28s; }

.product:hover .product-photo {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(49, 50, 51, 0.08);
}

.product-photo {
  aspect-ratio: 1;
  background: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.product-photo svg,
.product-hero svg {
  width: 72%;
  height: 72%;
}

.product-art {
  display: block;
}

.product-img,
.product-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-sku,
.product-stock,
.product-code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.product-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.02em;
}

.product-meta .product-code {
  margin: 0 0 10px;
  font-size: 14px;
  color: #666;
}

.product-unit {
  color: inherit;
  font-weight: 400;
  font-size: 0.92em;
}

.product-meta .product-price {
  margin: 14px 0 10px;
  font-size: 22px;
}

.product-stock.is-empty {
  color: #c4c4c4;
}

.product-name {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
}

.product-price {
  margin-top: 6px;
  color: var(--price);
  font-size: 14px;
}

.product-page {
  display: grid;
  gap: 18px;
}

.product-hero {
  background: #fff;
  border-radius: 16px;
  min-height: 320px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(49, 50, 51, 0.05);
}

.product-hero svg {
  width: 58%;
  height: 58%;
}

.product-meta h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
}

.back {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: max-content;
  gap: 10px;
  margin-bottom: 0;
  padding: 8px 20px 8px 8px;
  border-radius: 999px;
  background: var(--btn);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
  transition: background 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.back-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  transition: transform 0.22s var(--ease), background 0.22s var(--ease);
}

.back-icon svg {
  width: 16px;
  height: 16px;
}

.back:hover {
  background: var(--btn-hover);
  transform: translateX(-4px);
  box-shadow: 0 10px 20px rgba(49, 50, 51, 0.2);
}

.back:hover .back-icon {
  background: rgba(255, 255, 255, 0.28);
  transform: translateX(-2px);
}

.back:active {
  transform: scale(0.96);
}

.brand-logo {
  display: block;
  width: min(220px, 60vw);
  height: auto;
}

.gallery {
  position: relative;
  outline: none;
}

.gallery-stage {
  position: relative;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(49, 50, 51, 0.05);
  overscroll-behavior-x: contain;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-slide {
  flex: 0 0 100%;
  aspect-ratio: 1;
  max-height: 560px;
  scroll-snap-align: center;
  display: grid;
  place-items: center;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(49, 50, 51, 0.16);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s;
}

.gallery-arrow svg {
  width: 20px;
  height: 20px;
}

.gallery-arrow.is-prev { left: 10px; }
.gallery-arrow.is-next { right: 10px; }

.gallery-arrow:hover {
  background: #fff;
  transform: scale(1.06);
}

.gallery-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.55);
  color: #fff;
  font-size: 12px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}

.gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  flex: 0 0 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumb.is-active,
.gallery-thumb:hover {
  opacity: 1;
  border-color: var(--btn);
}

.product-desc {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.55;
}

.product-desc p {
  margin: 0 0 12px;
}

.specs {
  margin: 0 0 12px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.specs div {
  display: grid;
  grid-template-columns: minmax(120px, 40%) 1fr;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.specs div:last-child {
  border-bottom: 0;
}

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

.specs dd {
  margin: 0;
}

.product-block-title {
  margin: 8px 0 12px;
  font-size: 17px;
  font-weight: 500;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--btn);
  color: #fff;
}

.video-link svg {
  width: 18px;
  height: 18px;
}

.contacts-intro {
  margin: -4px auto 18px;
  max-width: 560px;
  text-align: center;
  line-height: 1.5;
  color: #555;
}

.contacts {
  display: grid;
  gap: 10px;
}

.contact {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 10px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

a.contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(49, 50, 51, 0.1);
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pill);
  display: grid;
  place-items: center;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
}

.contact-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}

.contact-value {
  display: block;
  font-size: 16px;
  line-height: 1.4;
  word-break: break-word;
}

.messengers {
  text-align: center;
}

.messengers.is-inline {
  margin-top: 28px;
}

.messengers-title {
  margin-bottom: 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.messengers-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}

.messenger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 76px;
  font-size: 12px;
  color: var(--ink);
}

.messenger-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 4px 14px rgba(49, 50, 51, 0.1);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.messenger-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.messenger:hover .messenger-icon {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(49, 50, 51, 0.16);
}

.messengers.is-footer .messengers-list {
  gap: 14px;
}

.messengers.is-footer .messenger {
  width: auto;
  gap: 4px;
  font-size: 11px;
}

.messengers.is-footer .messenger-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(49, 50, 51, 0.12);
}

.messenger.is-pending {
  cursor: default;
}

.site-footer {
  margin-top: -40px;
  padding: 32px 16px 36px;
  border-top: 1px solid #e6e6e6;
}

.site-footer:empty {
  display: none;
}

.footer-inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.footer-phones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  font-size: 16px;
  font-weight: 500;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  font-size: 12px;
  color: var(--muted);
}

.footer-meta a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.updated {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .catalog {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 12px;
  }

  .brand-title {
    font-size: 22px;
  }

  .nav-link {
    padding: 0 12px 0 10px;
  }

  .wrap {
    width: min(var(--max), calc(100% - 24px));
  }

  .search-hero {
    flex-direction: column;
  }

  .search-go {
    width: 100%;
  }

  .gallery-arrow {
    width: 36px;
    height: 36px;
    margin-top: -18px;
  }

  .gallery-thumb {
    flex-basis: 54px;
    height: 54px;
  }

  .specs div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (hover: none) {
  .gallery-arrow {
    background: rgba(255, 255, 255, 0.8);
  }
}
