/* =========================================================
PEPLOS — Global Navbar Search
Baseline-preserving version
========================================================= */

/*
 * The original frontend locked the mobile document while search was open.
 * Keep that behavior because it prevents the focused fixed search field
 * from moving the page underneath it.
 */
body.is-search-scroll-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

/* =========================================================
01 — Search Trigger
========================================================= */

.nav-search-btn {
    position: relative;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .99);
    color: #354346;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow:
        0 11px 27px rgba(18, 24, 26, .075),
        0 2px 7px rgba(18, 24, 26, .025);
    transition:
        transform .22s cubic-bezier(.2, .8, .2, 1),
        box-shadow .24s ease,
        background-color .24s ease,
        opacity .2s ease;
}

.nav-search-btn:hover {
    transform: translateY(-1px);
    background: #fff;
    box-shadow:
        0 14px 32px rgba(18, 24, 26, .09),
        0 2px 8px rgba(18, 24, 26, .028);
}

.nav-search-btn:focus-visible {
    outline: 2px solid rgba(53, 67, 70, .16);
    outline-offset: 2px;
}

.navbar-primary__actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
}

/* =========================================================
02 — Search Box
========================================================= */

.nav-search-experience {
    position: absolute;
    left: 0;
    top: 50%;
    width: min(455px, 44vw);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%) scaleX(.84);
    transform-origin: left center;
    transition:
        opacity .18s ease,
        visibility .18s ease,
        transform .30s cubic-bezier(.2, .8, .2, 1);
    z-index: 8;
}

.navbar-primary__actions.is-search-open .nav-search-experience {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) scaleX(1);
}

.navbar-primary__actions.is-search-open .nav-search-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(.84);
}

header.main-header.is-search-open .navbar-primary__links {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-2px);
}

.nav-search-form {
    position: relative;
    width: 100%;
    height: 56px;
    padding: 0 6px 0 9px;
    border: 1px solid rgba(18, 24, 26, .038);
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        rgba(245, 247, 246, .64) 0%,
        rgba(239, 242, 240, .52) 100%
    );
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    gap: 10px;
    isolation: isolate;
    box-shadow:
        0 13px 31px rgba(18, 24, 26, .030),
        0 2px 6px rgba(18, 24, 26, .013),
        inset 0 1px 0 rgba(255, 255, 255, .58);
    transition:
        border-color .24s ease,
        box-shadow .24s ease,
        background .24s ease,
        transform .24s cubic-bezier(.2, .8, .2, 1);
}

.nav-search-form:hover,
.nav-search-form:focus-within {
    border-color: rgba(18, 24, 26, .052);
    background: linear-gradient(
        135deg,
        rgba(246, 248, 247, .70) 0%,
        rgba(240, 243, 241, .58) 100%
    );
    box-shadow:
        0 17px 38px rgba(18, 24, 26, .040),
        0 3px 8px rgba(18, 24, 26, .015),
        inset 0 1px 0 rgba(255, 255, 255, .64);
}

.nav-search-submit {
    position: relative;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .99);
    color: #354346;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow:
        0 11px 27px rgba(18, 24, 26, .075),
        0 2px 7px rgba(18, 24, 26, .025);
    transition:
        transform .22s cubic-bezier(.2, .8, .2, 1),
        box-shadow .24s ease,
        background-color .24s ease;
}

.nav-search-submit::after {
    content: "";
    position: absolute;
    inset: -7px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(18, 24, 26, .028) 0%,
        rgba(18, 24, 26, .012) 45%,
        rgba(18, 24, 26, 0) 72%
    );
    opacity: .8;
    pointer-events: none;
}

.nav-search-submit:hover,
.nav-search-submit:focus-visible {
    outline: 0;
    transform: translateY(-1px);
    background: #fff;
    box-shadow:
        0 14px 32px rgba(18, 24, 26, .09),
        0 2px 8px rgba(18, 24, 26, .028);
}

.nav-search-input {
    min-width: 0;
    flex: 1;
    height: 100%;
    padding: 0 3px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #202729;
    font-family: inherit;
    font-size: 11.7px;
    font-weight: 560;
    text-align: right;
}

.nav-search-input::placeholder {
    color: #90989a;
    opacity: 1;
}

.nav-search-input::-webkit-search-cancel-button {
    display: none;
}

.nav-search-close {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    border: 1px solid rgba(53, 67, 70, .075);
    border-radius: 50%;
    background: rgba(255, 255, 255, .50);
    color: #6f797b;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .72),
        0 2px 7px rgba(18, 24, 26, .022);
    transition:
        transform .20s cubic-bezier(.2, .8, .2, 1),
        background-color .20s ease,
        color .20s ease,
        border-color .20s ease,
        box-shadow .20s ease;
}

.nav-search-close:hover,
.nav-search-close:focus-visible {
    outline: 0;
    transform: rotate(90deg);
    border-color: rgba(53, 67, 70, .14);
    background: #fff;
    color: #354346;
    box-shadow: 0 5px 12px rgba(18, 24, 26, .055);
}

/* =========================================================
03 — Results Panel
========================================================= */

/*
 * Important:
 * Do not use display:none or the hidden attribute on the whole panel.
 */
.nav-search-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: min(510px, 68vh);
    overflow: auto;
    padding: 9px;
    border: 1px solid rgba(18, 24, 26, .044);
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        rgba(248, 249, 248, .92),
        rgba(241, 244, 242, .86)
    );
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 22px 50px rgba(18, 24, 26, .10),
        0 4px 14px rgba(18, 24, 26, .028),
        inset 0 1px 0 rgba(255, 255, 255, .82);
    z-index: 9;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    overscroll-behavior: contain;
    transition:
        opacity .16s ease,
        visibility .16s ease,
        transform .16s ease;
}

