/**
 * Pure Life — сучасний десктопний хедер (≥1101px)
 */

@media (min-width: 1101px) {

    /* ——— Верхня смуга: лише навігація + кабінет ——— */
    #top {
        background: #fafafa;
        border-bottom: 1px solid #ececec;
    }

    #top .container {
        min-height: 38px;
        max-height: 38px;
        align-items: center;
    }

    #top .menu {
        margin-left: 0;
        gap: 4px;
    }

    #top .menu > li {
        margin-right: 0;
    }

    #top .menu > li:before {
        display: none;
    }

    #top .menu > li a,
    #top .menu > li {
        font-size: 13px;
        color: #555;
        transition: color 0.2s ease;
    }

    #top .menu > li a:hover {
        color: var(--main_color);
    }

    #top .top_right {
        gap: 8px;
    }

    #top .icon_account:before {
        -webkit-mask-size: 18px;
        mask-size: 18px;
        height: 18px;
        width: 18px;
    }

    #top .account .dropdown-toggle {
        font-size: 13px;
        color: #333;
        gap: 6px;
    }

    /* ——— Основний ряд: лого, каталог, пошук, дії ——— */
    /* z-index > .dropdown-bg (999), інакше меню «Зв'язок з нами» під оверлеєм і не клікається */
    header {
        background: var(--header_color, #fff);
        border-bottom: 1px solid #e9e9e9;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
        position: sticky;
        top: 0;
        z-index: 1001;
    }

    .dropdown-bg.active {
        z-index: 1000;
    }

    header .container {
        min-height: 68px;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap;
    }

    header .logo {
        margin-right: 8px;
        flex-shrink: 0;
        min-width: 0;
    }

    header .logo img {
        height: 34px;
        width: auto;
        max-width: 160px;
        object-fit: contain;
        display: block;
    }

    header #menu {
        flex-shrink: 0;
    }

    header #menu > .dropdown-toggle {
        height: 40px;
        min-width: 148px;
        font-size: 14px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    header #search {
        flex: 1 1 auto;
        min-width: 200px;
        max-width: 480px;
        margin-left: 4px;
        margin-right: 4px;
    }

    header #search input {
        height: 42px;
        min-width: 0;
        width: 100%;
        background: #f4f4f4;
        border: 1px solid transparent;
        border-radius: 10px;
        font-size: 14px;
        transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    header #search input:focus {
        background: #fff;
        border-color: rgba(0, 0, 0, 0.08);
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
        outline: none;
    }

    header #search button {
        height: 34px;
        width: 34px;
        right: 4px;
        border-radius: 8px;
    }

    header .contacts {
        margin-left: auto;
        margin-right: 0;
        flex-shrink: 0;
        gap: 8px;
        position: relative;
    }

    header .contacts .dropdown-menu.active {
        z-index: 1002;
        border-radius: 10px;
        border: 1px solid #ececec;
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
        overflow: hidden;
    }

    header .contacts .messenger_links li a {
        pointer-events: auto;
    }

    header .contacts .icon_contacts {
        flex-direction: row;
        align-items: center;
        gap: 4px;
        padding: 8px 12px;
        border-radius: 10px;
        background: #f7f7f7;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    header .contacts .icon_contacts:hover {
        background: #efefef;
    }

    header .contacts .icon_contacts span {
        font-size: 13px;
        line-height: 1.3;
        white-space: nowrap;
    }

    /* Один рядок контакту замість двох телефонів у шапці */
    header .contacts .icon_contacts span:not(:first-of-type) {
        display: none;
    }

    header .contacts .open {
        display: none;
    }

    header .compare,
    header .wishlist {
        margin-left: 12px;
        padding-left: 12px;
        border-left: 1px solid #eee;
        flex-shrink: 0;
    }

    header #cart {
        margin-left: 12px;
        padding-left: 12px;
        border-left: 1px solid #eee;
        flex-shrink: 0;
    }

    header #cart > button,
    header #cart > a {
        padding-right: 8px;
    }

    /* Відступ контенту під sticky-хедером не потрібен — sticky без стрибків */
    body.common-home #top + header {
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    }
}

@media (min-width: 1101px) and (max-width: 1280px) {
    header #search {
        max-width: 360px;
    }

    header .contacts .icon_contacts span {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
