/* =========================================================
   AANDEM HEADER
   Изолировано от старого шаблона через #aandem-header
   ========================================================= */

#aandem-header {
  --bg: #f5f6fa;
  --card: #ffffff;
  --ink: #20242d;
  --muted: #6b7280;
  --line: #e7eaf0;
  --red: #f14850;
  --red-dark: #d72f39;
  --shadow: 0 14px 36px rgba(30, 36, 48, 0.11);
  --radius-md: 18px;
  --radius-sm: 12px;

  position: relative;
  z-index: 100;

  width: 100%;

  color: var(--ink);

  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}


/* =========================================================
   RESET ТОЛЬКО ВНУТРИ ШАПКИ
   ========================================================= */

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

#aandem-header a {
  color: inherit;
  text-decoration: none;
  border-bottom: 0;
}

#aandem-header a:hover,
#aandem-header a:focus {
  text-decoration: none;
  border-bottom: 0;
}

#aandem-header button,
#aandem-header input {
  font: inherit;
  letter-spacing: 0;
}

#aandem-header button {
  margin: 0;
  cursor: pointer;
  text-shadow: none;
}

#aandem-header img {
  display: block;
  max-width: 100%;
}


/* =========================================================
   SHELL
   ========================================================= */

#aandem-header .shell {
  width: min(1440px, calc(100% - 32px));
  max-width: none;

  margin-right: auto;
  margin-left: auto;
}


/* =========================================================
   TOPLINE
   ========================================================= */

#aandem-header .topline {
  position: relative;

  width: 100%;

  margin: 0;
  padding: 0;

  color: #596070;

  background: #fff;

  border-bottom: 1px solid var(--line);

  font-size: 0.86rem;
}

#aandem-header .topline__inner {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 16px;

  align-items: center;

  min-height: 40px;

  padding: 8px 0 6px;
}

#aandem-header .factory-mark {
  display: block;
  align-self: center;

  width: auto;

  margin: 0;
  padding: 0;

  color: #000;

  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}

#aandem-header .factory-mark strong,
#aandem-header .factory-mark span {
  display: block;
  white-space: nowrap;
}

#aandem-header .factory-mark strong {
  margin: 0;
  padding: 0;

  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
}

#aandem-header .factory-mark span {
  font-size: 0.82rem;
}

#aandem-header .topline-contacts {
  display: flex;

  gap: 16px;

  align-items: center;
  justify-content: flex-end;

  margin: 0;
  padding: 0;

  white-space: nowrap;
}

#aandem-header .phone,
#aandem-header a.phone {
  display: inline-flex;

  align-items: center;

  width: auto;
  height: auto;

  margin: 0;
  padding: 0;

  color: #000;

  background: transparent;

  border: 0;

  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;

  white-space: nowrap;
}

#aandem-header .phone small,
#aandem-header a.phone small {
  display: inline;

  margin: 0;
  padding: 0;

  color: inherit;

  font-size: inherit;
  line-height: inherit;
}

#aandem-header .worktime {
  width: auto;
  height: auto;

  margin: 0;
  padding: 0;

  color: #000;

  background: transparent;

  border: 0;

  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;

  white-space: nowrap;
}


/* =========================================================
   DESKTOP / MOBILE HELPERS
   ========================================================= */

#aandem-header .dectop-block-450 {
  display: inline-flex;
}

#aandem-header .mobil-block-450 {
  display: none;
}

#aandem-header .mobil-block-450-worktime {
  display: none;
}


/* =========================================================
   HEADER
   ========================================================= */

#aandem-header .header {
  position: sticky;

  top: 0;

  z-index: 1000;

  width: 100%;
  height: auto;
  min-height: 0;

  margin: 0;
  padding: 0;

  background: rgba(245, 246, 250, 0.92);

  border-bottom: 1px solid var(--line);

  backdrop-filter: blur(18px);
}

#aandem-header .header::before,
#aandem-header .header::after {
  display: none;
  content: none;
}


/* =========================================================
   HEADER INNER
   ========================================================= */

