/* Общие элементы компьютерного каталога. Подключать после штатной темы. */
:root {
  --km-ink: #211a2b;
  --km-muted: #615a69;
  --km-brand: #5d1f82;
  --km-hover: #451765;
  --km-tint: #f3edf8;
  --km-line: #dedbe4;
  --km-bg: #f7f7fa;
  --km-paper: #fff;
  --km-radius: 1.15rem;
  --km-page: 85rem;
}

.km-shell,
body.store-page {
  margin: 0;
  color: var(--km-ink);
  background-color: var(--km-bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.km-shell {
  font-size: 1rem;
  line-height: 1.5;
}

.km-shell *,
.km-shell *::before,
.km-shell *::after { box-sizing: border-box; }
.km-shell img { display: block; max-width: 100%; }
.km-shell :where(input, select, textarea, button) { font: inherit; }
.km-shell :where(h1, h2, h3, p, dl, figure) { margin: 0; }
.km-shell a { color: var(--km-brand); text-underline-offset: .17em; }
.km-shell [hidden] { display: none !important; }
.km-shell :focus-visible,
body.store-page :focus-visible { outline: 3px solid #8255b5; outline-offset: 3px; }

.km-wrap {
  width: min(var(--km-page), calc(100% - clamp(2rem, 5vw, 5rem)));
  margin-inline: auto;
}
.km-wrap > * { min-width: 0; }
.km-section { margin-block: clamp(2rem, 5vw, 4.25rem); }
.km-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-block-end: 1.2rem;
}
.km-section-head :is(h1, h2),
.km-shell main > h1 { font-size: clamp(1.7rem, 3.2vw, 2.7rem); line-height: 1.1; letter-spacing: -.04em; }
.km-muted { color: var(--km-muted); }
.km-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }

/* Шапка и поиск. */
.km-header,
body.store-page .site-header { background: var(--km-paper); border-bottom: 1px solid var(--km-line); box-shadow: none; }
.km-header > .km-wrap,
.km-header.km-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem clamp(.8rem, 2vw, 1.75rem);
  padding-block: .7rem;
}
.km-brand { display: inline-flex; align-items: center; flex: none; }
.km-brand img { width: clamp(8.5rem, 15vw, 11.5rem); height: auto; }
.km-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1.1rem; }
.km-nav a { color: var(--km-ink); text-decoration: none; font-weight: 600; }
.km-nav a:hover,
.km-nav [aria-current="page"] { color: var(--km-brand); text-decoration: underline; }
.km-search {
  display: flex;
  flex: 1 1 16rem;
  min-width: 0;
  border: 1px solid var(--km-line);
  border-radius: .7rem;
  background: #f7f6f9;
}
.km-search:focus-within { outline: 2px solid var(--km-brand); outline-offset: 1px; }
.km-search input { width: 100%; min-width: 0; padding: .6rem .8rem; color: var(--km-ink); border: 0; background: transparent; }
.km-search input:focus-visible { outline: 0; }
.km-search button { min-height: 2.75rem; padding: .5rem .85rem; border: 0; background: transparent; color: var(--km-brand); font-weight: 700; cursor: pointer; }
.km-search button:focus-visible { outline-offset: -3px; }

