/* Киоск-стилист Mango Look — редизайн «editorial». Portrait 1080×1920. */
:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #8c8c8c;
  --muted2: #b8b3ad;
  --line: #e7e4df;
  --accent: #a65a3c;        /* терракота */
  --dark: #101010;
  --dark-soft: #1b1b1b;
  --dark-ink: #f4f2ef;
  --dark-mut: #9a948d;
  --touch: 64px;
  --serif: "Times New Roman", "Georgia", serif;
  --sans: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  background: #c9c6c1;
  color: var(--ink);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}

/* рамка киоска 9:16 */
#frame {
  position: relative;
  width: min(100vw, 56.25vh);
  height: min(177.78vw, 100vh);
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
#app { position: absolute; inset: 0; display: flex; flex-direction: column; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: 3.4vh 6%; opacity: 0; transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease; pointer-events: none; background: var(--bg); }
.screen.active { opacity: 1; transform: none; pointer-events: auto; }

/* --- типографика --- */
.wordmark { font-family: var(--serif); font-weight: 700; letter-spacing: .16em;
  font-size: 2.5vh; text-transform: uppercase; }
.seclabel { font-family: var(--sans); font-size: 1.5vh; letter-spacing: .28em;
  text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 1.2vh; }
.qtitle { font-family: var(--sans); font-weight: 250; font-size: 5.2vh; line-height: 1.02;
  letter-spacing: -.01em; margin: 0 0 1vh; }
