/* Telegram store Mini App. Always light and monochrome: no --tg-theme-* colors. */

:root {
  color-scheme: light;
  --ink: #111;
  --grey: #6e6e6e;
  --line: #e6e6e6;
  --tile: #f4f4f4;
  --bg: #fff;

  --font: 'TT Norms Pro Compact', 'Open Sans', system-ui, sans-serif;
  --gutter: 16px;
  --track: 0.12em;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-top: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --tabbar-h: 60px;
  --bottom-space: calc(var(--tabbar-h) + var(--safe-bottom));
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

button,
input {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

button { cursor: pointer; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
}

/* ---- shell ---------------------------------------------------------------- */

.view {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-space) + 24px);
}

.view.has-pill { padding-bottom: calc(var(--bottom-space) + 104px); }

body.no-tabbar .view { padding-bottom: calc(var(--safe-bottom) + 24px); }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--bottom-space);
  padding-bottom: var(--safe-bottom);
  background: var(--bg);
  border-top: 1px solid var(--line);
}

body.no-tabbar .tabbar { display: none; }

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  color: var(--grey);
}

.tab svg { width: 22px; height: 22px; }

.tab span {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tab.is-active { color: var(--ink); }
.tab.is-active span { font-weight: 600; }

/* ---- top bars and search -------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 56px;
  padding: 6px calc(var(--gutter) - 12px) 0 var(--gutter);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
}

.icon-btn svg { width: 22px; height: 22px; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin: 12px var(--gutter) 8px;
  border-bottom: 1px solid var(--ink);
}

.search svg { width: 18px; height: 18px; flex: none; }

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder { color: var(--grey); }
.search input::-webkit-search-cancel-button { display: none; }

.topbar .search { flex: 1; margin: 0 4px 0 0; }

/* ---- lists ---------------------------------------------------------------- */

.section { margin-top: 28px; }
.section:first-child { margin-top: 16px; }

.section-label {
  margin: 0;
  padding: 0 var(--gutter);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--grey);
}

.rows { margin: 8px 0 0; padding: 0; list-style: none; }

.row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 var(--gutter);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-align: left;
}

.row:active { background: var(--tile); }
.row .count { margin-left: 8px; font-weight: 400; color: var(--grey); }

/* ---- gender switch -------------------------------------------------------- */

.switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 calc(var(--gutter) - 10px);
}

.switch button {
  min-height: 44px;
  padding: 0 10px;
  font-size: 13px;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--grey);
}

.switch button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

.switch .sep { width: 1px; height: 14px; background: var(--line); }

/* ---- photos --------------------------------------------------------------- */

.photo {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--tile);
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* ---- home ----------------------------------------------------------------- */

.depts { display: grid; gap: 2px; margin-top: 8px; }

.dept-tile {
  position: relative;
  display: block;
  aspect-ratio: 5 / 4;
  background: var(--tile);
  overflow: hidden;
}

.dept-tile .photo {
  position: absolute;
  inset: 16px 16px 76px;
  background: transparent;
}

.dept-tile .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
}

.dept-tile .name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dept-tile .sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--grey);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: calc(var(--gutter) - 8px);
}

.section-head .more {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 42%;
  gap: 2px;
  margin-top: 4px;
  padding: 0 var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}

.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; }

/* ---- department page ------------------------------------------------------ */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 180px;
  margin-bottom: 2px;
  padding: 0 var(--gutter) 20px;
  background: var(--tile);
  overflow: hidden;
}

.hero .photo {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 42%;
  background: transparent;
}

.hero .text { position: relative; max-width: 55%; }

.hero h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.25;
}

.hero .sub { margin-top: 4px; font-size: 12px; color: var(--grey); }

/* ---- grid ----------------------------------------------------------------- */

.title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 56px;
  padding: 18px var(--gutter) 14px;
}