.nav-search-panel.is-results-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-search-panel__head {
    min-height: 34px;
    padding: 3px 7px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(53, 67, 70, .055);
    color: #7d8587;
    font-size: 9.5px;
}

.nav-search-panel__head strong {
    color: #354346;
    font-size: 10px;
    font-weight: 770;
}

.nav-search-results {
    display: grid;
    gap: 4px;
    padding-top: 7px;
}

.nav-search-result {
    min-width: 0;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    color: #293033;
    transition:
        background-color .18s ease,
        border-color .18s ease,
        transform .2s cubic-bezier(.2, .8, .2, 1),
        box-shadow .18s ease;
}

.nav-search-result:hover,
.nav-search-result:focus-visible {
    outline: 0;
    background: rgba(255, 255, 255, .64);
    border-color: rgba(53, 67, 70, .055);
    transform: translateX(-2px);
    box-shadow: 0 5px 13px rgba(18, 24, 26, .025);
}

.nav-search-result__image {
    width: 54px;
    height: 62px;
    overflow: hidden;
    border-radius: 9px;
    background: #eeefec;
    box-shadow: 0 3px 9px rgba(18, 24, 26, .045);
}

.nav-search-result__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-search-result__content {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.nav-search-result__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #262d2f;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
}

.nav-search-result__price {
    color: #354346;
    font-size: 9.7px;
    line-height: 1;
    font-weight: 790;
}

.nav-search-result__arrow {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .72);
    color: #354346;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 7px rgba(18, 24, 26, .025);
    transition:
        background-color .18s ease,
        color .18s ease,
        transform .2s cubic-bezier(.2, .8, .2, 1);
}

.nav-search-result__arrow svg {
    width: 11px;
    height: 11px;
}

.nav-search-result:hover .nav-search-result__arrow,
.nav-search-result:focus-visible .nav-search-result__arrow {
    background: #354346;
    color: #fff;
    transform: translateX(-1px);
}

/* =========================================================
04 — Empty State / View All
========================================================= */

.nav-search-empty {
    min-height: 132px;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.nav-search-empty[hidden],
.nav-search-panel__head[hidden],
.nav-search-all[hidden] {
    display: none !important;
}

.nav-search-empty__icon {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(53, 67, 70, .075);
    border-radius: 50%;
    background: rgba(255, 255, 255, .56);
    color: #526164;
    display: grid;
    place-items: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .72),
        0 5px 14px rgba(18, 24, 26, .028);
}

.nav-search-empty__icon svg {
    width: 19px;
    height: 19px;
}

.nav-search-empty__copy {
    max-width: 255px;
    display: grid;
    justify-items: center;
    gap: 4px;
}

.nav-search-empty__title {
    color: #354346;
    font-size: 11.5px;
    line-height: 1.55;
    font-weight: 800;
}

.nav-search-empty__text {
    color: #7f8789;
    font-size: 9.5px;
    line-height: 1.8;
    font-weight: 450;
}

.nav-search-all {
    width: 100%;
    min-height: 38px;
    margin-top: 6px;
    padding: 8px 11px;
    border: 0;
    border-top: 1px solid rgba(53, 67, 70, .055);
    background: transparent;
    color: #354346;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font: inherit;
    font-size: 9.8px;
    font-weight: 760;
    cursor: pointer;
}

.nav-search-all span:last-child {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #354346;
    color: #fff;
    display: grid;
    place-items: center;
    transition: transform .2s ease;
}

.nav-search-all:hover span:last-child {
    transform: translateX(-2px);
}

/* =========================================================
05 — Backdrop
========================================================= */

.nav-search-backdrop {
    position: fixed;
    inset: 0;
    z-index: 995;
    border: 0;
    background: rgba(18, 24, 26, .055);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    transition:
        opacity .2s ease,
        visibility .2s ease;
}

.nav-search-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =========================================================
06 — Responsive
========================================================= */

@media (max-width: 1100px) {
    .nav-search-btn {
        width: 41px;
        height: 41px;
        flex-basis: 41px;
    }
}

@media (max-width: 767px) {
    .navbar-primary__actions.is-search-open {
        position: static;
    }

    .nav-search-experience {
        position: fixed;
        top: 9px;
        right: 14px;
        left: 14px;
        width: auto;
        z-index: 1100;
        transform: translateY(-6px) scale(.988);
        transform-origin: center top;
    }

    .navbar-primary__actions.is-search-open .nav-search-experience {
        width: auto;
        transform: none;
    }

    .nav-search-form {
        height: 54px;
        padding: 0 6px 0 8px;
        border-radius: 16px;
    }

    .nav-search-submit {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .nav-search-input {
        font-size: 11px;
    }

    .nav-search-close {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .nav-search-panel {
        max-height: min(480px, 67vh);
        border-radius: 16px;
    }

    .nav-search-result {
        grid-template-columns: 48px minmax(0, 1fr) 26px;
        gap: 9px;
        padding: 6px;
    }

    .nav-search-result__image {
        width: 48px;
        height: 56px;
    }

    .nav-search-result__title {
        font-size: 10.5px;
    }

    .nav-search-result__price {
        font-size: 9px;
    }

    header.main-header.is-search-open .brand-identity-wrapper {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@media (max-width: 390px) {
    .nav-search-btn {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
}
