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

:root {
  --bg: #e8ddd0;
  --card: #ffffff;
  --ink: #2b2723;
  --ink-soft: #6b625a;
  --line: #e7e0d6;
  --accent: #b98b73;
  --accent-dark: #8a6249;
  --rose: #cf9c8d;
  --success: #6f8f6a;
  --danger: #b8564b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(43, 39, 35, 0.08);
  --max: 480px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: var(--max);
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 84px;
}

h1, h2, h3, .serif {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; border: none; cursor: pointer; background: none; }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(247, 243, 238, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header .logo {
  font-size: 20px;
  letter-spacing: 0.04em;
}

.header .icons { display: flex; gap: 14px; align-items: center; }

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

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

/* ---------- Category chips ---------- */
.chip-row {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  height: 420px;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  color: #fff;
}
/* Плавно "продолжает" песчаный фон фото в фон страницы ниже. */
.hero-sand-fade {
  height: 70px;
  margin-top: -1px;
  background: linear-gradient(180deg, #97969b 0%, var(--bg) 100%);
}
.hero-tag {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
}
.hero h1 { font-size: 30px; line-height: 1.15; margin-bottom: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  width: fit-content;
}
.btn.dark { background: var(--ink); color: #fff; }
.btn.accent { background: var(--accent-dark); color: #fff; }
.btn.block { width: 100%; justify-content: center; }

/* ---------- Section heading ---------- */
.section {
  padding: 6px 16px 22px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 21px; }
.section-head .link { font-size: 12px; font-weight: 700; color: var(--accent-dark); }

/* ---------- Promo strip ---------- */
.promo-strip {
  margin: 0 16px 22px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #eadfce, #f3e9dc);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.promo-strip .t { font-size: 15px; font-weight: 700; }
.promo-strip .s { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card-product {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
.card-product .ph {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #ece4d8;
}
.card-product .ph img { width: 100%; height: 100%; object-fit: cover; }
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fav-btn.active svg { fill: var(--danger); stroke: var(--danger); }
.tag-sale {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}
.card-product .info { padding: 10px 10px 12px; }
.card-product .name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price-row { display: flex; align-items: center; gap: 6px; }
.price { font-weight: 700; font-size: 14px; }
.price.old { font-weight: 500; font-size: 12px; color: var(--ink-soft); text-decoration: line-through; }
.dots { display: flex; gap: 4px; margin-top: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max);
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 60;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 4px 10px;
}
.nav-item.active { color: var(--ink); }
.nav-item svg { width: 22px; height: 22px; }

/* ---------- Raisa chat bubble ---------- */
.raisa-fab {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(calc(-50% + 190px - 28px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  z-index: 70;
  font-size: 22px;
}

.raisa-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  justify-content: center;
}
.raisa-panel.open { display: flex; }
.raisa-panel .backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,17,14,0.45);
}
.raisa-sheet {
  position: relative;
  width: 100%;
  max-width: var(--max);
  align-self: flex-end;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  height: 78vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -12px 30px rgba(0,0,0,0.2);
}
.raisa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.raisa-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--rose));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-family: 'Playfair Display', serif;
}
.raisa-head .who { flex: 1; }
.raisa-head .who .name { font-weight: 700; font-size: 14px; }
.raisa-head .who .status { font-size: 11px; color: var(--success); }
.raisa-close { font-size: 20px; color: var(--ink-soft); padding: 6px; }

.raisa-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
}
.msg.bot {
  background: var(--card);
  border: 1px solid var(--line);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.me {
  background: var(--ink);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.quick-reply {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
}
.raisa-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
}
.raisa-input input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13.5px;
  background: var(--bg);
}
.raisa-send {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}

.raisa-typing { color: var(--ink-soft); font-style: italic; }

.raisa-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  margin: -2px 0 4px;
}
.raisa-product-card {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  text-decoration: none;
  color: inherit;
}
.raisa-product-card img {
  width: 44px; height: 56px; object-fit: cover; border-radius: 8px; flex: none;
}
.raisa-product-info { min-width: 0; }
.raisa-product-name {
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.raisa-product-price { font-size: 12px; font-weight: 700; margin-top: 2px; }

/* ---------- Product page ---------- */
.gallery {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery-dots {
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.gallery-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.gallery-dots span.active { background: #fff; width: 18px; border-radius: 4px; }
.back-fab, .share-fab {
  position: absolute;
  top: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
}
.back-fab { left: 16px; }
.share-fab { right: 16px; }

.pd-body { padding: 18px 16px 0; }
.pd-title { font-size: 22px; margin-bottom: 6px; line-height: 1.25; }
.pd-price-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; }
.pd-price { font-size: 20px; font-weight: 700; }

.swatches { display: flex; gap: 10px; margin-bottom: 18px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid transparent;
  outline: 1px solid var(--line);
  outline-offset: 2px;
}
.swatch.active { border-color: var(--ink); }

.size-row { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.size-pill {
  min-width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.size-pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.size-pill.disabled { color: var(--line); text-decoration: line-through; }

.accordion { border-top: 1px solid var(--line); }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0; font-weight: 600; font-size: 14px; width: 100%;
}
.accordion-content {
  display: none;
  padding-bottom: 15px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.accordion-item.open .accordion-content { display: block; }
.accordion-item.open .chev { transform: rotate(180deg); }

.sticky-buy {
  position: sticky;
  bottom: 0;
  background: rgba(247,243,238,0.95);
  backdrop-filter: blur(6px);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
}
.fav-round {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}

/* ---------- Cart page ---------- */
.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item .ph {
  width: 78px; height: 100px; border-radius: var(--radius-sm);
  overflow: hidden; flex: none; background: #ece4d8;
}
.cart-item .ph img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .meta { flex: 1; min-width: 0; }
.cart-item .meta .name { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.cart-item .meta .opt { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.qty-val { font-weight: 600; font-size: 13px; min-width: 14px; text-align: center; }
.remove-btn { margin-left: auto; color: var(--ink-soft); font-size: 12px; text-decoration: underline; }
.cart-item .line-price { font-weight: 700; font-size: 14px; align-self: flex-start; }

.promo-box {
  display: flex; gap: 8px; margin: 16px 0;
}
.promo-box input {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--card); font-size: 13px;
}
.promo-box button {
  padding: 0 18px; border-radius: var(--radius-sm);
  background: var(--ink); color: #fff; font-weight: 700; font-size: 13px;
}

.summary { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 10px; color: var(--ink-soft); }
.summary-row.total { color: var(--ink); font-weight: 700; font-size: 16px; margin-bottom: 0; padding-top: 10px; border-top: 1px dashed var(--line); }

.empty-state { text-align: center; padding: 60px 24px; color: var(--ink-soft); }
.empty-state .em { font-size: 46px; margin-bottom: 12px; }

/* ---------- Page header (non-home) ---------- */
.page-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,243,238,0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: 18px; }
.page-head .back { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }

/* filters */
.filter-bar {
  display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.filter-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}

::selection { background: var(--accent); color: #fff; }
