:root {
  --bg: #000000;
  --fg: #ffffff;
  --muted: #d9d9d9;
  --w: 402px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
a { color: inherit; text-decoration: none; }

.app {
  max-width: var(--w);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}

#view { padding-bottom: 96px; }

/* ---------- Header (по центру, закреплён при скролле) ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  background: var(--bg);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.header .back,
.header .share {
  width: 40px; height: 40px;
  background: none; border: none; padding: 0; cursor: pointer;
  position: absolute;
}
.header .back { left: 16px; }
.header .share { right: 16px; }
.header .back img,
.header .share img { width: 100%; height: 100%; }
.header .title-c { flex: 1; text-align: center; }

/* ---------- Feed / work card ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; }

.card { display: flex; flex-direction: column; gap: 16px; padding-bottom: 20px; }

.card-media { position: relative; }

.carousel {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel img, .carousel .ph {
  flex: 0 0 366px;  /* фикс. ширина из Figma */
  height: 402px;    /* фикс. высота из Figma */
  object-fit: cover;
  scroll-snap-align: start;
  background: var(--muted);
}

.badge {
  position: absolute;
  top: 12px; left: 16px;
  padding: 6px 10px;
  background: var(--bg); /* чёрный прямоугольник без обводки */
  font-size: 11px;
  font-weight: 600;
}

.like {
  position: absolute;
  left: 16px; bottom: 16px;
  width: 40px; height: 40px;
  padding: 0; border: none; cursor: pointer;
  background: #000; /* чёрный квадрат снаружи */
}
/* само сердечко: белое по умолчанию, красное — когда лайкнуто */
.like::before {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask: url(assets/icons/like.svg) center / contain no-repeat;
  mask: url(assets/icons/like.svg) center / contain no-repeat;
  background-color: var(--fg);
  transition: background-color .15s;
}
.like.liked::before { background-color: #ff3b30; }

.card-body { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center; /* название и цена всегда на одном уровне: 1 или 2 строки */
  gap: 10px;
}
.title { font-size: 13px; font-weight: 600; white-space: pre-line; }
.price { font-size: 20px; font-weight: 600; white-space: nowrap; }

/* ---------- Button ---------- */
.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Category chips ---------- */
/* блок «шапка + фильтры» на странице мастеров — закреплён при скролле */
.masters-top {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--bg);
}
.masters-top .header { position: static; }

.chips {
  display: flex;
  gap: 9px;
  padding: 0 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
/* +8px над первой карточкой мастера (вне закреплённого блока фильтров) */
.feed-masters { margin-top: 8px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.chip.active { background: var(--fg); color: var(--bg); }

/* ---------- Masters page card ---------- */
.master-card { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-bottom: 20px; }
.master-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  padding: 0 16px;
}
/* имя мастера на странице категорий — без обводки */
.master-name { font-size: 13px; font-weight: 600; }
/* карусель квадратных фото мастера: видно 3, скроллится по горизонтали */
.master-carousel {
  display: flex;
  gap: 1px;
  align-items: flex-start; /* не растягивать фото по высоте */
  width: 100%;
  padding: 0 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.master-carousel::-webkit-scrollbar { display: none; }
.master-carousel img, .master-carousel .ph {
  flex: 0 0 168px; /* фикс. ширина из Figma */
  height: 168px;   /* фикс. высота из Figma */
  object-fit: cover;
  background: var(--muted);
  scroll-snap-align: start;
}
.master-actions { width: 100%; padding: 0 16px; }

/* ---------- Info page ---------- */
.info {
  min-height: calc(100dvh - 72px - 69px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 35px;
  padding: 0 63px 96px;
  text-align: center;
}
.info p { font-size: 13px; font-weight: 400; line-height: 1.3; margin: 0; }

/* ---------- Empty state ---------- */
.empty {
  min-height: calc(100dvh - 141px); /* высота экрана минус шапка и таб-бар */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 13px;
  opacity: .6;
}

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--w);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 16px 16px 24px;
  background: var(--bg);
  z-index: 10;
}
.tabbar a { width: 32px; height: 32px; }
.tabbar img { width: 100%; height: 100%; opacity: .5; transition: opacity .15s; }
.tabbar a.active img { opacity: 1; }
.tabbar.hidden { display: none; }

/* ---------- Splash ---------- */
#splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity .4s;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash span { font-size: 24px; font-weight: 400; }
