/* assets/css/header.css
   Header layout and component-specific sizing. */

.site-header,
.site-header--sticky{
  --icon-size: 22px;
  --hit-area: 36px;
  --logo-size: 34px;
  --search-height: 40px;
  --header-offset: 0px;
}

/* =========================================================
   STICKY HEADER
   ========================================================= */
.site-header--sticky{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3000;

  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);

  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.site-header--sticky.is-stuck{
  border-bottom-color: var(--header-border-strong);
  box-shadow: var(--header-shadow-stuck);
}

body.has-sticky-header{
  padding-top: var(--header-offset);
}

.site-header--sticky.site-header--shim{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* ===== Header shell ===== */
.site-header{
  background: var(--header-bg);
}

/* внутренний блок внутри .container */
.site-header__inner{
  width: 100%;
  max-width: 100%;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ===== Top row ===== */
.site-header__top{
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* =========================================================
   Buttons / Icons
   ========================================================= */
.icon-btn{
  width: var(--hit-area);
  height: var(--hit-area);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  padding: 0;
  background: transparent;
  color: var(--header-text);
  text-decoration: none;
  cursor: pointer;

  border-radius: 10px;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .15s ease, color .15s ease, transform .06s ease;
}

.icon-btn:hover{
  background: var(--header-hover);
}

.icon-btn:active{
  transform: translateY(.5px);
}

.icon-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px var(--header-focus);
}

.icon{
  width: var(--icon-size);
  height: var(--icon-size);
  display: block;
}

/* =========================================================
   Logo
   ========================================================= */
.site-header__logo{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;

  margin-left: 6px;
  padding-right: 96px;

  text-decoration: none;
  color: inherit;
}

.logo-placeholder{
  width: var(--logo-size);
  height: var(--logo-size);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  font-weight: 800;
  line-height: 1;
}

.site-header__logo-img{
  display: block;
  height: 35px;
  width: auto;
  max-width: 160px;
}

/* =========================================================
   Actions
   ========================================================= */
.site-header__actions{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.site-header__sep{
  display: none;
}

/* ===== badges ===== */
.cart-btn,
.fav-btn{
  position: relative;
}

.badge{
  position: absolute;
  top: 1px;
  right: 10px;

  min-width: 17px;
  height: 17px;
  padding: 0 4px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;
  line-height: 1;

  border: 1px solid rgba(0,0,0,.08);
}

.badge--empty{
  opacity: .50;
}

/* =========================================================
   Search row
   ========================================================= */
.site-header__search{
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
}

.search-field{
  position: relative;
  width: 100%;
  max-width: 100%;
}

.search-input{
  width: 100%;
  max-width: 100%;
  display: block;
  height: var(--search-height);

  box-sizing: border-box;
  border: 1px solid var(--search-border);
  border-radius: 999px;
  background: var(--search-bg);

  padding: 0 44px 0 14px;

  font-size: 15px;
  font-weight: 500;
  color: var(--header-text);
  outline: none;

  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.search-input::placeholder{
  color: var(--search-placeholder);
}

.search-input:focus{
  border-color: var(--search-border-focus);
  box-shadow: var(--ui-focus-ring);
}

.search-btn{
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);

  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--header-text);
  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .15s ease, color .15s ease;
}

.search-btn:hover{
  background: var(--header-hover);
}

/* =========================================================
   A11y
   ========================================================= */
.sr-only{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================================================
   Icon buttons with labels
   ========================================================= */
.icon-btn--stack{
  width: 50px;
  height: auto;

  flex-direction: column;
  gap: 3px;
  padding: 5px 2px 3px;

  border-radius: 12px;
}

.icon-btn__label{
  display: block;
  font-size: 11px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: .1px;
  color: var(--header-muted);
  user-select: none;
  white-space: nowrap;
}

.icon-btn__sublabel{
  display: block;
  margin-top: -1px;
  font-size: 10px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: .1px;
  color: var(--header-muted-2);
  user-select: none;
  white-space: nowrap;
}

.icon-btn--stack:hover{
  background: var(--header-hover);
}

.icon-btn--stack:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px var(--header-focus);
}

/* badge positioning */
.icon-btn--stack.cart-btn .badge,
.icon-btn--stack.fav-btn .badge{
  top: 1px;
  right: 10px;
}

/* =========================================================
   Dividers between action buttons
   ========================================================= */
.site-header__actions .icon-btn--stack{
  position: relative;
}

.site-header__actions .icon-btn--stack + .icon-btn--stack{
  margin-left: 6px;
  padding-left: 8px;
}

.site-header__actions .icon-btn--stack + .icon-btn--stack::before{
  content: "";
  position: absolute;
  left: -3px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--header-divider);
  border-radius: 1px;
}

/* =========================================================
   Active favorite
   ========================================================= */
.icon-btn--stack.fav-btn.is-active{
  background: var(--fav-active-bg);
}

.icon-btn--stack.fav-btn.is-active,
.icon-btn--stack.fav-btn.is-active .icon-btn__label{
  color: var(--fav-active);
}

.icon-btn--stack.fav-btn.is-active svg{
  color: var(--fav-active);
}

/* =========================================================
   Logged account
   ========================================================= */
.icon-btn--stack.acc-btn.is-logged{
  background: var(--acc-active-bg);
}

.icon-btn--stack.acc-btn.is-logged,
.icon-btn--stack.acc-btn.is-logged .icon-btn__label{
  color: var(--acc-active);
}

.icon-btn--stack.acc-btn.is-logged svg{
  color: var(--acc-active);
}

/* =========================================================
   Toast
   ========================================================= */
.site-toast{
  position: fixed;
  top: calc(var(--header-offset, 64px) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  z-index: 9999;

  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 14px;

  background: rgba(255,255,255,.98);
  border: 1px solid rgba(31,122,79,.28);
  color: var(--ui-text);

  font-size: 15px;
  line-height: 1.25;

  box-shadow: var(--ui-shadow-md);
  opacity: 0;
  pointer-events: none;

  transition: opacity .18s ease, transform .18s ease;

  display: flex;
  align-items: center;
  gap: 10px;
}

.site-toast::before{
  content: "✓";
  width: 22px;
  height: 22px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--ui-success-soft);
  color: var(--ui-success);
  font-weight: 800;
  flex: 0 0 auto;
}

.site-toast.is-show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   Desktop
   ========================================================= */
@media (min-width: 768px){
  .site-header__inner{
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .site-header__top{
    gap: 14px;
  }

  .site-header__logo{
    margin-left: 10px;
    padding-right: 120px;
  }

  .site-header__logo-img{
    height: 38px;
    max-width: 180px;
  }

  .icon-btn--stack{
    width: 56px;
    padding: 6px 3px 4px;
  }

  .icon-btn__label{
    font-size: 11.5px;
  }

  .icon-btn__sublabel{
    font-size: 10px;
  }

  .search-input{
    height: 42px;
    font-size: 15px;
    padding-left: 16px;
  }

  .search-btn{
    width: 36px;
    height: 36px;
    right: 4px;
  }
}

@media (max-width: 380px){
  .site-header__top{
    gap: 8px;
  }

  .site-header__logo{
    margin-left: 4px;
    padding-right: 84px;
  }

  .site-header__logo-img{
    height: 33px;
    max-width: 145px;
  }

  .icon-btn--stack{
    width: 46px;
  }

  .icon-btn__label{
    font-size: 10.5px;
  }

  .icon-btn__sublabel{
    font-size: 9.5px;
  }

  .search-input{
    font-size: 14px;
  }
}