.jd-ps-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.jd-ps-overlay.active {
    display: flex;
    opacity: 1;
}

.jd-ps-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 640px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.jd-ps-overlay.active .jd-ps-modal {
    transform: translateY(0) scale(1);
}

.jd-ps-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
    outline: none;
    box-shadow: none;
}

.jd-ps-close:hover {
    background: #f0f0f0;
    color: #333;
}

.jd-ps-close:focus {
    outline: none;
    box-shadow: none;
}

.jd-ps-header {
    padding: 28px 32px 0;
}

.jd-ps-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.jd-ps-search-box {
    padding: 20px 32px;
}

.jd-ps-input-wrapper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    padding: 0 16px;
    transition: background 0.2s, box-shadow 0.2s;
    outline: none;
    box-shadow: none;
}

.jd-ps-input-wrapper:focus-within {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: none;
    outline: none;
}

.jd-ps-search-icon {
    width: 20px;
    height: 20px;
    color: #999;
    flex-shrink: 0;
}

.jd-ps-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 14px 12px;
    font-size: 16px;
    color: #333;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.jd-ps-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.jd-ps-input::placeholder {
    color: #aaa;
}

.jd-ps-submit-btn {
    background: var(--jd-ps-primary, #f5a623);
    border: none;
    border-radius: 999px;
    width: auto;
    min-width: 82px;
    padding: 0 20px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transition: filter 0.2s, transform 0.1s, box-shadow 0.2s;
    outline: none;
    box-shadow: none;
}

.jd-ps-submit-btn:focus {
    outline: none;
    box-shadow: none;
}

.jd-ps-submit-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(245, 166, 35, 0.28);
}

.jd-ps-submit-btn svg {
    display: none;
}

.jd-ps-suggestions {
    max-height: 320px;
    overflow-y: auto;
    padding: 0 16px;
}

.jd-ps-suggestions::-webkit-scrollbar {
    width: 6px;
}

.jd-ps-suggestions::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.jd-ps-suggestion-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.jd-ps-suggestion-item:hover {
    background: #f8f8f8;
}

.jd-ps-suggestion-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.jd-ps-suggestion-info {
    flex: 1;
    min-width: 0;
}

.jd-ps-suggestion-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jd-ps-suggestion-meta {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.jd-ps-suggestion-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--jd-ps-primary, #f5a623);
    white-space: nowrap;
}

.jd-ps-loading {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 14px;
}

.jd-ps-loading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: var(--jd-ps-primary, #f5a623);
    border-radius: 50%;
    animation: jd-ps-spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes jd-ps-spin {
    to { transform: rotate(360deg); }
}

.jd-ps-no-results {
    text-align: center;
    padding: 32px 24px;
    color: #999;
    font-size: 14px;
}

.jd-ps-no-results svg {
    width: 48px;
    height: 48px;
    color: #ddd;
    margin-bottom: 12px;
}

.jd-ps-footer {
    padding: 16px 32px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.jd-ps-hint {
    font-size: 12px;
    color: #999;
}

.jd-ps-hint kbd {
    display: inline-block;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: inherit;
    color: #666;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Kill all outlines globally inside the modal */
.jd-ps-modal *:focus {
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 600px) {
    .jd-ps-overlay {
        padding-top: 5vh;
    }

    .jd-ps-modal {
        width: 95%;
        border-radius: 12px;
    }

    .jd-ps-header {
        padding: 20px 20px 0;
    }

    .jd-ps-search-box {
        padding: 16px 20px;
    }

    .jd-ps-footer {
        padding: 12px 20px;
    }

    .jd-ps-suggestions {
        max-height: 250px;
    }
}
