:root {
  --bg: #ffffff;
  --ink: #0d0d0f;
  --ink-soft: #6b6b72;
  --line: #ececee;
  --card: #f6f6f8;
  --nav-bg: #17171a;
  --accent-a: #00b19e;
  --accent-b: #00695c;
  --accent-grad: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  --radius-lg: 20px;
  --radius-pill: 999px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-bottom));
  position: relative;
}

/* Header */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.greeting {
  font-size: 13px;
  color: var(--ink-soft);
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
}

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

.bell-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-a);
}

/* Subheader (для всех экранов, кроме главной) */

.subheader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.subheader h1 {
  font-size: 17px;
  margin: 0;
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.back-btn svg { width: 18px; height: 18px; }

/* Content */

.content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 4px 0 8px;
}

h2 {
  font-size: 17px;
  margin: 0 0 12px;
  padding: 0 16px;
}

/* Marketplaces */

.mp-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px 4px;
  scrollbar-width: none;
}
.mp-scroll::-webkit-scrollbar { display: none; }

.mp-pill {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.mp-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mp-logo.lg {
  width: 40px;
  height: 40px;
  font-size: 12px;
}

.mp-all {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  padding: 8px 16px;
}

/* Gallery */

.gallery-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-scroll::-webkit-scrollbar { display: none; }

.gallery-slide {
  flex: 0 0 78%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  scroll-snap-align: start;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  background-size: cover;
}

.slide-1 { background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0) 55%), url('img/sneakers.jpg') center/cover; }
.slide-2 { background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0) 55%), url('img/gadgets.jpg') center/cover; }
.slide-3 { background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0) 55%), url('img/clothes.jpg') center/cover; }
.slide-4 { background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0) 55%), url('img/accessories.jpg') center/cover; }

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}

.dots span.active {
  background: var(--accent-a);
  width: 16px;
  border-radius: var(--radius-pill);
  transition: width 0.2s ease;
}

/* How it works */

.how-steps {
  list-style: none;
  margin: 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.how-steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-b);
}

.step-body h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.step-body p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Reviews */

.reviews-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 12px;
}

.reviews-head h2 { padding: 0; margin: 0; }

.rating {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.star { color: #ffb020; }

.reviews-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 4px;
  scrollbar-width: none;
}
.reviews-scroll::-webkit-scrollbar { display: none; }

.review-card {
  flex: 0 0 78%;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.review-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.review-name { font-weight: 700; }
.review-stars { color: #ffb020; letter-spacing: 1px; }

.review-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* Catalog screen */

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px;
}

.catalog-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.catalog-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.catalog-item-text strong {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.catalog-item-text span { font-size: 12px; color: var(--ink-soft); }

.mp-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-b);
  background: rgba(0, 177, 158, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.mp-tag.standalone {
  display: inline-block;
  margin-bottom: 8px;
}

/* Marketplace detail screen */

.mp-banner {
  margin: 0 16px 16px;
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9;
  background: var(--accent-grad);
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.mp-banner span {
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.mp-detail {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-detail h2 {
  padding: 0;
  margin: 20px 0 4px;
}

.mp-detail > p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

.mp-download {
  margin-top: 10px;
  text-decoration: none;
  text-align: center;
  display: block;
}

.mp-detail .how-steps { padding: 0; margin-top: 4px; }

.mp-detail #mpOrderBtn { margin-top: 20px; }

/* Orders screen: tabs + empty state */

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
}

.tab {
  flex: 1;
  border: none;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.tab.active {
  background: var(--ink);
  color: #fff;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 56px 32px;
  color: var(--ink-soft);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  opacity: 0.35;
}

.empty-state p {
  margin: 4px 0 0;
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
}

.empty-state span {
  font-size: 12px;
}

.order-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.order-card-status {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fff;
}

.order-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.order-card a {
  color: var(--accent-a);
  word-break: break-all;
}

/* Order form */

.order-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.order-form input,
.order-form select,
.order-form textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.order-form input:focus,
.order-form select:focus,
.order-form textarea:focus {
  outline: 2px solid var(--accent-a);
  outline-offset: 1px;
}

.order-form textarea { resize: vertical; }

.submit-btn {
  border: none;
  background: var(--accent-grad);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.order-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 40px 24px;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.success-icon svg { width: 28px; height: 28px; }

.order-success h2 { font-size: 16px; margin: 0; }
.order-success p { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }
.order-success .submit-btn { width: 100%; }

/* Расчёт стоимости (калькулятор) */

.calc {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px 16px;
}

.calc label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.calc input {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.calc input:focus {
  outline: 2px solid var(--accent-a);
  outline-offset: 1px;
}

.calc-ship-note {
  margin: -6px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.calc-total {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calc-total span { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.calc-total strong { font-size: 24px; }

.calc-shipping {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.calc-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Частые вопросы */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 16px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: none;
  background: #fff;
  padding: 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}

.chevron {
  transition: transform 0.15s ease;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.faq-item.open .chevron { transform: rotate(180deg); }

.faq-a {
  padding: 0 14px 14px;
}

.faq-a p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.faq-contact {
  text-align: center;
  padding: 20px 16px 8px;
}

.faq-contact p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Onboarding sheet */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 15, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.sheet-overlay[hidden] { display: none; }

.sheet {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet h2 { font-size: 18px; margin: 0; }
.sheet-intro { font-size: 13px; color: var(--ink-soft); margin: 0; }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-head h2 { margin: 0; }

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}

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

.form-terms {
  margin: 0;
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.sheet-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.sheet-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badges {
  display: flex;
  gap: 8px;
}

.badge {
  background: var(--card);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.agree {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.agree input { width: 16px; height: 16px; accent-color: var(--accent-a); }

.sheet .submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Bottom nav */

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(92%, 448px);
  background: var(--nav-bg);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 10;
}

.nav-item {
  background: none;
  border: none;
  color: #cfcfd6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.nav-item svg { width: 20px; height: 20px; }

.nav-item.active { color: #fff; }
.nav-item.active svg { color: var(--accent-a); }

.nav-plus {
  background: var(--accent-grad);
  color: #fff;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  padding: 0;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 105, 92, 0.5);
}

.nav-plus svg { width: 22px; height: 22px; }
.nav-item.nav-plus.active svg { color: #fff; }

.bot-footer {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 4px 0 12px;
}
