/* SEWEQU Header 2.0 */
:root {
  --site-header-height: 176px;
  --header-blue: #7096be;
  --header-blue-dark: #304050;
  --header-text: #1f2937;
  --header-line: #dce4ed;
  --header-bg: #fff;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--site-header-height) + 16px); }
body { margin: 0; }

#header {
  position: sticky;
  top: 0;
  z-index: 5000;
  width: 100%;
  background: var(--header-bg);
}

#header > header,
body > header {
  width: 100%;
}

header {
  position: relative;
  z-index: 5000;
  width: 100%;
  min-height: 0 !important;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  box-shadow: 0 5px 18px rgba(15, 31, 50, .08);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 10px clamp(20px, 4vw, 60px) 8px;
}

.logo {
  display: flex;
  flex: 0 0 190px;
  align-items: center;
  text-decoration: none;
}

.logo img {
  display: block;
  width: 190px;
  height: 82px;
  object-fit: contain;
}

.search-bar {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  min-width: 180px;
  max-width: none;
  height: 48px;
  margin: 0;
}

.search-bar input {
  min-width: 0;
  flex: 1 1 auto;
  height: 48px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid #c9d4df;
  border-right: 0;
  border-radius: 24px 0 0 24px;
  background: #fff;
  color: var(--header-text);
  font: 400 16px/1 Arial, sans-serif;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--header-blue);
  box-shadow: inset 0 0 0 1px var(--header-blue);
}

.search-bar button {
  flex: 0 0 54px;
  width: 54px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 24px 24px 0;
  background: var(--header-blue);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  box-shadow: none;
  transform: none;
}

.search-bar button:hover,
.search-bar button:focus-visible { background: #567aa0; }

.header-user {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  max-width: 330px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--header-blue-dark);
  font: 700 13px/1.2 Arial, sans-serif;
  white-space: nowrap;
}