#aandem-header .header__inner {
  display: grid;

  grid-template-columns:
    160px
    auto
    minmax(280px, 1fr)
    48px;

  gap: 14px;

  align-items: center;

  padding: 16px 0 12px;
}


/* =========================================================
   LOGO
   ========================================================= */

#aandem-header .logo {
  position: static;

  display: flex;

  align-items: center;

  min-width: 0;
  width: auto;
  height: auto;

  margin: 0;
  padding: 0;

  background: transparent;

  border: 0;
}

#aandem-header .logo::before,
#aandem-header .logo::after {
  display: none;
  content: none;
}

#aandem-header .logo img {
  position: static;

  display: block;

  width: 148px;
  max-width: 100%;
  height: auto;

  margin: 0;
}


/* =========================================================
   CATALOG BUTTON
   ========================================================= */

#aandem-header .catalog-button {
  position: static;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  width: auto;

  min-height: 44px;

  margin: 0;
  padding: 0 22px;

  color: #fff;

  background: var(--red);

  border: 0;
  border-radius: 999px;

  box-shadow:
    0 10px 18px rgba(241, 72, 80, 0.2);

  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;

  white-space: nowrap;
}

#aandem-header .catalog-button:hover,
#aandem-header .catalog-button:focus {
  color: #fff;

  background: var(--red-dark);
}


/* мобильный каталог сверху на desktop скрыт */

#aandem-header .topline .catalog-button.mobil-block-450 {
  display: none;
}


/* =========================================================
   SEARCH
   ========================================================= */

#aandem-header .search {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    96px;

  align-items: stretch;

  min-width: 0;
  max-width: 100%;

  width: 100%;
  height: 48px;

  margin: 0;
  padding: 2px;

  overflow: hidden;

  background: var(--card);

  border: 2px solid var(--red);
  border-radius: 999px;
}

#aandem-header .search label {
  position: absolute;

  width: 1px;
  height: 1px;

  margin: -1px;
  padding: 0;

  overflow: hidden;

  clip: rect(0 0 0 0);
  clip-path: inset(50%);

  white-space: nowrap;
}

#aandem-header .search input[type="search"] {
  -webkit-appearance: none;
  appearance: none;

  box-sizing: border-box;

  width: 100%;
  min-width: 0;
  height: 40px;

  margin: 0;
  padding: 0 18px;

  color: var(--ink);

  background: transparent;

  border: 0;
  border-radius: 0;

  outline: 0;

  box-shadow: none;

  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 40px;
}

#aandem-header .search input[type="search"]::placeholder {
  color: #9298a6;
  opacity: 1;
}

#aandem-header .search button {
  display: grid;

  place-items: center;

  width: 96px;
  min-width: 96px;

  height: 40px;
  min-height: 40px;

  margin: 0;
  padding: 0 18px;

  color: #fff;

  background: var(--red);

  border: 0;
  border-radius: 999px;

  box-shadow: none;

  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;

  white-space: nowrap;
}

#aandem-header .search button:hover,
#aandem-header .search button:focus {
  background: var(--red-dark);
}


/* =========================================================
   HEADER ACTIONS
   ========================================================= */

#aandem-header .header-actions {
  display: flex;

  align-items: center;
  justify-content: flex-end;

  gap: 0;

  width: auto;
  height: auto;

  margin: 0;
  padding: 0;
}


/* =========================================================
   CART
   ========================================================= */

#aandem-header .cart-icon {
  display: grid;

  place-items: center;

  flex: 0 0 48px;

  width: 48px;
  height: 48px;

  margin: 0;
  padding: 0;

  color: #2a2f38;

  background: #fff;

  border: 1px solid var(--line);
  border-radius: 50%;

  box-shadow: none;
}

#aandem-header .cart-icon:hover {
  color: #2a2f38;

  transform: translateY(-2px);
}

#aandem-header .cart-icon svg {
  display: block;

  width: 24px;
  height: 24px;

  fill: none;

  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* =========================================================
   MOBILE SEARCH / MENU BUTTONS
   ========================================================= */

