/* Paper and Silk · новый вид рабочих страниц магазина (оформление и оплата, вход и кабинет, отслеживание, контакты).
   Механика страниц прежняя; сверху и снизу — шапка и подвал нового сайта (legacy.js), всё остальное перекрашено
   под «Лист и шёлк»: бумага, чернила, шёлк; Cormorant Garamond — заголовки, Manrope — текст. Подключает nginx (блок PSNEW). */

:root, html[data-theme], html[data-theme="graphite"], html[data-theme="night"] {
  --paper: #F6F2EE; --paper-2: #EFE8E0; --sheet: #FBF8F4;
  --ink: #2E251C; --ink-2: #5B4F44; --ink-3: #7A6656;
  --silk: #C9B09A; --silk-2: #A48D7B; --rule: rgba(164, 141, 123, .38); --rule-2: rgba(164, 141, 123, .62);
  --wax: #8E3B2E; --wax-soft: #F3E3DC;
  --satin: linear-gradient(90deg, #A8907A, #E9DCCF 22%, #BCA48E 42%, #F0E5DA 63%, #AE9680 82%, #DCCBBB);
  --display: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gut: clamp(16px, 4vw, 56px); --maxw: 1360px; --hdr: 68px;
  /* переменные магазина → палитра нового сайта */
  --bg: #F6F2EE; --surface: #FBF8F4; --warm-gray: #EFE8E0; --border: #DCCFC2; --border-light: #E8DED3;
  --text: #2E251C; --text-soft: #5B4F44; --text-muted: #7A6656; --gold: #8E3B2E; --gold-light: #F3E3DC; --accent: #A48D7B;
  --color-white: #FBF8F4; --color-black: #2E251C; --color-dark: #2E251C; --color-text: #2E251C; --color-bg: #F6F2EE; --color-warm-bg: #EFE8E0;
  --font-sans: 'Manrope', system-ui, sans-serif; --ps-nav-bg: rgba(246, 242, 238, .92);
  color-scheme: light;
}

/* старые шапка и подвал магазина не показываются */
body > nav.sticky, body > footer:not(#psx-foot) { display: none !important; }
html:not(.psx-done) body { padding-top: 112px; }
@media (max-width: 760px) { html:not(.psx-done) body { padding-top: 96px; } }

html.psx, html.psx body { background: var(--paper) !important; }
html.psx body { color: var(--ink); font-family: var(--ui) !important; -webkit-font-smoothing: antialiased; }
html.psx ::selection { background: rgba(201, 176, 154, .45); }

/* ——— шапка нового сайта ——— */
#psx-top { position: sticky; top: 0; z-index: 60; font-family: var(--ui); }
#psx-top a { color: inherit; text-decoration: none; }
#psx-top .wrap, #psx-foot .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
#psx-top .realm { display: flex; justify-content: center; gap: 4px 34px; flex-wrap: wrap; padding: 9px 16px 7px; background: var(--paper);
  font: 500 11.5px/1.2 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--rule); }
