:root {
  --red: #e6003c;
  --red-dark: #cc0033;
  --teal: #11879a;
  --ink: #282d30;
  --muted: #62696e;
  --line: #dedede;
  --soft: #f5f6f7;
  --panel: #fff;
  --shadow: 0 14px 34px rgba(24, 30, 34, 0.08);
  --footer: #262c2f;
  --footer-card: #424849;
}

* {
  box-sizing: border-box;
}

html {
  background: #fff;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  letter-spacing: 0;
}

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

button {
  color: inherit;
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.search-icon::before {
  content: "";
  position: absolute;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 3px;
  background: currentColor;
  transform: rotate(45deg);
}

.searchbar {
  min-height: 78px;
  background: #ededed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 10px clamp(24px, 2.6vw, 56px);
}

.search-wrap {
  flex: 1;
  max-width: 1580px;
  min-width: 0;
  height: 56px;
  background: #fff;
  border-radius: 3px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  color: #9aa0a5;
  font-size: 19px;
}

.search-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #30373a;
  font: inherit;
}

.search-input::placeholder {
  color: #9aa0a5;
  opacity: 1;
}

.search-icon {
  width: 28px;
  height: 28px;
  margin-right: 28px;
  color: #222;
  position: relative;
}

.search-icon::before {
  inset: 2px 8px 8px 2px;
}

.search-icon::after {
  right: 1px;
  bottom: 5px;
}

.ask-ai {
  height: 58px;
  min-width: 116px;
  border: 3px solid transparent;
  border-radius: 4px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #e21b63, #00c7e6) border-box;
  font-size: 18px;
  font-weight: 700;
}

.ask-ai span {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-left: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #62e4ff 22%, #816dff 48%, #f01363 74%, #19cbd6);
  vertical-align: middle;
}

.page-content {
  max-width: 85%;
  margin: 0 auto;
  padding: 42px clamp(24px, 2.6vw, 56px) 0;
  position: relative;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #42484c;
  font-size: 16px;
  margin-bottom: 42px;
}

.breadcrumb a {
  color: #c00038;
  font-weight: 700;
}

.page-main {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  column-gap: clamp(48px, 4vw, 72px);
  padding-bottom: 76px;
}

.category-rail {
  position: sticky;
  top: 122px;
  z-index: 20;
  align-self: start;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

.category-rail h2 {
  flex: 0 0 auto;
  margin: 0 0 30px;
  font-size: 28px;
  line-height: 1.25;
}

.category-rail ul {
  flex: 1 1 auto;
  margin: 0;
  padding: 4px 10px 18px 24px;
  list-style: none;
  border-left: 1px solid #e3e3e3;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c9cdd1 transparent;
  scrollbar-width: thin;
}

.category-rail ul::-webkit-scrollbar {
  width: 6px;
}

.category-rail ul::-webkit-scrollbar-track {
  background: transparent;
}

.category-rail ul::-webkit-scrollbar-thumb {
  background: #c9cdd1;
  border-radius: 999px;
}

.category-rail li {
  min-height: 76px;
  color: #30373a;
  font-size: 17px;
  line-height: 1.35;
  position: relative;
  outline: 0;
}

.category-link {
  min-height: 76px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  cursor: default;
  padding-right: 8px;
}

.category-link::after {
  content: "\203A";
  color: var(--red);
  font-weight: 700;
}

.category-rail li.is-open > .category-link,
.category-rail li.is-current > .category-link {
  color: var(--red);
  font-weight: 700;
}

.category-rail li.is-current::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 0;
  width: 5px;
  height: 76px;
  background: var(--red);
}

.category-rail img {
  width: 58px;
  height: 58px;
  border-radius: 3px;
  background: #f0f1f2;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.subcategory-panel {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: min(440px, calc(100vw - 420px));
  padding: 30px 36px;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
  display: none;
  gap: 18px;
  pointer-events: none;
  visibility: hidden;
}

.subcategory-panel::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 0;
  width: 28px;
  height: 100%;
}

.category-rail li.is-open > .subcategory-panel {
  display: grid;
  pointer-events: auto;
  visibility: visible;
}

