
.site-header.phv3-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 5000 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    border: 0 !important;
    /* background: rgba(255,253,253,.93) !important; */
    -webkit-backdrop-filter: blur(18px) !important;
    /* backdrop-filter: blur(18px) !important; */
    /* box-shadow:
        0 6px 24px rgba(53,29,41,.045) !important; */
}

.site-header.phv3-header > .container {
    position: relative !important;
}

/* =========================================================================
   DESKTOP
   ========================================================================= */

.phv3-desktop {
    display: grid;
    /* grid-template-columns: minmax(auto,210px)
        auto
        minmax(250px,1fr)
        auto; */
    align-items: center;
    gap: clamp(12px,1.4vw,22px);
    min-height: 68px;
    padding: 8px 12px;
    border: 1px solid rgba(123,51,85,.08);
    border-radius: 22px;
    background: rgba(255,255,255,.97);
    box-shadow:
        0 10px 30px rgba(59,30,44,.05);
    grid-auto-flow: column;
}

.phv3-brand {
    display: flex;
    align-items: center;

    min-width: 0;
}

.phv3-brand img {
    display: block;

    width: 100%;
    max-width: 205px;
    height: auto;
}

.phv3-nav {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: clamp(14px,1.5vw,26px);

    min-width: 0;

    white-space: nowrap;
}

.phv3-nav a {
    position: relative;

    padding: 10px 0;

    font-size: 13px;
    font-weight: 650;
}

.phv3-nav a::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 4px;

    width: 0;
    height: 1px;

    background: var(--wine,#7b3355);

    transform: translateX(-50%);

    transition: width .18s ease;
}

.phv3-nav a:hover::after,
.phv3-nav a.active::after {
    width: 100%;
}

.phv3-desktop-search {
    /* width: 100% !important; */
    max-width: 620px !important;
    margin: 0 auto !important;
}

.phv3-desktop-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 5px;

    white-space: nowrap;
}

.phv3-mobile {
    display: none;
}

/* Compact desktop */
@media (max-width: 1180px) and (min-width: 821px) {
    .phv3-desktop {
        grid-template-columns:
            minmax(145px,180px)
            minmax(240px,1fr)
            auto;

        gap: 12px;
    }

    .phv3-nav {
        display: none;
    }

    .phv3-brand img {
        max-width: 178px;
    }
}

/* =========================================================================
   MOBILE
   ========================================================================= */