.qsub { font-family: var(--sans); color: var(--muted); font-size: 2vh; margin: 0 0 2.6vh; font-weight: 300; }
.steplabel { font-size: 1.6vh; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* кнопки: прямоугольные, uppercase */
.btn { min-height: var(--touch); border-radius: 2px; padding: 0 3vh;
  font-size: 1.9vh; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  border: 1px solid var(--ink); background: var(--bg); color: var(--ink);
  transition: transform .08s ease, background .15s ease, color .15s ease;
  display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary[disabled] { background: #cfccc7; border-color: #cfccc7; color: #fff; pointer-events: none; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 5vh; padding: 0 2vh; font-size: 1.5vh; }
.btn.big { min-height: 8vh; font-size: 2.1vh; width: 100%; }

.hidden { display: none !important; }

/* --- header анкеты --- */
.top { display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 2.4vh; border-bottom: 1px solid var(--line); margin-bottom: 3vh; }
.top .right { display: flex; align-items: center; gap: 2vh; }
.progress { height: 2px; background: var(--line); margin: -1px 0 3vh; position: relative; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .35s ease; }

/* --- attract --- */
#attract { align-items: center; justify-content: center; text-align: center; padding: 8% 6%; }
#attract .wordmark { font-size: 5vh; letter-spacing: .2em; margin-bottom: 3vh; }
#attract h1 { font-family: var(--sans); font-weight: 250; font-size: 6vh; line-height: 1.03;
  letter-spacing: -.01em; margin: 0 0 1.5vh; }
#attract .lead { color: var(--muted); font-size: 2.2vh; font-weight: 300; margin-bottom: 6vh; }
.langbar { display: flex; gap: 1.4vh; flex-wrap: wrap; justify-content: center; }
.pulse { margin-top: 6vh; font-size: 1.7vh; letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .45 } 50% { opacity: 1 } }

/* --- сетка карточек --- */
.grid { display: grid; gap: 1.6vh; grid-template-columns: 1fr 1fr;
  grid-auto-rows: max-content; align-content: start; overflow-y: auto; padding-bottom: 1vh; }
.grid.one { grid-template-columns: 1fr; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 2px;
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .08s; }
.card:active { transform: scale(.985); }
.card.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
/* карточка с фото (мероприятие/стиль) */
.card .card-photo { width: 100%; aspect-ratio: 3/4; flex: 0 0 auto;
  background: #f2f0ec center/cover no-repeat; }
.card .card-label { flex: 0 0 auto; }
.card .card-label { padding: 1.8vh; font-size: 2.1vh; font-weight: 400; text-align: left; }
/* текстовая/цветовая карточка (бюджет/цвет) */
.card.text { min-height: 12vh; justify-content: center; align-items: flex-start; padding: 2.4vh; gap: 1.4vh; }
.card.text .card-label { padding: 0; font-size: 2.3vh; }
.card.text .sw { width: 4.6vh; height: 4.6vh; border-radius: 2px; border: 1px solid var(--line); display: block; }
.grid.one .card.text { min-height: 8vh; flex-direction: row; align-items: center; }

/* размеры (chips) */
.sizes3 { display: flex; flex-direction: column; gap: 2.6vh; overflow-y: auto; padding-bottom: 1vh; }
.sizerow .sizelabel { font-size: 1.5vh; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.2vh; }
.chips { display: flex; flex-wrap: wrap; gap: 1.2vh; }
.chip { min-height: 7.4vh; min-width: 7.4vh; border-radius: 2px; padding: 0 2vh;
  border: 1px solid var(--line); background: var(--bg); font-size: 2.1vh;
  display: flex; align-items: center; justify-content: center; }
.chip.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.navrow { display: flex; gap: 1.2vh; margin-top: auto; padding-top: 2.4vh; }
.navrow .btn { flex: 1; }
.navrow .btn.back { flex: 0 0 26%; }

/* --- loading --- */
#loading { align-items: center; justify-content: center; text-align: center; }
.spinner { width: 9vh; height: 9vh; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin 1s linear infinite; margin-bottom: 3.4vh; }
@keyframes spin { to { transform: rotate(360deg) } }

/* --- результаты --- */
#results .rhead { margin-bottom: 2.4vh; }
.note { background: #faf3ee; border: 1px solid #ecd9cd; color: #8a4a2c;
  border-radius: 2px; padding: 1.4vh 2vh; font-size: 1.8vh; margin-bottom: 2vh; }
.carousel { flex: 1; display: flex; gap: 2vh; overflow-x: auto; scroll-snap-type: x mandatory; }
.lookcard { scroll-snap-align: center; flex: 0 0 100%; display: flex; flex-direction: column; }
.lookcard h3 { font-family: var(--sans); font-weight: 300; margin: 0 0 1.6vh; font-size: 3vh; }
.collage { display: grid; grid-template-columns: 1fr 1fr; gap: 1vh; margin-bottom: 1.6vh; }
.piece { background: #f2f0ec; border: 1px solid var(--line); border-radius: 2px;
  aspect-ratio: 4/5; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.piece .swatch { flex: 1; }
.piece .pcap { font-size: 1.6vh; padding: 1vh 1.2vh; background: #fff; border-top: 1px solid var(--line); }
.piece .pcap b { display: block; font-weight: 500; font-size: 1.7vh; }
.piece .pcap span { color: var(--muted); }
.piece .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted2); font-size: 1.6vh; }
.looktotal { display: flex; justify-content: space-between; align-items: baseline; margin: auto 0 1.6vh;
  padding-top: 1.4vh; border-top: 1px solid var(--line); }
.looktotal .lbl { font-size: 1.6vh; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.looktotal b { font-family: var(--sans); font-weight: 400; font-size: 2.8vh; }
.dots { display: flex; gap: .9vh; justify-content: center; margin: 1.2vh 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: .2s; }
.dots i.on { background: var(--accent); width: 22px; border-radius: 4px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vh; margin-top: 1vh; }
.actions .btn.wide { grid-column: 1 / -1; }

/* --- модалки (sheet) --- */
.sheet { position: absolute; inset: 0; background: rgba(10,8,6,.42); display: flex;
  align-items: flex-end; z-index: 20; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-card { background: var(--bg); width: 100%; max-height: 90%; border-radius: 0;
  padding: 3.4vh 6%; overflow-y: auto; transform: translateY(100%); transition: transform .3s ease; }
.sheet.open .sheet-card { transform: none; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.4vh; }
.sheet-h h2 { font-family: var(--sans); font-weight: 300; font-size: 3.2vh; margin: 0; }
.close { width: var(--touch); height: var(--touch); border-radius: 2px; border: 1px solid var(--line);
  background: #fff; font-size: 2.6vh; }

.detail-item { display: flex; gap: 2vh; padding: 2.2vh 0; border-top: 1px solid var(--line); }
.detail-item:first-child { border-top: none; }
.detail-item .sw { width: 16vh; aspect-ratio: 4/5; border-radius: 2px; border: 1px solid var(--line); flex: 0 0 auto; }
.detail-item .info { flex: 1; }
.detail-item .info .nm { font-size: 2.3vh; font-weight: 500; }
.detail-item .info .row { color: var(--muted); font-size: 1.8vh; margin: .5vh 0; }
.detail-item .info .price { font-size: 2.2vh; margin-top: .6vh; }
.detail-item .altbtn { align-self: center; }

.alts { display: flex; gap: 1.2vh; overflow-x: auto; padding: 1.6vh 0; }
.alt { flex: 0 0 34%; }
.alt .sw { aspect-ratio: 4/5; border-radius: 2px; margin-bottom: 1vh; border: 1px solid var(--line); }
.alt .an { font-size: 1.7vh; font-weight: 500; }
.alt .ap { font-size: 1.6vh; color: var(--muted); }

.qr-wrap { text-align: center; padding: 2vh 0; }
.qr-wrap svg { width: 60%; height: auto; background: #fff; padding: 3%; border: 1px solid var(--line); }
.qr-hint { color: var(--muted); margin-top: 2vh; font-size: 2vh; }

.big-code { font-family: var(--sans); font-weight: 300; font-size: 8vh; letter-spacing: .1em;
  text-align: center; margin: 3vh 0; color: var(--accent); }
.center-msg { text-align: center; padding: 3vh 0; }
.center-msg .big-emoji { font-size: 8vh; }

/* --- виртуальная примерка (тёмная тема) --- */
.sheet.dark .sheet-card { background: var(--dark); color: var(--dark-ink); }
.sheet.dark .sheet-h h2 { color: var(--dark-ink); }
.sheet.dark .seclabel { color: var(--accent); }
.sheet.dark .close { background: transparent; border-color: #333; color: var(--dark-ink); }
.sheet.dark .btn { border-color: #444; color: var(--dark-ink); background: transparent; }
.sheet.dark .btn.primary { background: #fff; color: #111; border-color: #fff; }
.sheet.dark .sub, .sheet.dark .qsub { color: var(--dark-mut); }
.consent { list-style: none; padding: 0; margin: 2vh 0 3vh; }
.consent li { position: relative; padding-left: 3vh; margin-bottom: 1.8vh; font-size: 2vh;
  font-weight: 300; color: #d9d5cf; line-height: 1.35; }
.consent li::before { content: ""; position: absolute; left: 0; top: .7vh; width: 1vh; height: 1vh;
  background: var(--accent); }
.tryon-title { font-family: var(--sans); font-weight: 250; font-size: 5vh; line-height: 1.03;
  margin: 4vh 0 0; }
.tryon-box { display: flex; flex-direction: column; min-height: 40vh; }
.tryon-img { width: 100%; max-height: 66vh; object-fit: contain; background: #000; border-radius: 2px; }
.tryon-note { color: var(--dark-mut); font-size: 1.6vh; margin: 1.6vh 0; font-weight: 300; }
.tryon-cam { width: 100%; max-height: 54vh; border-radius: 2px; background: #000;
  object-fit: cover; transform: scaleX(-1); }
.tryon-box .navrow { width: 100%; margin-top: 2.4vh; }
.tryon-loading { align-items: center; justify-content: center; text-align: center; }
.tryon-loading .spinner { border-color: #333; border-top-color: var(--accent); }

/* --- idle --- */
.idle { position: absolute; inset: 0; background: rgba(10,8,6,.6); z-index: 40;
  display: flex; align-items: center; justify-content: center; }
.idle-card { background: var(--bg); border-radius: 2px; padding: 5vh 4vh; text-align: center; width: 82%; }
.idle-card h2 { font-family: var(--sans); font-weight: 300; font-size: 3.4vh; margin: 0 0 1vh; }
.idle-card p { color: var(--muted); font-size: 2.2vh; margin: 0 0 3vh; }
#idle-count { color: var(--accent); font-weight: 600; }

#done { align-items: center; justify-content: center; text-align: center; }
#done .wordmark { font-size: 4vh; margin-bottom: 3vh; }
#done h1 { font-family: var(--sans); font-weight: 250; font-size: 5vh; margin: 0 0 1vh; }

.tag { display: inline-block; font-size: 1.5vh; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-left: 1vh; }
