/**
 * Header Search Styles
 * Header Search — overlay search styles.
 */

:root {
    --nm--page-width: 1200px;
    --nm--page-column-spacing: 20px;
}

/* Search holder */
.nm-header-search-holder {
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.header-search-closing .nm-header-search-holder,
.header-search-open .nm-header-search-holder {
    visibility: visible;
    pointer-events: all;
    z-index: 1020;
    width: 100%;
    height: 100%;
}

/* Overlay */
.nm-page-overlay.nm-header-search-overlay {
    position: absolute;
}
.header-search-open .nm-page-overlay.nm-header-search-overlay {
    visibility: visible;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
}
.header-search-closing .nm-page-overlay.nm-header-search-overlay {
    opacity: 0;
}

/* Search panel */
#nm-header-search {
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    z-index: 1010;
    width: auto;
    overflow: hidden;
    background: #fff;
    max-height: 100%;
    transform: translate3d(0, 0, 0);
    transition: transform 0.2s ease;
}
.header-search-open #nm-header-search {
    transform: translate3d(0, 100%, 0);
}
.header-search-closing #nm-header-search {
    transform: translate3d(0, 0, 0);
}

/* Search wrap */
.nm-header-search-wrap {
    display: flex;
    flex-direction: column;
    max-width: var(--nm--page-width);
    max-height: 100vh;
    margin: 0 auto;
    padding-top: 18px;
    padding-right: calc(var(--nm--page-column-spacing) * 2);
    padding-left: calc(var(--nm--page-column-spacing) * 2);
    padding-bottom: calc(var(--nm--page-column-spacing) * 2);
    transition: opacity 0.2s ease;
}
.nm-header-search-wrap.redirecting {
    opacity: 0.5;
    pointer-events: none;
}

/* Form */
#nm-header-search-form {
    position: relative;
}
#nm-header-search-form.nm-loader:after {
    left: 3px;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 0;
}
#nm-header-search-form > i {
    position: absolute;
    top: 12px;
    left: 0;
    font-size: 18px;
    color: var(--nm--color-font-strong, #282828);
}
#nm-header-search.has-suggestions #nm-header-search-form > i,
#nm-header-search-form.nm-loader > i {
    display: none;
}
#nm-header-search-input {
    display: block;
    font-size: 22px;
    line-height: normal;
    font-family: inherit;
    width: 100%;
    padding: 8px 0 8px 26px;
    border-top: 0 none;
    border-right: 0 none;
    border-left: 0 none;
    border-radius: 0;
    background: none;
}
#nm-header-search-input:not(:focus) {
    border-color: var(--nm--color-divider, #ccc);
}
#nm-header-search-input::-ms-clear {
    width: 0;
    height: 0;
}

/* Clear button */
#nm-header-search-clear-button {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    top: 14px;
    left: 1px;
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    line-height: 1;
    width: 17px;
    height: 17px;
    padding: 0;
    opacity: 0;
    transform: translateY(10px);
    border: 0 none;
    border-radius: 50%;
    transition: transform 0.2s ease, opacity 0.2s ease, border 0.2s ease;
    background: var(--nm--color-body-background, #fff);
}
#nm-header-search.has-suggestions #nm-header-search-clear-button {
    visibility: visible;
    pointer-events: all;
    z-index: 10;
    opacity: 1;
    transform: translateY(0px);
}
#nm-header-search-clear-button span {
    pointer-events: none;
    display: block;
    position: absolute;
    top: calc(100% + 11px);
    left: calc(50% - 1px);
    font-size: 12px;
    line-height: 1;
    font-style: normal;
    color: #fff;
    white-space: nowrap;
    padding: 4px 6px;
    transform: translateX(-50%);
    opacity: 0;
    border-radius: 3px;
    transition: opacity 0.2s ease;
    background: #282828;
}
.no-touch #nm-header-search-clear-button:hover span {
    opacity: 1;
}
#nm-header-search-clear-button span:after {
    pointer-events: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    content: " ";
    width: 0;
    height: 0;
    margin-left: -3px;
    border: solid transparent;
    border-width: 4px;
    border-color: transparent;
    border-bottom-color: #282828;
    border-radius: 0;
}

/* Close button */
#nm-header-search-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    font-size: 20px;
    line-height: 1;
    color: inherit;
}

/* Keywords */
#nm-search-keywords {
    opacity: 0;
    transform: translateY(10px);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