#aandem-header .header-mobile-action {
  display: none;

  place-items: center;

  flex: 0 0 48px;

  width: 48px;
  height: 48px;

  margin: 0;
  padding: 0;

  color: #2a2f38;

  background: #fff;

  border: 1px solid var(--line);
  border-radius: 50%;

  box-shadow: none;
}

#aandem-header .header-mobile-action:hover,
#aandem-header .header-mobile-action:focus {
  color: #2a2f38;

  background: #fff;

  border-color: var(--line);
}

#aandem-header .header-mobile-action svg {
  display: block;

  width: 23px;
  height: 23px;

  fill: none;

  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* =========================================================
   CATEGORY TABS
   ========================================================= */

#aandem-header .category-tabs {
  display: flex;

  gap: 10px;

  align-items: center;
  justify-content: center;

  width: min(1440px, calc(100% - 32px));
  max-width: none;

  margin: 0 auto;
  padding: 0 0 14px;

  overflow-x: auto;
  overflow-y: hidden;

  background: transparent;

  border: 0;

  scrollbar-width: none;
}

#aandem-header .category-tabs::-webkit-scrollbar {
  display: none;
}

#aandem-header .category-tabs > a {
  display: block;

  flex: 0 0 auto;

  width: auto;

  margin: 0;
  padding: 10px 16px;

  color: #3c4350;

  background: #fff;

  border: 0;
  border-radius: 999px;

  box-shadow:
    0 1px 0 rgba(30, 36, 48, 0.04);

  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;

  white-space: nowrap;
}

#aandem-header .category-tabs > a::before,
#aandem-header .category-tabs > a::after {
  display: none;
  content: none;
}

#aandem-header .category-tabs > a:hover {
  color: var(--red);

  background: #fff;

  transform: translateY(-2px);
}

#aandem-header .category-tabs > a.active {
  color: #fff;

  background: var(--red);
}

#aandem-header .category-tabs > .mobil-block-450-worktime {
  display: none;
}


/* =========================================================
   <= 1180
   ========================================================= */

@media (max-width: 1180px) {

  #aandem-header .header__inner {
    grid-template-columns:
      142px
      auto
      minmax(240px, 1fr)
      48px;
  }
}


/* =========================================================
   <= 1100
   ПОЯВЛЯЮТСЯ ЛУПА + БУРГЕР
   КАТАЛОГ ОСТАЕТСЯ
   ========================================================= */

@media (max-width: 1100px) {

  #aandem-header .header {
    position: relative;

    z-index: 9999;
  }


  /*
   * logo | catalog | actions
   */

  #aandem-header .header__inner {
    grid-template-columns:
      minmax(134px, 1fr)
      auto
      auto;

    gap: 10px;

    padding-top: 12px;
    padding-bottom: 12px;
  }


  /*
   * Каталог остается
   */

  #aandem-header .header__inner > .catalog-button {
    display: inline-flex;

    min-height: 40px;

    padding: 0 16px;
  }


  /*
   * Поиск скрываем
   */

  #aandem-header .header__inner > .search {
    display: none;
  }


  /*
   * actions справа
   */

  #aandem-header .header-actions {
    display: flex;

    grid-column: 3;
    grid-row: 1;

    align-items: center;
    justify-content: flex-end;

    gap: 8px;
  }


  /*
   * лупа + бургер
   */

  #aandem-header .header-mobile-action {
    display: grid;
  }


  /*
   * горизонтальное меню скрываем
   */

  #aandem-header .header > .category-tabs {
    display: none;
  }


  /* =======================================================
     OPEN SEARCH
     ======================================================= */

  #aandem-header .header.search-open .header__inner > .search {
    position: absolute;

    top: calc(100% + 8px);
    right: 16px;
    left: 16px;

    z-index: 10001;

    display: grid;

    grid-template-columns:
      minmax(0, 1fr)
      96px;

    width: auto;
    max-width: none;

    height: 48px;

    margin: 0;
    padding: 2px;

    background: #fff;

    border: 2px solid var(--red);
    border-radius: 999px;

    box-shadow: var(--shadow);
  }


  /* =======================================================
     OPEN MENU
     ======================================================= */

  #aandem-header .header.menu-open > .category-tabs {
    position: absolute;

    top: 100%;
    right: 10px;
    left: 10px;

    z-index: 10000;

    display: grid;

    grid-template-columns: 1fr;

    gap: 8px;

    width: auto;
    max-width: none;

    max-height: calc(100vh - 110px);

    margin: 0;
    padding: 12px;

    overflow-x: hidden;
    overflow-y: auto;

    background: var(--bg);

    border: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);

    box-shadow: var(--shadow);
  }

  #aandem-header .header.menu-open > .category-tabs > a {
    display: flex;

    align-items: center;

    width: 100%;
    min-height: 48px;

    margin: 0;
    padding: 12px 16px;

    color: var(--ink);

    background: #fff;

    border: 1px solid var(--line);
    border-radius: var(--radius-sm);

    box-shadow: none;

    white-space: normal;

    transform: none;
  }

  #aandem-header .header.menu-open > .category-tabs > a:hover {
    color: var(--red);

    background: #fff;

    transform: none;
  }

  #aandem-header .header.menu-open > .category-tabs > a.active {
    color: #fff;

    background: var(--red);

    border-color: var(--red);
  }
}


