/* ===== TOP BAR (1:1 from prototype) ===== */
.top-bar {
  background: var(--brand-teal-light);
  border-bottom: 1px solid #d8e8eb;
  height: 40px;
  font-size: 13px;
  color: var(--brand-gray);
  overflow: hidden;
  position: relative;
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.top-bar__left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
}
.top-bar__center {
  position: relative;
  overflow: hidden;
  height: 40px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-bar__slider {
  display: flex;
  align-items: center;
  animation: slideText 12s ease-in-out infinite;
  white-space: nowrap;
  width: 100%;
}
.top-bar__slide {
  min-width: 100%;
  text-align: center;
  font-weight: 700;
  color: var(--brand-dark);
  font-size: 13px;
}
@keyframes slideText {
  0%, 30%   { transform: translateX(0); }
  35%, 65%  { transform: translateX(-100%); }
  70%, 100% { transform: translateX(-200%); }
}
.top-bar__right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  flex: 0 0 auto;
}
.top-bar__phone {
  font-weight: 700;
  color: var(--brand-dark);
  white-space: nowrap;
}
.top-bar__phone a { color: var(--brand-dark); }
.top-bar__phone a:hover { color: var(--brand-teal); }

/* "Официальный дилер" badge */
.official-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-teal);
  color: white;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.official-badge svg { width: 12px; height: 12px; fill: white; }

/* ===== HEADER (1:1 from prototype) ===== */
.header {
  background: #fff;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header__logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}
.header__logo img {
  display: block;
  height: 42px;
  width: 274px;
  max-width: 100%;
}
.header__nav {
  display: flex;
  gap: 28px;
  flex: 0 1 auto;
  white-space: nowrap;
}
.header__nav a {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-dark);
  letter-spacing: 0.5px;
  transition: color 0.2s;
  white-space: nowrap;
}
.header__nav a:hover { color: var(--brand-teal); }

/* Search */
.header__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-light-gray);
  border: 1px solid var(--brand-border);
  border-radius: 4px;
  padding: 8px 12px;
  width: 240px;
  flex: 0 0 auto;
  /* position: relative — для SearchLive .searchlive-result/.searchlive-wait,
     которые position: absolute и якорятся к ближайшему позиционированному
     предку. Без этого выпадашка прыгает в угол body. */
  position: relative;
}
.header__search svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  stroke: #999;
}
.header__search input {
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  color: var(--brand-dark);
}
.header__search input::placeholder { color: #999; }

/* Header icons (compare / wishlist / cart / burger) */
.header__icons {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 0 0 auto;
}
.header__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  color: var(--brand-dark);
  transition: opacity 0.2s;
}
.header__icon:hover { opacity: 0.6; }

/* Help icon dropdown — пункты «Доставка / Оплата / Возврат» при hover/focus.
   Pure CSS, без JS. :focus-within держит меню открытым при keyboard-навигации
   и tap на мобиле (после касания элемент получает фокус → меню остаётся открытым
   пока пользователь не тапнет вне). */
.header__help { position: relative; }
.header__help:hover,
.header__help:focus-within { opacity: 1; }
.header__help-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin: 6px 0 0;
  padding: 8px 0;
  list-style: none;
  min-width: 160px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 1000;
}
.header__help:hover .header__help-menu,
.header__help:focus-within .header__help-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header__help-menu li { margin: 0; }
.header__help-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.header__help-menu a::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-yellow);
  flex-shrink: 0;
}
.header__help-menu a:hover { background: rgba(0, 0, 0, 0.04); }
.header__icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--brand-dark);
  fill: none;
}
.header__icon .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: var(--brand-yellow);
  color: var(--brand-dark);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}
.header__cart-hidden { display: none !important; }