#nm-search-keywords.hide {
    display: none;
}
#nm-search-keywords.show {
    opacity: 1;
    transform: translateY(0px);
}
.nm-search-keywords-title {
    display: block;
    font-weight: normal;
    line-height: normal;
    color: inherit;
    margin-top: 15px;
    margin-bottom: 15px;
    opacity: 0.7;
}
.nm-search-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.nm-search-keywords-list li {
    list-style: none;
}
.nm-search-keywords-list .button.border {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1;
    padding: 7px 14px 7px 12px;
    border-radius: 50px;
}
.nm-search-keywords-list i {
    line-height: 1;
}

/* Notice */
#nm-header-search-notice {
    font-size: 14px;
    line-height: normal;
    color: #aaa;
    height: 0px;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: default;
}
#nm-header-search-notice.show {
    height: auto;
    opacity: 1;
}
#nm-header-search-notice span {
    display: block;
    padding-top: 15px;
}

/* Suggestions */
#nm-search-suggestions {
    flex: 1;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
#nm-search-suggestions.show {
    opacity: 1;
}

/* Suggestions notice */
#nm-search-suggestions-notice {
    display: none;
    line-height: normal;
    opacity: 0.7;
    white-space: nowrap;
}
#nm-search-suggestions-notice.show {
    display: block;
}
#nm-search-suggestions-notice span {
    display: none;
    padding-top: 14px;
}
#nm-search-suggestions-notice:not(.no-results) span {
    padding-bottom: 15px;
}
#nm-search-suggestions-notice.press-enter .txt-press-enter,
#nm-search-suggestions-notice.has-results .txt-has-results,
#nm-search-suggestions-notice.no-results .txt-no-results {
    display: block;
}

/* Suggestions products */
#nm-search-suggestions-product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 0;
    list-style: none;
    padding: 0;
    margin: 0;
}
#nm-search-suggestions-product-list li {
    padding-bottom: 0;
}
#nm-search-suggestions-product-list a {
    display: block;
    color: inherit;
}
#nm-search-suggestions-product-list .col {
    display: block;
}
#nm-search-suggestions-product-list i {
    display: block;
    aspect-ratio: 1/1;
}
#nm-search-suggestions-product-list img {
    display: block;
    width: 100%;
    border-radius: min(5px, var(--nm--border-radius-image));
}
#nm-search-suggestions-product-list strong {
    display: block;
    font-size: 16px;
    font-weight: normal;
    line-height: 1.2;
    color: inherit;
    margin-top: 16px;
}
#nm-search-suggestions-product-list .price {
    display: block;
    line-height: initial;
    color: #282828;
    margin-top: 5px;
}

/* WP admin bar */
.admin-bar #nm-header-search {
    padding-top: 32px;
}

/* Body lock when search open */
body.header-search-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 1400px) {
    #nm-header-search-input {
        padding-right: 28px;
    }
    #nm-header-search-close {
        font-size: 20px;
    }
}
@media (max-width: 768px) {
    #nm-header-search-clear-button {
        top: 13px;
        left: 0;
        font-size: 14px;
    }
    .nm-search-keywords-title {
        margin-top: 12px;
        margin-bottom: 12px;
    }
    .nm-header-search-wrap {
        padding-top: 14px;
        padding-right: var(--nm--page-column-spacing);
        padding-left: var(--nm--page-column-spacing);
        padding-bottom: var(--nm--page-column-spacing);
    }
    #nm-header-search-form > i {
        top: 13px;
        font-size: 16px;
    }
    #nm-header-search-input {
        font-size: 18px;
        padding: 10px 24px;
    }
    #nm-header-search-close {
        font-size: 16px;
    }
    #nm-search-suggestions-notice.show:not(.no-results) + #nm-search-suggestions #nm-search-suggestions-product-list {
        padding-bottom: 10px;
    }
}
@media (max-width: 550px) {
    #nm-search-suggestions-product-list {
        flex-direction: column;
        gap: 8px 0;
    }
    #nm-search-suggestions-product-list:before,
    #nm-search-suggestions-product-list:after {
        display: none;
    }
    #nm-search-suggestions-product-list li {
        width: 100%;
    }
    #nm-search-suggestions-product-list li:not(:last-child) {
        padding-bottom: 8px;
        border-bottom: 1px solid var(--nm--color-border, #eee);
    }
    #nm-search-suggestions-product-list a {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    #nm-search-suggestions-product-list i {
        width: 60px;
    }
    #nm-search-suggestions-product-list strong {
        margin-top: 0;
    }
}