@media (max-width: 820px) {

    .site-header.phv3-header {
        padding: 7px 0 !important;
    }

    .site-header.phv3-header > .container {
        width: calc(100% - 12px) !important;
        max-width: none !important;

        margin-inline: auto !important;
    }

    .phv3-desktop {
        display: none !important;
    }

    .phv3-mobile {
        position: relative;

        display: flex;
        align-items: center;
        justify-content: space-between;

        width: 100%;
        min-height: 60px;

        gap: 8px;

        padding: 7px 8px;

        overflow: visible;

        border: 1px solid rgba(123,51,85,.09);
        border-radius: 18px;

        background: rgba(255,255,255,.985);

        box-shadow:
            0 9px 28px rgba(60,31,45,.07);
    }

    /* ---------------------------------------------------------
       NORMAL MOBILE STATE
       Wishlist and Cart intentionally not present in mobile markup.
       --------------------------------------------------------- */

    .phv3-mobile-brand {
        display: flex;
        align-items: center;

        flex: 1 1 auto;

        min-width: 0;
        max-width: 166px;

        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: translate3d(0,0,0) scale(1);

        transition:
            opacity .15s ease,
            transform .20s cubic-bezier(.2,.8,.2,1),
            visibility 0s linear 0s;
    }

    .phv3-mobile-brand img {
        display: block;

        width: 100%;
        max-width: 166px;
        height: auto;
    }

    .phv3-mobile-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;

        flex: 0 0 auto;

        gap: 3px;

        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: translate3d(0,0,0) scale(1);

        transition:
            opacity .15s ease,
            transform .20s cubic-bezier(.2,.8,.2,1),
            visibility 0s linear 0s;
    }

    .phv3-mobile-icon {
        position: relative;
        display: grid;
        place-items: center;

        flex: 0 0 38px;

        width: 38px;
        height: 38px;

        padding: 0;

        border: 0;
        border-radius: 50%;

        background: transparent;
        color: #34262d;

        cursor: pointer;

        transition:
            background .12s ease,
            transform .12s ease;
    }

    .phv3-mobile-icon:hover,
    .phv3-mobile-icon:focus-visible {
        background: #f8eef2;
    }

    .phv3-mobile-icon:active {
        transform: scale(.94);
    }

    .phv3-mobile-icon .count-badge {
        position: absolute;
        top: 0;
        right: 0;
        min-width: 15px;
        height: 15px;
        padding: 0 3px;
        font-size: 8px;
    }

    /* ---------------------------------------------------------
       HIDDEN SEARCH LAYER
       It exists in DOM, so smart-search.js can initialize it,
       but it is not visible until the search button is clicked.
       --------------------------------------------------------- */

    .phv3-mobile-search {
        position: absolute !important;

        top: 6px !important;
        right: 6px !important;
        bottom: 6px !important;
        left: 6px !important;

        z-index: 30 !important;

        display: flex !important;
        align-items: center !important;

        width: auto !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;

        gap: 4px !important;

        margin: 0 !important;
        padding: 0 6px 0 10px !important;

        overflow: visible !important;

        border: 1px solid rgba(123,51,85,.14) !important;
        border-radius: 15px !important;

        background: #fff !important;

        box-shadow:
            0 8px 22px rgba(61,29,45,.09) !important;

        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;

        transform:
            translate3d(18px,0,0)
            scaleX(.22) !important;

        transform-origin: right center !important;

        transition:
            opacity .14s ease,
            transform .24s cubic-bezier(.2,.85,.2,1),
            visibility 0s linear .24s !important;
    }

    /* ---------------------------------------------------------
       SEARCH OPEN
       --------------------------------------------------------- */

    .phv3-header.phv3-search-open .phv3-mobile-brand,
    .phv3-header.phv3-search-open .phv3-mobile-actions {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform:
            translate3d(-8px,0,0)
            scale(.97);

        transition:
            opacity .10s ease,
            transform .16s ease,
            visibility 0s linear .16s;
    }

    .phv3-header.phv3-search-open .phv3-mobile-search {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;

        transform:
            translate3d(0,0,0)
            scaleX(1) !important;

        transition:
            opacity .15s ease,
            transform .24s cubic-bezier(.2,.85,.2,1),
            visibility 0s linear 0s !important;
    }

    .phv3-mobile-search-icon {
        display: grid;
        place-items: center;

        flex: 0 0 28px;

        width: 28px;
        height: 42px;

        color: #86506a;
    }

    .phv3-mobile-search input[type="search"] {
        display: block !important;

        flex: 1 1 auto !important;

        width: 1px !important;
        min-width: 0 !important;
        height: 42px !important;

        margin: 0 !important;
        padding: 0 3px !important;

        border: 0 !important;
        outline: 0 !important;

        background: transparent !important;
        box-shadow: none !important;

        color: #302229 !important;

        font-family: var(--font-body,sans-serif) !important;
        font-size: 13.5px !important;
        font-weight: 600 !important;

        -webkit-appearance: none !important;
        appearance: none !important;
    }

    .phv3-mobile-search input[type="search"]::placeholder {
        color: #a0949a !important;

        opacity: 1 !important;

        font-weight: 500 !important;
    }

    .phv3-mobile-search input[type="search"]::-webkit-search-cancel-button {
        display: none !important;

        -webkit-appearance: none !important;
        appearance: none !important;
    }

    .phv3-mobile-submit,
    .phv3-mobile-close {
        display: grid !important;
        place-items: center !important;

        flex: 0 0 36px !important;

        width: 36px !important;
        height: 36px !important;

        padding: 0 !important;

        border: 0 !important;
        border-radius: 11px !important;

        cursor: pointer !important;

        transition:
            transform .10s ease,
            background .10s ease !important;
    }

    .phv3-mobile-submit {
        background: #8b345d !important;
        color: #fff !important;

        box-shadow:
            0 5px 12px rgba(123,51,85,.18) !important;
    }

    .phv3-mobile-close {
        background: #f6edf1 !important;
        color: #7b5166 !important;
    }

    .phv3-mobile-submit:active,
    .phv3-mobile-close:active {
        transform: scale(.93);
    }

    /* ---------------------------------------------------------
       SMART SEARCH RESULT PANEL
       --------------------------------------------------------- */

    .phv3-mobile-panel {
        position: absolute !important;

        top: calc(100% + 8px) !important;
        right: 0 !important;
        left: 0 !important;

        z-index: 100 !important;

        width: 100% !important;
        max-width: none !important;
        max-height: min(64vh,500px) !important;

        margin: 0 !important;
        padding: 7px !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        border: 1px solid rgba(123,51,85,.12) !important;
        border-radius: 15px !important;

        background: rgba(255,255,255,.995) !important;

        box-shadow:
            0 20px 48px rgba(47,24,35,.17) !important;
    }

    .phv3-mobile-panel img {
        border-radius: 9px;
    }

}

