.header { padding: 26px 0; }
.header .header__container { align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 24px; }
.header__container > .header__logo,
.header__container > .header__catalog,
.header__container > .header__nav,
.header__container > .header__city,
.header__container > .header__toggle { margin: 0; flex-shrink: 0; }
.header .header__logo { display: flex; align-items: center; height: 80px; width: 136px; }
.header .header__logo-image { position: static; width: 100%; }
.header .header__catalog { width: 160px; }
.header .header__catalog-toggle { gap: 16px; padding: 0 16px; font-size: 16px; }
.header .header__catalog-toggle .button__text { margin: 0; padding: 0; }
.header .header__nav-toggle, .header .header__city { font-size: 16px; }
.header .header__city { max-width: 160px; }
.header .header__city .link__text { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.header .header__tools { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; gap: 16px; margin: 0; }
.header__tools > .header__search,
.header__tools > .header__links,
.header__tools > .header__cart { margin: 0; flex-shrink: 0; }
.header .header__search { width: 320px; }
.header .header__search-toggle { display: none; }
.header .header__search-bar { position: relative; top: auto; right: auto; opacity: 1; visibility: visible; width: 100%; }
.header .header__search-input { padding-right: 12px; font-size: 16px; }
.header .header__links-item { width: 64px; }
.header .header__cart { width: 64px; }
.header .header__cart-toggle { justify-content: center; padding: 0; }
.header .header__cart-toggle .button__text { display: none; }
.header .header__contact {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 306px;
    gap: 13px;
    min-height: 64px;
    margin: 0;
    padding: 13px 15px;
    border: 1px solid #b58183;
    border-radius: 7px;
    background: #fff;
    color: #373737;
    white-space: nowrap;
}
.header__contact-label { position: absolute; top: -10px; left: 17px; padding: 0 7px; background: #fff; color: #9b2d30; font-size: 12px; font-weight: 500; line-height: 18px; }
.header__contact-number { font-size: 24px; font-weight: 700; line-height: 34px; transition: color 160ms; }
.header__contact-icon { flex-shrink: 0; color: #9b2d30; }
.header__contact:hover .header__contact-number { color: #9b2d30; }
.header__contact:focus-visible { outline: 3px solid #9b2d30; outline-offset: 4px; }
.header.is-fixed .header__logo { height: 56px; width: 112px; }
.header.is-fixed .header__logo-image { width: 100%; }

@media (min-width: 1024px) and (max-width: 1799px) {
    .header .header__container { gap: 12px; }
    .header .header__logo { width: 112px; height: 72px; }
    .header .header__catalog { width: 148px; }
    .header .header__catalog-toggle { gap: 12px; padding: 0 12px; }
    .header .header__city { max-width: 112px; }
    .header .header__tools { gap: 12px; }
    .header .header__search { flex: 0 1 240px; width: 240px; min-width: 216px; }
    .header .header__links-item { width: 48px; }
    .header .header__cart { width: 48px; }
    .header .header__contact { flex-basis: 286px; }
}

@media (max-width: 1439px) {
    .header .header__search { position: static; flex: none; width: 48px; min-width: 48px; }
    .header .header__search-toggle { display: flex; }
    .header .header__search-toggle.is-active { position: static; border-color: #d9d9d9; }
    .header .header__search-bar { position: absolute; top: calc(100% + 10px); right: var(--container-gap); width: min(400px, calc(100% - 2 * var(--container-gap))); opacity: 0; visibility: hidden; pointer-events: none; z-index: 20; }
    .header .header__search-bar.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
    .header .header__search-input { padding-left: 48px; padding-right: 12px; }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .header .header__container { gap: 8px; }
    .header .header__tools { gap: 10px; }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .header { padding: 20px 0; }
    .header .header__container { display: grid; grid-template-columns: 112px 148px 70px minmax(0, 1fr) 286px; gap: 12px; }
    .header .header__logo { grid-column: 1; grid-row: 1 / 3; }
    .header .header__catalog { grid-column: 2; grid-row: 1; }
    .header .header__nav--clients { grid-column: 2; grid-row: 2; justify-self: start; }
    .header .header__nav--about { grid-column: 3; grid-row: 2; justify-self: start; }
    .header .header__nav-toggle { height: 32px; }
    .header .header__city { grid-column: 4; grid-row: 2; justify-self: start; max-width: 100%; }
    .header .header__tools { grid-column: 3 / 5; grid-row: 1; justify-self: end; }
    .header .header__contact { grid-column: 5; grid-row: 1 / 3; width: 286px; }
}

@media (max-width: 1023px) {
    .header, .header.is-fixed { padding: 16px 0; }
    .header .header__container { display: grid; grid-template-columns: 40px 88px minmax(0, 1fr); gap: 16px 12px; }
    .header__container > .header__toggle { grid-column: 1; grid-row: 1; width: 40px; height: 40px; }
    .header .header__logo, .header.is-fixed .header__logo { grid-column: 2; grid-row: 1; width: 88px; height: 58px; }
    .header .header__catalog, .header .header__nav { display: none; }
    .header .header__city { grid-column: 1 / -1; grid-row: 2; justify-self: start; max-width: calc(100% - 204px); font-size: 12px; }
    .header .header__tools { grid-column: 1 / -1; grid-row: 2; justify-self: end; gap: 7px; }
    .header .header__search, .header .header__search-toggle { width: 40px; min-width: 40px; height: 40px; }
    .header .header__search-toggle svg { width: 20px; height: 20px; }
    .header .header__links { height: 40px; }
    .header .header__links-item { width: 32px; }
    .header .header__links-item svg { width: 20px; height: 20px; }
    .header .header__cart { width: 40px; }
    .header .header__cart-toggle { height: 40px; }
    .header .header__cart-toggle svg { width: 21px; height: 21px; }
    .header .header__contact { grid-column: 3; grid-row: 1; margin: 0; padding: 9px 8px; gap: 6px; width: 100%; max-width: 306px; min-height: 52px; justify-self: end; border-radius: 6px; }
    .header__contact-number { font-size: 16px; line-height: 22px; }
    .header__contact-label { top: -8px; left: 5px; padding: 0 4px; font-size: 11px; line-height: 14px; }
    .header__contact-icon { width: 18px; height: 18px; }
}

@media (max-width: 379px) {
    .header .header__container { grid-template-columns: 34px 72px minmax(0, 1fr); column-gap: 8px; --container-gap: 10px; }
    .header__container > .header__toggle { width: 34px; height: 38px; }
    .header .header__logo, .header.is-fixed .header__logo { width: 72px; }
    .header .header__contact { padding-left: 5px; padding-right: 5px; }
    .header__contact-number { font-size: 14px; }
    .header__contact-icon { display: none; }
    .header .header__tools { gap: 5px; }
    .header .header__search, .header .header__search-toggle { width: 36px; min-width: 36px; }
    .header .header__links-item { width: 28px; }
    .header .header__cart { width: 36px; }
    .header .header__city { max-width: calc(100% - 180px); font-size: 11px; }
}

@media (prefers-reduced-motion: no-preference) {
    .header__contact:hover .header__contact-icon,
    .header__contact:focus-visible .header__contact-icon { animation: header-phone-ring 650ms ease-in-out 2; transform-origin: 50% 50%; }
    @keyframes header-phone-ring { 0%, 100% { transform: rotate(0); } 20%, 60% { transform: rotate(-12deg); } 40%, 80% { transform: rotate(12deg); } }
}