.header-user[hidden] { display: none !important; }
.header-user-label { color: #667085; font-weight: 600; }
.header-user-email {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-logout {
  width: auto;
  margin: 0 0 0 3px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--header-blue-dark);
  color: #fff;
  cursor: pointer;
  font: 700 12px/1 Arial, sans-serif;
}
.header-logout:hover { background: #567aa0; }

.title-menu {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 7px clamp(20px, 4vw, 60px) 12px;
}

.header-title {
  flex: 0 0 300px;
  margin: 0;
  color: #567aa0 !important;
  font: 700 13px/1.3 Arial, sans-serif;
  text-align: center;
  text-transform: uppercase;
}

.main-menu {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.main-menu > * { flex: 0 0 auto; }
.main-menu a,
.dropbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0;
  padding: 9px clamp(7px, .8vw, 13px);
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: #333;
  cursor: pointer;
  font: 700 clamp(12px, .95vw, 15px)/1 Arial, sans-serif;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.dropbtn { background: var(--header-blue); color: #fff; }
.main-menu a:hover,
.dropbtn:hover { background: #567aa0; color: #fff; transform: translateY(-1px); }

.dropdown { position: relative; }
.dropdown-content { display: none; }
.dropdown-content.show { display: block; }

.header-catalog-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 5100;
  width: min(540px, calc(100vw - 32px));
  max-height: min(72vh, 720px);
  overflow-y: auto;
  padding: 8px 0;
  border: 1px solid #e4e9ef;
  border-radius: 16px;
  background: #fff;
  color: var(--header-text);
  box-shadow: 0 20px 50px rgba(15, 31, 50, .24);
}

.header-catalog-title {
  display: block;
  padding: 13px 18px;
  border-bottom: 1px solid #e5e7eb;
  color: var(--header-blue-dark) !important;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.header-catalog-panel ul { margin: 0; padding: 0; list-style: none; }
.header-catalog-panel li {
  position: relative;
  padding: 10px 44px 10px 18px;
  cursor: pointer;
  font: 500 13px/1.35 Arial, sans-serif;
  text-transform: uppercase;
}
.header-catalog-panel li:hover { background: #eef4fb; }
.header-catalog-panel li.has-sub::after {
  content: "▶";
  position: absolute;
  top: 11px;
  right: 17px;
  color: var(--header-blue);
  font-size: 11px;
  transition: transform .18s ease;
}
.header-catalog-panel li.has-sub.open::after { transform: rotate(90deg); }
.header-catalog-panel li.has-sub > ul {
  display: none;
  margin: 8px -44px 0 -18px;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #f7f9fc;
}
.header-catalog-panel li.has-sub.open > ul { display: block; }
.header-cat-level2 > li { padding-left: 32px; }
.header-cat-level3 > li { padding-left: 48px; background: #fff; }

.header-catalog-panel li.catalog-separator {
  cursor: default !important;
  background: var(--header-blue-dark) !important;
  color: #fff !important;
  font-weight: 800;
}
.header-catalog-panel li.catalog-separator::after { display: none !important; }
.header-catalog-panel li.catalog-unavailable { opacity: .46; cursor: not-allowed !important; }
.header-catalog-panel li.catalog-unavailable::before {
  content: "Скоро";
  float: right;
  margin-left: 8px;
  font-size: 10px;
  text-transform: none;
}

.cart-link [data-cart-count] { min-width: 18px; text-align: center; font-weight: 800; }
.mobile-menu-toggle { display: none; }

@media (max-width: 1180px) {
  .header-top { gap: 14px; padding-left: 18px; padding-right: 18px; }
  .logo { flex-basis: 150px; }
  .logo img { width: 150px; height: 70px; }
  .header-user-label { display: none; }
  .header-user-email { max-width: 110px; }
  .title-menu { gap: 10px; padding-left: 18px; padding-right: 18px; }
  .header-title { flex-basis: 230px; font-size: 11px; }
  .main-menu a, .dropbtn { padding-left: 7px; padding-right: 7px; font-size: 12px; }
}

@media (max-width: 900px) {
  :root { --site-header-height: 132px; }
  .header-top { flex-wrap: wrap; padding: 8px 12px; }
  .logo { flex: 0 0 125px; }
  .logo img { width: 125px; height: 58px; }
  .search-bar { order: 2; flex: 1 1 calc(100% - 139px); max-width: none; height: 44px; }
  .search-bar input, .search-bar button { height: 44px; }
  .header-user { order: 3; margin-left: auto; max-width: 100%; }
  .title-menu { position: relative; justify-content: space-between; padding: 7px 12px 10px; }
  .header-title { flex: 1 1 auto; text-align: left; }
  .header-title br { display: none; }
  .mobile-menu-toggle {
    display: inline-flex;
    flex: 0 0 42px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 40px;
    padding: 9px;
    border: 0;
    border-radius: 10px;
    background: var(--header-blue-dark);
    cursor: pointer;
  }
  .mobile-menu-toggle span { display: block; width: 100%; height: 2px; background: #fff; }
  .main-menu {
    display: none;
    position: absolute;
    top: calc(100% - 2px);
    left: 12px;
    right: 12px;
    z-index: 5050;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    border: 1px solid #dce4ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 31, 50, .22);
    white-space: normal;
  }
  .main-menu.mobile-open { display: flex; }
  .main-menu > * { width: 100%; }
  .main-menu a, .dropbtn { width: 100%; justify-content: flex-start; padding: 11px 13px; font-size: 14px; }
  .dropdown { position: static; }
  .header-catalog-panel {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: none;
  }
}

@media (max-width: 560px) {
  :root { --site-header-height: 178px; }
  .header-top { gap: 8px; }
  .logo { flex: 1 1 100%; justify-content: center; }
  .logo img { width: 138px; height: 62px; }
  .search-bar { flex-basis: 100%; order: 2; }
  .header-user { order: 3; width: 100%; justify-content: center; }
  .header-user-email { max-width: 180px; }
  .header-title { font-size: 10px; line-height: 1.35; }
}


/* Верхняя строка: единая линия и одинаковая высота поиска */
.header-top > .logo,
.header-top > .search-bar,
.header-top > .header-user {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.header-top .search-bar input,
.header-top .search-bar button {
  box-sizing: border-box !important;
  min-height: 48px !important;
  max-height: 48px !important;
  line-height: 48px !important;
}

.header-top .search-bar button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

@media (min-width: 901px) {
  .header-top { flex-wrap: nowrap; }
  .header-top .search-bar { width: auto; }
  .header-top .header-user { margin-left: auto !important; }
}
