/**
 * Rizal Pulse PH - Header Search Modal & Live Autocomplete Overlay
 */

/* Modal Container & Backdrop */
.rp-search-modal-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 20px;
    box-sizing: border-box;
}

.rp-search-modal-wrap.active {
    display: flex;
}

.rp-search-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: rpFadeIn 0.2s ease-out;
}

/* Modal Dialog */
.rp-search-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: rpSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

@keyframes rpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rpSlideDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header Form */
.rp-search-modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.rp-modal-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.rp-modal-search-icon {
    font-size: 1.25rem;
    color: #64748b;
    line-height: 1;
    flex-shrink: 0;
}

.rp-modal-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    padding: 6px 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.rp-modal-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.rp-modal-search-clear {
    background: #e2e8f0;
    color: #475569;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
}

.rp-modal-search-clear:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.rp-modal-search-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.rp-modal-close-key {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* Modal Body */
.rp-search-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 220px;
}

/* Quick Suggestions */
.rp-search-suggestions-initial {
    padding: 8px 0;
}

.rp-search-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.rp-search-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rp-quick-pill {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.rp-quick-pill:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: translateY(-1px);
}

/* Results Groups */
.rp-search-group {
    margin-bottom: 18px;
}

.rp-search-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f1f5f9;
}

.rp-search-group-icon {
    font-size: 1rem;
}

.rp-search-group-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rp-search-item {
    margin: 0;
    padding: 0;
}

.rp-search-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.rp-search-item-link:hover,
.rp-search-item-link.selected {
    background: #f0f9ff;
}

.rp-search-item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #e2e8f0;
    flex-shrink: 0;
}

.rp-search-item-thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.rp-search-item-info {
    flex: 1;
    min-width: 0;
}

.rp-search-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-search-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #64748b;
}

.rp-search-item-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.rp-search-item-price {
    font-weight: 700;
    color: #059669;
.rp-search-item-verified {
    color: #10b981;
    font-weight: 700;
    font-size: 0.75rem;
}

.rp-search-item-registry-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #065f46;
    background: #d1fae5;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #a7f3d0;
}

.rp-search-map-pin-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0284c7;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    margin-right: 8px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.rp-search-map-pin-btn:hover {
    background: #0284c7;
    color: #ffffff !important;
}

/* View All CTA */
.rp-search-view-all-cta {
    display: block;
    margin-top: 14px;
    padding: 10px 14px;
    background: #0284c7;
    color: #ffffff !important;
    text-align: center;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.15s;
}

.rp-search-view-all-cta:hover {
    background: #0369a1;
}

/* Loading Spinner */
.rp-search-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #64748b;
    gap: 12px;
}

.rp-search-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: rpSpin 0.7s linear infinite;
}

@keyframes rpSpin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.rp-search-empty-state {
    text-align: center;
    padding: 36px 16px;
}

.rp-search-empty-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 8px;
}

.rp-search-empty-text {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 16px 0;
}

.rp-search-empty-btn {
    display: inline-block;
    background: #0284c7;
    color: #ffffff !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
}

/* Modal Footer */
.rp-search-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    font-size: 0.78rem;
    color: #94a3b8;
}

.rp-search-hints {
    display: flex;
    gap: 12px;
}

.rp-search-hints kbd {
    background: #e2e8f0;
    color: #475569;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.72rem;
}

.rp-search-footer-brand {
    font-weight: 700;
    color: #0284c7;
}

/* Trigger Icon Styles & Cursor */
.elementor-element-58402698,
[data-interaction-id="3d3a85b"],
.ast-search-icon {
    cursor: pointer !important;
    transition: transform 0.15s, opacity 0.15s;
}

.elementor-element-58402698:hover,
[data-interaction-id="3d3a85b"]:hover,
.ast-search-icon:hover {
    transform: scale(1.1);
    opacity: 0.85;
}