.title-row h1 {
  margin: 0;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.title-row .count { font-size: 13px; color: var(--grey); flex: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
}

.grid.cols-1 { grid-template-columns: minmax(0, 1fr); }

.card { position: relative; min-width: 0; }

.card .photo { aspect-ratio: 3 / 4; }

.card .meta {
  display: block;
  padding: 8px 10px 14px;
}

.grid .card .meta { padding: 8px var(--gutter) 16px 10px; }
.grid.cols-1 .card .meta { padding: 10px var(--gutter) 22px; }
.strip .card .meta { padding: 8px 0 4px; }

.card .brand {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .price {
  display: block;
  min-height: 1.4em;
  margin-top: 2px;
  font-size: 12px;
  color: var(--grey);
}

.badge {
  position: absolute;
  top: 12px;
  left: 10px;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  pointer-events: none;
}

.card-btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
}

.card-btn svg { width: 18px; height: 18px; }
.card-btn.star { top: 0; right: 0; }
.card-btn.chat { right: 0; bottom: 0; display: none; }
body.has-managers .card-btn.chat { display: grid; }
[data-action="fav"][aria-pressed="true"] svg { fill: currentColor; }

.card .photo-wrap { position: relative; }
.card .photo-link { display: block; }

.strip .card-btn svg { width: 16px; height: 16px; }

.more-wrap { display: flex; justify-content: center; padding: 24px var(--gutter) 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  border: 1px solid var(--ink);
}

.btn.solid { background: var(--ink); color: var(--bg); }
.btn[disabled] { opacity: 0.4; cursor: default; }

/* ---- empty, error, placeholder -------------------------------------------- */

.notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 72px var(--gutter);
  text-align: center;
}

.notice p { margin: 0; font-size: 14px; color: var(--grey); }
.notice .label { color: var(--ink); }

.loading { min-height: 60vh; }

.notice-inline { margin: 0 0 12px; font-size: 13px; color: var(--grey); text-align: center; }
.more-wrap { flex-direction: column; align-items: center; }

/* ---- floating filters pill ------------------------------------------------ */

.pill {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-space) + 16px);
  z-index: 15;
  display: flex;
  align-items: center;
  width: min(calc(100% - 2 * var(--gutter)), 360px);
  height: 64px;
  padding: 0 10px 0 0;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.pill .pill-label {
  flex: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-align: left;
}

.pill .sq {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: 6px;
  background: var(--tile);
  border-radius: 2px;
}

.pill .sq svg { width: 22px; height: 22px; }

.pill .dot {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: var(--bg);
  background: var(--ink);
  border-radius: 8px;
}

/* ---- filter sheet --------------------------------------------------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 17, 17, 0.32);
  animation: fade-in 0.2s ease-out;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  max-height: 88dvh;
  background: var(--bg);
  border-radius: 12px 12px 0 0;
  animation: sheet-up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet .grab {
  width: 40px;
  height: 4px;
  margin: 10px auto 0;
  background: var(--line);
  border-radius: 2px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px calc(var(--gutter) - 12px) 0 var(--gutter);
}

.sheet-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 12px;
}

.sheet .section { margin-top: 20px; }

.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 var(--gutter);
  font-size: 14px;
  text-align: left;
}

.choice .count { font-size: 12px; color: var(--grey); }

.choice .mark {
  width: 16px;
  height: 16px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.choice[aria-checked="true"] { font-weight: 600; }
.choice[aria-checked="true"] .mark { border: 5px solid var(--ink); }

.choice-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.choice-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand-list { max-height: 264px; overflow-y: auto; overscroll-behavior: contain; }

.sheet .search { margin: 8px var(--gutter) 4px; height: 45px; border-bottom-color: var(--line); }

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px var(--gutter) 0;
}

.price-row input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.price-row input:focus { border-color: var(--ink); }
.price-row input::placeholder { color: var(--grey); }

.sheet-foot {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line);
}

.sheet-foot .btn { padding: 0 12px; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop { animation: none; }
}

body.sheet-open { overflow: hidden; }

/* ---- product page --------------------------------------------------------- */

.product { position: relative; }

.gallery {
  display: flex;
  height: 62vh;
  height: 62dvh;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: var(--tile);
}

.gallery::-webkit-scrollbar { display: none; }
.gallery:focus-visible { outline-offset: -2px; }

.gallery .slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.gallery .slide img { inset: 6% 8%; width: 84%; height: 88%; }

.dots {
  display: flex;
  gap: 4px;
  height: 2px;
  margin: 10px var(--gutter) 0;
}

.dots span { flex: 1; max-width: 48px; background: var(--line); transition: background-color 0.2s; }
.dots span.on { background: var(--ink); }

