/* Split from headernew.css: core header styles */

/* 0) Reset (мягкий) */

*, *::before, *::after{
  box-sizing: border-box;
}

html, body{
  margin: 0;
}

button, input, select{
  font: inherit;
}

/* 1) Tokens / theme */

:root{
  --bg: #0e0e1a;
  --bg-alt: #181929;
  --text: #f6faff;
  --muted: #bcc5db;
  --brand: #ffe173;
  --brand-ink: #23273b;
  --stroke: #2e314c;
  --shadow: 0 4px 32px #181e2f48;
  --content-max: 1654px;
  --page-gutter: max(16px, calc((100vw - var(--content-max)) / 2));
  --nt-border: rgba(255,255,255,.08);
  --scroll-track: #20222c;
  --scroll-thumb: #585a66;
  --scroll-thumb-hover: #6b6e7a;
}

/* 2) Header shell */

.header-desktop{
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding-inline: var(--page-gutter);
}

.header-left, .header-center, .header-right{
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-center{
  flex: 1 1 auto;
  justify-content: flex-start;
}

.logo{
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: var(--brand);
}

.logo-svg{
  width: 149px;
  height: 40px;
}

/* 3) Search (desktop look) */

/* аккуратная анимация при фокусе + «Enter» */

@keyframes hint-pop {
  0% { transform: translateY(6px) scale(.96); opacity: 0; }
  100%{ transform: translateY(0)  scale(1);   opacity: 1; }
}

.header-center{
  opacity: 1;
  animation: hint-pop .18s ease both;
}

.header-center .search-form .search-btn{
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #eaeaea;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}

.header-center .search-form .search-btn:hover{
  filter: brightness(1.06);
}

.header-center .search-form .search-btn:active{
  transform: translateY(-50%) scale(.98);
}

@media (max-width: 520px){
  .header-center .search-form{
    padding: 0 44px 0 38px;
  }

  .header-center .search-form .search-btn{
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }
}

.header-center .search-form input{
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: #e9e9e9;
  font-size: 14px;
  line-height: 40px;
  padding: 0;
}

.header-center .search-form input::placeholder{
  color: #9a9a9a;
}

@media (max-width: 900px){
  .header-center .search-form{
    width: 100%;
    max-width: 100%;
  }
}

/* 4) Right actions — чистый вид (без фона) */

.header-right .dropdown-toggle,
.header-right .btn-secondary,
.header-right .btn-primary,
.header-right .cart-btn{
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  box-shadow: none !important;
}

.header-right :where(.dropdown-toggle,.btn-secondary,.btn-primary,.cart-btn):hover{
  color: var(--brand);
}

.header-right .cart-btn{
  position: relative;
  display: inline-flex !important;
  align-items: center;
  color: #fff !important;
  text-decoration: none;
}

.header-right .cart-btn .cart-icon{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* круглый бейдж количества */

.header-right .cart-btn .cart-badge{
  position: absolute;
  padding: 0 5px;
  border-radius: 10px;
  background: linear-gradient(135deg,#ff0000,#ff0000);
  color: #fff;
  font-weight: 800;
  border: 3px solid #0f111a;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(92,53,255,.45);
  transform-origin: 50% 50%;
}

/* разделитель-точка перед суммой */

.header-right .cart-btn .price-dot{
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #7b7e8d;
  opacity: .85;
  display: inline-block;
}

/* сумма заказа */

.header-right .cart-btn .cart-total{
  letter-spacing: .1px;
}

/* hover — золотая подсветка текста/иконки */

.header-right .cart-btn:hover{
  color: var(--brand) !important;
}

.header-right img.icon{
  width: 32px;
  height: 32px;
  display: inline-block;
  object-fit: contain;
}

/* Favorites как обычная иконка-кнопка в правой зоне */

.header-right .favorites-btn{
  display: inline-flex;
  align-items: center;
}

.header-right .favorites-btn:hover{
  color: var(--brand) !important;
}

/* ===== небольшая анимация при обновлении корзины ===== */

@keyframes cart-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.12); }
  60%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.cart-badge.bump{
  animation: cart-bump .38s ease;
}

@keyframes price-shine {
  0% { color: #fff; }
  30%{ color: #ffe173; }
  100%{ color: #fff; }
}

.cart-total.shine{
  animation: price-shine .65s ease;
}

/* 4.2) Dropdowns — общий стиль (баланс/профиль) */

.dropdown{
  position: relative;
}

.dropdown-menu{
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 200px;
  background: rgba(18,18,24,.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);  
  display: none;
  z-index: 1300;
  font-size: 16px;
}

/* маленькая стрелочка сверху у dropdown */
.dropdown-menu::before{
  content: "";
  position: absolute;
  top: -7px;
  left: 18px;
  width: 12px;
  height: 12px;
  background: rgba(18,18,24,.96);
  border-left: 1px solid rgba(255,255,255,.10);
  border-top: 1px solid rgba(255,255,255,.10);
  transform: rotate(45deg);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}

.dropdown-menu .menu-item, .dropdown-menu a{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: none;
  border: 0;
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
}

.dropdown-menu .menu-item:hover, .dropdown-menu a:hover{
  background: rgba(255,255,255,.07);
}

.dropdown-menu .menu-item.is-active{
  background: rgba(255,255,255,.10);
}

/* правые выпадашки выравниваем к правому краю */

.balance-dropdown .dropdown-menu, #profileDropdown-authArea .dropdown-menu{
  right: 0;
  left: auto;
}

.balance-dropdown .dropdown-menu::before, #profileDropdown-authArea .dropdown-menu::before{
  left: auto;
  right: 16px;
}

/* 4.3) Currency dropdown — компактный собственный */

.currency-dropdown .dropdown-menu::before{
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) rotate(45deg) !important;
}

.currency-dropdown{
  position: relative;
  display: inline-block;
}

.currency-dropdown .currency-toggle{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: #fff !important;
  font-weight: 600;
  line-height: 1;
}

.currency-dropdown .currency-toggle .caret{
  width: 20px;
  height: 20px;
  opacity: .9;
  transition: transform .18s ease;
}

.currency-dropdown.open .currency-toggle .caret{
  transform: rotate(180deg);
}

.currency-dropdown .dropdown-menu{
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  min-width: unset;
  padding: 6px 8px;
  background: rgba(18,18,24,.96);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
  text-align: left;

}

.currency-dropdown .currency-toggle .cur-symbol{
  margin-right: 2px;
}

.currency-dropdown .currency-toggle .cur-code{
  display: none;
}

.currency-dropdown .dropdown-menu .menu-item{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  margin-top: 3px;
  margin-bottom: 3px;
  background: none;
  border: 0;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .2px;
}

.currency-dropdown .dropdown-menu .menu-item .sym{
  width: 16px;
  text-align: center;
  opacity: .95;
}

.currency-dropdown .dropdown-menu .menu-item .code{
  font-weight: 700;
}

.currency-dropdown .dropdown-menu .menu-item:hover{
  background: #2a2a2a;
}

.currency-dropdown .dropdown-menu .menu-item.is-active{
  background: #323232;
  outline: 1px solid #3a3a3a;
}

/* 5) MegaMenu — кнопка-триггер */

/* Global scrollbars */

/* 7) Global scrollbars (включая FF) */

*{
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

*::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track{
  background: var(--scroll-track);
  border-radius: 12px;
}

*::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg,#6f6f78,#4b4d57);
  border-radius: 12px;
  border: 2px solid var(--scroll-track);
}

*::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg,#8a8a94,#5b5e69);
}

/* Legacy mobile-nav block kept for parity? omitted intentionally */

/* Баланс: уменьшаем шрифт */

.header-right .balance-info{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.header-right .balance-label{
  font-size: 11px;
  font-weight: 600;
  color: #666666;
  letter-spacing: .08em;
}

.header-right .balance-amount{
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

/* Все элементы правой части шапки — одинаковая высота */

.header-right > *{
  height: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Иконки — подгоняем под 32px, но по центру в 40px */

.header-right img.icon,
.header-right .balance-svg{
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-right: 0;
}

/* Корзина: бейдж и сумма — выравнивание по центру */

.header-right .cart-btn .cart-badge{
  min-width: 18px;
  height: 18px;
  font-size: 12px;
}

.header-right .cart-btn .cart-total{
  font-size: 15px;
  font-weight: 600;
  min-width: unset;
  margin-left: 2px;
  align-self: center;
}

/* Кнопки и dropdown — высота 40px */

.header-right .dropdown-toggle,
.header-right .btn-secondary,
.header-right .btn-primary,
.header-right .cart-btn{
  height: 40px !important;
  min-height: 40px !important;
}

.balance-bg{
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #374FEF 0%, #470599 63%);
  border-radius: 50%;
  position: relative;
}

.balance-bg .balance-svg{
  width: 17px !important;
  height: 17px !important;
  display: block;
  position: relative;
  z-index: 1;
}


/* Search suggestions + currency modal + shell */

/* ===== Search suggestions (автокомплит под поиском) ===== */

.search-form{
  position: relative;
}

.search-form .search-suggest{
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: rgba(18,18,24,.96);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 34px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  padding: 6px;
  z-index: 1400;
  display: none;
}

.search-form .search-suggest-list{
  max-height: 420px;
  overflow-y: auto;
}

.search-suggest-group{
  padding: 6px 8px;
  margin: 4px 6px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fa3b4;
  border-top: 1px solid rgba(255,255,255,.06);
}

.search-suggest-group:first-child{
  border-top: none;
  margin-top: 0;
}

.search-suggest-item{
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #f5f5f5;
}

.search-suggest-item:hover,
.search-suggest-item.is-active{
  background: rgba(255,255,255,.08);
}

/* левая картинка */

.search-suggest-thumb{
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
}

.search-suggest-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* центр – текст */

.search-suggest-body{
  flex: 1 1 auto;
  min-width: 0;
}

.search-suggest-main{
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest-sub{
  margin-top: 2px;
  font-size: 11px;
  color: #9fa3b4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* правая колонка – цена */

.search-suggest-right{
  flex: 0 0 auto;
  text-align: right;
  margin-left: 4px;
}

.search-suggest-price-old{
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
  color: #8c8f99;
  text-decoration: line-through;
}

.search-suggest-price-current{
  font-size: 13px;
  font-weight: 600;
  color: #3fd774;
}

.search-suggest-price-label{
  margin-right: 4px;
  font-size: 11px;
  color: #9fa3b4;
}

/* чуть ужмём на мобилках, чтобы не вылезало за экран */

@media (max-width: 768px){
  .mm-main-search .search-form .search-suggest,
  .mm-cats-search .search-form .search-suggest{
    margin-top: 4px;
    border-radius: 10px;
  }

  .mm-main-search .search-form .search-suggest::before,
  .mm-cats-search .search-form .search-suggest::before{
    display: none;
  }  
}

.currency-modal.cart-modal-overlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.60);
  z-index: 1300;
}

.currency-modal.cart-modal-overlay .cart-modal{
  height: auto;
  max-height: min(90vh, 720px);
  margin: 0;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,.6);
}

.payment-currency-pill{
  padding: 4px 10px;
  border-radius: 12px;
  background: #1b1b24;
  border: 1px solid #393c5c;
  font-size: 13px;
}

/* Glass header + accent line */

.site-header{
  background: rgba(0,0,0,.72);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  position: sticky;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  color: var(--brand);
}

@supports not ((backdrop-filter: blur(1px))){
  .site-header{
    background: #0b0b0b;
  }
}

/* нижняя “подсветка” */

.site-header::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(114,15,254,0) 0%,
    rgba(37,99,235,.55) 35%,
    rgba(114,15,254,.65) 70%,
    rgba(255,225,115,0) 100%
  );
}

/* Чуть плотнее при скролле */

.site-header.is-scrolled{
  background: rgba(0,0,0,.86);
  box-shadow: 0 10px 34px rgba(0,0,0,.55);
}

/* Action chips справа (кликабельнее и симпатичнее) */

#authArea > a,
#authArea > button,
#authArea > .dropdown > .dropdown-toggle{
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 10px !important;
  border-radius: 12px;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  transition: background .15s ease, border-color .15s ease;
}

