/* =========================================================
   PROPERASPORT — HEADER
========================================================= */
.ps-header,
.ps-header * { box-sizing: border-box; }

.ps-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    background: var(--ps-color-background, #fff);
    color: #111;
    border-bottom: 1px solid #eee;
    font-family: var(--ps-font-body, 'Nunito', sans-serif);
}

.ps-header a { text-decoration: none; }
.ps-header button,
.ps-header input { font: inherit; }

.ps-header__inner {
    width: min(1470px, calc(100% - 64px));
    min-height: 88px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.ps-header__logo {
    display: flex;
    align-items: center;
    flex: 0 0 220px !important;
    width: 220px !important;
    max-width: 220px !important;
}
.ps-header__logo img {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
    max-height: 86px;
    object-fit: contain;
}

.ps-header__nav { min-width: 0; flex: 1 1 auto; }
.ps-header__menu,
.ps-header__menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ps-header__menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 1.5vw, 24px);
}
.ps-header__menu > li { position: relative; }
.ps-header__menu a {
    display: inline-flex;
    align-items: center;
    color: #222;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.25;
    white-space: nowrap;
    transition: color var(--ps-transition, .25s ease);
}
.ps-header__menu a:hover,
.ps-header__menu a:focus,
.ps-header__menu .current-menu-item > a,
.ps-header__menu .current-menu-ancestor > a { color: var(--ps-color-accent, #8f2a91); }

.ps-header__menu .sub-menu {
    position: absolute;
    top: 100%;
    left: -16px;
    z-index: 1001;
    min-width: 220px;
    padding: 10px 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.ps-header__menu li:hover > .sub-menu,
.ps-header__menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.ps-header__menu .sub-menu a {
    display: flex;
    padding: 10px 16px;
    white-space: normal;
}

.ps-header__cta,
.ps-header__mobile-cta {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    color: #fff !important;
    background: var(--ps-color-accent, #8f2a91);
    border: 1px solid var(--ps-color-accent, #8f2a91);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color var(--ps-transition, .25s ease), border-color var(--ps-transition, .25s ease), transform var(--ps-transition, .25s ease);
}
.ps-header__cta:hover,
.ps-header__cta:focus,
.ps-header__mobile-cta:hover,
.ps-header__mobile-cta:focus {
    color: #fff !important;
    background: var(--ps-color-accent-hover, #762078);
    border-color: var(--ps-color-accent-hover, #762078);
    transform: translateY(-1px);
}

.ps-header__search { flex: 0 1 175px; min-width: 130px; }
.ps-header__search form,
.ps-header__mobile-search form { position: relative; margin: 0; }
.ps-header__search input[type="search"],
.ps-header__mobile-search input[type="search"] {
    display: block;
    width: 100%;
    height: 38px;
    margin: 0;
    padding: 0 40px 0 14px;
    color: #222;
    background: #fff;
    border: 1px solid #bdbdbd;
    border-radius: 22px;
    outline: none;
    box-shadow: none;
    font-size: 13px;
}
.ps-header__search input[type="search"]:focus,
.ps-header__mobile-search input[type="search"]:focus {
    border-color: var(--ps-color-accent, #8f2a91);
    box-shadow: 0 0 0 2px rgba(143,42,145,.1);
}
.ps-header__search form > button,
.ps-header__mobile-search form > button {
    position: absolute;
    top: 50%;
    right: 9px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    color: #666;
    background: transparent;
    border: 0;
    transform: translateY(-50%);
    cursor: pointer;
}
.ps-header__search form > button svg,
.ps-header__mobile-search form > button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ps-header__icons {
    display: flex;
    align-items: center;
    gap: 17px;
    flex: 0 0 auto;
}
.ps-header__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 30px;
    color: #111;
    transition: color var(--ps-transition, .25s ease), transform var(--ps-transition, .25s ease);
}
.ps-header__icon:hover,
.ps-header__icon:focus { color: var(--ps-color-accent, #8f2a91); transform: translateY(-1px); }
.ps-header__icon svg {
    display: block;
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ps-header__cart-count {
    position: absolute;
    top: -2px;
    right: -9px;
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    color: #fff;
    background: var(--ps-color-accent-secondary, #8e3fa9);
    border-radius: 50px;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
}

.ps-header__mobile-toggle,
.ps-header__mobile-menu { display: none; }

@media (max-width: 1320px) {
    .ps-header__inner { width: calc(100% - 40px); gap: 14px; }
    .ps-header__logo { flex-basis: 155px; width: 155px; max-width: 155px; }
    .ps-header__logo img { max-width: 155px; }
    .ps-header__menu { gap: 12px; }
    .ps-header__menu a { font-size: 14px; }
    .ps-header__cta { padding-inline: 14px; font-size: 13px; }
    .ps-header__search { flex-basis: 145px; min-width: 115px; }
    .ps-header__icons { gap: 12px; }
}

@media (max-width: 1050px) and (min-width: 901px) {
    .ps-header__inner { gap: 10px; }
    .ps-header__logo { flex-basis: 125px; width: 125px; max-width: 125px; }
    .ps-header__logo img { max-width: 125px; }
    .ps-header__menu { gap: 9px; }
    .ps-header__menu a { font-size: 12px; }
    .ps-header__cta { padding-inline: 10px; font-size: 12px; }
    .ps-header__search { flex-basis: 120px; min-width: 100px; }
    .ps-header__icons { gap: 9px; }
}

@media (max-width: 900px) {
    .ps-header__inner {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 8px;
        width: 100%;
        min-height: 70px;
        padding: 0 16px;
    }
    .ps-header__mobile-toggle {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        padding: 5px;
        color: #111;
        background: transparent;
        border: 0;
        cursor: pointer;
    }
    .ps-header__mobile-toggle span {
        display: block;
        width: 22px;
        height: 1.5px;
        background: currentColor;
        border-radius: 2px;
        transition: transform .2s ease, opacity .2s ease;
    }
    .ps-header__mobile-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
    .ps-header__mobile-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .ps-header__mobile-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
    .ps-header__logo {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        width: 150px;
        max-width: 150px;
        flex: none;
    }
    .ps-header__logo img { max-width: 150px; max-height: 52px; }
    .ps-header__nav,
    .ps-header__cta,
    .ps-header__search { display: none; }
    .ps-header__icons { grid-column: 3; grid-row: 1; gap: 12px; }
    .ps-header__icon { width: 24px; }
    .ps-header__icon svg { width: 21px; height: 21px; }

    .ps-header__mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1002;
        display: block;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        padding: 18px 20px 24px;
        background: #fff;
        border-top: 1px solid #eee;
        box-shadow: 0 12px 30px rgba(0,0,0,.1);
    }
    .ps-header__mobile-menu[hidden] { display: none !important; }
    .ps-header__mobile-search { margin-bottom: 18px; }
    .ps-header__mobile-search input[type="search"] { height: 44px; font-size: 15px; }
    .ps-header__mobile-search form > button { right: 12px; }
    .ps-header__mobile-nav,
    .ps-header__mobile-nav ul { margin: 0; padding: 0; list-style: none; }
    .ps-header__mobile-nav > li { border-bottom: 1px solid #eee; }
    .ps-header__mobile-nav a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
        padding: 8px 0;
        color: #222;
        font-size: 16px;
        line-height: 1.3;
    }
    .ps-header__mobile-nav a:hover,
    .ps-header__mobile-nav a:focus,
    .ps-header__mobile-nav .current-menu-item > a { color: var(--ps-color-accent, #8f2a91); }
    .ps-header__mobile-nav .sub-menu {
        padding-left: 16px;
        border-top: 1px solid #f0f0f0;
    }
    .ps-header__mobile-nav .sub-menu a { min-height: 40px; color: #555; font-size: 14px; }
    .ps-header__mobile-cta { display: flex; width: 100%; margin-top: 18px; min-height: 46px; }
    .ps-header__mobile-icons {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        padding-top: 18px;
        margin-top: 18px;
        border-top: 1px solid #eee;
    }
    .ps-header__mobile-icons a { color: #444; font-size: 14px; }
    .ps-header__mobile-icons a:hover { color: var(--ps-color-accent, #8f2a91); }
    .ps-header.is-menu-open { z-index: 1100; }
}

@media (max-width: 520px) {
    .ps-header__inner { padding-inline: 12px; grid-template-columns: 34px minmax(0, 1fr) auto; }
    .ps-header__logo { width: 125px; max-width: 125px; }
    .ps-header__logo img { max-width: 125px; }
    .ps-header__icons { gap: 8px; }
    .ps-header__icon { width: 22px; }
    .ps-header__icon svg { width: 19px; height: 19px; }
}





/* =========================================================
   PROPERASPORT — MULTILEVEL DESKTOP MENU
========================================================= */

@media (min-width: 901px) {

    .ps-header__nav,
    .ps-header__menu,
    .ps-header__menu li {
        overflow: visible !important;
    }

    .ps-header__menu,
    .ps-header__menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .ps-header__menu > li {
        position: relative;
    }

    .ps-header__menu li {
        position: relative;
    }

    /* Все подменю скрыты по умолчанию */
    .ps-header__menu li > ul {
        position: absolute;
        top: 0;
        left: 100%;
        min-width: 220px;
        width: max-content;
        max-width: 320px;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 0 8px 8px 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 99999;
    }

    /* Второй уровень раскрывается под основным пунктом */
    .ps-header__menu > li > ul {
        top: 100%;
        left: 0;
    }

    /* Третий и последующие уровни раскрываются справа */
    .ps-header__menu li:hover > ul,
    .ps-header__menu li:focus-within > ul {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .ps-header__menu li > ul > li > a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        white-space: normal;
        line-height: 1.4;
        text-decoration: none;
    }

    .ps-header__menu li > ul > li > a:hover,
    .ps-header__menu li > ul > li > a:focus {
        color: #8F2A91;
        background: #FAF7FA;
    }

    /* Не даём пунктам с вложенностью обрезать подменю */
    .ps-header__menu li.menu-item-has-children > a {
        position: relative;
        padding-right: 30px;
    }

    .ps-header__menu li.menu-item-has-children > a::after {
        content: "›";
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
    }
}





@media (min-width: 901px) {

    /* Родительские пункты — опорная точка для подменю */
    .ps-header__menu > li,
    .ps-header__menu li li {
        position: relative;
    }

    /* Второй уровень — под пунктом первого уровня */
    .ps-header__menu > li > ul {
        top: 100% !important;
        left: 0 !important;
    }

    /* Третий и последующие уровни — справа от родителя */
    .ps-header__menu li li > ul {
        top: 0 !important;
        left: 100% !important;
        right: auto !important;
        margin: 0 !important;
        transform: none !important;
    }

    /* Убираем зазор между уровнями, чтобы курсор не терял меню */
    .ps-header__menu li > ul {
        min-width: 220px;
    }

    /* Открываем вложенное меню при наведении */
    .ps-header__menu li:hover > ul,
    .ps-header__menu li:focus-within > ul {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}






/* PROPERASPORT — fix search button hover */
.ps-header__search form button,
.ps-header__mobile-search form button {
    position: absolute !important;
    top: 50% !important;
    right: 4px !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #063F63 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none;
    transition: none !important;
}

.ps-header__search form button:hover,
.ps-header__search form button:focus,
.ps-header__search form button:active,
.ps-header__mobile-search form button:hover,
.ps-header__mobile-search form button:focus,
.ps-header__mobile-search form button:active {
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #063F63 !important;
    border: none !important;
    box-shadow: none !important;
}

.ps-header__search form button svg,
.ps-header__mobile-search form button svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}