.subcategory-panel a {
  color: var(--red);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.subcategory-panel a::after {
  content: "\203A";
  margin-left: 10px;
}

.subcategory-panel a:hover,
.subcategory-panel a:focus-visible {
  color: var(--red-dark);
  outline: 0;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.product-area h1 {
  margin: -6px 0 18px;
  font-size: clamp(46px, 4vw, 76px);
  line-height: 1.05;
  font-weight: 700;
}

.page-lead {
  max-width: 980px;
  margin: 0 0 42px;
  color: #343b3f;
  font-size: 18px;
  line-height: 1.65;
}

.page-lead:empty {
  display: none;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 34px;
}

.product-card {
  min-height: 0;
  padding: 0;
  background: var(--soft);
  border: 1px solid #eceff1;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(24, 30, 34, 0.05);
}

.product-card img {
  width: 100%;
  height: clamp(260px, 22vw, 360px);
  margin: 0;
  background: #eef0f2;
  object-fit: cover;
}

.product-card h2 {
  margin: 24px 28px 12px;
  font-size: 24px;
  line-height: 1.2;
}

.product-card h2::after {
  color: var(--red);
  content: "›";
  font-size: 27px;
  margin-left: 11px;
}

.product-card p {
  margin: 0 28px 26px;
  color: #4a5156;
  font-size: 16px;
  line-height: 1.5;
}

.catalog-button {
  width: 220px;
  height: 54px;
  margin: auto 28px 28px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  font-size: 16px;
  font-weight: 700;
}

.book-icon {
  width: 27px;
  height: 24px;
  border: 3px solid currentColor;
  border-top-width: 2px;
  border-radius: 2px;
  display: inline-block;
  position: relative;
}

.book-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 3px;
  height: 25px;
  background: currentColor;
}

@media (max-width: 767px) {
  body {
    background: #fff;
    overflow-x: hidden;
  }

  .searchbar {
    height: auto;
    gap: 10px;
    padding: 12px 14px;
  }

  .search-wrap {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    font-size: 14px;
  }

  .search-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-right: 10px;
  }

  .search-icon::before {
    border-width: 2px;
  }

  .search-icon::after {
    width: 9px;
    height: 2px;
  }

  .ask-ai {
    min-width: 70px;
    height: 46px;
    border-width: 2px;
    font-size: 14px;
  }

  .ask-ai span {
    display: none;
  }

  .page-content {
    width: 100%;
    padding: 20px 16px 0;
  }

  .breadcrumb {
    gap: 10px;
    margin: 0 0 30px;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 14px;
  }

  .page-main {
    display: block;
    padding-bottom: 48px;
  }

  .category-rail {
    position: relative;
    top: auto;
    z-index: 5;
    display: block;
    max-height: none;
    margin-bottom: 34px;
  }

  .category-rail h2 {
    margin-bottom: 16px;
    font-size: 22px;
  }

  .category-rail ul {
    display: flex;
    flex: none;
    gap: 12px;
    margin: 0 -16px;
    padding: 0 16px 14px;
    border-left: 0;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .category-rail ul::-webkit-scrollbar {
    display: none;
  }

  .category-rail li {
    flex: 0 0 168px;
    min-height: auto;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    scroll-snap-align: start;
  }

  .category-link {
    min-height: 72px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
    font-size: 14px;
  }

  .category-rail li:hover > .category-link,
  .category-rail li:focus-within > .category-link {
    color: var(--red);
    font-weight: 700;
  }

  .category-rail img {
    width: 44px;
    height: 44px;
  }

  .category-rail li.is-current::before {
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    border-radius: 6px 0 0 6px;
  }

  .subcategory-panel {
    display: none;
    position: static;
    left: auto;
    top: auto;
    width: auto;
    padding: 0 12px 14px 64px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    gap: 8px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .subcategory-panel::before {
    display: none;
  }

  .category-rail li:hover > .subcategory-panel,
  .category-rail li:focus-within > .subcategory-panel {
    display: grid;
    transform: none;
  }

  .subcategory-panel a {
    font-size: 13px;
    line-height: 1.35;
  }

  .product-area h1 {
    margin: 0 0 18px;
    font-size: 42px;
  }

  .page-lead {
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 1.55;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .product-card {
    min-height: 0;
    padding: 0 18px 22px;
  }

  .product-card img {
    width: calc(100% + 36px);
    height: auto;
    aspect-ratio: 16 / 11;
    margin: 0 -18px 20px;
  }

  .product-card h2 {
    margin-bottom: 10px;
    font-size: 21px;
  }

  .product-card p {
    margin-bottom: 22px;
    font-size: 16px;
  }

  .catalog-button {
    width: 100%;
    height: 54px;
    padding: 0 22px;
    font-size: 16px;
  }
}

@media (min-width: 768px) and (max-width: 1320px) {
  .page-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .page-main {
    grid-template-columns: 275px minmax(0, 1fr);
    column-gap: 54px;
  }

  .subcategory-panel {
    left: calc(100% + 24px);
    width: min(370px, calc(100vw - 340px));
    padding: 28px 32px;
    gap: 18px;
  }

  .subcategory-panel::before {
    left: -24px;
    width: 24px;
  }

  .subcategory-panel a {
    font-size: 18px;
  }

  .product-grid {
    gap: 26px;
  }
}
