@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&display=swap');

:root {
  --bg: #f1ede1;
  --surface: #ffffff;
  --ink: #1b2438;
  --ink-soft: #4a5468;
  --text-muted: #8b8677;
  --border: #1b2438;
  --border-soft: #ddd8c8;
  --accent: #e8602c;
  --success: #4f9e6e;
  --danger: #d95c5c;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(27, 36, 56, 0.08);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-bottom: 80px;
  overflow-x: hidden;
}

/* ---------- Лого / Hero ---------- */
.logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 4px;
}
.logo-wordmark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-wordmark svg { width: 26px; height: 26px; flex: 0 0 auto; }

.hero {
  padding: 4px 16px 18px;
}
.hero h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.5px;
  margin: 0 0 16px;
}
.hero-doodle { width: 46px; height: 46px; opacity: 0.85; }

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.6px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 15px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  width: 100%;
}
.pill-btn.filled {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.pill-btn:disabled { opacity: 0.5; }

/* ---------- Бегущая строка ---------- */
.marquee-wrap {
  background: var(--ink);
  overflow: hidden;
  padding: 11px 0;
  margin-bottom: 4px;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 18s linear infinite;
}
.marquee-track span {
  color: #f1ede1;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0 14px;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Хлебные крошки / фильтры ---------- */
.breadcrumb {
  padding: 16px 16px 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.breadcrumb b { color: var(--ink); font-weight: 700; }

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.filter-row .filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
}
.filter-row .search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 18px;
}
.search-inline {
  padding: 0 16px 10px;
  display: none;
}
.search-inline.open { display: block; }
.search-inline input {
  width: 100%;
  border: 1.4px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 11px 16px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  color: var(--ink);
}

/* ---------- Навигация по тегам ---------- */
.tag-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 14px 16px 8px;
}
.tag-nav .tag-link {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
}
.tag-nav .tag-link.active {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------- Сетка товаров ---------- */
.view { padding: 4px 16px 8px; flex: 1; }

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 1px solid var(--border-soft);
}

.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f7f5ee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 30px;
  overflow: hidden;
  position: relative;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sale-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  z-index: 2;
}

.heart-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}
.heart-btn svg { width: 16px; height: 16px; }
.heart-btn .heart-icon path { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.heart-btn.active .heart-icon path { fill: var(--accent); stroke: var(--accent); }

.product-info { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 8px; }

.product-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}

.price-row { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.product-price { font-size: 15px; font-weight: 800; color: var(--ink); }
.old-price { font-size: 12.5px; color: var(--text-muted); text-decoration: line-through; }

.card-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.card-actions .pill-btn { padding: 10px 12px; font-size: 11.5px; }

.qty-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
}
.qty-stepper button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.qty-stepper span { color: #fff; font-weight: 700; font-size: 13px; }

.loading-row, .empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 0;
  font-size: 14px;
}

/* ---------- Нижняя навигация ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  display: flex;
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  z-index: 30;
}

.nav-btn {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 4px 0;
  cursor: pointer;
  position: relative;
}
.nav-btn .icon { font-size: 19px; }
.nav-btn.active { color: var(--ink); }

.nav-badge {
  position: absolute;
  top: -2px;
  right: 22%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ---------- Корзина ---------- */
.cart-item {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  align-items: center;
  border: 1px solid var(--border-soft);
}
.cart-item .thumb {
  width: 56px; height: 56px; border-radius: 12px;
  background: #f7f5ee; flex: 0 0 auto;
  display:flex;align-items:center;justify-content:center;color:var(--ink);
  overflow: hidden;
}
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .meta { flex: 1; min-width: 0; }
.cart-item .meta .title { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.cart-item .meta .price { font-size: 12.5px; color: var(--text-muted); }
.cart-item .remove { background: none; border: none; color: var(--danger); font-size: 18px; cursor: pointer; padding: 4px; }

.cart-summary {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-top: 8px;
  border: 1px solid var(--border-soft);
}
.cart-summary .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); margin-bottom: 6px; }
.cart-summary .row.total { font-size: 17px; font-weight: 800; color: var(--ink); margin-top: 8px; }

.primary-btn {
  width: 100%;
  border: none;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 15px 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  margin-top: 14px;
}
.primary-btn:disabled { opacity: 0.5; }

/* ---------- Формы ---------- */
.form-field { margin-bottom: 12px; }
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-field input, .form-field textarea {
  width: 100%;
  border: 1.4px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--accent); }
.form-field textarea { resize: none; min-height: 70px; }

/* ---------- Профиль / Заказы ---------- */
.order-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  cursor: pointer;
  border: 1px solid var(--border-soft);
}
.order-card .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-card .order-number { font-weight: 800; font-size: 14px; }
.order-card .order-date { font-size: 12px; color: var(--text-muted); }
.order-card .order-total { font-size: 14px; font-weight: 800; color: var(--ink); margin-top: 4px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.status-new { background: #eef1fb; color: #5b6bd5; }
.status-paid { background: #e6f7ee; color: #2f9e5f; }
.status-processing { background: #fff3e0; color: #c9832a; }
.status-shipped { background: #e5f4fb; color: #2f8fc0; }
.status-delivered { background: #e6f7ee; color: #2f9e5f; }
.status-cancelled { background: #fbeaea; color: #c94a4a; }

.timeline { margin-top: 14px; padding-left: 4px; }
.timeline-item { display: flex; gap: 10px; padding-bottom: 16px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--ink);
  margin-top: 4px; flex: 0 0 auto; position: relative; z-index: 1;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 4px; top: 14px; bottom: -4px;
  width: 2px; background: var(--border-soft);
}
.timeline-text .label { font-size: 13.5px; font-weight: 800; }
.timeline-text .time { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.profile-header {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #fff;
  margin-bottom: 16px;
}
.profile-header .name { font-size: 17px; font-weight: 800; }
.profile-header .username { font-size: 13px; opacity: 0.75; margin-top: 2px; }

.profile-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.profile-tab-btn {
  flex: 1;
  border: 1.4px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 11px 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.profile-tab-btn.active { background: var(--ink); color: #fff; }

.section-title { font-size: 15px; font-weight: 800; margin: 18px 0 10px; }

.back-row {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 4px;
}
.back-btn {
  border: 1.4px solid var(--border); background: var(--surface);
  width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; color: var(--ink);
}

.info-link {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  padding: 14px 16px; margin-top: 10px; cursor: pointer; font-weight: 700; font-size: 13.5px;
}

.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  text-align: center;
  max-width: 85%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(27,36,56,0.5);
  display: flex; align-items: flex-end; z-index: 40;
}
.modal-sheet {
  background: var(--bg);
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
}
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.sheet-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px; border-bottom: 1px solid var(--border-soft); font-size: 14px; font-weight: 600; cursor: pointer;
}
.sheet-option.active { color: var(--accent); font-weight: 800; }
