/**
 * Десктопный нижний ряд шапки (пилюли, корзина, контакты) — макет из local/doc/header/prototype.
 * Включается классом .header--actions-bar на <header>. На max-width 81.25em — прежняя мобильная вёрстка.
 */

.header.header--actions-bar .header__container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.header.header--actions-bar .header__top-wrapper {
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.75rem;
}

.header.header--actions-bar .header__navbar {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.header.header--actions-bar .header__navbar-list {
  align-items: center;
  flex-wrap: wrap;
}

.header.header--actions-bar .header__info {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.header.header--actions-bar .header__info-link {
  gap: 0.5rem;
}

.header.header--actions-bar .header__info-link--accent .header__info-text {
  color: var(--brown);
}

/* --- Нижний ряд: новый блок только на широком экране --- */
.header.header--actions-bar .header__desktop-actions {
  display: none;
}

@media (min-width: 81.3125em) {
  .header.header--actions-bar .header__bottom-wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.125rem;
  }

  .header.header--actions-bar .header__desktop-actions {
    display: flex;
    flex: 1 1 320px;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
  }

  .header.header--actions-bar .header__actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 66.75rem;
    margin-left: auto;
    gap: 1.875rem;
  }

  .header.header--actions-bar .header__actions-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
  }

  /* Старый блок формы /sidelki/ остаётся в DOM для JS — только визуально убираем */
  .header.header--actions-bar .header__search--legacy {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    clip-path: inset(50%) !important;
  }

  .header.header--actions-bar .header__contacts--legacy {
    display: none !important;
  }

  .header.header--actions-bar .header__bottom-wrapper > .header__login,
  .header.header--actions-bar .header__bottom-wrapper > .header__dropdown {
    display: none !important;
  }
}

/* Пилюли и элементы ряда */
.header.header--actions-bar .header__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.375rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 2rem;
  background: var(--gray-light, #f2f2f2);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  font-family: Onest, Montserrat, system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
  color: var(--blue-dark);
  box-sizing: border-box;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.header.header--actions-bar .header__pill:hover {
  background: #e8e8e8;
}

.header.header--actions-bar .header__pill:focus-visible {
  outline: 2px solid var(--brown);
  outline-offset: 2px;
}

.header.header--actions-bar .header__pill--narrow {
  min-width: 5.625rem;
}

.header.header--actions-bar .header__pill--search {
  flex: 1 1 auto;
  max-width: 23.3125rem;
  min-width: min(12.5rem, 100%);
  justify-content: flex-start;
}

.header.header--actions-bar .header__search-input {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--blue-dark);
  outline: none;
}

.header.header--actions-bar .header__search-input::placeholder {
  color: #d9d9d9;
}

.header.header--actions-bar .header__pill--sidelki {
  display: inline-grid;
  grid-template-columns: auto minmax(0, max-content);
  align-items: center;
  gap: 0 1rem;
  justify-items: start;
}

.header.header--actions-bar .header__pill--shop {
  display: inline-grid;
  grid-template-columns: auto minmax(0, max-content);
  align-items: center;
  gap: 0 1rem;
  justify-items: start;
}

.header.header--actions-bar .header__pill-shop-icon {
  grid-column: 1;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header.header--actions-bar .header__pill-shop-icon svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.header.header--actions-bar .header__pill-shop-label {
  grid-column: 2;
  min-width: 0;
  text-align: left;
}

.header.header--actions-bar .header__pill-sidelki-icon {
  grid-column: 1;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header.header--actions-bar .header__pill-sidelki-icon svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.header.header--actions-bar .header__pill-sidelki-label {
  grid-column: 2;
  min-width: 0;
  text-align: left;
}

.header.header--actions-bar .header__pill--service {
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  min-height: 3rem;
}

.header.header--actions-bar .header__pill--service svg {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.header.header--actions-bar .header__desktop-actions .header__login.header__pill {
  display: inline-flex;
  width: auto;
  min-height: 3.375rem;
  border: none;
  border-radius: 2rem;
  background: var(--gray-light, #f2f2f2);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 1rem;
}

.header.header--actions-bar .header__desktop-actions .header__login.header__pill:hover {
  background: var(--brown);
  color: var(--white);
}

.header.header--actions-bar .header__desktop-actions .header__dropdown {
  position: relative;
}

.header.header--actions-bar .header__desktop-actions .header__dropdown > .header__login {
  display: inline-flex;
  width: auto;
  min-width: 5.625rem;
  min-height: 3.375rem;
  border: none;
  border-radius: 2rem;
  background: var(--gray-light, #f2f2f2);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 1rem;
}

.header.header--actions-bar .header__desktop-actions .header__dropdown > .header__login:hover {
  background: #e8e8e8;
  color: var(--blue-dark);
}

.header.header--actions-bar .header__cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.3125rem;
  height: 3.375rem;
  flex-shrink: 0;
  border-radius: 3.125rem;
  background: var(--gray-light, #f2f2f2);
  text-decoration: none;
  color: var(--blue-dark);
}

.header.header--actions-bar .header__cart:hover {
  background: #e8e8e8;
}

.header.header--actions-bar .header__cart-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.header.header--actions-bar .header__cart-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.header.header--actions-bar .header__cart-badge {
  position: absolute;
  top: -0.125rem;
  right: -0.25rem;
  box-sizing: border-box;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #D1416B;
  color: var(--white, #fff);
  font-family: Onest, Montserrat, system-ui, sans-serif;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.125rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--gray-light, #f2f2f2);
}

.header.header--actions-bar .header__cart-badge[hidden] {
  display: none !important;
}

.header.header--actions-bar .header__cart-icon svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.header.header--actions-bar .header__desktop-actions .header__contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
}

.header.header--actions-bar .header__desktop-actions .header__phone {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--blue-dark);
  text-decoration: none;
  white-space: nowrap;
}

.header.header--actions-bar .header__desktop-actions .footer__mail {
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--gray);
  text-decoration: none;
}

.header.header--actions-bar .header__logo img {
  max-height: 5.125rem;
  width: auto;
  max-width: min(15.625rem, 42vw);
  height: auto;
}

/* вместо style.min.css: padding: 1.875rem 0 на широкой шапке */
@media (min-width: 81.25em) {
  .header__bottom-wrapper {
    padding: 0;
    margin-bottom: 24px;
  }
}

@media (max-width: 81.25em) {
  .header.header--actions-bar .header__top {
    display: none;
  }

  .header.header--actions-bar .header__search--legacy .header__search-wrap {
    align-items: stretch;
  }

  .header.header--actions-bar .header__search--legacy .header__form-control {
    width: 100%;
  }

  .header.header--actions-bar .header__search--legacy .header__pill--sidelki {
    width: 100%;
  }
}
