/* assets/css/components/header.css
   Header component: topbar + header-main + brand + search + header actions + burger.
   Cleaned: removed legacy/double definitions, left one active design (topbar green, header white).
*/

/* ===== Base positioning ===== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 5000;
}

/* ===== Topbar (тонкая верхняя полоса) ===== */
.topbar{
  background: linear-gradient(180deg, #6f6f6f, #5f5f5f);
  border-bottom: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 9px 0;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,.92);
}

.topbar-left,
.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.topbar a,
.topbar-link{
  color: rgba(255,255,255,.92);
  text-decoration:none;
}

.topbar a:hover,
.topbar-link:hover{
  color:#fff;
  text-decoration:none;
}

.topbar .dot{
  opacity: 1;
  color: rgba(255,255,255,.55);
  margin: 0 8px;
}

.topbar a:focus-visible,
.topbar-link:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(215,161,0,.22);
  border-radius: 10px;
}

/* ===== Header (white) ===== */
.header-main{
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(31,41,55,.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-row{
  display:flex;
  align-items:center;
  gap:16px;
  padding: 14px 0;
}

/* бренд */
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 240px;
  text-decoration:none;
  color: var(--green-900);
}
.brand-logo{ display:block; height:56px; width:auto; }
.brand-text{ display:flex; flex-direction:column; line-height:1.1; }
.brand-name{ font-weight:800; letter-spacing:.5px; font-size:15px; color: var(--green-900); }
.brand-sub{ font-size:12px; margin-top:2px; color: rgba(107,114,128,.92); }

/* поиск — капсула */
.header-search{
  flex: 1 1 auto;
  display:flex;
  align-items:center;
  background: #fff;
  border: 1px solid rgba(31,41,55,.14);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(17,24,39,.06);
  height: 44px;
  overflow:hidden;
  max-width: 520px;
}

.header-search input{
  flex:1;
  height: 44px;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0 12px;
  color: var(--text);
  font-size: 14px;
  min-width: 0;
}
.header-search input::placeholder{ color: rgba(31,41,55,.45); }

.header-search button{
  height: 44px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, var(--green-700), var(--green-900));
  color: #fff;
  font-weight: 800;
  padding: 0 16px;
  white-space: nowrap;
}
.header-search button:hover{ filter: brightness(1.04); }

.header-search:focus-within{
  border-color: rgba(148,179,82,.75);
  box-shadow: 0 0 0 4px var(--ring), 0 14px 34px rgba(17,24,39,.10);
}

/* контакты + кнопки */
.header-actions{
  display:flex;
  align-items:center;
  gap:14px;
}

.header-contact{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  white-space:nowrap;
}
.header-phone{
  font-size: 18px;
  font-weight: 900;
  color: var(--green-900);
  text-decoration:none;
}
.header-phone:hover{ color: var(--green-800); text-decoration: underline; }

.header-note{
  font-size: 12px;
  margin-top:2px;
  color: rgba(107,114,128,.92);
}

.header-buttons{
  display:flex;
  gap:10px;
  align-items:center;
}

/* header buttons */
.header-buttons .hbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration:none;
  cursor:pointer;
  border: 1px solid rgba(31,41,55,.16);
  box-shadow: 0 4px 12px rgba(17,24,39,.06);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease, color .14s ease;
}
.header-buttons .hbtn:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(17,24,39,.10);
}

/* Primary / Ghost */
.header-buttons .hbtn-primary{
  background: #ffcb05;
  color:#000;
  border-color: transparent;
}
.header-buttons .hbtn-primary:hover{ filter: brightness(0.96); }

.header-buttons .hbtn-ghost{
  background: rgba(255,255,255,.90);
  color: var(--green-900);
}
.header-buttons .hbtn-ghost:hover{
  background: rgba(148,179,82,.10);
  border-color: rgba(148,179,82,.38);
  color: var(--green-900);
}

/* MAX button (можно переопределять в skin-*) */
.header-buttons .hbtn-max{
  background: linear-gradient(135deg, #161F8A 0%, #2D085F 100%);
  color: #fff;
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 10px 26px rgba(45,8,95,.22);
}
.header-buttons .hbtn-max:hover{ filter: brightness(1.05); }

/* Логотип MAX внутри кнопки */
.hbtn-max-logo{
  height: 18px;
  width: auto;
  display: block;
}

/* ===== Burger ===== */
.burger-menu::before,
.burger-menu::after{
  content: none !important;
  display: none !important;
}

.burger-menu{
  margin-left:auto;
  border: 1px solid rgba(35,65,30,0.20);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: none; /* включаем только на мобиле */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  color: var(--green-900);
}

.burger-menu .burger-icon span{
  width: 22px;
  height: 2px;
  margin: 0 !important;
  background: currentColor;
  border-radius: 999px;
}

/* ===== Small transitions ===== */
.site-header.is-scrolled .header-main{
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.header-row,
.brand-logo{ transition: transform .18s ease; transform-origin: left center; }
.header-main{ transition: box-shadow .18s ease, background-color .18s ease; }
.header-search{ transition: border-color .18s ease, box-shadow .18s ease; }

/* ===== Responsive ===== */
@media (max-width: 1100px){
  .header-contact{ display:none; }
  .header-search{ max-width: 420px; }
}


@media (max-width: 880px){
  /* topbar компактнее */
  .topbar{ display:block; }
  .topbar-left{ display:none; }
  .topbar-row{
    padding: 6px 0;
    font-size: 12px;
  }
  .topbar-right{
    width: 100%;
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }
  .topbar-right .dot{ display:none; }
  .topbar-right a{
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.10);
    text-decoration:none;
  }

  /* шапка */
  .header-row{
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .brand{
    min-width: 0;
    flex: 1 1 auto;
  }
  .brand-name{ font-size: 13px; letter-spacing: .3px; }
  .brand-sub{ display:none; }
  .brand-logo{ height: 46px; }

  .burger-menu{
    display:flex; /* включаем бургер на мобиле */
    order: 2;
    margin-left: auto;
  }

  /* Поиск на второй строке */
  .header-search{
    display:flex;
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    height: 46px;
    margin: 0;
  }
  .header-search input{ height: 46px; }
  .header-search button{ height: 46px; }

  /* Кнопки/контакты прячем — они есть в меню */
  .header-actions{ display:none; }
}

/* ===== Restore header height (desktop) ===== */
@media (min-width: 921px){
  .site-header .header-main{ padding: 20px 0; }
  .site-header .header-row{ min-height: 92px; }
}
