:root {
  --ink: #111;
  --ink-2: #5d5953;
  --ink-3: #9a958d;
  --paper: #fff;
  --paper-2: #f5f2ed;
  --line: #e4dfd7;
  --sale: #b3261e;
  --glass: rgba(255, 255, 255, .86);
  --shadow: 0 18px 50px rgba(20, 16, 10, .18);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e9e4dc; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene.is-drag { cursor: grabbing; }
#scene.is-point { cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--ink); font-weight: 600; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; transition: transform .15s, background .15s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: default; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover:not(:disabled) { background: #2b2925; }
.btn--line { background: transparent; }
.btn--line:hover { background: var(--paper-2); }
.grow { flex: 1; }
.x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper-2); font-size: 14px; flex: none; }
.x:hover { background: var(--line); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 4px 18px rgba(0,0,0,.08); font-weight: 600; font-size: 13px; }
.chip:hover { background: #fff; }
.chip--cart b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 12px; display: grid; place-items: center; }
.chip--cart.bump { animation: bump .45s; }
@keyframes bump { 30% { transform: scale(1.12); } }

/* Loader — окно входа в форме арки зала: розовый лак, рифлёные рейки, золотая кромка */
.loader {
  --lacquer: #f3a6b4; --blush: #fbe4e8; --petal: #f6c4cd; --gold: #c9a14c; --rose: #5c1f33; --rose-2: #94506a;
  --arch-w: min(440px, calc(100vw - 32px));
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(110% 80% at 50% 35%, rgba(255, 244, 246, .5), rgba(232, 205, 212, .88));
  backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1); transition: opacity .6s;
}
.loader.is-out { opacity: 0; pointer-events: none; }
.loader__card {
  position: relative; isolation: isolate; width: var(--arch-w); text-align: center; color: var(--rose);
  padding: calc(var(--arch-w) * .3) 36px 30px;
  border-radius: calc(var(--arch-w) / 2) calc(var(--arch-w) / 2) 30px 30px;
  background: linear-gradient(#fff7f8, #fffdfc 55%);
  box-shadow: 0 30px 80px rgba(92, 31, 51, .22), 0 0 0 1px rgba(201, 161, 76, .35);
}
/* рейки арки — как стенка за кассой; к середине окна растворяются */
.loader__arch {
  position: absolute; inset: 12px 12px auto; height: calc(var(--arch-w) * .78); z-index: -1;
  border-radius: calc(var(--arch-w) / 2 - 12px) calc(var(--arch-w) / 2 - 12px) 0 0;
  background: repeating-linear-gradient(90deg, #f9d3da 0 2px, #fde9ec 8px, #f7c8d1 16px, #f2b5c1 18px);
  -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent);
}
.loader__arch::after { /* золотая кромка арки */
  content: ""; position: absolute; inset: 0; border: 1.5px solid var(--gold); border-bottom: 0; border-radius: inherit; opacity: .85;
}
.loader__logo { display: block; width: min(300px, 78%); height: auto; margin: 0 auto; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9)); }
.loader__title { font-family: var(--serif); font-weight: 600; font-size: 46px; line-height: 1; margin: 22px 0 0; letter-spacing: .01em; }
.loader__sub { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 20px; color: var(--rose-2); margin: 8px 0 0; }
.loader__progress { margin: 26px auto 18px; width: min(280px, 100%); }
.loader__bar { height: 2px; background: rgba(201, 161, 76, .22); border-radius: 2px; overflow: hidden; }
.loader__bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s; }
.loader__status { font-size: 12px; color: var(--rose-2); margin-top: 9px; font-variant-numeric: tabular-nums; }
.loader__enter {
  width: 100%; height: 54px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--rose); color: #fff6ef; font: 600 16px/1 var(--sans); letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(201, 161, 76, .55), 0 10px 24px rgba(92, 31, 51, .25);
  transition: background .2s, transform .15s, opacity .3s;
}
.loader__enter:hover:not(:disabled) { background: #74293f; }
.loader__enter:active:not(:disabled) { transform: scale(.985); }
.loader__enter:disabled { opacity: .4; cursor: default; box-shadow: inset 0 0 0 1px rgba(201, 161, 76, .4); }
.loader__enter:focus-visible, .seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.loader__keys { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid rgba(201, 161, 76, .3); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; font-size: 12.5px; line-height: 1.4; color: var(--rose-2); text-align: left; }
.loader__keys li { position: relative; padding-left: 14px; }
.loader__keys li::before { content: ""; position: absolute; left: 0; top: .5em; width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .loader, .loader__bar i, .loader__enter { transition: none; } }

/* HUD */
.hud-top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: max(14px, env(safe-area-inset-top)) 16px 0; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-top__left { display: flex; align-items: center; gap: 12px; }
.hud-logo { height: 34px; filter: drop-shadow(0 2px 6px rgba(255,255,255,.8)); }
.zonebar { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10; display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 6px 24px rgba(0,0,0,.1); }
.zonebar__btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; padding-bottom: 3px; }
.zonebar__btn:hover { background: var(--paper-2); }
.zonebar__label { min-width: 190px; text-align: center; display: grid; line-height: 1.15; }
.zonebar__label small { font-size: 10px; color: var(--ink-3); letter-spacing: .1em; }
.zonebar__label span { font-weight: 600; font-size: 14px; }
.hint { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); z-index: 9; background: var(--ink); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; animation: fadeUp .5s; }
@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 8px); } }
.tip { position: fixed; z-index: 9; pointer-events: none; background: #fff; border-radius: 10px; padding: 8px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.14); display: grid; gap: 2px; font-size: 12px; transform: translate(14px, 14px); }
.tip b { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .02em; }

/* Sheets */
.sheet { position: fixed; top: 0; bottom: 0; z-index: 30; width: min(400px, 100vw); background: var(--paper); box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 18px 20px; animation: slideIn .3s ease-out; }
.sheet--left { left: 0; --from: -30px; }
.sheet--right { right: 0; --from: 30px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(var(--from)); } }
.sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet__head h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin: 0; }
.search { height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 14px; background: var(--paper-2); outline: none; }
.search:focus { border-color: var(--ink); background: #fff; }
.dept-list { overflow: auto; margin: 12px -8px 0; padding: 0 8px; }
.dept { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 15px; font-weight: 500; }
.dept:hover { color: var(--ink-2); }
.dept small { color: var(--ink-3); font-size: 12px; }
.res { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.res img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--paper-2); }
.res b { display: block; font-size: 14px; }
.res span { font-size: 12px; color: var(--ink-2); }
.empty { color: var(--ink-3); font-size: 14px; padding: 24px 4px; }

