/*============================================*/
/* Search popup: inc/search-popup.php */

.peptix-search-lock,
.peptix-search-lock body {
    overflow: hidden;
}

.peptix-search {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(12px, 10.06px + 0.52vw, 20px);
    background: rgba(15, 23, 42, 0.35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-family: "Outfit", sans-serif;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.peptix-search[hidden] {
    display: none;
}

.peptix-search.is-open {
    opacity: 1;
}

.peptix-search-panel {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin-top: 8vh;
    padding: 40px;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
    transform: translateY(-16px);
    transition: transform 0.25s ease;
}

.peptix-search.is-open .peptix-search-panel {
    transform: none;
}

.peptix-search .peptix-search-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #EEF4FE;
    color: #3B82F6;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.peptix-search .peptix-search-close:hover,
.peptix-search .peptix-search-close:focus-visible {
    background: #3B82F6;
    color: #FFFFFF;
}

.peptix-search .peptix-search-title {
    margin: 0 0 20px;
    font-family: "Instrument Serif", serif;
    font-size: clamp(30px, 27.57px + 0.65vw, 40px);
    line-height: 1.1;
    color: #0F172A;
}

.peptix-search-form {
    display: flex;
    gap: 10px;
    margin: 0;
}

.peptix-search-field {
    position: relative;
    flex: 1;
    display: block;
}

.peptix-search-field svg {
    position: absolute;
    top: 50%;
    left: 16px;
    color: #757575;
    transform: translateY(-50%);
    pointer-events: none;
}

.peptix-search .peptix-search-field input[type="search"] {
    width: 100%;
    height: 56px;
    margin: 0;
    padding: 0 16px 0 50px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: none;
    font-family: inherit;
    font-size: 17px;
    color: #0F172A;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.peptix-search .peptix-search-field input[type="search"]:focus {
    border-color: #3B82F6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.peptix-search .peptix-search-submit,
.peptix-search .peptix-search-submit:focus {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    margin: 0;
    padding: 0 28px;
    border: 0;
    border-radius: 8px;
    background: #3B82F6;
    font-family: inherit;
    font-weight: 400;
    font-size: 17px;
    line-height: 1;
    color: #FFFFFF;
    cursor: pointer;
    transition: background 0.2s ease;
}

.peptix-search .peptix-search-submit:hover {
    background: #2563EB;
    color: #FFFFFF;
}

.peptix-search-submit svg {
    transition: transform 0.25s ease;
}

.peptix-search-submit:hover svg {
    transform: rotate(45deg);
}

.peptix-search-popular {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 15px;
    color: #757575;
}

.peptix-search .peptix-search-popular a {
    padding: 5px 14px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 50px;
    background: rgba(59, 130, 246, 0.08);
    font-size: 14px;
    color: #0F172A;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.peptix-search .peptix-search-popular a:hover {
    background: #3B82F6;
    color: #FFFFFF;
}

@media (max-width: 767px) {

    .peptix-search-panel { margin-top: 0; padding: 28px 20px 22px; }

    .peptix-search-form { flex-direction: column; }
    .peptix-search .peptix-search-submit { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .peptix-search,
    .peptix-search-panel {
        transition: none;
    }
}
