:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --text: #1b1f27;
  --muted: #6b7280;
  --primary: #1f6feb;
  --primary-dark: #1558c0;
  --accent: #e5484d;
  --ok: #178a4c;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 30, 50, .07);
  --shadow-lg: 0 8px 24px rgba(20, 30, 50, .12);
}

/* ==========================================
   Приховування повзунка скролу (Scrollbar)
   ========================================== */

/* Для Firefox, IE та Edge */
html, body {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / Edge */
}

/* Для WebKit-браузерів (Chrome, Safari, iOS Safari, Opera) */
::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Приховуємо повзунок також у внутрішніх блоках з прокруткою (наприклад, у меню чи пошуку) */
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

* {
  scrollbar-width: none;
}


*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin-top: 1.6em; }
ul, ol { padding: 0; margin: 0; list-style: none; }
.muted { color: var(--muted); }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.main { padding-block: 20px 48px; min-height: 60vh; }
.center { text-align: center; padding: 48px 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
:focus,
:focus-visible {
  outline: none;
}

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 14px; font-size: .9rem; }
.btn--light { background: #fff; color: var(--primary); }
.btn--light:hover { background: #eef4ff; }
.btn--ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn--ghost:hover { background: #eef4ff; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 1.1rem; color: var(--muted); padding: 6px; }
.icon-btn:hover { color: var(--accent); }

/* Шапка */
.header { background: var(--surface); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.header__row { display: flex; align-items: center; gap: 16px; padding-block: 12px; }
.logo {
  display: inline-block;
  text-decoration: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.logo__text {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo__dot {
  display: none; /* У градієнтному варіанті крапка не потрібна */
}
.logo:hover { text-decoration: none; }
.search { flex: 1; display: flex; max-width: 560px; margin-inline: auto; }
.search input {
  flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--border);
  border-right: 0; border-radius: 10px 0 0 10px; font: inherit; background: var(--bg);
}
.search button { border: 1px solid var(--border); background: var(--bg); padding: 0 14px; border-radius: 0 10px 10px 0; cursor: pointer; }


.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.badge {
  background: var(--accent); color: #fff; border-radius: 999px; font-size: .75rem;
  min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px;
}
.burger { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; padding: 8px; }
.burger span { display: block; height: 2px; background: var(--text); margin: 6px 0; border-radius: 2px; transition: .2s; }

.nav { border-top: 1px solid var(--border); background: var(--surface); }
.nav__list { display: flex; gap: 4px; }
.nav__item { position: relative; }
.nav__item > a { display: block; padding: 12px 14px; color: var(--text); font-weight: 600; }
.nav__item > a:hover { color: var(--primary); text-decoration: none; }
.nav__sub {
  position: absolute; left: 0; top: 100%; min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 10;
}
.nav__sub a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.nav__sub a:hover { background: #eef4ff; text-decoration: none; }
.nav__item.has-sub:hover .nav__sub, .nav__item.has-sub:focus-within .nav__sub { display: block; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #1f6feb, #6a4cff); color: #fff;
  border-radius: 20px; padding: clamp(28px, 6vw, 64px); margin-bottom: 8px;
}
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.8rem); }
.hero p { max-width: 560px; opacity: .92; margin: 0 0 20px; }

#catalog {
  scroll-margin-top: 90px;
}

/* Категорії */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.cat {
  background: var(--surface); border-radius: var(--radius); padding: 24px 16px; text-align: center;
  box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.cat__icon { display: block; font-size: 2.6rem; margin-bottom: 8px; }
.cat__name { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px; color: var(--text); font-weight: 600; }
.chip:hover { border-color: var(--primary); text-decoration: none; }

/* Сітка товарів */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card__img { position: relative; aspect-ratio: 1; background: #eef1f6; display: block; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 4rem; background: linear-gradient(135deg, #eef4ff, #f3eefe); }
.ph--lg { font-size: 9rem; aspect-ratio: 1; border-radius: var(--radius); }
.tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 8px; }
.tag--sale { background: var(--accent); color: #fff; }
.card__img .tag { position: absolute; top: 10px; left: 10px; }
.card__body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__brand { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card__title { font-size: 1rem; margin: 0; flex: 1; }
.card__title a { color: var(--text); }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-block: 4px 8px; }
.price__now { font-size: 1.2rem; font-weight: 800; }
.price__old { color: var(--muted); }
.price--lg .price__now { font-size: 1.9rem; }

/* Фільтри */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; background: var(--surface); padding: 14px 16px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.filters label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: 4px; }
.filters .check { flex-direction: row; align-items: center; color: var(--text); padding-bottom: 8px; }
.filters input[type=number] { width: 110px; }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); }
textarea { width: 100%; resize: vertical; }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 28px 0; }
.pager a { background: var(--surface); padding: 8px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; }

/* Хлібні крихти */
.crumbs { margin-bottom: 14px; font-size: .9rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.crumbs span { color: var(--muted); }

/* Сторінка товару */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; background: var(--surface); padding: 24px; border-radius: 20px; box-shadow: var(--shadow); }
.pdp__media img { width: 100%; border-radius: var(--radius); }
.stock.ok { color: var(--ok); font-weight: 600; }
.stock.no { color: var(--accent); font-weight: 600; }
.buy { display: flex; gap: 12px; margin-block: 16px; }
.buy input { width: 80px; }
.lead { font-size: 1.05rem; }
.perks-list li { padding: 4px 0; color: var(--muted); }
.seo-text, .prose { background: var(--surface); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 24px; }
.seo-text h2 { margin-top: 0; }
.prose { max-width: 800px; }

.perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 40px; }
.perks div { background: var(--surface); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.perks span { color: var(--muted); font-size: .9rem; }

/* Кошик */
.cart { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 20px 20px; }
.cart__row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart__name { font-weight: 600; color: var(--text); }
.qty { display: flex; gap: 8px; align-items: center; }
.qty input { width: 70px; }
.cart__sum { font-weight: 700; min-width: 90px; text-align: right; }
.cart__total { display: flex; justify-content: flex-end; gap: 12px; font-size: 1.3rem; padding: 18px 0; }

.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.form, .summary { background: var(--surface); padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .9rem; }
.field input, .field textarea { width: 100%; }
.error { color: var(--accent); font-size: .85rem; margin-top: 3px; }
.summary h2 { margin-top: 0; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.summary__total { font-size: 1.15rem; border-bottom: 0; }

/* Футер */
.footer { background: #12161d; color: #cbd2dc; padding-top: 36px; margin-top: 40px; }
.footer a { color: #cbd2dc; }
.footer .logo { color: #fff; }
.footer h3 { color: #fff; font-size: 1rem; }
.footer li { margin-bottom: 6px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer__copy { border-top: 1px solid #262c37; margin-top: 28px; padding-block: 18px; font-size: .88rem; color: #8b94a3; }

/* ---------- Адаптивність ---------- */
@media (max-width: 900px) {
  .pdp { grid-template-columns: 1fr; padding: 16px; }
  .checkout { grid-template-columns: 1fr; }
}

.nav__toggle {
  display: none;
}

@media (max-width: 760px) {
  .burger { display: block; }
  .header__row { flex-wrap: wrap; gap: 10px; }
  .logo { order: 1; margin-right: auto; }
  .burger { order: 0; position: relative; }
  .cart-link { order: 2; }
  .search { order: 3; flex: 1 0 100%; max-width: none; }
  .cart-link__text { display: none; }

  /* Анімація перетворення бургера в хрестик */
  .burger span { transition: transform 0.2s ease, opacity 0.2s ease; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* Випадаючий блок меню під шапкою */
  .nav {
    display: none;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.08);
    padding: 12px 16px 16px;
  }

  /* Плавне випадання при відкритті */
  .nav.open {
    display: block;
    animation: menuFadeIn 0.2s ease-out;
  }

  @keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .nav__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
  }

  /* Окремі картки для елементів меню */
  .nav__item > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.98rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }

  .nav__item > a:hover,
  .nav__item > a:active {
    background: #eef4ff;
    color: var(--primary);
    border-color: #c9ddfb;
    text-decoration: none;
  }

  /* Контейнер категорії з підкатегоріями */
  .nav__item.has-sub {
    display: flex;
    flex-wrap: wrap;
    align-items:stretch;
  }

  .nav__item.has-sub > a {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }


  /* Окрема кнопка праворуч */
  .nav__toggle {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 10px 10px 0;
    padding: 0 16px;;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .nav__toggle:hover,
  .nav__toggle:active {
    background: #eef4ff;
    color: var(--primary);
  }

  /* Анімація повертання іконки */
  .nav__toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
  }

  .nav__item.has-sub.is-open .nav__toggle-icon {
    transform: rotate(90deg);
  }

  /* ВИМКНЕНО залипання десктопного :hover / :focus-within на мобільних */
  .nav__item.has-sub:hover .nav__sub,
  .nav__item.has-sub:focus-within .nav__sub {
    display: none;
  }

  /* Блок підкатегорій (схований за замовчуванням) */
  .nav__sub {
    display: none;
    width: 100%;
    position: static;
    margin: 6px 0 6px 10px;
    padding: 2px 0 2px 12px;
    border-left: 2px solid var(--primary);
    box-shadow: none;
    background: transparent;
    min-width: 0;
  }

  /* Відображення підкатегорій ТІЛЬКИ коли додано клас .is-open */
  .nav__item.has-sub.is-open .nav__sub,
  .nav__item.has-sub.is-open:hover .nav__sub,
  .nav__item.has-sub.is-open:focus-within .nav__sub {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .nav__sub a {
    padding: 7px 10px;
    font-size: 0.9rem;
    color: var(--muted);
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .nav__sub a:hover {
    background: #f1f5f9;
    color: var(--text);
    text-decoration: none;
  }

  /* Інші мобільні стилі */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card__body { padding: 10px; }
  .price__now { font-size: 1.05rem; }
  .filters { gap: 10px; }
  .filters input[type=number] { width: 90px; }

  .cart__row { grid-template-columns: 1fr auto; }
  .cart__sum { text-align: left; }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Підказки пошуку ---------- */
.search { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 60; max-height: 70vh; overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest__item { display: flex; align-items: center; gap: 12px; padding: 9px 14px; color: var(--text); }
.suggest__item:hover, .suggest__item.is-active { background: #eef4ff; text-decoration: none; }
.suggest__thumb { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: #eef1f6; border-radius: 8px; font-size: 1.4rem; overflow: hidden; }
.suggest__thumb img { width: 100%; height: 100%; object-fit: cover; }
.suggest__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.suggest__item small { display: block; color: var(--muted); font-size: .78rem; }
.suggest__cat span:last-child small { display: inline; margin-left: 6px; }
.suggest__price { white-space: nowrap; }
.suggest mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.suggest__note, .suggest__empty { padding: 12px 14px; color: var(--muted); font-size: .9rem; }
.suggest__all { display: block; padding: 11px 14px; border-top: 1px solid var(--border); font-weight: 600; text-align: center; }

/* ---------- Кабінет, вподобані, купони ---------- */
.messages { margin-bottom: 14px; }
.msg { padding: 11px 16px; border-radius: 10px; background: #eaf3ff; border: 1px solid #c9ddfb; margin-bottom: 8px; }
.msg--success { background: #e8f7ee; border-color: #bfe6cd; }
.msg--error { background: #fdecec; border-color: #f5c2c4; }

.card { position: relative; }
.heart-form { position: absolute; top: 8px; right: 8px; z-index: 2; margin: 0; }
.pdp__media--rel { position: relative; }
.pdp__media--rel .heart-form { top: 12px; right: 12px; }
.heart {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.2rem; line-height: 1;
  background: rgba(255,255,255,.92); color: #b4bcc8; box-shadow: var(--shadow); transition: transform .12s, color .12s;
}
.heart:hover { transform: scale(1.1); color: var(--accent); }
.heart.is-on { color: var(--accent); }

.auth { max-width: 420px; margin: 24px auto; }
.center-text { text-align: center; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.hint ul { list-style: disc; padding-left: 18px; }

.acc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.acc-nav { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; position: sticky; top: 130px; }
.acc-nav__user { display: flex; gap: 10px; align-items: center; padding: 6px 6px 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; min-width: 0; }
.acc-nav__user small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.acc-nav__ava { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.acc-nav nav { display: flex; flex-direction: column; }
.acc-nav a, .acc-nav__out { padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 600; background: none; border: 0; text-align: left; font: inherit; font-weight: 600; cursor: pointer; width: 100%; }
.acc-nav a:hover, .acc-nav__out:hover { background: #eef4ff; text-decoration: none; }
.acc-nav a[aria-current="page"] { background: #eef4ff; color: var(--primary); }
.acc__main h1 { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; color: var(--text); }
a.stat:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.stat b { font-size: 1.8rem; color: var(--primary); }
.stat span { color: var(--muted); font-size: .9rem; }

.coupons { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.coupon { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 2px dashed #c9ddfb; border-radius: var(--radius); padding: 12px 14px; }
.coupon--off { opacity: .55; border-color: var(--border); }
.coupon__val { font-size: 1.5rem; font-weight: 800; color: var(--primary); min-width: 72px; text-align: center; }
.coupon__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.coupon__body code { background: #f1f3f7; padding: 2px 8px; border-radius: 6px; width: fit-content; letter-spacing: .05em; }
.perk-banner { background: #fff8e1; border: 1px solid #f3e0a3; padding: 14px 16px; border-radius: var(--radius); }
.perk-banner small { display: block; }

.order { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.order__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.order__sum { margin-left: auto; }
.tag--st { background: #eaf3ff; color: var(--primary); }
.order__items { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.order__items li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }

.promo { padding: 14px 0; border-bottom: 1px solid var(--border); }
.promo__form { display: flex; gap: 8px; max-width: 360px; }
.promo__form input { flex: 1; min-width: 0; }
.promo__on { background: #e8f7ee; padding: 10px 14px; border-radius: 10px; }
.promo__hint { font-size: .85rem; margin: 8px 0 0; }
.inline { display: inline; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0 0 0 8px; text-decoration: underline; }
.totals { margin-left: auto; max-width: 340px; padding: 14px 0; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals__disc { color: var(--ok); }
.totals__sum { font-size: 1.3rem; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px !important; }

@media (max-width: 900px) {
  .acc { grid-template-columns: 1fr; }
  .acc-nav { position: static; }
  .acc-nav nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .acc-nav a, .acc-nav__out { width: auto; }
  .acc-nav form { display: contents; }
}

/* Віджет чату */
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* Закріплена кругла кнопка */
.chat-widget__toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chat-widget__toggle:hover {
  transform: scale(1.08);
}

.chat-widget__toggle .chat-icon-close {
  display: none;
}

/* Стан коли чат відкритий */
.chat-widget.is-active .chat-widget__toggle .chat-icon-open {
  display: none;
}

.chat-widget.is-active .chat-widget__toggle .chat-icon-close {
  display: block;
}

/* Вікно чату */
.chat-widget__window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 330px;
  max-width: calc(100vw - 32px);
  height: 430px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border, #e2e8f0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.chat-widget.is-active .chat-widget__window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Шапка чату */
.chat-widget__header {
  background: var(--primary, #2563eb);
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-widget__avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.chat-widget__info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-widget__info strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.chat-widget__info span {
  font-size: 0.75rem;
  opacity: 0.85;
}

.chat-widget__close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.chat-widget__close:hover {
  opacity: 1;
}

/* Область повідомлень */
.chat-widget__body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.chat-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg--incoming {
  background: #ffffff;
  color: #1e293b;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  border: 1px solid #e2e8f0;
}

.chat-msg--outgoing {
  background: var(--primary, #2563eb);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

/* Форма вводу */
.chat-widget__footer {
  display: flex;
  padding: 8px 10px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  gap: 6px;
}

.chat-widget__footer input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-widget__footer input:focus {
  border-color: var(--primary, #2563eb);
}

.chat-widget__footer button {
  background: var(--primary, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.chat-widget__footer button:hover {
  opacity: 0.9;
}