:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --accent: #0071e3;
  --accent-hover: #0062c4;
  --sale: #e3342f;
  --ok: #1f9d55;
  --star: #ffb400;
  --dark: #1d1d1f;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.container { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); border: 1px solid var(--line); }
.btn--block { width: 100%; }
.btn:disabled { background: #c7c7cc; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); padding: 0; font-size: 14px; }
.link-btn:disabled { color: var(--muted); opacity: .5; cursor: default; }
.icon-btn {
  position: relative; background: none; border: 0; padding: 8px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(0,0,0,.06); }
.counter {
  position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.counter:empty, .counter[data-zero] { display: none; }

.topbar { background: var(--dark); color: #d2d2d7; font-size: 13px; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.topbar__links { display: flex; gap: 20px; }
.topbar__links a:hover { color: #fff; }
.topbar__info { display: flex; gap: 16px; }
.topbar__phone { color: #fff; font-weight: 600; }
.topbar__ig { display: inline-flex; align-items: center; gap: 6px; }
.topbar__ig:hover { color: #fff; }
.social { display: inline-flex; align-items: center; gap: 7px; }

.header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.header__inner { display: flex; align-items: center; gap: 16px; height: 72px; }
.logo { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.logo--footer { color: #fff; margin-bottom: 8px; }
.logo__mark { flex-shrink: 0; }
.catalog-btn {
  display: flex; align-items: center; gap: 10px; background: var(--dark); color: #fff;
  border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600;
}
.catalog-btn:hover { background: #000; }
.burger { display: grid; gap: 3px; width: 16px; }
.burger i { display: block; height: 2px; background: currentColor; border-radius: 1px; transition: transform .2s, opacity .2s; }
.catalog-btn[aria-expanded="true"] .burger i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.catalog-btn[aria-expanded="true"] .burger i:nth-child(2) { opacity: 0; }
.catalog-btn[aria-expanded="true"] .burger i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.search { flex: 1; display: flex; background: var(--bg); border-radius: 10px; border: 1px solid transparent; }
.search:focus-within { border-color: var(--accent); background: #fff; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 14px; outline: none; }
.search button { border: 0; background: none; padding: 0 14px; color: var(--muted); }
.header__actions { display: flex; gap: 4px; }

.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.mega__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; padding: 24px 20px; }
.mega__item {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px;
  border-radius: var(--radius); text-align: center; font-weight: 500; font-size: 14px;
}
.mega__item:hover { background: var(--bg); }
.mega__img { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.mega__img img, .mega__img svg { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.catnav { background: var(--surface); border-bottom: 1px solid var(--line); }
.catnav__inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav__inner::-webkit-scrollbar { display: none; }
.catnav a {
  padding: 12px 14px; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.catnav a:hover { color: var(--text); }
.catnav a.active { color: var(--text); border-bottom-color: var(--accent); }

.breadcrumbs { font-size: 13px; color: var(--muted); padding: 18px 0 6px; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 6px; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 30px; margin: 0; letter-spacing: -.5px; }
.page-head__count { color: var(--muted); }

.layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }

.filters { background: var(--surface); border-radius: var(--radius); padding: 18px; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
.filters__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.filters__apply { display: none; }
.filter { border-top: 1px solid var(--line); padding: 14px 0; }
.filter h3 { font-size: 14px; margin: 0 0 10px; }
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; outline: none; }
.price-inputs input:focus { border-color: var(--accent); }
.checks { display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 2px 0; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.check small { color: var(--muted); margin-left: auto; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); padding: 0;
  box-shadow: 0 0 0 2px #fff inset;
}
.swatch.active { outline: 2px solid var(--accent); outline-offset: 2px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar__filters { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 5px 10px; font-size: 13px;
}
.chip button { border: 0; background: none; padding: 0; color: var(--muted); font-size: 14px; line-height: 1; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-left: auto; }
.sort select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card {
  position: relative; background: var(--surface); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__badge {
  position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px; color: #fff; background: var(--accent); z-index: 1;
}
.card__badge--Знижка { background: var(--sale); }
.card__badge--Хіт { background: #ff9500; }
.card__fav { position: absolute; top: 8px; right: 8px; z-index: 1; color: var(--muted); }
.card__fav.active { color: var(--sale); }
.card__fav.active svg path { fill: currentColor; }
.card__img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; cursor: pointer; }
.card__img svg { width: 78%; height: 78%; }
.card__img img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.card:hover .card__img img { transform: scale(1.04); }
.card__title { font-size: 14px; font-weight: 500; line-height: 1.35; margin: 0 0 4px; cursor: pointer; min-height: 38px; }
.card__title:hover { color: var(--accent); }
.card__meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.rating { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.rating b { color: var(--star); letter-spacing: 1px; font-weight: 400; }
.card__bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price { display: flex; flex-direction: column; }
.price__old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.price__now { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.price__now--sale { color: var(--sale); }
.stock { font-size: 12px; margin-bottom: 6px; }
.stock--yes { color: var(--ok); }
.stock--no { color: var(--muted); }
.buy-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.buy-btn:hover { background: var(--accent-hover); }
.buy-btn.in-cart { background: var(--ok); }
.buy-btn:disabled { background: #d2d2d7; cursor: not-allowed; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); background: var(--surface); border-radius: var(--radius); }

.pagination { display: flex; justify-content: center; gap: 6px; margin: 24px 0 8px; }
.pagination button {
  min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
.pagination button.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.pagination button:disabled { opacity: .4; cursor: default; }

.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 40px 0; }
.perk { background: var(--surface); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.perk span { color: var(--muted); font-size: 14px; }

.footer { background: var(--dark); color: #d2d2d7; padding: 40px 0 20px; font-size: 14px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer h4 { color: #fff; margin: 0 0 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a:hover { color: #fff; }
.footer .muted { color: #86868b; }
.footer__bottom { border-top: 1px solid #333; margin-top: 28px; padding-top: 16px; font-size: 12px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); z-index: 60;
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease;
}
.drawer.open { transform: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { margin: 0; font-size: 20px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.drawer__foot { padding: 16px 20px; border-top: 1px solid var(--line); }
.drawer__total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 16px; }
.drawer__total strong { font-size: 22px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item__img { width: 64px; height: 64px; }
.cart-item__img img, .cart-item__img svg { width: 100%; height: 100%; object-fit: contain; }
.cart-item__name { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.cart-item__price { font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; }
.qty button { width: 28px; height: 28px; border: 0; background: none; }
.qty span { min-width: 24px; text-align: center; font-size: 14px; }
.cart-item__remove { background: none; border: 0; color: var(--muted); font-size: 18px; align-self: start; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 0; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal__box { position: relative; background: var(--surface); border-radius: 18px; width: min(860px, 100%); max-height: 92vh; overflow-y: auto; padding: 28px; }
.modal__close { position: absolute; top: 12px; right: 12px; }
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.pdp__img { background: var(--bg); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; aspect-ratio: 1; }
.pdp__img svg { width: 75%; height: 75%; }
.pdp__img { overflow: hidden; }
.pdp__img img { width: 90%; height: 90%; object-fit: contain; mix-blend-mode: multiply; }
.pdp h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.3px; }
.pdp .price__now { font-size: 30px; }
.specs { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.specs td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.specs td:first-child { color: var(--muted); width: 45%; }
.pdp__actions { display: flex; gap: 10px; margin-top: 12px; }
.pdp__actions .btn { flex: 1; }

.rating--link { cursor: pointer; }
.rating--link:hover { color: var(--accent); }
.reviews { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; }
.reviews__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.reviews__head h3 { margin: 0; font-size: 20px; }
.reviews__score { font-size: 14px; color: var(--muted); }
.reviews__score b { color: var(--star); letter-spacing: 1px; font-weight: 400; }
.reviews__list { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; margin-bottom: 20px; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review__top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.review__author { font-size: 14px; }
.review__date { font-size: 12px; }
.review__del { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 14px; }
.review__del:hover { color: var(--sale); }
.review .rating { margin-bottom: 6px; }
.review__text { margin: 0; font-size: 14px; line-height: 1.5; }
.review-form { display: grid; gap: 10px; background: var(--bg); border-radius: var(--radius); padding: 16px; }
.review-form h4 { margin: 0; font-size: 16px; }
.review-form__note { margin: 0; font-size: 13px; color: var(--muted); }
.review-form input, .review-form textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; background: var(--surface);
  font-family: inherit; resize: vertical;
}
.review-form input:focus, .review-form textarea:focus { border-color: var(--accent); }
.review-form .btn { justify-self: start; }
.stars-input { display: flex; gap: 2px; }
.stars-input button { background: none; border: 0; padding: 0 2px; font-size: 26px; line-height: 1; color: #d2d2d7; }
.stars-input button.on { color: var(--star); }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.form input, .form select { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.form input:focus, .form select:focus { border-color: var(--accent); }

.doc { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; margin: 8px 0 48px; }
.doc__nav { position: sticky; top: 90px; background: var(--surface); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.doc__nav b { font-size: 14px; margin-bottom: 6px; }
.doc__nav a { font-size: 14px; color: var(--muted); padding: 6px 0; }
.doc__nav a:hover { color: var(--accent); }
.doc__body { background: var(--surface); border-radius: var(--radius); padding: 32px; }
.doc__body section { scroll-margin-top: 100px; }
.doc__body section + section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 28px; }
.doc__body h2 { font-size: 22px; margin: 0 0 14px; letter-spacing: -.3px; }
.doc__body h3 { font-size: 16px; margin: 20px 0 8px; }
.doc__body p, .doc__body li { line-height: 1.6; }
.doc__body p { margin: 0 0 12px; }
.doc__body ul, .doc__body ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.doc__lead { font-size: 16px; color: var(--muted); }
.doc table { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 14px; }
.doc th, .doc td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { background: var(--bg); font-weight: 600; }
.doc td b { font-weight: 600; }
.note { background: var(--bg); border-radius: 12px; padding: 14px 16px; font-size: 14px; margin: 0 0 12px; }
.note--accent { background: #eef5ff; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.faq { display: grid; gap: 8px; }
.faq details { background: var(--bg); border-radius: 12px; padding: 12px 16px; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq p { margin: 10px 0 2px; font-size: 14px; }
.page-head--doc { display: block; }
.page-head--doc p { color: var(--muted); margin: 6px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--dark); color: #fff;
  padding: 12px 20px; border-radius: 12px; z-index: 80; transition: transform .25s; font-size: 14px;
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 1024px) {
  .mega__grid { grid-template-columns: repeat(4, 1fr); }
  .perks { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .doc { grid-template-columns: 1fr; }
  .doc__nav { position: static; }
  .doc__body { padding: 20px; }
  .topbar__links { display: none; }
  .topbar__inner { justify-content: flex-end; }
  .layout { grid-template-columns: 1fr; }
  .filters {
    position: fixed; inset: 0; top: 0; max-height: none; border-radius: 0; z-index: 65;
    transform: translateX(-100%); transition: transform .25s;
  }
  .filters.open { transform: none; }
  .filters__apply { display: flex; width: 100%; margin-top: 12px; }
  .toolbar__filters { display: inline-flex; }
  .chips { order: 3; flex-basis: 100%; }
  .pdp { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header__inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .catalog-btn { order: 3; padding: 10px 12px; }
  .search { order: 4; flex-basis: calc(100% - 110px); }
  .header__actions { margin-left: auto; }
  .mega__grid { grid-template-columns: repeat(2, 1fr); }
  .page-head h1 { font-size: 24px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card { padding: 12px; }
  .price__now { font-size: 17px; }
  .buy-btn { width: 38px; height: 38px; }
  .sort span { display: none; }
  .perks, .footer__grid { grid-template-columns: 1fr; }
  .modal__box { padding: 20px; }
}