#authArea > a:hover,
#authArea > button:hover,
#authArea > .dropdown > .dropdown-toggle:hover{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.08) !important;
}

#authArea > a:focus-visible,
#authArea > button:focus-visible,
#authArea > .dropdown > .dropdown-toggle:focus-visible{
  outline: 2px solid rgba(114,15,254,.55);
  outline-offset: 2px;
}

/* Баланс-чип — чуть шире */

#authArea .balance-toggle{
  padding: 0 12px !important;
}

/* Валютный символ немного меньше (сейчас крупноват) */

.currency-dropdown .currency-toggle .cur-symbol{
  font-size: 22px;
}

/* Поиск — тонкая обводка и мягкий фокус */

.header-center .search-form:focus-within{
  border-color: rgba(114,15,254,.35);
  box-shadow: 0 0 0 3px rgba(114,15,254,.20);
}

.header-desktop,
.header-compact{
  position: relative;
  z-index: 2;
}

.header-center{
  min-width: 0;
}

.header-center .search-form{
  flex: 1 1 520px;
  width: auto;
  max-width: 600px;
  min-width: 150px;
  margin: 0 16px;
  position: relative;
  height: 40px;
  border-radius: 12px;
  padding: 0 52px 0 16px;
  overflow: visible;
  box-shadow: none;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

@media (max-width: 1150px){
  .header-left, .header-center, .header-right{
    gap: .65rem;
  }

  .header-center .search-form{
    margin: 0 12px;
    padding: 0 48px 0 14px;
  }
}

@media (max-width: 1050px){
  #authArea .balance-label{
    display: none;
  }
}
