body:has(#shop .drawer.open, #shop .pmodal.open) { overflow: hidden; }

@scope (#shop) {
:scope {
  color-scheme: dark;
  --bg: #141311;
  --bg2: #1b1915;
  --card: #1e1c18;
  --surface: #26231e;
  --border: #39342b;
  --gold: #e7ba69;
  --gold2: #f1d7a4;
  --gold-dim: #8d7046;
  --text: #f2eee5;
  --muted: #b6ad9e;
  --ok: #9bd1a7;
  --bad: #ff9b96;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
:scope {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { line-height: 1.18; }
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.wrap {
  width: min(100%, 1200px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Навигация */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #141311f5;
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .13em;
  text-decoration: none;
  white-space: nowrap;
}
.logo .gem { color: var(--gold); font-size: 14px; }
.links { display: flex; align-items: center; gap: clamp(14px, 2.3vw, 28px); margin-left: auto; }
.links a {
  padding-block: 8px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.links a:hover { color: var(--gold2); }
.cart-btn, .btn-ghost, .btn-line, .add-btn, .btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.cart-btn:hover, .btn-ghost:hover, .btn-line:hover, .add-btn:hover {
  background: #302a20;
  border-color: var(--gold-dim);
}
.cart-count {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding-inline: 5px;
  border-radius: 5px;
  background: #3b3020;
  color: var(--gold2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #20180d;
}
.btn-gold:hover { background: var(--gold2); border-color: var(--gold2); }

/* Главный экран */
.hero { padding-top: 26px; }
.hero-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(30px, 4vw, 44px) clamp(30px, 5vw, 64px);
  border: 1px solid #463b2b;
  border-radius: 14px;
  background: linear-gradient(110deg, #231e17 35%, #32281b);
}
.hero-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 52%;
  background:
    linear-gradient(45deg, transparent 49%, #e7ba6924 50%, transparent 51%) 0 0 / 48px 48px,
    linear-gradient(-45deg, transparent 49%, #e7ba6924 50%, transparent 51%) 0 0 / 48px 48px;
  mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.hero-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: clamp(92px, 15vw, 174px);
  aspect-ratio: 1;
  right: 14%;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  border: 1px solid #e7ba6945;
  outline: 1px solid #e7ba692b;
  outline-offset: 12px;
  background: linear-gradient(135deg, #e7ba6919, #e7ba6905);
}
.hero .kicker {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}
.shop-title {
  color: var(--text);
  font-size: clamp(44px, 8vw, 84px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -.045em;
}
.hero p {
  max-width: 460px;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(14px, 1.8vw, 16px);
}
.hero-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-btns > * { min-height: 46px; }
.btn-ghost { background: #1c1915; color: var(--gold2); font-variant-numeric: tabular-nums; }

/* Каталог */
.catalog > section { padding-block: 30px 36px; }
.catalog > section + section { padding-top: 4px; }
.sec-head { margin-bottom: 20px; }
.sec-head h2 {
  color: var(--text);
  font-size: clamp(27px, 4vw, 36px);
  font-weight: 750;
  letter-spacing: -.035em;
}
.sec-head p { max-width: 690px; margin-top: 7px; color: var(--muted); }
.grid, .steps { display: grid; gap: 14px; }
.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ranks-grid, #relicsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card, .step {
  min-width: 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.card[data-product="sponsor"] { background: #252017; border-color: #655033; }
.card:hover, .card:focus-within { border-color: var(--gold-dim); }
.card-labels { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; }
.card-labels:not(:empty) { margin-bottom: 11px; }
.ranks-grid .card-labels { min-height: 23px; margin-bottom: 11px; }
.badge, .inq {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 4px;
  background: #352c1e;
  color: var(--gold2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
}
.inq { background: #26342a; color: var(--ok); }
.card h3 { font-size: clamp(19px, 2vw, 22px); letter-spacing: -.025em; }
.product-title {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}
.product-title:hover { color: var(--gold2); }
.tagline, .pm-tag { margin-top: 6px; color: var(--muted); font-size: 14px; }
.card ul, .pm-feats { list-style: none; padding: 0; margin-block: 15px 17px; }
.card ul { flex: 1; }
.card li, .pm-feats li {
  display: flex;
  gap: 9px;
  padding-block: 3px;
  font-size: 13.5px;
}
.card li::before, .pm-feats li::before { content: "✓"; color: var(--gold); }
.card .bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}
.price { color: var(--gold); font-size: 23px; font-weight: 750; line-height: 1.2; }
.price.small { color: var(--gold2); font-size: 14px; font-weight: 650; }
.add-btn { background: #33291b; border-color: #59452c; color: var(--gold2); }
.add-btn.done { color: var(--ok); cursor: default; }

/* Покупка, вопросы и контакты */
.steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step .num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 13px;
  border: 1px solid #57452e;
  border-radius: 6px;
  color: var(--gold2);
  font-size: 13px;
  font-weight: 700;
}
.step h3 { margin-bottom: 6px; font-size: 16px; }
.step p, details p { color: var(--muted); font-size: 14px; }
#faq { display: grid; grid-template-columns: minmax(155px, 1fr) minmax(0, 3fr); gap: 20px; padding-bottom: 52px; }
.faq { border-top: 1px solid var(--border); }
details { border-bottom: 1px solid var(--border); }
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--gold); font-size: 19px; line-height: 1; }
details[open] summary::after { content: "−"; }
summary:hover { color: var(--gold2); }
details p { padding: 0 24px 14px 4px; }
footer { padding-block: 28px; background: var(--bg2); border-top: 1px solid var(--border); }
.foot-about { max-width: 690px; margin-bottom: 22px; }
.foot-about h3 { font-size: 18px; margin-bottom: 8px; }
.foot-about p, .foot { color: var(--muted); font-size: 13px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.foot .mono { color: var(--gold2); white-space: nowrap; }

/* Корзина и карточка товара */
.backdrop, .pbackdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  visibility: hidden;
  opacity: 0;
  background: #090806bd;
  transition: opacity .2s, visibility .2s;
}
.backdrop.open, .pbackdrop.open { visibility: visible; opacity: 1; }
.pbackdrop { z-index: 105; }
.drawer, .pmodal {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  visibility: hidden;
  box-shadow: 0 15px 48px #0006;
}
.drawer {
  inset: 0 0 0 auto;
  z-index: 100;
  width: min(100%, 430px);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s, visibility .22s;
}
.drawer.open { visibility: visible; transform: none; }
.pmodal {
  inset: 50% auto auto 50%;
  z-index: 110;
  width: min(510px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 23px;
  overflow: auto;
  border-radius: 14px;
  opacity: 0;
  transform: translate(-50%, -48%);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.pmodal.open { visibility: visible; opacity: 1; transform: translate(-50%, -50%); }
.x {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.x:hover { color: var(--text); border-color: var(--gold-dim); }
.pmodal .x { position: absolute; top: 12px; right: 12px; }
.pm-name { padding-right: 38px; font-size: 24px; }
.pm-priceline { margin-bottom: 12px; }
.pm-count, .pm-note {
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
}
.pm-count { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pm-count .q { min-width: 34px; }
.pm-sum { color: var(--gold); font-size: 15px; font-weight: 700; white-space: nowrap; }
.pm-cap { color: var(--muted); margin-bottom: 10px; font-size: 12.5px; }
.pm-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-btns button { flex: 1 1 125px; }
.drawer-head, .drawer-body, .drawer-foot { padding: 16px 20px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 22px; }
.drawer-body { flex: 1; overflow: auto; }
.drawer-foot { max-height: 70%; overflow: auto; border-top: 1px solid var(--border); }
.drawer-foot:empty { display: none; }
.citem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 11px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.citem .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.citem .nm b { display: block; }
.citem .pr { color: var(--gold); font-weight: 650; text-align: right; white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 5px; }
.qty button {
  width: 34px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  font-size: 18px;
  cursor: pointer;
}
.qty button:hover:not(:disabled) { border-color: var(--gold-dim); }
.qty button:disabled { opacity: .38; cursor: default; }
.qty .q { min-width: 18px; text-align: center; font-size: 13px; font-weight: 650; white-space: nowrap; }
.qty.oncard .q { padding-inline: 3px; }
.rm { display: block; padding: 2px 0; border: 0; background: none; color: var(--bad); font-size: 12px; cursor: pointer; }
.total-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 10px; font-weight: 700; }
.total-row span:last-child { color: var(--gold); font-size: 22px; }
.field { margin-bottom: 10px; }
.field label, .hint, .field .err { color: var(--muted); font-size: 12px; }
.field label { display: block; margin-bottom: 4px; }
.field input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
.field input:focus { border-color: var(--gold-dim); }
.field .err { display: none; margin-top: 4px; color: var(--bad); }
.hint { margin-top: 7px; }
.empty, .success { padding: 24px 0; text-align: center; color: var(--muted); }
.success .ok-ring { color: var(--ok); font-size: 28px; }
.success h3 { margin-top: 7px; color: var(--text); font-size: 24px; }
.success .onum { margin-block: 8px; color: var(--gold); font-weight: 700; }
.success p { margin-bottom: 7px; font-size: 14px; }
.success button { margin-top: 7px; }
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 120;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 11px 15px;
  border: 1px solid #5c4b32;
  border-radius: 8px;
  background: var(--surface);
  color: var(--gold2);
  box-shadow: 0 8px 24px #0006;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 1180px) {
  .ranks-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 14px;
    padding-block: 8px 4px;
  }
  .cart-btn { grid-area: 1 / 2; }
  .links { grid-column: 1 / -1; margin-left: 0; gap: 17px; overflow: auto; scrollbar-width: thin; }
  .grid, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-panel::after { right: 12%; }
}
@media (max-width: 590px) {
  .hero { padding-top: 18px; }
  .hero-panel { padding: 23px; }
  .hero-panel::before { inset-inline-start: 42%; }
  .hero-panel::after { right: -55px; opacity: .48; }
  .hero-btns { margin-top: 18px; }
  .catalog > section { padding-bottom: 26px; }
  .grid, #relicsGrid, .steps, #faq { grid-template-columns: minmax(0, 1fr); }
  #faq { gap: 0; padding-bottom: 30px; }
  .card, .step { padding: 16px; }
  .ranks-grid .card-labels:empty { display: none; }
  .card ul { margin-block: 11px 13px; }
  .links { gap: 14px; }
  .links a { font-size: 13px; }
  .step .num { float: left; margin: 0 10px 0 0; }
  .step h3, .step p { margin-left: 40px; }
}
@media (max-width: 360px) {
  .links { gap: 10px; }
  .links a { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.catalog > section { scroll-margin-top: 98px; }
@media (max-width: 850px) {
  .catalog > section { scroll-margin-top: 114px; }
}
}
