/* ============================================================
   КОМПОНЕНТЫ: шапка, навигация, подвал, чат, поиск
   ============================================================ */

/* ---------- Логотип ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__mark {
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1; font-weight: 700;
  box-shadow: var(--sh-primary);
}
.logo__txt { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; color: var(--ink); }
.logo__dot { color: var(--primary); }

/* ---------- ШАПКА ---------- */
.hdr { position: sticky; top: 0; z-index: 80; background: rgba(250,247,242,.85); backdrop-filter: blur(14px); transition: box-shadow .2s, border-color .2s; border-bottom: 1px solid transparent; }
.hdr.is-scrolled { box-shadow: var(--sh-sm); border-color: var(--border-2); }
.hdr__row { display: flex; align-items: center; gap: 28px; height: 76px; }
.hdr__nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.hdr__link { font-size: 15px; font-weight: 600; color: var(--ink-soft); padding: 9px 14px; border-radius: var(--r-md); transition: color .15s, background .15s; }
.hdr__link:hover { color: var(--ink); background: var(--surface-2); }
.hdr__link.is-active { color: var(--primary-dark); }
.hdr__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icn-btn { position: relative; width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--ink-soft); transition: color .15s, background .15s; }
.icn-btn:hover { color: var(--ink); background: var(--surface-2); }
.icn-badge { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-pill); background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; font-family: var(--font-display); }
.hdr__cart { position: relative; margin-left: 6px; }
.hdr__cart-count { background: rgba(255,255,255,.25); border-radius: var(--r-pill); min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; }

/* ---------- Нижняя навигация (моб.) ---------- */
.mobnav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.mobnav__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: var(--r-md); color: var(--ink-mute); font-size: 10.5px; font-weight: 600; transition: color .15s; }
.mobnav__item.is-active { color: var(--primary); }
.mobnav__ic { position: relative; }
.mobnav__badge { position: absolute; top: -4px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill); background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* ---------- ПОДВАЛ ---------- */
.ftr { background: var(--navy); color: var(--on-dark); margin-top: 40px; padding: 64px 0 28px; }
.ftr__top { display: grid; grid-template-columns: 1.3fr 2fr; gap: 48px; padding-bottom: 44px; border-bottom: 1px solid rgba(255,255,255,.08); }
.ftr__tag { color: var(--on-dark-mute); font-size: 14px; line-height: 1.6; margin: 18px 0 22px; max-width: 320px; }
.ftr__socials { display: flex; gap: 10px; }
.ftr__soc { padding: 8px 14px; border-radius: var(--r-pill); background: rgba(255,255,255,.06); font-size: 13px; font-weight: 600; transition: background .15s; }
.ftr__soc:hover { background: rgba(255,255,255,.14); }
.ftr__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.ftr__col { display: flex; flex-direction: column; gap: 11px; }
.ftr__col h4 { color: #fff; font-size: 13px; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 5px; }
.ftr__col button, .ftr__col a, .ftr__col span { text-align: left; color: var(--on-dark-mute); font-size: 14px; transition: color .15s; }
.ftr__col button:hover, .ftr__col a:hover { color: #fff; }
.ftr__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; color: var(--on-dark-mute); font-size: 13px; }
.ftr__legal { display: flex; gap: 22px; }
.ftr__legal a:hover { color: #fff; }

/* ---------- Чат поддержки ---------- */
.chat-fab { position: fixed; right: 24px; bottom: 24px; z-index: 95; width: 58px; height: 58px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: var(--sh-primary); transition: transform .18s, background .18s; }
.chat-fab:hover { transform: scale(1.06); background: var(--primary-dark); }
.chat-fab.is-open { background: var(--navy); }
.chat-panel { position: fixed; right: 24px; bottom: 94px; z-index: 95; width: 360px; max-width: calc(100vw - 32px); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border-2); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--navy); color: #fff; }
.chat-head__av { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); display: grid; place-items: center; font-size: 20px; font-weight: 700; }
.chat-head__name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.chat-head__status { font-size: 12px; color: var(--on-dark-mute); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.chat-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; height: 280px; overflow-y: auto; background: var(--bg); }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: var(--r-lg); font-size: 14px; line-height: 1.45; }
.chat-msg--op { background: var(--surface); border: 1px solid var(--border-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg--me { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border-2); background: var(--surface); }
.chat-input .input { height: 44px; }

/* ---------- Поиск (оверлей) ---------- */
.search-ov { position: fixed; inset: 0; z-index: 120; background: rgba(15,23,42,.4); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 86px 18px 18px; animation: fadeUp .2s ease both; }
.search-box { width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden; }
.search-top { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border-2); }
.search-top input { flex: 1; border: none; outline: none; font-size: 18px; font-family: var(--font-display); font-weight: 600; background: none; }
.search-top input::placeholder { color: var(--ink-mute); font-weight: 500; }
.search-res { max-height: 52vh; overflow-y: auto; padding: 10px; }
.search-hint { padding: 14px; }
.search-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-md); cursor: pointer; transition: background .12s; }
.search-item:hover { background: var(--surface-2); }
.search-item .ph { width: 52px; height: 52px; border-radius: var(--r-sm); flex: none; }
.search-item__t { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.search-item__c { font-size: 12.5px; color: var(--ink-mute); }
.search-empty { text-align: center; padding: 40px 20px; color: var(--ink-mute); }

@media (max-width: 920px) {
  .hdr__nav { display: none; }
  .ftr__top { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .hdr__cart-lbl { display: none; }
  .hdr__row { height: 64px; gap: 10px; }
  .mobnav { display: flex; }
  body.has-mobnav { padding-bottom: 72px; }
  .chat-fab { bottom: 84px; }
  .chat-panel { bottom: 154px; }
  .ftr__cols { grid-template-columns: 1fr 1fr; }
  .ftr__bottom { flex-direction: column; align-items: flex-start; }
}