/* Inspect */
.inspect { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.inspect > * { pointer-events: auto; }
.inspect__thumbs { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }
.thumb { width: 62px; height: 82px; padding: 0; border-radius: 10px; border: 2px solid transparent; overflow: hidden; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-on { border-color: #fff; outline: 2px solid var(--ink); }
.inspect__gallery { position: absolute; left: 104px; top: 50%; transform: translateY(-50%); width: min(46vw, 560px); aspect-ratio: 3 / 4; max-height: 82vh; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.inspect__gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inspect__modes { position: absolute; left: calc((100vw - min(400px, 36vw)) / 2); bottom: 26px; transform: translateX(-50%); display: flex; gap: 8px; }
.mode { height: 38px; padding: 0 18px; border-radius: 999px; border: 0; background: rgba(255,255,255,.85); font-weight: 600; font-size: 13px; }
.mode.is-on { background: #fff; outline: 2px solid var(--ink); }
.inspect__nav { position: absolute; top: 50%; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 28px; line-height: 1; padding-bottom: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.inspect__nav--prev { left: 100px; }
.inspect__nav--next { right: calc(min(400px, 36vw) + 44px); }
.panel { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: min(400px, 36vw); max-height: calc(100vh - 48px); overflow: auto; background: var(--paper); border-radius: 20px; padding: 28px 26px 22px; box-shadow: var(--shadow); animation: panelIn .35s ease-out; }
@keyframes panelIn { from { opacity: 0; transform: translate(24px, -50%); } }
.panel__x { position: absolute; top: 16px; right: 16px; }
.panel__eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding-right: 44px; }
.panel__name { font-family: var(--serif); font-weight: 600; font-size: 42px; line-height: .95; margin: 10px 0 6px; letter-spacing: .01em; }
.panel__sub { color: var(--ink-2); font-size: 14px; }
.panel__price { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 20px; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.panel__price s { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.panel__price em { font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: var(--sale); padding: 3px 7px; border-radius: 6px; align-self: center; }
.panel__label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.panel__label span { color: var(--sale); text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin-bottom: 18px; }
.size { height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.size:hover { border-color: var(--ink); }
.size.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.size.one { grid-column: 1 / -1; cursor: default; }
.sizes.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.panel__row { display: flex; gap: 10px; margin-bottom: 10px; }
.panel .btn--line { width: 100%; }
.qty { display: flex; align-items: center; height: 48px; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 40px; height: 100%; border: 0; background: none; font-size: 18px; }
.qty span { min-width: 18px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.panel__link { display: block; text-align: center; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.panel__keys { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); text-align: center; }

/* Cart */
.cart-items { flex: 1; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ci img { width: 64px; height: 85px; object-fit: cover; border-radius: 8px; background: var(--paper-2); }
.ci b { font-family: var(--serif); font-size: 20px; display: block; line-height: 1; }
.ci small { display: block; color: var(--ink-2); font-size: 12px; margin: 4px 0 8px; }
.ci .qty { height: 32px; width: max-content; }
.ci .qty button { width: 30px; font-size: 15px; }
.ci__price { text-align: right; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.ci__rm { display: block; margin-top: 10px; margin-left: auto; border: 0; background: none; color: var(--ink-3); font-size: 12px; text-decoration: underline; }
.cart-foot { padding-top: 14px; display: grid; gap: 12px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.cart-total b { font-size: 22px; font-variant-numeric: tabular-nums; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(20,16,10,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal__card { width: min(860px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); animation: panelIn2 .3s ease-out; }
@keyframes panelIn2 { from { opacity: 0; transform: translateY(14px); } }
.modal__card--sm { width: min(420px, 100%); text-align: center; padding: 36px 28px 28px; }
.modal__card--sm h2 { font-family: var(--serif); font-size: 40px; margin: 12px 0 6px; }
.modal__card--sm p { color: var(--ink-2); line-height: 1.5; margin: 0 0 22px; }
.success__logo { width: 220px; height: auto; }
.co-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.co-fields { display: grid; gap: 12px; align-content: start; }
.co-fields label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); }
.co-fields input:not([type=radio]) { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--ink); background: var(--paper-2); outline: none; }
.co-fields input:focus { border-color: var(--ink); background: #fff; }
.co-fields input.bad { border-color: var(--sale); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); margin-bottom: 6px; }
.co-fields .radio { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink); cursor: pointer; }
.co-fields .radio:has(input:checked) { border-color: var(--ink); background: var(--paper-2); }
.radio input { accent-color: var(--ink); margin: 0; }
.co-summary { background: var(--paper-2); border-radius: 16px; padding: 16px; display: grid; gap: 14px; align-content: start; }
.co-line { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.co-line img { width: 40px; height: 53px; object-fit: cover; border-radius: 6px; }
.co-line div { flex: 1; }
.co-line b { display: block; }
.co-line span { color: var(--ink-2); font-size: 12px; }
.co-note { margin: 0; font-size: 11px; color: var(--ink-3); line-height: 1.45; }
.co-error { color: var(--sale); font-size: 13px; margin: 0; }

.toast { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); animation: fadeUp .3s; max-width: calc(100vw - 32px); }

/* Mobile */
@media (max-width: 760px) {
  .hud-logo { height: 38px; }
  .chip span { display: none; }
  .zonebar__label { min-width: 150px; }
  .hint { bottom: 80px; white-space: normal; text-align: center; width: max-content; }
  .loader__keys { grid-template-columns: 1fr; }
  .loader__card { padding-left: 24px; padding-right: 24px; }
  .loader__title { font-size: 40px; }
  .panel { top: auto; bottom: 0; right: 0; left: 0; transform: none; width: 100%; max-height: 54vh; border-radius: 20px 20px 0 0; padding: 22px 18px calc(16px + env(safe-area-inset-bottom)); animation: none; }
  .panel__name { font-size: 34px; }
  .panel__keys { display: none; }
  .inspect__thumbs { left: 50%; top: 64px; transform: translateX(-50%); display: flex; }
  .thumb { width: 44px; height: 58px; }
  .inspect__gallery { left: 50%; top: 132px; transform: translateX(-50%); width: auto; height: calc(46vh - 140px); max-height: none; }
  .inspect__modes { left: 50%; bottom: calc(54vh + 10px); }
  .inspect__nav { top: 27vh; width: 40px; height: 40px; }
  .inspect__nav--prev { left: 12px; }
  .inspect__nav--next { right: 12px; }
  .co-grid { grid-template-columns: 1fr; }
}

/* Переключатели языка и валюты */
.hud-top__right { display: flex; align-items: center; gap: 10px; }
.locale { display: inline-flex; gap: 6px; }
.seg { display: inline-flex; height: 40px; padding: 4px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.seg button { min-width: 36px; height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: 600 12px/1 var(--sans); letter-spacing: .06em; cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.locale--loader { justify-content: center; margin-top: 14px; }
.chip { white-space: nowrap; }
@media (max-width: 900px) { .hud-top__left { gap: 8px; } .hud-logo { max-width: 22vw; } }
.locale--loader .seg { background: var(--blush); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.locale--loader .seg button { color: var(--rose-2); }
.locale--loader .seg button[aria-pressed="true"] { background: var(--rose); color: #fff6ef; }
@media (max-width: 640px) {
  .chip--cart > span { display: none; }
  .seg { height: 36px; } .seg button { min-width: 30px; height: 28px; padding: 0 8px; }
  .hud-top__right { gap: 6px; } .locale { gap: 4px; }
}