/* ===== CATEGORY NAV (1:1 from prototype) ===== */
.cat-nav {
  background: var(--brand-teal);
  padding: 0;
}
.cat-nav .container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}
.cat-nav a {
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 12px 20px;
  letter-spacing: 0.5px;
  transition: background 0.2s;
  white-space: nowrap;
}
.cat-nav a:hover { background: rgba(255,255,255,0.15); }
.cat-nav a.cat-nav--highlight {
  background: rgba(255,255,255,0.2);
  border-bottom: 2px solid var(--brand-yellow);
}
.cat-nav a.cat-nav--highlight:hover { background: rgba(255,255,255,0.25); }

/* ===== BURGER (mobile only) ===== */
.burger-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1001;   /* above the open drawer (1000) so the X-icon stays clickable to close it */
}
.burger-btn span,
.burger-btn span::before,
.burger-btn span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--brand-dark);
  border-radius: 2px;
  transition: all 0.3s;
}
.burger-btn span { position: relative; }
.burger-btn span::before,
.burger-btn span::after {
  content: '';
  position: absolute;
  left: 0;
}
.burger-btn span::before { top: -7px; }
.burger-btn span::after  { top:  7px; }
.burger-btn.active span { background: transparent; }
.burger-btn.active span::before { top: 0; transform: rotate(45deg); }
.burger-btn.active span::after  { top: 0; transform: rotate(-45deg); }

/* ===== MOBILE DRAWER ===== */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;   /* must be ABOVE the sticky header (z-index: 200) so the panel covers it */
}
.mobile-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.3s;
}
.mobile-drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: white;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  padding: 72px 24px 32px;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}
.mobile-drawer.open { display: block; }
.mobile-drawer.visible .mobile-drawer__overlay { opacity: 1; }
.mobile-drawer.visible .mobile-drawer__panel { transform: translateX(0); }

.mobile-drawer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--brand-dark);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.mobile-drawer__close svg { width: 22px; height: 22px; }
.mobile-drawer__close:hover,
.mobile-drawer__close:focus { background: var(--brand-light-gray); outline: none; }
.mobile-drawer__close:active { color: var(--brand-teal); }

.mobile-drawer__nav { display: flex; flex-direction: column; gap: 0; }
.mobile-drawer__nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-dark);
  border-bottom: 1px solid #f0f0f0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mobile-drawer__nav a:last-child { border-bottom: none; }
.mobile-drawer__nav a:active { color: var(--brand-teal); }

.mobile-drawer__section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--brand-light-gray);
}
.mobile-drawer__section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-gray);
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.mobile-drawer__contacts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-drawer__contacts a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-dark);
}
.mobile-drawer__contacts a svg {
  width: 18px;
  height: 18px;
  stroke: var(--brand-teal);
  fill: none;
  stroke-width: 2;
}
.mobile-drawer__schedule {
  font-size: 12px;
  color: var(--brand-gray);
  margin-top: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .header .container { gap: 16px; }
  .header__nav { gap: 20px; }
  .header__search { width: 200px; }
}

@media (max-width: 992px) {
  .top-bar__left { display: none; }
  .top-bar__right { gap: 14px; }
}

@media (max-width: 768px) {
  .top-bar { height: 36px; font-size: 12px; }
  .top-bar .container { justify-content: center; }
  .top-bar__left, .top-bar__right { display: none; }
  .top-bar__center { flex: 1; height: 36px; }
  .top-bar__slide { font-size: 12px; }

  .header { padding: 12px 0; position: sticky; top: 0; z-index: 200; background: #fff; }
  .header .container { gap: 8px; }
  .header__logo img { height: 30px; width: auto; }
  .header__nav { display: none; }
  .header__search { display: none; }
  .header__icons { gap: 4px; }
  .header__icon { width: 44px; height: 44px; }
  .header__icon--desktop { display: none; }
  .burger-btn { display: flex; }

  .cat-nav { position: sticky; top: 65px; z-index: 199; }
  .cat-nav .container {
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cat-nav .container::-webkit-scrollbar { display: none; }
  .cat-nav a { padding: 10px 14px; font-size: 12px; }
}