/* =========================================================
   <= 820
   ОРИГИНАЛЬНАЯ СЕТКА НОВОГО ШАБЛОНА
   ========================================================= */

@media (max-width: 820px) {

  #aandem-header .shell {
    width: min(100% - 20px, 680px);
  }


  /* topline */

  #aandem-header .topline__inner {
    display: flex;

    flex-wrap: wrap;

    justify-content: space-between;
    align-items: center;

    gap: 8px 14px;

    padding: 8px 0;
  }

  #aandem-header .topline-contacts {
    gap: 10px;
  }


  /* header */

  #aandem-header .header {
    position: relative;
  }

  #aandem-header .header__inner {
    grid-template-columns:
      1fr
      auto
      auto;

    gap: 10px;
  }

  #aandem-header .logo img {
    width: 134px;
  }

  #aandem-header .header__inner > .catalog-button {
    display: inline-flex;

    min-height: 40px;

    padding: 0 16px;
  }

  #aandem-header .header-actions {
    grid-column: 3;
    grid-row: 1;
  }

  #aandem-header .header.search-open .header__inner > .search {
    right: 10px;
    left: 10px;
  }
}


/* =========================================================
   <= 600
   ========================================================= */

@media (max-width: 600px) {

  #aandem-header .header__inner {
    grid-template-columns:
      1fr
      auto
      auto;

    gap: 8px;
  }

  #aandem-header .logo img {
    width: 130px;
  }

  #aandem-header .header-actions {
    gap: 6px;
  }

  #aandem-header .header-mobile-action,
  #aandem-header .cart-icon {
    flex-basis: 44px;

    width: 44px;
    height: 44px;
  }

  #aandem-header .header-mobile-action svg,
  #aandem-header .cart-icon svg {
    width: 21px;
    height: 21px;
  }
}


/* =========================================================
   <= 520
   ========================================================= */

@media (max-width: 520px) {

  #aandem-header .shell {
    width: calc(100% - 20px);
  }

  #aandem-header .header__inner {
    grid-template-columns:
      1fr
      auto
      auto;

    gap: 6px;

    padding-top: 10px;
    padding-bottom: 10px;
  }

  #aandem-header .logo img {
    width: 120px;
  }

  #aandem-header .header-actions {
    gap: 6px;
  }

  #aandem-header .header-mobile-action,
  #aandem-header .cart-icon {
    flex-basis: 42px;

    width: 42px;
    height: 42px;
  }

  #aandem-header .header-mobile-action svg,
  #aandem-header .cart-icon svg {
    width: 21px;
    height: 21px;
  }


  /*
   * открытый поиск:
   * оригинальное поведение <=520
   */

  #aandem-header .header.search-open .header__inner > .search {
    grid-template-columns: 1fr;

    height: auto;

    padding: 3px;

    border-radius: var(--radius-md);
  }

  #aandem-header .header.search-open .search input[type="search"] {
    height: 44px;
  }

  #aandem-header .header.search-open .search button {
    width: 100%;
    min-width: 100%;

    height: 44px;

    border-radius: 12px;
  }
}