.p-back {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 12px;
  z-index: 24; /* under the sheet: an open sheet covers it, the handle closes it */
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--bg);
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.p-back svg { width: 20px; height: 20px; }

.psheet {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--safe-top);
  bottom: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.06);
  transform: translate3d(0, 100%, 0);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.psheet:not([data-ready]) { visibility: hidden; }
.psheet.dragging { transition: none; }
.product.has-cta .psheet { bottom: calc(64px + var(--safe-bottom)); }

.psheet-grab {
  flex: none;
  display: grid;
  place-items: center;
  width: 100%;
  height: 44px;
  touch-action: none;
}

.psheet-grab span { width: 40px; height: 4px; background: var(--line); border-radius: 2px; }

.psheet-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  padding-bottom: calc(var(--safe-bottom) + 32px);
}

.psheet[data-state="open"] { border-radius: 0; box-shadow: none; }
.psheet[data-state="open"] .psheet-body { overflow-y: auto; }
.psheet[data-state="closed"] .psheet-body { touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }

.psheet-head { padding: 0 var(--gutter) 18px; }

.p-brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -6px -10px 0 0;
}

.p-brand {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.p-actions { display: flex; flex: none; }

.p-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
}

.p-icon svg { width: 20px; height: 20px; }

.p-title { margin: 2px 0 0; font-size: 14px; font-weight: 400; line-height: 1.4; }
.p-price { margin-top: 8px; font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.p-note { margin: 10px 0 0; font-size: 12px; color: var(--grey); }

.p-more { transition: opacity 0.2s; }
.psheet[data-state="closed"] .p-more { opacity: 0; }
.p-sku { margin: 0; padding: 0 var(--gutter); font-size: 13px; color: var(--grey); }
.p-more .section { margin-top: 36px; }
.p-more .section-label { color: var(--ink); font-weight: 600; }
.p-more .strip { margin-top: 14px; }

.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 26;
  padding: 8px var(--gutter) calc(8px + var(--safe-bottom));
  background: var(--bg);
}

.cta-btn { width: 100%; }

/* ---- manager chooser and cards ------------------------------------------- */

.mgr-list {
  margin: 8px 0 0;
  padding: 0 0 calc(16px + var(--safe-bottom));
  list-style: none;
  overflow-y: auto;
}

.mgr-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px var(--gutter);
}

.mgr-row:active { background: var(--tile); }
.mgr-row svg { width: 18px; height: 18px; flex: none; }
.mgr-row .mgr-name { flex: 1; }

.mgr-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--ink);
  border-radius: 50%;
}

.mgr-row .mgr-avatar { width: 44px; height: 44px; font-size: 14px; }

.mgr-name {
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.mgr-cards {
  display: grid;
  gap: 24px;
  margin: 14px 0 0;
  padding: 0 var(--gutter);
  list-style: none;
}

.mgr-card { display: flex; align-items: flex-start; gap: 16px; }
.mgr-body { flex: 1; min-width: 0; padding-top: 4px; }
.mgr-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.mgr-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--track);
  border: 1px solid var(--ink);
}

.mgr-link:active { background: var(--tile); }

.managers { margin-top: 40px; }

/* ---- Сервис --------------------------------------------------------------- */

.page-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin: 0;
  padding: 18px var(--gutter) 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-title + .managers { margin-top: 20px; }

.info-rows { margin: 0 var(--gutter); padding: 0; list-style: none; }
.info-rows li { border-bottom: 1px solid var(--line); }

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-align: left;
}

.info-row svg { width: 18px; height: 18px; flex: none; transition: transform 0.2s ease-out; }
.info-row[aria-expanded="true"] svg { transform: rotate(90deg); }
.info-panel p { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: var(--grey); }

@media (prefers-reduced-motion: reduce) {
  .psheet, .p-more, .info-row svg, .dots span { transition: none; }
}

/* Product page with an unknown config: retry line in place of the contact button. */
.cta-retry { display: flex; align-items: center; gap: 12px; }
.cta-retry p { flex: 1; min-width: 0; margin: 0; font-size: 12px; line-height: 1.35; color: var(--grey); }
.cta-retry .btn { flex: none; padding: 0 16px; }
