:root {
  --bg: #f7f7fb;
  --bg-alt: #eef0f7;
  --surface: #ffffff;
  --text: #12131a;
  --muted: #6b6f80;
  --border: #e3e5ee;
  --primary: #6c5ce7;
  --primary-2: #00b8d9;
  --accent: #ff6b6b;
  --shadow: 0 10px 30px rgba(20, 20, 50, .08);
  --radius: 20px;
  --header-bg: rgba(247, 247, 251, .75);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e14;
    --bg-alt: #13151e;
    --surface: #181a25;
    --text: #f1f2f7;
    --muted: #9a9db0;
    --border: #262938;
    --shadow: 0 10px 30px rgba(0, 0, 0, .4);
    --header-bg: rgba(13, 14, 20, .7);
  }
}

:root[data-theme="dark"] {
  --bg: #0d0e14;
  --bg-alt: #13151e;
  --surface: #181a25;
  --text: #f1f2f7;
  --muted: #9a9db0;
  --border: #262938;
  --shadow: 0 10px 30px rgba(0, 0, 0, .4);
  --header-bg: rgba(13, 14, 20, .7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-weight: 700;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: 0 8px 24px rgba(108, 92, 231, .35);
}
.btn--ghost { border: 1.5px solid var(--border); background: var(--surface); }
.btn--light { background: #fff; color: #12131a; }
.btn--block { width: 100%; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  transition: background .2s;
}
.icon-btn:hover { background: var(--bg-alt); }

/* Шапка */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.header.scrolled { border-color: var(--border); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.5rem; letter-spacing: -.5px; }
.logo__dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.nav { display: flex; gap: 32px; font-weight: 600; }
.nav a { color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--text); }
.header__actions { display: flex; gap: 4px; }
.cart-btn__count {
  position: absolute; top: 4px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center; transition: transform .2s;
}
.cart-btn__count.bump { transform: scale(1.4); }
.burger { display: none; }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

/* Hero */
.hero { position: relative; padding: 80px 0 100px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -200px -200px auto auto; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(108, 92, 231, .25), transparent 65%);
  pointer-events: none;
}
.hero__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; position: relative; }
.badge {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .9rem; font-weight: 600; margin-bottom: 24px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.1; letter-spacing: -1.5px; margin-bottom: 20px; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 520px; margin-bottom: 32px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.hero__stats { display: flex; gap: 40px; }
.hero__stats strong { display: block; font-size: 1.6rem; }
.hero__stats span { color: var(--muted); font-size: .9rem; }

.hero__visual { position: relative; height: 460px; }
.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 28px; box-shadow: var(--shadow);
}
.hero-card--main {
  position: absolute; inset: 20px 40px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 32px;
  background: linear-gradient(160deg, rgba(108, 92, 231, .18), rgba(0, 184, 217, .12)), var(--surface);
}
.hero-card__emoji { font-size: 9rem; text-align: center; filter: drop-shadow(0 20px 30px rgba(0,0,0,.2)); animation: float 5s ease-in-out infinite; }
.hero-card__info span { color: var(--primary); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; }
.hero-card__info strong { display: block; font-size: 1.5rem; }
.hero-card__info em { font-style: normal; font-weight: 700; color: var(--muted); }
.hero-card--float {
  position: absolute; padding: 14px 20px; font-size: 1.5rem;
  display: flex; align-items: center; gap: 10px;
  animation: float 6s ease-in-out infinite;
}
.hero-card--float span { font-size: .95rem; font-weight: 700; }
.hero-card--a { top: 0; left: 0; }
.hero-card--b { bottom: 0; right: 0; animation-delay: -3s; }
.hero-card--b span { color: var(--accent); }
@keyframes float { 50% { transform: translateY(-14px); } }

/* Секції */
.section { padding: 90px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { text-align: center; margin-bottom: 48px; }
.section__head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -1px; }
.section__head p { color: var(--muted); }

/* Тулбар каталогу */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  background: var(--surface); border: 1px solid var(--border); transition: all .2s;
}
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.toolbar__right { display: flex; gap: 8px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.search svg { width: 18px; color: var(--muted); }
.search input { border: none; outline: none; background: none; padding: 10px 0; width: 180px; }
.select {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); outline: none; cursor: pointer;
}