/* =========================================================
   <= 450
   МОБИЛЬНЫЙ ВАРИАНТ
   ========================================================= */

@media (max-width: 450px) {

  /*
   * Верхняя строка:
   *
   * ФАБРИКА ТУЛЬСКИХ САМОВАРОВ
   *
   * Каталог                 Телефон
   */

  #aandem-header .topline__inner {
    display: grid;

    grid-template-columns: 1fr;

    gap: 8px;

    width: calc(100% - 20px);

    padding-top: 10px;
    padding-bottom: 10px;
  }


  /*
   * фабрика отдельной строкой
   */

  #aandem-header .factory-mark {
    display: block;

    width: 100%;

    text-align: center;
  }

  #aandem-header .factory-mark strong {
    width: 100%;

    font-size: 12px;

    text-align: center;
  }


  /*
   * Каталог + телефон
   */

  #aandem-header .topline-contacts {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    width: 100%;
  }


  /*
   * время сверху скрываем
   */

  #aandem-header .topline .dectop-block-450 {
    display: none;
  }


  /*
   * мобильный Каталог сверху показываем
   */

  #aandem-header .topline .catalog-button.mobil-block-450 {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 0 16px;

    color: #fff;

    background: var(--red);

    border: 0;
    border-radius: 999px;

    font-size: 14px;
    font-weight: 600;
  }


  /*
   * телефон справа
   */

  #aandem-header .topline a.phone {
    margin-left: auto;

    font-size: 14px;
  }


  /*
   * В основной строке Каталог теперь скрываем,
   * потому что он уже появился сверху.
   */

  #aandem-header .header__inner > .catalog-button {
    display: none;
  }


  /*
   * logo | search menu cart
   */

  #aandem-header .header__inner {
    grid-template-columns:
      minmax(105px, 1fr)
      auto;

    gap: 8px;

    padding-top: 12px;
    padding-bottom: 12px;
  }

  #aandem-header .logo img {
    width: 120px;
  }

  #aandem-header .header-actions {
    grid-column: 2;
    grid-row: 1;

    gap: 6px;
  }

  #aandem-header .header-mobile-action,
  #aandem-header .cart-icon {
    flex: 0 0 42px;

    width: 42px;
    height: 42px;
  }


  /*
   * search/menu закрыты
   */

  #aandem-header .header__inner > .search {
    display: none;
  }

  #aandem-header .header > .category-tabs {
    display: none;
  }


  /*
   * поиск открыт
   */

  #aandem-header .header.search-open .header__inner > .search {
    display: grid;
  }


  /*
   * меню открыто
   */

  #aandem-header .header.menu-open > .category-tabs {
    display: grid;
  }


  /*
   * мобильное время показываем
   * только внутри открытого меню
   */

  #aandem-header
  .header.menu-open
  > .category-tabs
  > .mobil-block-450-worktime {
    display: flex;

    align-items: center;

    width: 100%;
    min-height: 48px;

    margin: 0;
    padding: 12px 16px;

    color: var(--ink);

    background: #fff;

    border: 1px solid var(--line);
    border-radius: var(--radius-sm);

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;
  }
}


/* =========================================================
   <= 380
   ========================================================= */

@media (max-width: 380px) {

  #aandem-header .header__inner {
    grid-template-columns:
      minmax(100px, 1fr)
      auto;

    gap: 6px;
  }

  #aandem-header .logo img {
    width: 112px;
  }

  #aandem-header .header-actions {
    gap: 5px;
  }

  #aandem-header .header-mobile-action,
  #aandem-header .cart-icon {
    flex-basis: 40px;

    width: 40px;
    height: 40px;
  }

   .header-mobile-action svg,
  #aandem-header .cart-icon svg {
    width: 20px;
    height: 20px;
  }

  #aandem-header .factory-mark strong {
    font-size: 11px;
  }

  #aandem-header .topline a.phone {
    font-size: 13px;
  }

  #aandem-header .topline .catalog-button.mobil-block-450 {
    min-height: 38px;

    padding: 0 14px;

    font-size: 13px;
  }
}