/* Фирменный знак с исходной иконки Клик36. Баннер из админки оформляется отдельно. */
.km-hero,
.store-page-home .home-hero:not(:has(.hero-media-link)) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 0;
  border: 0;
  border-radius: clamp(1.1rem, 2vw, 1.75rem);
  color: #fff;
  background:
    radial-gradient(ellipse at 86% 20%, #713596, transparent 53%),
    linear-gradient(113deg, #21152f 4%, #3b1a54 58%, #50276f);
}
.km-hero { margin-block: 1.25rem 2rem; padding: clamp(1.75rem, 5.2vw, 4.9rem); }
.store-page-home .home-hero:not(:has(.hero-media-link)) .hero-content {
  min-height: 0;
  width: 73%;
  padding: clamp(1.75rem, 5.2vw, 4.9rem);
}
.km-hero > * { position: relative; z-index: 1; }
.km-hero::before,
.store-page-home .home-hero:not(:has(.hero-media-link))::before {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 0;
  inset: -65% -17% -90% 50%;
  background: repeating-radial-gradient(ellipse at 55% 48%, transparent 0 2.75rem, rgb(227 194 255 / 13%) 2.79rem 2.84rem, transparent 2.91rem 4rem);
  transform: rotate(-20deg);
}
.km-hero::after,
.store-page-home .home-hero:not(:has(.hero-media-link))::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 0;
  inset: 50% 9% auto auto;
  width: clamp(5.75rem, 13vw, 12.5rem);
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 24%;
  background: var(--km-brand) url("../img/favicon.svg") center/100% no-repeat;
  box-shadow: 0 .38rem 0 #41145f, 0 1.4rem 2.8rem rgb(18 6 29 / 38%);
  transform: translateY(-50%) rotate(-12deg);
}
.km-hero h1,
.store-page-home .home-hero:not(:has(.hero-media-link)) h1 {
  max-width: 18ch;
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.km-hero p,
.store-page-home .home-hero:not(:has(.hero-media-link)) .hero-content p {
  max-width: min(57ch, 66%);
  margin-block: .85rem 1.25rem;
  color: #e7ddee;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}
.store-page-home .home-hero:not(:has(.hero-media-link)) .hero-content p { max-width: 53ch; }
.km-btn,
.km-shell .filter-actions button,
.km-shell .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .58rem 1rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  background: var(--km-brand);
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.km-shell a.km-btn { color: #fff; }
.km-btn:hover,
.km-shell .button-primary:hover,
.km-shell .filter-actions button:hover { background-color: var(--km-hover); }
.km-btn.km-secondary { border-color: var(--km-line); background: #fff; color: var(--km-brand); }
.km-btn:disabled { opacity: .56; cursor: default; }
.km-hero a.km-btn,
.store-page-home .home-hero:not(:has(.hero-media-link)) .hero-actions .catalog-button { background: #fff; color: #471664; }
.km-hero a.km-btn:hover { background: #efe7f5; }

/* Категории, параметры и результаты. */
.km-categories,
.km-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr));
  gap: .85rem;
  padding: 0;
  list-style: none;
}
.km-categories :is(a, .km-category),
.km-card,
.km-panel,
.km-filters {
  min-width: 0;
  border: 1px solid var(--km-line);
  border-radius: var(--km-radius);
  background: var(--km-paper);
}
.km-categories a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 4.6rem;
  padding: .8rem 1rem;
  color: var(--km-ink);
  font-weight: 660;
  text-decoration: none;
}
.km-categories a:hover,
.km-card:focus-within { border-color: #9870ac; }
.km-categories img { width: 3.4rem; height: 3.4rem; object-fit: contain; }
.km-categories small { color: var(--km-muted); font-weight: 500; }
.km-catalog { display: grid; grid-template-columns: minmax(13.5rem, 17.5rem) minmax(0, 1fr); align-items: start; gap: clamp(.85rem, 2vw, 1.75rem); }
.km-catalog > * { min-width: 0; }
.km-filters,
.km-panel { padding: clamp(1rem, 2.5vw, 1.65rem); }
.km-filters :is(form, .catalog-facet-list) { display: grid; gap: .8rem; }
.km-filters :is(fieldset, .facet-fieldset) { min-width: 0; border: 0; margin: 0; padding: 0; }
.km-filters legend,
.km-filters summary { color: var(--km-ink); font-weight: 650; }
.km-filters summary { cursor: pointer; }
.km-filters details + details { border-top: 1px solid var(--km-line); padding-top: .75rem; }
.km-filters :is(.facet-values, .filter-actions) { display: grid; gap: .3rem; padding-top: .5rem; }
.km-filters .facet-choice { display: flex; align-items: center; gap: .5rem; min-height: 2rem; cursor: pointer; }
.km-filters .facet-choice small { margin-inline-start: auto; color: var(--km-muted); }
.km-filters input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: var(--km-brand); }
.km-filters .price-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-block: .4rem; }
.km-filters .price-fields input { width: 100%; min-width: 0; }
.km-filters .price-sliders { display: grid; gap: .3rem; }
.km-filters .price-sliders label { display: flex; align-items: center; gap: .6rem; }
.km-filters .price-sliders input { flex: 1; min-width: 0; }
.km-filters .filter-actions a { display: block; justify-self: center; padding: .45rem; }
.km-filters input[type=range] { accent-color: var(--km-brand); }
.km-filters .catalog-filter-apply {
  position: fixed;
  z-index: 20;
  min-height: 2.65rem;
  padding: .55rem .85rem;
  border: 0;
  border-radius: .6rem;
  background: var(--km-brand);
  color: #fff;
  box-shadow: 0 .25rem .75rem rgb(40 14 55 / 18%);
  font-weight: 700;
  cursor: pointer;
}
.km-filters .catalog-filter-apply[hidden] { display: none; }
.km-toolbar,
.km-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-block: .75rem 1rem; }
.km-pagination a,
.km-pagination [aria-current] { display: grid; place-items: center; min-width: 2.6rem; min-height: 2.6rem; border-radius: .55rem; }
.km-pagination [aria-current] { background: var(--km-tint); color: var(--km-brand); font-weight: 700; }
.km-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .5rem;
  padding: .9rem;
  overflow-wrap: anywhere;
}
.km-card > :is(img, .km-photo),
.km-card .km-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.km-card .km-photo { display: grid; place-items: center; border-radius: .65rem; }
.km-card :is(h2, h3) { color: var(--km-ink); font-size: 1.04rem; line-height: 1.32; }
.km-card :is(h2, h3) a { color: inherit; text-decoration: none; }
.km-card :is(h2, h3) a:hover { color: var(--km-brand); text-decoration: underline; }
.km-card .km-price { margin-top: auto; }
.km-price { font-weight: 750; font-size: 1.25rem; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.km-card small { color: var(--km-muted); }

/* Карточка, формы и строки заказа. */
.km-product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(17rem, .9fr); align-items: start; gap: clamp(1rem, 3vw, 2.5rem); }
.km-product > * { min-width: 0; }
.km-product h1 { font-size: clamp(1.65rem, 3.2vw, 2.6rem); line-height: 1.13; overflow-wrap: anywhere; }
.km-product figure img { width: 100%; max-height: 30rem; object-fit: contain; }
.km-gallery-strip { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem; }
.km-gallery-strip img { width: 4.5rem; height: 4.5rem; object-fit: contain; }
.km-form { display: grid; gap: 1rem; }
.km-form :is(label, fieldset) { min-width: 0; }
.km-form label { display: grid; gap: .35rem; font-weight: 600; }
.km-form label:has(> input[type=checkbox]),
.km-form label:has(> input[type=radio]) { display: flex; align-items: baseline; gap: .5rem; }
.km-form :is(input, select, textarea):not([type=hidden],[type=checkbox],[type=radio],[type=range],[type=file]),
.km-filters .price-fields input,
.km-toolbar select {
  min-height: 2.65rem;
  padding: .48rem .68rem;
  border: 1px solid #aca5b6;
  border-radius: .5rem;
  background: #fff;
  color: var(--km-ink);
}
.km-form :is(select, input, textarea) { max-width: 100%; }
.km-form textarea { min-height: 5rem; resize: vertical; }
.km-form :is(.km-btn,button[type=submit]) { justify-self: start; }
.km-form [aria-invalid=true] { border-color: #a22232 !important; }
.km-table-scroll { width: 100%; overflow-x: auto; }
.km-table-scroll table { width: 100%; border-collapse: collapse; }
.km-table-scroll :is(th,td) { padding: .7rem .6rem; text-align: start; border-bottom: 1px solid var(--km-line); }
.km-table-scroll th { color: var(--km-muted); font-weight: 600; }
.km-note { padding: .7rem 1rem; border-inline-start: .2rem solid var(--km-brand); background: var(--km-tint); }
.km-footer { margin-block-start: 2.5rem; padding-block: 1.5rem; border-top: 1px solid var(--km-line); }
.km-footer .km-wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.km-shell .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 52rem) {
  .km-header .km-search { flex-basis: 100%; order: 2; }
  .km-header .km-nav { margin-inline-start: auto; }
  .km-catalog,
  .km-product { grid-template-columns: minmax(0, 1fr); }
  .km-hero::after,
  .store-page-home .home-hero:not(:has(.hero-media-link))::after { right: 6%; width: 15vw; }
}
@media (max-width: 680px) {
  .km-filters .catalog-filter-apply { position: static; width: 100%; margin-block: .25rem; }
}

