.site-header {
    --header-primary: var(--sv-primary, #0093ee);
    --header-secondary: var(--sv-primary-secondary, #e8f6ff);
    --header-white: var(--sv-white, #ffffff);
    --header-field-border: var(--sv-field-border, #c2c2c2);
    --header-placeholder: #757575;

    position: relative;

    padding: 0;
    border: none;

    color: var(--header-secondary);
    background-color: var(--header-primary);

    font-family: "Inter", Arial, sans-serif;
}

.header-symbols {
    position: absolute;

    width: 0;
    height: 0;
    overflow: hidden;

    pointer-events: none;
}

/*
 * Десктопна шапка.
 *
 * Правий блок:
 * монтаж 194px + телефон 146px + значки 158px
 * + два проміжки по 32px = 562px.
 *
 * Окремої колонки для мобільного меню немає.
 */
.header-content {
    width: min(1576px, calc(100% - 48px));
    height: 80px;
    margin-inline: auto;

    display: grid;
    grid-template-columns:
        138.08px
        38.92px
        108px
        35px
        minmax(0, 456px)
        minmax(0, 1fr)
        562px;

    align-items: center;
}

.header-logo {
    grid-column: 1;

    width: 138.08px;
    height: 48px;

    display: block;

    text-decoration: none;
}

.header-logo img {
    display: block;

    width: 100%;
    height: 100%;
    max-width: none;

    object-fit: contain;
}

.header-icon {
    display: block;
    flex-shrink: 0;

    width: 32px;
    height: 32px;
}

.header-icon-small {
    width: 16px;
    height: 16px;
}

.header-pill {
    box-sizing: border-box;

    height: 36px;
    padding: 8px 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    border: none;
    border-radius: 18px;

    color: var(--header-primary);
    background-color: var(--header-secondary);

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;

    white-space: nowrap;
    text-decoration: none;
}

.header-catalog {
    grid-column: 3;
    width: 108px;
}

/* Пошук вирівнюється по центру шапки. */

.header-search {
    grid-column: 5;
    align-self: center;

    min-width: 0;
    width: 100%;
    height: 36px;
    margin-top: 0;

    display: flex;
    align-items: center;

    border-radius: 18px;

    background-color: var(--header-white);
    box-shadow: inset 0 0 0 1px var(--header-field-border);
}

.header-search-input {
    box-sizing: border-box;

    flex: 1;
    min-width: 0;
    width: 100%;
    height: 36px;
    padding: 8px 8px 8px 12px;

    border: none;
    border-radius: 18px 0 0 18px;

    color: var(--header-placeholder);
    background-color: transparent;

    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

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

.header-search-input:disabled {
    color: var(--header-placeholder);
    opacity: 1;

    -webkit-text-fill-color: var(--header-placeholder);
}

.header-search-button {
    flex: 0 0 16px;

    width: 16px;
    height: 16px;
    margin: 0 12px 0 0;
    padding: 0;

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

    border: none;

    color: var(--header-primary);
    background-color: transparent;
}

/*
 * Правий блок закінчується біля правого краю контейнера.
 * Усі елементи вирівняні по спільній горизонтальній осі.
 */
.header-utility {
    grid-column: 7;
    align-self: center;
    justify-self: end;

    width: 562px;
    height: 41px;
    margin-top: 0;

    display: grid;
    grid-template-columns: 194px 146px 158px;
    align-items: center;
    column-gap: 32px;
}

.header-installation {
    width: 194px;
}

.header-contact {
    width: 146px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    white-space: nowrap;
}

.header-phone {
    display: block;

    font-size: 20px;
    font-weight: 700;
    line-height: 32px;
}

.header-phone-caption {
    display: block;
    margin-top: -7px;

    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.header-actions {
    justify-self: end;

    width: 158px;

    display: grid;
    grid-template-columns: repeat(4, 32px);
    align-items: center;
    gap: 10px;
}

.header-action {
    box-sizing: border-box;

    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;

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

    border: none;

    color: var(--header-secondary);
    background-color: transparent;

    text-decoration: none;
}

/*
 * Кнопка мобільного меню за замовчуванням прихована.
 * Вона не займає місце і не потрапляє в порядок Tab.
 */
.header-menu {
    box-sizing: border-box;

    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;

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

    border: none;

    color: var(--header-secondary);
    background-color: transparent;
}

.header-menu .header-icon {
    width: 24px;
    height: 24px;
}

.site-header button {
    font-family: inherit;
}

.site-header button:disabled {
    opacity: 1;
    cursor: default;
}

/*
 * Проміжна адаптація.
 *
 * Монтаж і телефон приховані.
 * Чотири значки залишаються праворуч.
 * Мобільне меню ще не показуємо.
 */
@media (max-width: 1439px) {
    .header-content {
        grid-template-columns:
            138.08px
            108px
            minmax(0, 1fr)
            158px;

        column-gap: 24px;
    }

    .header-logo {
        grid-column: 1;
    }

    .header-catalog {
        grid-column: 2;
    }

    .header-search {
        grid-column: 3;
        align-self: center;

        margin-top: 0;
    }

    .header-utility {
        grid-column: 4;
        align-self: center;
        justify-self: end;

        width: 158px;
        height: 32px;
        margin-top: 0;

        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0;
    }

    .header-installation,
    .header-contact {
        display: none;
    }
}

/*
 * Мобільна композиція:
 * логотип → пошук → кошик → меню.
 *
 * Кнопка меню доступна лише до 767px включно.
 */
@media (max-width: 767px) {
    .header-content {
        width: calc(100% - 48px);
        height: 68px;

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

        column-gap: 16px;
    }

    .header-logo {
        grid-column: 1;
        grid-row: 1;

        width: 106.05px;
        height: 36px;
    }

    .header-catalog {
        display: none;
    }

    .header-search {
        grid-column: 2;
        grid-row: 1;

        width: 100%;
        height: 36px;
        margin-top: 0;
    }

    .header-utility,
    .header-actions {
        display: contents;
    }

    .header-installation,
    .header-contact,
    .header-compare,
    .header-profile,
    .header-favorites {
        display: none;
    }

    .header-cart {
        grid-column: 3;
        grid-row: 1;

        width: 32px;
        height: 32px;
    }

    .header-menu {
        grid-column: 4;
        grid-row: 1;

        display: inline-flex;

        width: 32px;
        height: 32px;
    }

    .header-menu .header-icon {
        width: 32px;
        height: 32px;
    }
}