/* Картки товарів */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .3s, box-shadow .3s;
  animation: fadeUp .4s both;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card__img {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center;
  font-size: 5.5rem;
}
.card__img span { transition: transform .4s; }
.card:hover .card__img span { transform: scale(1.12) rotate(-6deg); }
.card__tag {
  position: absolute; top: 14px; left: 14px; padding: 4px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; background: var(--accent); color: #fff;
}
.card__tag--new { background: var(--primary); }
.card__body { padding: 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__cat { color: var(--muted); font-size: .85rem; font-weight: 600; }
.card__title { font-size: 1.1rem; }
.card__rating { color: #f5a623; font-size: .9rem; }
.card__rating small { color: var(--muted); }
.card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.price { font-size: 1.3rem; font-weight: 800; }
.price s { display: block; font-size: .85rem; color: var(--muted); font-weight: 500; }
.add-btn {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--text); color: var(--bg); transition: transform .2s, background .2s;
}
.add-btn:hover { transform: scale(1.08); background: var(--primary); color: #fff; }
.add-btn.added { background: #2ecc71; color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 1.1rem; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }

/* Переваги */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: transform .3s;
}
.feature:hover { transform: translateY(-4px); }
.feature__icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem;
  background: linear-gradient(135deg, rgba(108, 92, 231, .15), rgba(0, 184, 217, .15)); margin-bottom: 16px;
}
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: .95rem; }

/* Відгуки */
.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.review__stars { color: #f5a623; letter-spacing: 2px; }
.review blockquote { flex: 1; }
.review figcaption { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

/* Розсилка */
.newsletter {
  display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap;
  padding: 56px; border-radius: 32px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.newsletter h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.5px; }
.newsletter p { opacity: .85; }
.newsletter__form { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter__form input {
  padding: 14px 22px; border-radius: 999px; border: none; outline: none; min-width: 240px;
  background: rgba(255, 255, 255, .2); color: #fff;
}
.newsletter__form input::placeholder { color: rgba(255, 255, 255, .8); }

/* Футер */
.footer { border-top: 1px solid var(--border); padding: 56px 0 24px; }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer__inner > div { display: flex; flex-direction: column; gap: 10px; }
.footer h4 { margin-bottom: 4px; }
.footer__inner a:not(.logo) { color: var(--muted); transition: color .2s; }
.footer__inner a:hover { color: var(--text); }
.footer__bottom { border-top: 1px solid var(--border); padding-top: 24px; font-size: .9rem; }

/* Кошик */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 90;
  opacity: 0; visibility: hidden; transition: .3s;
}
.overlay.show { opacity: 1; visibility: visible; }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 100;
  background: var(--surface); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.cart.open { transform: none; }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.cart__items { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.cart__empty { text-align: center; color: var(--muted); margin-top: 60px; }
.cart__empty div { font-size: 3.5rem; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; }
.cart-item__img { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; font-size: 2rem; }
.cart-item__title { font-weight: 700; font-size: .95rem; }
.cart-item__price { color: var(--muted); font-size: .9rem; }
.qty { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-alt); font-weight: 700; }
.qty span { min-width: 20px; text-align: center; font-weight: 700; }
.remove { color: var(--muted); }
.remove:hover { color: var(--accent); }
.remove svg { width: 18px; height: 18px; }
.cart__foot { padding: 20px 24px; border-top: 1px solid var(--border); }
.cart__total { display: flex; justify-content: space-between; margin-bottom: 16px; font-size: 1.1rem; }
.cart__total strong { font-size: 1.4rem; }

/* Модалка */
.modal {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transition: .3s;
}
.modal.show { opacity: 1; visibility: visible; }
.modal__box {
  position: relative; width: min(440px, 100%); background: var(--surface); border-radius: 24px; padding: 32px;
  display: flex; flex-direction: column; gap: 14px; transform: scale(.95); transition: transform .3s;
}
.modal.show .modal__box { transform: none; }
.modal__close { position: absolute; top: 14px; right: 14px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.modal input {
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); outline: none;
}
.modal input:focus { border-color: var(--primary); }
.modal__sum { margin: 6px 0; }

/* Тост */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200;
  transform: translate(-50%, 120px); padding: 14px 24px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* Анімація появи */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s, transform .7s; }
.reveal.visible { opacity: 1; transform: none; }

/* Адаптив */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { height: 380px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .reviews { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .burger { display: grid; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .nav.open { max-height: 300px; }
  .nav a { padding: 16px 24px; }
  .hero { padding: 48px 0 64px; }
  .hero__stats { gap: 24px; }
  .hero-card--main { inset: 30px 10px; }
  .hero-card__emoji { font-size: 6.5rem; }
  .section { padding: 64px 0; }
  .toolbar__right, .search { width: 100%; }
  .search input { width: 100%; }
  .features { grid-template-columns: 1fr; }
  .newsletter { padding: 32px 24px; }
  .newsletter__form, .newsletter__form input { width: 100%; min-width: 0; }
  .footer__inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