@media (max-width: 36rem) {
  .km-nav { gap: .4rem .7rem; font-size: .9rem; }
  .km-hero { padding: 1.4rem; }
  .km-hero h1,
  .store-page-home .home-hero:not(:has(.hero-media-link)) h1 { font-size: 2rem; max-width: 100%; }
  .store-page-home .home-hero:not(:has(.hero-media-link)) .hero-content { width: 100%; padding: 1.5rem; }
  .km-hero p { max-width: 100%; }
  .km-hero::after,
  .store-page-home .home-hero:not(:has(.hero-media-link))::after { display: none; }
  .km-grid,
  .km-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .km-categories a { min-height: 3.8rem; padding: .65rem; flex-wrap: wrap; font-size: .93rem; }
  .km-card { padding: .65rem; }
  .km-card :is(h2, h3) { font-size: .94rem; }
  .km-card .km-btn { padding-inline: .5rem; }
}

@media (max-width: 20rem) {
  .km-grid,
  .km-categories { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .km-header, .km-footer, .km-pagination, .km-filters { display: none; }
  .km-wrap { width: 100%; }
  .km-shell { color: #000; background: #fff; }
}

.km-shell main {padding-block:1.75rem} .km-shell table{width:100%;border-collapse:collapse}.km-shell th,.km-shell td{padding:.65rem .5rem;text-align:left;border-bottom:1px solid #e6deed}.km-shell form{margin-block:.65rem}.km-shell fieldset{min-width:0}.km-shell dl{display:grid;grid-template-columns:minmax(8rem,1fr) 2fr;gap:.45rem 1rem}.km-shell dd{margin:0}.km-shell img{max-width:100%}.km-mobile-filter{display:none}.shop-gallery{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem}.shop-gallery a:first-child{grid-column:1/-1}.shop-gallery img{width:100%;object-fit:contain;aspect-ratio:4/3}.km-shell dialog{width:min(92vw,65rem);max-height:92dvh;border:0;border-radius:1rem}.km-shell dialog img{display:block;width:100%;object-fit:contain;height:72vh}.km-shell dialog::backdrop{background:#211829b8}.km-shell [role=alert]{white-space:pre-line;color:#94213a}.km-panel{margin-block:1rem}.km-shell .km-card img{height:9.5rem;object-fit:contain}
@media(max-width:680px){.km-mobile-filter{display:inline-flex!important}.km-shell #shop-filters{display:none}.km-shell #shop-filters.is-open{display:block}.km-shell .km-catalog{display:block}.km-shell table{font-size:.875rem}.km-shell .km-panel{max-width:100%;overflow:auto}}

.km-category-cover{display:block;width:100%;height:100px;object-fit:contain;margin-bottom:.6rem}

/* Личный кабинет */
.km-auth{max-width:29rem;margin:clamp(2rem,8vw,7rem) auto;padding:clamp(1.3rem,4vw,2.4rem);box-shadow:0 12px 45px #2719330c;border-top:4px solid #6c355d}.km-auth h1,.km-account-head h1{letter-spacing:-.04em;margin:0 0 1.25rem}.km-auth .km-form,.km-profile .km-form{display:grid;grid-template-columns:1fr;gap:1rem}.km-auth .km-form input{width:100%;min-height:44px}.km-auth button{min-height:44px}.km-auth-links,.km-auth-back{display:flex;justify-content:space-between;margin-top:1.35rem;gap:1rem}.km-account-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:2.5rem 0 1.35rem}.km-account-head h1{margin-bottom:.4rem}.km-account-head p{margin:0}.km-account-head .km-form{margin:0;display:block}.km-logout{background:white!important;color:#572746!important;border:1px solid #d5c7d0!important}.km-account-nav{display:flex;flex-wrap:wrap;gap:.45rem;padding:.45rem;border:1px solid #ddd6df;border-radius:14px;background:#fff;margin-bottom:1.8rem}.km-account-nav a{border-radius:9px;padding:.65rem .95rem;text-decoration:none;color:#372934;font-weight:600}.km-account-nav a[aria-current=page]{background:#602e56;color:white}.km-admin-hub{margin:1rem 0 2rem}.km-admin-hub>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:.8rem}.km-admin-hub a{background:#fff;text-decoration:none;border:1px solid #e0d9e3;border-radius:14px;padding:1.1rem;display:grid;gap:.55rem;align-content:start}.km-admin-hub a:hover,.km-account-nav a:hover{box-shadow:inset 0 0 0 1px #88547c}.km-admin-hub a strong{color:#4b2743}.km-admin-hub a span{color:#615965;font-size:.94rem;line-height:1.4}.km-profile{max-width:40rem}.km-profile dt{font-weight:600}.km-profile dd{margin:0 0 1rem}.km-auth input:focus-visible,.km-account-nav a:focus-visible,.km-admin-hub a:focus-visible{outline:3px solid #7d4771;outline-offset:3px}@media(max-width:600px){.km-account-head{align-items:flex-start}.km-account-nav a{padding:.55rem .65rem}.km-admin-hub>div{grid-template-columns:1fr 1fr}.km-admin-hub a{padding:.85rem}.km-auth{margin:1.5rem auto}}
