:root {
  --blue: #2F5BFF;
  --blue-dark: #2347D6;
  --yellow: #ffd84a;
  --text: #111;
  --muted: #555;
  --line: #e6e6e6;
  --red: #e5484d;
  --footer: #e9e9e9;
  --head-font: "Unbounded", sans-serif;
  --body-font: "Montserrat", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--body-font); color: var(--text); background: #fff; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select { font: inherit; }
.container { max-width: 1210px; margin: 0 auto; padding: 0 16px; }
.badge {
  position: absolute; top: -6px; right: -8px;
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 50%;
  background: var(--yellow); color: #111; font-size: 9px; font-weight: 700;
  display: grid; place-items: center;
}
.chev {
  display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}

/* ---------- Topbar ---------- */
.topbar { border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.topbar__social { display: flex; gap: 14px; }
.ic { width: 16px; height: 16px; border-radius: 50%; background: #111; display: inline-block; position: relative; }
.ic::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.ic--tg { border-radius: 2px; clip-path: polygon(0 45%, 100% 0, 80% 100%); }
.ic--tg::after { display: none; }
.lang a { color: #111; }
.lang a.active { color: var(--blue); }

/* ---------- Header ---------- */
.header { border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; height: 78px; gap: 28px; }
.logo { font-family: var(--head-font); font-weight: 800; font-size: 28px; letter-spacing: -1px; display: flex; align-items: center; }
.logo { flex: none; }
.logo__img { display: block; height: 34px; width: auto; }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 13px; font-weight: 500; color: #333; }
.nav a:hover { color: var(--blue); }
.nav__drop { position: relative; }
.nav__menu {
  position: absolute; top: 100%; left: -12px; z-index: 20; padding: 10px 0; min-width: 210px;
  background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s;
}
.nav__menu a { display: block; padding: 8px 16px; }
.nav__drop:hover .nav__menu { opacity: 1; visibility: visible; transform: none; }
.account { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.account svg { width: 18px; }
.callback {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px;
  background: #ececec; border-radius: 24px; font-size: 13px; font-weight: 500; transition: .2s;
}
.callback:hover { background: var(--yellow); }
.callback svg { width: 16px; }
.header__icons { display: flex; gap: 22px; }
.hicon { position: relative; display: block; }
.hicon svg { width: 22px; height: 22px; display: block; }

/* ---------- Searchbar ---------- */
.searchbar { background: var(--blue); }
.searchbar__inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.catalog-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 22px;
  background: var(--yellow); border-radius: 22px; font-weight: 500; font-size: 15px; transition: .2s;
}
.catalog-btn:hover { filter: brightness(.95); }
.grid-ic { display: grid; grid-template-columns: 7px 7px; gap: 2px; }
.grid-ic i { width: 7px; height: 7px; background: #111; border-radius: 2px; }
.search { flex: 1; position: relative; max-width: 740px; }
.search input {
  width: 100%; height: 38px; padding: 0 50px 0 16px; border: 0; border-radius: 22px; outline: none;
  font-size: 14px;
}
.search button {
  position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--yellow); display: grid; place-items: center;
}
.search button svg { width: 16px; }
.cart { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 15px; font-weight: 500; }
.cart__ic { position: relative; }
.cart__ic svg { width: 24px; display: block; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding: 10px 16px; font-size: 12px; color: #444; }
.breadcrumbs span { margin: 0 6px; }

/* ---------- Layout ---------- */
.shop { display: grid; grid-template-columns: 274px 1fr; gap: 26px; padding-bottom: 80px; }

/* Sidebar */
.sidebar {
  align-self: start; border: 1px solid var(--line); border-radius: 4px; padding: 18px 24px 20px;
}
.sidebar__cats { list-style: none; }
.sidebar__cats li { margin-bottom: 7px; }
.sidebar__cats a { font-size: 12.5px; color: #444; line-height: 1.25; transition: .15s; }
.sidebar__cats a:hover, .sidebar__cats a.active { color: var(--blue); font-weight: 600; }
.sidebar__sub { list-style: none; margin: 7px 0 4px 10px; padding-left: 12px; border-left: 2px solid #e5e9f2; }
.sidebar__sub li { margin-bottom: 6px; }
.sidebar__sub a { font-size: 12px; color: #666; }
.sidebar__title { font-family: var(--head-font); font-size: 15px; margin: 26px 0 8px; }
.filter { border-top: 1px solid var(--line); }
.filter__head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 13px 0; font-size: 13px; color: #333;
}
.filter__head .chev { color: #999; }
.filter__body { display: none; padding-bottom: 14px; }
.filter.open .filter__body { display: block; }
.filter.open .chev { transform: rotate(-135deg); }
.price-row { display: flex; align-items: center; gap: 8px; }
.price-row input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; outline: none; }
.price-row input:focus { border-color: var(--blue); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; cursor: pointer; }
.check input { accent-color: var(--blue); width: 15px; height: 15px; }
.reset-btn {
  margin-top: 10px; width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 12px; color: #555; transition: .2s;
}
.reset-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Content */
.content__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.content__head h1 { font-family: var(--head-font); font-size: 30px; font-weight: 700; }
.sort { font-size: 13px; color: #333; display: flex; align-items: center; gap: 10px; }
.sort select {
  padding: 5px 12px; border: 0; border-radius: 14px; background: #ececec; outline: none; cursor: pointer;
}

/* Category circles */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px 20px; margin-bottom: 50px; }
.cat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cat__circle {
  width: 100%; max-width: 186px; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; transition: transform .3s, box-shadow .3s;
}
.cat:hover .cat__circle { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,.18); }
.cat.active .cat__circle { outline: 4px solid var(--yellow); outline-offset: 3px; }
.cat__img { width: 100%; height: 100%; object-fit: cover; }
.cat__img--emoji { display: grid; place-items: center; font-size: 78px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }
.cat__name { margin-top: 12px; font-family: var(--head-font); font-size: 12px; font-weight: 700; line-height: 1.3; max-width: 170px; }

/* Product cards */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
/* Картка: біла плитка з тінню; при наведенні знизу випадає панель характеристик */
.card {
  display: flex; flex-direction: column; position: relative; background: #fff;
  border: 1px solid #eceef3; border-radius: 14px; padding: 14px 16px 16px;
  box-shadow: 0 2px 10px rgba(16, 26, 51, .05); transition: box-shadow .2s, border-color .2s;
}
.card:hover { z-index: 5; border-color: #e2e6f0; box-shadow: 0 12px 34px rgba(16, 26, 51, .14); }
.card--specs:hover { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.card__labels { position: absolute; top: 14px; left: 14px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.card__badge {
  font-family: var(--head-font); font-size: 10px; font-weight: 700; text-transform: uppercase;
  background: var(--yellow); color: #111; padding: 5px 9px; border-radius: 8px;
}
.card__badge--sale { background: var(--red); color: #fff; }
.card__acts { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.card__act { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; transition: .2s; }
.card__act:hover { background: #EEF2FF; }
.card__act svg { width: 20px; height: 20px; fill: none; stroke: #111; stroke-width: 1.8; stroke-linecap: round; transition: .2s; }
.card__act:hover svg { stroke: var(--blue); }
.card__act.on svg { fill: var(--red); stroke: var(--red); }
.card__act[data-act="cmp"].on svg { fill: none; stroke: var(--blue); }
.card__media { height: 210px; display: flex; align-items: center; justify-content: center; margin: 6px 0 14px; overflow: hidden; }
/* Фото поставщиків різного розміру — вписуємо в однаковий блок, не обрізаючи */
img.card__img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; transition: transform .3s; }
.card:hover img.card__img { transform: scale(1.04); }
.card__img--emoji { font-size: 110px; line-height: 1; transition: transform .3s; }
.card:hover .card__img--emoji { transform: scale(1.08); }
.card--out .card__media { opacity: .45; }
.card__meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; color: #8a8f9c; margin-bottom: 6px; min-height: 16px; }
.card__meta > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__stock { font-size: 11.5px; color: #2f9e44; white-space: nowrap; }
.card--out .card__stock { color: #999; }
/* Назва: зліва, жирна, не більше 2 рядків — картки однакової висоти */
.card__name {
  font-size: 15px; font-weight: 600; line-height: 1.4; color: #111;
  min-height: calc(1.4em * 2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.card__price { display: flex; flex-direction: column; line-height: 1.15; }
.card__price span { font-family: var(--head-font); font-size: 19px; font-weight: 700; color: #111; white-space: nowrap; }
.card__price .new { color: var(--red); }
.card__price s { font-size: 12px; color: #8a8f9c; }
.card__buy {
  padding: 11px 24px; border-radius: 10px; background: #101A33; color: #fff;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .2s;
}
.card__buy:hover { background: var(--blue); color: #fff; }
.card__buy:disabled { background: #eee; color: #888; cursor: default; }
/* Характеристики при наведенні — накривають ряд нижче, не зсуваючи сітку */
.card__specs {
  display: none; position: absolute; left: -1px; right: -1px; top: calc(100% - 6px);
  background: #fff; border: 1px solid #e2e6f0; border-top: 0; border-radius: 0 0 14px 14px;
  padding: 10px 16px 14px; box-shadow: 0 18px 30px rgba(16, 26, 51, .14);
  grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; font-size: 12.5px;
}
.card__specs dt { color: #8a8f9c; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card__specs dt::after { content: " ··························································"; color: #cfd3dc; }
.card__specs dd { text-align: right; color: #222; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 170px; }
@media (hover: hover) and (min-width: 901px) {
  .card--specs:hover .card__specs { display: grid; }
}
.empty { text-align: center; padding: 40px; color: #777; font-size: 16px; }

/* ---------- Footer ---------- */
.footer { background: var(--footer); }
.footer__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding: 50px 16px 40px; }
.footer h4 { font-family: var(--head-font); font-size: 14.5px; margin-bottom: 14px; }
.footer h4.mt { margin-top: 24px; }
.footer a, .footer p { display: block; font-size: 12.5px; color: #333; margin-bottom: 9px; }
.footer a:hover { color: var(--blue); }
.footer .lang a { display: inline; }
.footer .big-phone { font-family: var(--head-font); font-size: 17px; font-weight: 700; color: var(--blue); }
.pay { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.visa { font-weight: 800; font-style: italic; color: #1a1f71; font-size: 15px; }
.mc { display: flex; }
.mc i { width: 18px; height: 18px; border-radius: 50%; background: #eb001b; }
.mc i + i { background: #f79e1b; margin-left: -7px; mix-blend-mode: multiply; }
.socials { display: flex; gap: 10px; }
.socials .s {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 14px; margin: 0;
}
.socials .s:hover { color: #fff; transform: scale(1.08); }
.s--tg { background: #2aa3e0; } .s--vb { background: #7360f2; } .s--wa { background: #25d366; } .s--ms { background: #0a7cff; }
.footer__bottom { background: #111; color: #aaa; text-align: center; font-size: 10px; padding: 12px; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal__box { background: #fff; border-radius: 16px; padding: 30px; width: 100%; max-width: 380px; position: relative; }
.modal__box h3 { font-family: var(--head-font); margin-bottom: 8px; }
.modal__box p { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.modal__box input { width: 100%; padding: 11px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.modal__box input:focus { border-color: var(--blue); }
.modal__box form button { width: 100%; padding: 12px; border-radius: 22px; background: var(--yellow); font-weight: 600; }
.modal__close { position: absolute; top: 10px; right: 14px; font-size: 26px; color: #999; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: #111; color: #fff; padding: 12px 20px; border-radius: 24px; font-size: 13px;
  transition: .25s; pointer-events: none; z-index: 200; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav { display: none; }
  .account { margin-left: auto; }
}
@media (max-width: 900px) {
  .topbar__phone:nth-of-type(2), .topbar__mail { display: none; }
  .shop { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .cats { grid-template-columns: repeat(3, 1fr); }
  .products { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
  .card__buy { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  .topbar__social { display: none; }
  .account, .callback { display: none; }
  .header__icons { margin-left: auto; }
  .searchbar__inner { gap: 10px; }
  .catalog-btn { padding: 9px 14px; font-size: 13px; }
  .cart { font-size: 0; gap: 0; }
  .content__head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .content__head h1 { font-size: 24px; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .cat__img--emoji { font-size: 56px; }
  .products { gap: 10px; }
  .card { padding: 10px 10px 12px; border-radius: 12px; }
  .card__acts { top: 8px; right: 8px; }
  .card__labels { top: 10px; left: 10px; }
  .card__name { font-size: 13px; }
  .card__bottom { flex-direction: column; align-items: stretch; gap: 8px; }
  .card__price span { font-size: 16px; }
  .card__buy { padding: 9px 10px; }
  .card__media { height: 140px; }
  .card__img--emoji { font-size: 80px; }
  .footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Кошик / оформлення (дані з CRM) ---------- */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.modal__box--wide { max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; }
.btn-primary { width: 100%; padding: 12px; border-radius: 22px; background: var(--yellow); font-weight: 600; margin-top: 8px; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.cart-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.cart-list__empty { color: var(--muted); text-align: center; padding: 20px 0; }
.cart-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cart-item__media { width: 52px; height: 52px; border-radius: 10px; background: #f4f4f4; display: grid; place-items: center; font-size: 28px; overflow: hidden; }
.cart-item__media img { width: 100%; height: 100%; object-fit: contain; }
.cart-item__name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.cart-item__price { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cart-item__out { color: var(--red); font-size: 12px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 50%; background: #f1f1f1; font-weight: 700; }
.qty button:hover { background: var(--yellow); }
.qty span { min-width: 18px; text-align: center; font-weight: 600; }
.qty .rm { background: none; color: #999; font-size: 18px; }
.cart-total { display: flex; justify-content: space-between; font-size: 16px; margin: 6px 0 4px; }
.checkout input, .checkout textarea { width: 100%; padding: 11px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; outline: none; font: inherit; resize: vertical; }
.checkout input:focus, .checkout textarea:focus { border-color: var(--blue); }
.checkout input:disabled { background: #f6f6f6; }
.checkout .check { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.checkout .check input { width: auto; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lbl { display: block; font-weight: 600; font-size: 13px; margin: 6px 0 8px; }
.ac { position: relative; }
.ac__list { position: absolute; z-index: 5; top: calc(100% - 8px); left: 0; right: 0; max-height: 220px; overflow-y: auto; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.1); }
.ac__list li { padding: 9px 14px; cursor: pointer; font-size: 13px; }
.ac__list li:hover, .ac__list li.hl { background: #f3f6ff; }
.ac__list li.muted { color: var(--muted); cursor: default; background: none; }
.form-error { color: var(--red); font-size: 13px; margin-bottom: 10px; }
.notice { background: #fff7d6; border: 1px solid #f3df8a; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

[hidden] { display: none !important; }