@media (max-width: 430px) {
    .site-header.phv3-header > .container {
        width: calc(100% - 8px) !important;
    }

    .phv3-mobile {
        min-height: 58px;

        gap: 3px;

        padding: 6px;

        border-radius: 17px;
    }

    .phv3-mobile-brand {
        max-width: 146px;
    }

    .phv3-mobile-brand img {
        max-width: 146px;
    }

    .phv3-mobile-icon {
        flex-basis: 36px;

        width: 36px;
        height: 36px;
    }

    .phv3-mobile-search {
        top: 5px !important;
        right: 5px !important;
        bottom: 5px !important;
        left: 5px !important;

        padding-left: 8px !important;
    }

    .phv3-mobile-search input[type="search"] {
        font-size: 13px !important;
    }

    .phv3-mobile-submit,
    .phv3-mobile-close {
        flex-basis: 34px !important;

        width: 34px !important;
        height: 34px !important;

        border-radius: 10px !important;
    }
}

@media (max-width: 340px) {
    .phv3-mobile-brand {
        max-width: 132px;
    }

    .phv3-mobile-brand img {
        max-width: 132px;
    }

    .phv3-mobile-icon {
        flex-basis: 33px;
        width: 33px;
        height: 33px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .phv3-mobile-brand,
    .phv3-mobile-actions,
    .phv3-mobile-search {
        transition: none !important;
    }
}

/* Shopping basket with a stable label on desktop and mobile */
@media (min-width: 721px) {
    .site-header .cart-pill {
        position: relative;
        width: auto;
        min-width: 94px;
        height: 46px;
        padding: 0 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 999px;
        white-space: nowrap;
    }

    .site-header .cart-pill-icon {
        display: grid;
        place-items: center;
        margin: 0;
    }

    .site-header .cart-pill-label {
        display: inline-block;
        font-size: 13px;
        font-weight: 750;
        line-height: 1;
    }

    .site-header .cart-pill-count {
        position: absolute;
        top: -4px;
        right: -3px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        font-size: 10px;
        line-height: 1;
    }
}

@media (max-width: 720px) {
    .phv3-mobile-cart {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex-basis: 58px;
        width: 58px;
        padding: 0 7px;
        border-radius: 999px;
        white-space: nowrap;
    }

    .phv3-mobile-cart-label {
        display: inline-block;
        font-size: 10px;
        font-weight: 750;
        line-height: 1;
    }

    .phv3-mobile-cart .count-badge {
        right: 1px;
        top: -1px;
    }
}

@media (max-width: 390px) {
    .phv3-mobile-brand img { max-width: 140px; }
    .phv3-mobile-actions { gap: 1px; }
    .phv3-mobile-icon { flex-basis: 34px; width: 34px; height: 36px; }
    .phv3-mobile-cart { flex-basis: 55px; width: 55px; }
}

/* Mobile header uses the compact cart icon only. */
@media (max-width: 720px) {
    .phv3-mobile-cart {
        display: grid;
        place-items: center;
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 50%;
    }

    .phv3-mobile-cart-label {
        display: none !important;
    }

    .phv3-mobile-cart .count-badge {
        top: 0;
        right: 0;
    }
}

@media (max-width: 390px) {
    .phv3-mobile-cart {
        flex-basis: 34px;
        width: 34px;
        height: 36px;
    }
}