#psx-top .realm a { position: relative; padding-bottom: 6px; }
#psx-top .realm a:hover, #psx-top .realm .on { color: var(--ink); }
#psx-top .realm .on::after { content: ""; position: absolute; left: 0; right: .2em; bottom: 0; height: 2px; border-radius: 2px; background: var(--satin); }
#psx-top .hdr { background: rgba(246, 242, 238, .92); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); transition: box-shadow .3s; }
#psx-top.stuck .hdr { box-shadow: 0 1px 0 var(--rule); }
#psx-top .hdr .wrap { height: var(--hdr); display: flex; align-items: center; gap: clamp(14px, 2.4vw, 36px); }
#psx-top .nav { display: flex; gap: clamp(14px, 2vw, 28px); margin-left: 8px; }
#psx-top .nav a { position: relative; font-weight: 500; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
#psx-top .nav a:hover, #psx-top .nav a.on { color: var(--ink); }
#psx-top .nav a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--satin); }
#psx-top .tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
#psx-top .ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); position: relative; background: none; border: 0; cursor: pointer; }
#psx-top .ic:hover { background: var(--paper-2); }
#psx-top .ic svg { width: 20px; height: 20px; }
#psx-top .badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--wax); color: #fff; font: 600 10.5px/18px var(--ui); text-align: center; transform: scale(0); transition: transform .3s var(--ease); }
#psx-top .badge.on { transform: scale(1); }
#psx-top .langs { display: flex; gap: 2px; margin-right: 4px; }
#psx-top .langs a { font: 600 11.5px/1 var(--ui); letter-spacing: .08em; color: var(--ink-3); padding: 8px 5px; position: relative; }
#psx-top .langs a:hover, #psx-top .langs a[aria-current="true"] { color: var(--ink); }
#psx-top .langs a[aria-current="true"]::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--satin); }
#psx-top .burger { display: none; }
#psx-top .menu { display: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand-mk { width: auto; height: 40px; display: block; }
.brand-w { display: flex; flex-direction: column; gap: 5px; line-height: 1; }
.brand-w b { font: 500 21px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.brand-w b i { font-style: normal; font-size: .6em; letter-spacing: .16em; margin: 0 .5em 0 .55em; vertical-align: .08em; }
.brand-w small { font: 500 9.5px/1 var(--ui); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); }
.brand-w small::before { content: ""; display: inline-block; width: 18px; height: 1px; margin: 0 8px 3px 0; vertical-align: middle; background: var(--satin); }
@media (max-width: 1100px) { #psx-top .nav { display: none; } #psx-top .burger { display: grid; } }
@media (max-width: 760px) {
  #psx-top .brand-mk { height: 30px; } #psx-top .brand-w b { font-size: 15px; letter-spacing: .1em; } #psx-top .brand-w small { display: none; }
  #psx-top .tools .langs { display: none; } #psx-top .hdr .wrap { gap: 8px; }
}
#psx-top.open .menu { display: flex; flex-direction: column; gap: 4px; padding: 10px var(--gut) 16px; border-top: 1px solid var(--rule); background: var(--paper); }
#psx-top .menu > a { font: 500 16px/1.2 var(--ui); padding: 10px 0; border-bottom: 1px solid var(--rule); }
#psx-top .menu .langs { display: flex; margin-top: 8px; }

/* ——— подвал нового сайта ——— */
#psx-foot { margin-top: 40px; border-top: 1px solid var(--rule); padding: 48px 0 28px; font: 400 14px/1.6 var(--ui); color: var(--ink-2); background: var(--paper); }
#psx-foot a { color: inherit; text-decoration: none; display: block; padding: 4px 0; }
#psx-foot a:hover { color: var(--ink); }
#psx-foot .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
#psx-foot h5 { margin: 0 0 14px; font: 600 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
#psx-foot .mono { font-family: var(--mono); font-size: .86em; }
#psx-foot .brand-mk { height: 46px; }
#psx-foot .legal { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }
#psx-foot .big { font: 400 clamp(56px, 11vw, 160px)/.8 var(--display); color: var(--paper-2); letter-spacing: -.02em; margin-top: 26px; white-space: nowrap; overflow: hidden; }
#psx-foot .big i { font-style: normal; font-size: .42em; letter-spacing: .12em; vertical-align: .18em; }
@media (max-width: 860px) { #psx-foot .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { #psx-foot .cols { grid-template-columns: 1fr; } }

/* ——— содержимое страниц: «Лист и шёлк» ——— */
html.psx main { background: var(--paper) !important; }
html.psx h1, html.psx h2, html.psx h3, html.psx [style*="Playfair"] { font-family: var(--display) !important; letter-spacing: 0 !important; color: var(--ink); }
html.psx h1 { font-weight: 400 !important; font-size: clamp(38px, 5vw, 62px) !important; line-height: 1.04 !important; }
html.psx h2, html.psx h3 { font-weight: 500 !important; }
html.psx main h1::after { content: ""; display: block; width: 64px; height: 2px; margin: 16px 0 0; border-radius: 2px; background: var(--satin); }
html.psx main .text-center h1::after, html.psx main h1.text-center::after { margin-left: auto; margin-right: auto; }
html.psx .bg-white, html.psx button.bg-white, html.psx a.bg-white, html.psx [style*="background:#fff"] { background-color: var(--sheet) !important; }
html.psx .rounded-xl, html.psx .rounded-2xl { border-radius: 14px !important; }
html.psx main .border, html.psx main [class*="border-[var(--border"] { border-color: var(--rule) !important; }
html.psx .shadow-xl, html.psx .shadow-lg, html.psx .shadow-md, html.psx .shadow-sm, html.psx .shadow { box-shadow: 0 1px 0 var(--rule), 0 24px 48px -32px rgba(46, 37, 28, .35) !important; }
html.psx input, html.psx select, html.psx textarea { font-family: var(--ui) !important; color: var(--ink); }
html.psx input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), html.psx select, html.psx textarea {
  background-color: var(--sheet) !important; border: 1px solid var(--rule-2) !important; border-radius: 10px !important; }
html.psx input:focus, html.psx select:focus, html.psx textarea:focus { outline: none !important; border-color: var(--ink) !important; box-shadow: 0 0 0 3px rgba(201, 176, 154, .3) !important; }
html.psx input[type="checkbox"], html.psx input[type="radio"] { accent-color: var(--ink); }
html.psx label, html.psx .uppercase { letter-spacing: .12em; }
/* главные кнопки — чернила, как «В корзину» на новом сайте */
html.psx main .bg-dark, html.psx main button.bg-\[var\(--text\)\], html.psx main a.bg-\[var\(--text\)\], html.psx main button[type="submit"]:not(.bg-white) {
  background-color: var(--ink) !important; color: var(--paper) !important; border-radius: 999px !important; font-family: var(--ui) !important; font-weight: 600 !important; }
html.psx main .bg-dark:hover, html.psx main button[type="submit"]:hover { background-color: #3d3226 !important; }
html.psx .text-white { color: var(--paper) !important; }
html.psx .bg-\[var\(--gold-light\)\], html.psx .bg-blue-50, html.psx .bg-amber-50, html.psx .bg-yellow-50, html.psx .bg-orange-50, html.psx .bg-sky-50, html.psx a.bg-green-50 {
  background-color: var(--wax-soft) !important; border-color: var(--rule) !important; color: var(--ink) !important; }
html.psx .text-\[var\(--gold\)\] { color: var(--wax) !important; }
html.psx .text-blue-700, html.psx .text-blue-800, html.psx .text-amber-700, html.psx .text-amber-800, html.psx .text-yellow-800, html.psx .text-orange-700 { color: var(--ink-2) !important; }
html.psx main a:not([class*="bg-"]):not([class*="rounded"]) { text-decoration-color: var(--silk-2); text-underline-offset: 3px; }
/* цены и суммы — цифры как на новом сайте */
html.psx main .tabular-nums, html.psx main [class*="tabular"] { font-variant-numeric: tabular-nums; }
#ps-wtu-root, #ps-wtu-root * { font-family: var(--ui) !important; }

/* подпись к названию — «штамп» (выбор владельца 18.11): слово в рамке оттиска, сургучные чернила, чуть наискосок; при появлении и наведении «ставится» */
.brand-w small { align-self: flex-start; font: 700 9.5px/1 var(--ui); letter-spacing: .3em; text-transform: uppercase; color: var(--wax);
  padding: 4px 7px 4px 9px; border: 1.5px solid var(--wax); border-radius: 3px; transform: rotate(-4deg); opacity: .88;
  -webkit-mask: radial-gradient(circle at 30% 40%, #000 60%, rgba(0, 0, 0, .78) 61%); mask: radial-gradient(circle at 30% 40%, #000 60%, rgba(0, 0, 0, .78) 61%);
  }
.brand-w small::before { content: none; display: none; }
/* на рабочих страницах магазина штамп неподвижен */
@keyframes psStamp { 0% { opacity: 0; transform: rotate(-12deg) scale(1.9); } 70% { opacity: .95; transform: rotate(-3deg) scale(.94); } 100% { opacity: .88; transform: rotate(-4deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .brand-w small, .brand:hover .brand-w small { animation: none; } }

/* DRP-194, 18.11: оформление до оживления страницы — сервер отдаёт «Ваша корзина пуста» (корзину магазин читает уже в браузере, через секунды).
   Пока страница не ожила (класс psx-hyd ставит legacy.js), эту заглушку не показываем — вместо неё кружок загрузки. Пустая корзина после оживления видна как обычно. */
html:not(.psx-hyd) main > .max-w-md.text-center:has(> a[href$="/catalog"]) { visibility: hidden; }
html:not(.psx-hyd) main:has(> .max-w-md.text-center > a[href$="/catalog"]) { position: relative; }
html:not(.psx-hyd) main:has(> .max-w-md.text-center > a[href$="/catalog"])::before { content: ""; position: absolute; left: 50%; top: 96px; width: 30px; height: 30px; margin-left: -15px;
  border: 2px solid rgba(46, 37, 28, .15); border-top-color: var(--ink); border-radius: 50%; animation: psxSpin .8s linear infinite; }
@keyframes psxSpin { to { transform: rotate(360deg); } }
/* оформление: цена позиции изменилась — полоса перед перезагрузкой страницы */
#psxNote { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 9999; max-width: min(92vw, 560px); padding: 14px 20px; border-radius: 12px; background: #2E251C; color: #FBF8F2; font: 500 15px/1.35 Manrope, system-ui, sans-serif; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }

/* переход на другую страницу: полоска загрузки сверху, страница приглушена, пока грузится следующая */
#psxLoad { position: fixed; left: 0; top: 0; z-index: 2147483000; height: 3px; width: 0; opacity: 0; pointer-events: none; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #A8907A, #8E3B2E); box-shadow: 0 0 10px rgba(142, 59, 46, .35); }
#psxLoad.go { opacity: 1; width: 88%; transition: width 9s cubic-bezier(.08, .82, .17, 1), opacity .1s; }
#psxLoad.end { opacity: 0; width: 100%; transition: width .2s ease, opacity .35s ease .15s; }
html.psx-leaving main, html.psx-leaving #main { opacity: .45; transition: opacity .25s ease .06s; }
html.psx-leaving body { cursor: progress; }

/* логотип «Гравировка» (выбор владельца 22.11) — как в каталоге: знак, тонкая черта, PAPER and SILK; без штампа */
.brand-rl { flex: none; width: 1px; height: 29px; background: var(--rule-2); }
.brand-w { gap: 0; }
.brand-w b { font: 400 18.5px/1 'PS Brand', 'Marcellus', Georgia, serif; letter-spacing: .17em; text-transform: uppercase; color: var(--ink); padding-top: 1.5px;
  background: none; -webkit-background-clip: border-box; background-clip: border-box; -webkit-text-fill-color: var(--ink); animation: none; }
.brand:hover .brand-w b { animation: none; }
.brand-w b i { font: italic 500 1.14em/1 'PS Brand', var(--display); letter-spacing: .01em; text-transform: none; color: var(--silk-2); -webkit-text-fill-color: var(--silk-2); margin: 0 .3em 0 .12em; vertical-align: baseline; padding: 0; }
.brand-w small { display: none; }
#psx-foot .brand-rl { height: 34px; }
@media (max-width: 760px) { #psx-top .brand { gap: 9px; } #psx-top .brand-rl { height: 22px; } #psx-top .brand-w b { font-size: 14px; letter-spacing: .17em; } }
@media (max-width: 400px) { #psx-top .brand { gap: 7px; } #psx-top .brand-mk { height: 28px; } #psx-top .brand-rl { height: 20px; } #psx-top .brand-w b { font-size: 12px; letter-spacing: .14em; } #psx-top .brand-w b i { margin: 0 .28em 0 .1em; } }
@media (max-width: 350px) { #psx-top .brand { gap: 6px; } #psx-top .brand-mk { height: 26px; } #psx-top .brand-rl { display: none; } #psx-top .brand-w b { font-size: 10px; letter-spacing: .08em; } }
/* кружок «Напишите нам» (DRP-157, партнёрский): его стили вставляет скрипт уже после загрузки (style#ps-wtu-style), а разметка приходит с сервера —
   до этого подсказка на миг видна простым текстом под шапкой (/track, /account; жалоба владельца 22.11). Прячем до появления его стилей, потом он как был. */
html:not(:has(#ps-wtu-style)) #ps-wtu-root { display: none !important; }
