.ph-header {
    --ph-logo-width: 170px;
    --ph-logo-offset-y: 30px;
    --ph-logo-clearance: 34px;
    position: relative;
    width: 100%;
    z-index: 20;
}

.ph-header, .ph-header * {
    box-sizing: border-box;
}

.ph-header__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-height: 82px;
    padding-left: 28px;
    padding-right: 28px;
}

.ph-header__nav {
    display: flex;
    align-items: center;
    gap: 34px;
    min-width: 0;
}

.ph-header__nav--left {
    justify-content: flex-end;
    padding-right: calc((var(--ph-logo-width) / 2) + var(--ph-logo-clearance));
}

.ph-header__right-cluster {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 34px;
    min-width: 0;
    padding-left: calc((var(--ph-logo-width) / 2) + var(--ph-logo-clearance));
}

.ph-header__nav--right {
    justify-content: flex-start;
}

.ph-header__nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: color .2s ease;
}

.ph-header__nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .2s ease;
}

.ph-header__nav-link:hover::after,
.ph-header__nav-link:focus-visible::after {
    transform: scaleX(1);
}

.ph-header__logo {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: calc(50% + var(--ph-logo-offset-y));
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ph-header__logo-box {
    display: block;
    line-height: 0;
    pointer-events: auto;
}

.ph-header__logo img {
    display: block;
    width: var(--ph-logo-width);
    max-width: none;
    height: auto;
}

.ph-header__cart {
    position: relative;
    z-index: 5;
    flex: 0 0 auto;
    color: #fff;
}

.ph-header__cart > * {
    max-width: 100%;
}

.ph-hamburger {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.ph-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    border-radius: 999px;
    background: currentColor;
}

.ph-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 99996;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.ph-drawer-overlay[hidden] {
    display: block;
}

.ph-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 99997;
    width: min(86vw, 360px);
    padding: 24px;
    overflow-y: auto;
    background: #0B1630;
    box-shadow: 0 12px 45px rgba(0, 0, 0, .28);
    transition: transform .3s ease;
}

.ph-header--drawer-left .ph-drawer {
    left: 0;
    transform: translateX(-102%);
}

.ph-header--drawer-right .ph-drawer {
    right: 0;
    transform: translateX(102%);
}

.ph-drawer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.ph-drawer__title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.ph-drawer__close {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.ph-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ph-drawer__link {
    display: block;
    padding: 14px 2px;
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.ph-header.is-drawer-open .ph-drawer {
    transform: translateX(0);
}

.ph-header.is-drawer-open .ph-drawer-overlay {
    opacity: 1;
    visibility: visible;
}

body.ph-no-scroll {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .ph-header__inner {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .ph-hamburger {
        display: inline-block;
        grid-column: 1;
        justify-self: start;
        z-index: 6;
    }

    .ph-header__nav {
        display: none;
    }

    .ph-header__logo {
        /* Keep the absolutely positioned logo centered against the entire header.
         * Do not assign it to grid column 2: an absolutely positioned grid item
         * would then use that grid area as its containing block and appear offset. */
        grid-column: auto;
        grid-row: auto;
        left: 50%;
        right: auto;
        top: calc(50% + var(--ph-logo-offset-y));
        margin: 0;
        transform: translate(-50%, -50%);
    }

    .ph-header__right-cluster {
        grid-column: 3;
        justify-self: end;
        padding-left: 0;
        gap: 0;
        z-index: 6;
    }

    .ph-header__cart {
        display: block;
    }
}

@media (max-width: 767px) {
    .ph-header__inner {
        grid-template-columns: 44px minmax(0, 1fr) minmax(44px, auto);
    }

    .ph-header__cart {
        font-size: .9em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ph-drawer,
    .ph-drawer-overlay,
    .ph-header__nav-link::after {
        transition: none;
    }
}
