#wpps-search-wrapper {
    --wpps-accent: #6366f1;
    --wpps-accent-hover: #4f46e5;
    --wpps-wrapper-bg: #f8f7ff;
    --wpps-border: #c7d2fe;
    --wpps-input-border: #a5b4fc;
    --wpps-input-bg: #ffffff;
    --wpps-input-text: #1e293b;
    --wpps-btn-bg: #6366f1;
    --wpps-btn-text: #ffffff;
    --wpps-badge-bg: #eef2ff;
    --wpps-badge-text: #6366f1;
    --wpps-dropdown-bg: #ffffff;
    --wpps-item-hover: #f5f3ff;
}

#wpps-search-wrapper {
    display: none;
    justify-content: center;
    padding: 10px 0;
    background: var(--wpps-wrapper-bg);
    border-top: 2px dashed var(--wpps-border);
    border-bottom: 2px dashed var(--wpps-border);
    position: relative;
    z-index: 100;
}

#wpps-search-wrapper.wpps-mounted {
    display: flex;
}

.wpps-search-container {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 0 16px;
}

.wpps-search-input-group {
    display: flex;
    align-items: center;
    background: var(--wpps-input-bg);
    border: 2px dashed var(--wpps-input-border);
    border-radius: 50px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.wpps-search-input-group:focus-within {
    border-color: var(--wpps-accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.wpps-search-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 6px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--wpps-badge-bg);
    color: var(--wpps-badge-text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.wpps-search-input-group:focus-within .wpps-search-numero {
    background: var(--wpps-accent);
    color: var(--wpps-btn-text);
}

#wpps-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--wpps-input-text);
    padding: 12px 0;
    min-width: 0;
    letter-spacing: 0.01em;
}

#wpps-search-input::placeholder {
    color: #a0aec0;
}

#wpps-search-btn {
    flex-shrink: 0;
    border: none;
    outline: none;
    background: var(--wpps-btn-bg);
    color: var(--wpps-btn-text);
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 10px 22px;
    margin: 4px;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.2s ease;
    line-height: 1;
}

#wpps-search-btn:hover {
    background: var(--wpps-accent-hover);
}

#wpps-search-btn:active {
    opacity: 0.85;
}

/* ── Autocomplete dropdown ── */

.wpps-autocomplete-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    background: var(--wpps-dropdown-bg);
    border: 1px solid var(--wpps-border);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.10);
    display: none;
    max-height: 340px;
    overflow: hidden;
    overflow-y: auto;
}

.wpps-autocomplete-list.active {
    display: block;
    animation: wpps-fade-in 0.18s ease;
}

@keyframes wpps-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Result item ── */

.wpps-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.12s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
}

.wpps-autocomplete-item:first-child {
    border-radius: 16px 16px 0 0;
}

.wpps-autocomplete-item:last-child {
    border-bottom: none;
    border-radius: 0 0 16px 16px;
}

.wpps-autocomplete-item:only-child {
    border-radius: 16px;
}

.wpps-autocomplete-item:hover,
.wpps-autocomplete-item.selected {
    background: var(--wpps-item-hover);
}

/* ── Thumbnail ── */

.wpps-autocomplete-item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.04);
}

.wpps-autocomplete-item-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

/* ── Info block ── */

.wpps-autocomplete-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wpps-autocomplete-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--wpps-input-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.wpps-autocomplete-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpps-autocomplete-item-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--wpps-accent);
    font-variant-numeric: tabular-nums;
}

.wpps-autocomplete-item-type {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ── Arrow ── */

.wpps-autocomplete-item-arrow {
    flex-shrink: 0;
    color: #cbd5e1;
    transition: color 0.15s ease, transform 0.15s ease;
}

.wpps-autocomplete-item:hover .wpps-autocomplete-item-arrow {
    color: var(--wpps-accent);
    transform: translateX(3px);
}

/* ── Empty / loading states ── */

.wpps-autocomplete-empty {
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.wpps-autocomplete-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    color: #94a3b8;
    font-size: 14px;
}

.wpps-autocomplete-loading::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--wpps-accent);
    border-radius: 50%;
    animation: wpps-spin 0.6s linear infinite;
}

@keyframes wpps-spin {
    to { transform: rotate(360deg); }
}

/* ── Mobile ── */

@media (max-width: 560px) {
    .wpps-search-container {
        max-width: 100%;
        padding: 0 10px;
    }

    #wpps-search-input {
        font-size: 14px;
        padding: 10px 0;
    }

    #wpps-search-btn {
        padding: 9px 16px;
        font-size: 12px;
    }

    .wpps-autocomplete-item {
        padding: 10px 14px;
    }
}
