/* ══════════════════════════════════════════════
   Waldberries — маркетплейс + записи покупок
   ══════════════════════════════════════════════ */
* { box-sizing: border-box; }

:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --ink: #171a26;
  --muted: #7b8194;
  --line: #e7e9f2;
  --brand: #e0187a;
  --brand-2: #ff4d9d;
  --brand-ink: #b3125f;
  --violet: #6b4dff;
  --ok: #16a34a;
  --way: #d97706;
  --new: #2563eb;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(23, 26, 38, .08);
  --shadow-lg: 0 24px 60px rgba(23, 26, 38, .16);
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'SN Pro', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 500px at 80% -10%, #ffe4f1 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 10%, #e7e3ff 0%, transparent 55%),
    var(--bg);
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; }
b { font-weight: 700; }
s { color: var(--muted); font-weight: 500; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1160px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; font-weight: 800; font-size: 1.15rem;
}
.logo__mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #fff; display: grid; place-items: center; font-weight: 900;
  box-shadow: 0 6px 16px rgba(224,24,122,.35);
}
.logo__text em { color: var(--brand); font-style: normal; }

.nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav__btn {
  border: 1px solid transparent; background: transparent; color: var(--ink);
  padding: 9px 15px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  display: flex; align-items: center; gap: 8px; transition: .18s;
}
.nav__btn:hover { background: #fff; border-color: var(--line); }
.nav__btn.is-active { background: var(--ink); color: #fff; }
.nav__btn--lock.is-active { background: linear-gradient(135deg, var(--brand), var(--violet)); }
.nav__badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .78rem;
  display: grid; place-items: center; font-weight: 800;
}
.nav__btn.is-active .nav__badge { background: #fff; color: var(--brand); }

.topbar__total {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
}
.topbar__total-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.topbar__total strong { color: var(--brand-ink); font-size: 1.02rem; }

/* ── Layout ── */
main { max-width: 1160px; margin: 0 auto; padding: 24px 20px 60px; }
.view { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view__title { font-size: 1.6rem; margin-bottom: 6px; }

/* ── Hero ── */
.hero {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: center;
  background: linear-gradient(135deg, #fff 0%, #fff2f8 100%);
  border: 1px solid var(--line); border-radius: 26px;
  padding: 38px; box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero__eyebrow { margin: 0; color: var(--brand); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; }
.hero__title { font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.1; margin: 10px 0 12px; }
.hero__title span { background: linear-gradient(135deg, var(--brand), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { color: var(--muted); font-size: 1.02rem; max-width: 44ch; }
.hero__actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.hero__art { position: relative; min-height: 200px; }
.hero__emojis { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.25; text-align: center; position: relative; z-index: 2; filter: drop-shadow(0 10px 20px rgba(0,0,0,.15)); animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }
.hero__blob { position: absolute; border-radius: 50%; filter: blur(6px); opacity: .55; }
.hero__blob--1 { width: 170px; height: 170px; background: #ff9ec9; top: 0; right: 10%; }
.hero__blob--2 { width: 130px; height: 130px; background: #b9a5ff; bottom: 0; left: 5%; }

/* ── Buttons ── */
.btn {
  border: 1px solid transparent; border-radius: 14px; padding: 11px 20px;
  font-weight: 700; font-size: .95rem; transition: .18s; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
}
.btn--primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 8px 20px rgba(224,24,122,.32);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(224,24,122,.42); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--lg { padding: 14px 26px; font-size: 1.02rem; }
.btn--sm { padding: 8px 14px; font-size: .86rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* ── Toolbar ── */
.toolbar { display: flex; flex-direction: column; gap: 14px; margin: 28px 0 20px; }
.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px 4px 16px;
  box-shadow: var(--shadow); max-width: 560px;
}
.search__icon { opacity: .7; }
.search input { border: 0; outline: 0; flex: 1; padding: 12px 6px; font-size: 1rem; background: transparent; color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 15px; border-radius: 999px; font-weight: 600; font-size: .88rem; transition: .16s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sort {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 10px 14px; border-radius: 12px; font-weight: 600; align-self: flex-start;
}
.toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ── Product grid ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: .2s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #d8d2ff; }
.card__img {
  position: relative; aspect-ratio: 4/3; display: grid; place-items: center; font-size: 3.4rem;
  background: linear-gradient(135deg, #ffeef7, #eee9ff);
}
.card__emoji { filter: drop-shadow(0 8px 12px rgba(0,0,0,.18)); transition: .2s; }
.card:hover .card__emoji { transform: scale(1.12) rotate(-4deg); }
.card__sale {
  position: absolute; top: 10px; left: 10px; background: var(--brand); color: #fff;
  font-size: .78rem; font-weight: 800; padding: 5px 9px; border-radius: 999px;
  box-shadow: 0 6px 14px rgba(224,24,122,.4);
}
.card__fav {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.9); font-size: 1rem; transition: .16s;
}
.card__fav:hover { transform: scale(1.14); }
.card__body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card__price { display: flex; align-items: baseline; gap: 8px; font-size: 1.18rem; }
.card__price b { color: var(--brand-ink); }
.card__price s { font-size: .88rem; }
.card__rating { color: #f59e0b; font-size: .84rem; }
.card__rating span { color: var(--muted); }
.card__name { font-size: .98rem; line-height: 1.35; font-weight: 600; flex: 1; }
.card__cat {
  font-size: .76rem; color: var(--muted); background: #f1f2f8;
  align-self: flex-start; padding: 4px 9px; border-radius: 999px;
}

/* ── Cart ── */
.cart { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.cart-row {
  display: grid; grid-template-columns: 64px 1fr auto auto auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.cart-row__img { width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; font-size: 1.9rem; }
.cart-row__info b { display: block; }
.cart-row__cat { color: var(--muted); font-size: .85rem; }
.qty { display: flex; align-items: center; gap: 4px; background: #f3f4f9; border-radius: 999px; padding: 4px; }
.qty__btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 1.1rem; font-weight: 800; color: var(--brand-ink); line-height: 1;
}
.qty__btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.qty__n { min-width: 30px; text-align: center; font-weight: 800; }
.cart-row__sum { font-weight: 800; min-width: 90px; text-align: right; }
.cart-row__del { border: 0; background: transparent; font-size: 1.15rem; opacity: .6; transition: .15s; }
.cart-row__del:hover { opacity: 1; transform: scale(1.15); }
.cart__footer {
  margin-top: 16px; background: linear-gradient(135deg, #fff, #fff0f7);
  border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  box-shadow: var(--shadow); flex-wrap: wrap;
}
.cart__sum { display: flex; align-items: baseline; gap: 10px; font-size: 1rem; color: var(--muted); }
.cart__sum strong { font-size: 1.7rem; color: var(--brand-ink); }

.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; font-size: 1.05rem; }

/* ── Lock / пароль ── */
.lock { display: flex; justify-content: center; padding: 30px 0; }
.lock__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: var(--shadow-lg); padding: 40px 34px; max-width: 440px; width: 100%; text-align: center;
  position: relative; overflow: hidden;
}
.lock__card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--violet));
}
.lock__icon { font-size: 3rem; }
.lock__title { font-size: 1.5rem; margin: 8px 0; }
.lock__lead { color: var(--muted); line-height: 1.5; }
.lock__form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.lock__field { position: relative; display: flex; }
.lock__field input {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 15px 52px 15px 18px;
  font-size: 1.15rem; letter-spacing: .4em; text-align: center; outline: 0; transition: .16s; background: #fafbff;
}
.lock__field input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(224,24,122,.14); }
.lock__eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; font-size: 1.2rem;
}
.lock__error { color: #e11d48; font-weight: 600; margin: 0; }
.lock__hint { color: var(--muted); font-size: .85rem; font-style: italic; margin-top: 16px; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(6px)} }

/* ── Purchases ── */
.purchases__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.purchases__sub { color: var(--muted); margin: 4px 0 0; }
.purchases__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 22px 0; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat__label { color: var(--muted); font-size: .82rem; display: block; margin-bottom: 6px; }
.stat__val { font-size: 1.4rem; color: var(--brand-ink); }
.orders { display: flex; flex-direction: column; gap: 12px; }
.order {
  display: grid; grid-template-columns: 56px 1fr auto auto auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 18px; box-shadow: var(--shadow); transition: .16s;
}
.order:hover { border-color: #d8d2ff; transform: translateX(4px); }
.order__emoji { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-size: 1.7rem; }
.order__main b { display: block; }
.order__meta { color: var(--muted); font-size: .85rem; }
.order__qty { color: var(--muted); font-weight: 700; }
.order__sum { font-weight: 800; min-width: 92px; text-align: right; }
.pill { padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pill--ok { background: #e7f8ee; color: var(--ok); }
.pill--way { background: #fdf1e0; color: var(--way); }
.pill--new { background: #e7efff; color: var(--new); }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15,17,28,.55); backdrop-filter: blur(3px); }
.modal__card {
  position: relative; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; padding: 24px; animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
.modal__title { font-size: 1.25rem; margin-bottom: 4px; }
.modal__pm-img {
  width: 100%; aspect-ratio: 16/9; border-radius: 16px; display: grid; place-items: center;
  font-size: 4.5rem; margin: 14px 0;
}
.modal__pm-meta { color: var(--muted); font-size: .9rem; margin: 4px 0; }
.modal__descr { color: var(--ink); line-height: 1.5; background: #f7f8fc; padding: 12px 14px; border-radius: 12px; }
.modal__pm-price { display: flex; gap: 10px; align-items: baseline; font-size: 1.5rem; color: var(--brand-ink); margin: 14px 0; }
.modal__actions { display: flex; gap: 12px; align-items: center; }
.modal__actions .btn--primary { flex: 1; }

/* product modal pieces */
.pm-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 1.1rem; z-index: 2; }

/* ── Add-form fields ── */
.modal__form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.field > span { font-size: .84rem; color: var(--muted); font-weight: 600; }
.field input, .field select {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: .97rem;
  outline: 0; background: #fafbff; color: var(--ink); transition: .15s;
}
.field input:focus, .field select:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(224,24,122,.12); }
.field-row { display: flex; gap: 12px; }
.modal__actions { justify-content: flex-end; }
.modal__error { color: #e11d48; font-weight: 600; margin: 0; font-size: .9rem; }
.modal__add-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 999px;
  box-shadow: var(--shadow-lg); font-weight: 600; z-index: 200; opacity: 0;
  transition: .3s; display: flex; gap: 9px; align-items: center; max-width: 92vw;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ── Quickbar ── */
.quickbar {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 8px 8px 8px 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-lg); animation: pop .3s ease;
}
.quickbar span { font-weight: 800; }

/* ── Footer ── */
.footer {
  max-width: 1160px; margin: 0 auto; padding: 24px 20px 40px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 28px; }
  .hero__art { display: none; }
  .cart-row, .order { grid-template-columns: 52px 1fr auto; grid-auto-rows: auto; }
  .cart-row__sum, .order__sum { grid-column: 2; text-align: left; }
  .cart-row__del, .order .pill { grid-column: 3; }
  .topbar__total { display: none; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .card__img { font-size: 2.6rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .sort { align-self: stretch; }
  .field-row { flex-direction: column; }
}

.boot-error { display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--muted); }

/* ── Quickbar ── */
.quickbar {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff; padding: 10px 12px 10px 18px;
  border-radius: 999px; box-shadow: var(--shadow-lg); font-weight: 700;
  animation: pop .3s ease;
}
.quickbar span {
  background: var(--brand); min-width: 26px; height: 26px; border-radius: 999px;
  display: grid; place-items: center; font-size: .85rem;
}

/* ── Footer ── */
.footer {
  max-width: 1160px; margin: 0 auto; padding: 26px 20px 40px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
