/* ResultsAiX Search - front-end instant search bar.
   Neutral by default so it sits well on any theme; the accent is house amber
   and can be overridden with the --ras-accent CSS variable on .ras-search. */

.ras-search {
    --ras-accent: #f59e0b;
    --ras-accent-ink: #0a0a0a;
    --ras-bg: #ffffff;
    --ras-text: #1f2328;
    --ras-muted: #6b7280;
    --ras-border: #e2e4e9;
    --ras-hover: #f6f7f9;
    --ras-shadow: 0 12px 34px -8px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .08);
    position: relative;
    width: 100%;
    max-width: 560px;
    font-family: var(--ras-font, inherit);
    box-sizing: border-box;
}
.ras-search *, .ras-search *::before, .ras-search *::after { box-sizing: border-box; }
.ras-search.ras-align-center { margin-left: auto; margin-right: auto; }
.ras-search.ras-align-right { margin-left: auto; }
/* Author display values below would otherwise defeat the [hidden] attribute
   (author beats the UA [hidden]{display:none}); this keeps hidden reliable. */
.ras-search [hidden] { display: none !important; }

/* the input pill */
.ras-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ras-bg);
    border: 1.5px solid var(--ras-border);
    border-radius: 999px;
    padding: 0 14px;
    height: 50px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ras-box:focus-within {
    border-color: var(--ras-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ras-accent) 18%, transparent);
}
.ras-ico { width: 20px; height: 20px; fill: var(--ras-muted); flex: none; }
.ras-box:focus-within .ras-ico { fill: var(--ras-accent); }
.ras-input {
    flex: 1;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 16px;
    color: var(--ras-text);
    padding: 0 !important;
    margin: 0 !important;
    height: 100%;
    line-height: normal;
    min-width: 0;
}
.ras-input::-webkit-search-cancel-button { display: none; }
.ras-input::placeholder { color: var(--ras-muted); opacity: 1; }
.ras-clear {
    border: 0; background: transparent; cursor: pointer;
    font-size: 22px; line-height: 1; color: var(--ras-muted);
    width: 26px; height: 26px; border-radius: 50%; flex: none;
    padding: 0; display: flex; align-items: center; justify-content: center;
}
.ras-clear:hover { background: var(--ras-hover); color: var(--ras-text); }
.ras-spin {
    width: 18px; height: 18px; flex: none; border-radius: 50%;
    border: 2px solid var(--ras-border); border-top-color: var(--ras-accent);
    animation: ras-spin .6s linear infinite;
}
@keyframes ras-spin { to { transform: rotate(360deg); } }

/* the dropdown */
.ras-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--ras-bg);
    border: 1px solid var(--ras-border);
    border-radius: 16px;
    box-shadow: var(--ras-shadow);
    overflow: hidden;
    z-index: 99999;
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
}
.ras-list { overflow-y: auto; padding: 6px; }
.ras-group-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--ras-muted);
    padding: 12px 12px 6px;
}
.ras-group-label.ras-group-promoted { color: var(--ras-accent); }
.ras-group-label.ras-group-promoted::before { content: "\2605"; margin-right: 5px; }
.ras-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 10px;
    text-decoration: none; color: var(--ras-text);
    cursor: pointer;
}
.ras-item:hover, .ras-item.ras-active { background: var(--ras-hover); }
.ras-item.ras-active { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ras-accent) 45%, transparent); }
.ras-thumb {
    width: 44px; height: 44px; flex: none; border-radius: 8px;
    object-fit: cover; background: var(--ras-hover);
}
.ras-thumb-ph {
    width: 44px; height: 44px; flex: none; border-radius: 8px;
    background: color-mix(in srgb, var(--ras-accent) 12%, var(--ras-hover));
    display: flex; align-items: center; justify-content: center;
    color: var(--ras-accent); font-weight: 800; font-size: 18px;
}
/* Smart tiles: an item with no picture gets a rich gradient keyed off its
   title instead of a flat letter box, so a mixed list still looks designed. */
.ras-thumb-ph.ras-g0, .ras-thumb-ph.ras-g1, .ras-thumb-ph.ras-g2, .ras-thumb-ph.ras-g3,
.ras-thumb-ph.ras-g4, .ras-thumb-ph.ras-g5, .ras-thumb-ph.ras-g6, .ras-thumb-ph.ras-g7 {
    color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.ras-g0 { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.ras-g1 { background: linear-gradient(135deg, #6366f1, #4338ca) !important; }
.ras-g2 { background: linear-gradient(135deg, #10b981, #047857) !important; }
.ras-g3 { background: linear-gradient(135deg, #f43f5e, #be123c) !important; }
.ras-g4 { background: linear-gradient(135deg, #0ea5e9, #0369a1) !important; }
.ras-g5 { background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important; }
.ras-g6 { background: linear-gradient(135deg, #14b8a6, #0f766e) !important; }
.ras-g7 { background: linear-gradient(135deg, #475569, #1e293b) !important; }
.ras-item-body { min-width: 0; flex: 1; }
.ras-item-title {
    font-size: 15px; font-weight: 600; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ras-item-title mark {
    background: color-mix(in srgb, var(--ras-accent) 26%, transparent);
    color: inherit; padding: 0 1px; border-radius: 3px;
}
.ras-item-excerpt {
    font-size: 12.5px; color: var(--ras-muted); line-height: 1.35;
    margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden;
}
.ras-empty { padding: 26px 16px; text-align: center; color: var(--ras-muted); font-size: 14px; }
.ras-foot {
    border-top: 1px solid var(--ras-border);
    padding: 4px;
}
.ras-viewall {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 11px 14px; border-radius: 10px;
    text-decoration: none; color: var(--ras-text);
    font-weight: 600; font-size: 14px;
}
.ras-viewall:hover, .ras-viewall.ras-active { background: var(--ras-hover); }
.ras-viewall .ras-count { color: var(--ras-muted); font-weight: 500; font-size: 13px; }
.ras-viewall .ras-arrow { color: var(--ras-accent); font-weight: 800; }

/* ---- full results page ([results_ai_search_results]) ---- */
.ras-full { max-width: 720px; }
.ras-full .ras-box { height: 56px; }
.ras-full .ras-input { font-size: 17px; }
.ras-results { margin-top: 26px; text-align: left; }
.ras-meta { font-size: 14px; color: var(--ras-muted); margin: 0 0 14px; }
.ras-results .ras-group-label { font-size: 13px; padding: 20px 2px 10px; }
.ras-results .ras-item {
    background: var(--ras-bg);
    border: 1px solid var(--ras-border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.ras-results .ras-item:hover, .ras-results .ras-item.ras-active {
    background: var(--ras-hover);
    border-color: color-mix(in srgb, var(--ras-accent) 40%, var(--ras-border));
}
.ras-results .ras-thumb, .ras-results .ras-thumb-ph { width: 56px; height: 56px; border-radius: 10px; }
.ras-results .ras-item-title { font-size: 17px; white-space: normal; }
.ras-results .ras-item-excerpt { -webkit-line-clamp: 2; white-space: normal; margin-top: 4px; font-size: 13.5px; }
.ras-results .ras-empty { padding: 40px 16px; font-size: 15px; }

/* ---- optional add-on blocks (answer, offer, lead, filters, did-you-mean) ---- */
.ras-dym { padding: 10px 12px; font-size: 14px; color: var(--ras-muted); }
.ras-dym-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ras-accent); cursor: pointer; text-decoration: underline; }
.ras-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 2px 12px; }
.ras-chip-f { border: 1px solid var(--ras-border); background: var(--ras-bg); color: var(--ras-text); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ras-chip-f:hover { border-color: var(--ras-accent); }
.ras-chip-f.on { background: var(--ras-accent); border-color: var(--ras-accent); color: #0a0a0a; }
.ras-answer { margin: 6px 6px 12px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--ras-accent) 8%, var(--ras-bg)); border: 1px solid color-mix(in srgb, var(--ras-accent) 30%, transparent); }
.ras-answer-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ras-accent); margin-bottom: 6px; }
.ras-answer-t { font-size: 14.5px; line-height: 1.55; color: var(--ras-text); }
.ras-answer-src { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 9px; }
.ras-answer-src a { font-size: 12.5px; color: var(--ras-muted); text-decoration: underline; }
.ras-offer { display: flex; align-items: center; gap: 13px; margin: 6px 6px 12px; padding: 13px 15px; border-radius: 12px; text-decoration: none; color: var(--ras-text); background: color-mix(in srgb, var(--ras-offer, var(--ras-accent)) 10%, var(--ras-bg)); border: 1.5px solid color-mix(in srgb, var(--ras-offer, var(--ras-accent)) 45%, transparent); }
.ras-offer:hover { background: color-mix(in srgb, var(--ras-offer, var(--ras-accent)) 18%, var(--ras-bg)); }
.ras-offer-img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; flex: none; }
.ras-offer-b { flex: 1; min-width: 0; }
.ras-offer-e { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ras-offer, var(--ras-accent)); }
.ras-offer-t { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.ras-offer-x { font-size: 12.5px; color: var(--ras-muted); margin-top: 2px; }
.ras-offer-cta { flex: none; background: var(--ras-offer, var(--ras-accent)); color: #0a0a0a; font-weight: 800; font-size: 13px; padding: 9px 16px; border-radius: 9px; }
.ras-lead { margin: 6px 6px 12px; padding: 15px 16px; border-radius: 12px; background: var(--ras-bg); border: 1px dashed var(--ras-border); }
.ras-lead-t { font-size: 15px; font-weight: 700; color: var(--ras-text); }
.ras-lead-x { font-size: 13px; color: var(--ras-muted); margin-top: 3px; }
.ras-lead-row { display: flex; gap: 8px; margin-top: 10px; }
.ras-lead-in { flex: 1; min-width: 0; border: 1px solid var(--ras-border); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 14px; background: #fff; color: var(--ras-text); }
.ras-lead-btn { flex: none; border: 0; background: var(--ras-accent); color: #0a0a0a; font-weight: 800; font-size: 13.5px; padding: 9px 16px; border-radius: 9px; cursor: pointer; font-family: inherit; }
.ras-lead-ok { font-size: 14px; font-weight: 600; color: var(--ras-text); }

/* ---- commerce data inside a result ---- */
.ras-item-price { font-size: 13.5px; font-weight: 700; color: var(--ras-accent); margin-top: 3px; }
.ras-item-cart { flex: none; align-self: center; background: var(--ras-accent); color: #0a0a0a; font-weight: 700; font-size: 12.5px; padding: 7px 13px; border-radius: 8px; text-decoration: none; }
.ras-item-cart:hover { filter: brightness(.94); }

/* ---- spotlight overlay (Ctrl/Cmd + K) ---- */
.ras-spot-back { position: fixed; inset: 0; background: rgba(10,10,15,.55); backdrop-filter: blur(3px); z-index: 999998; opacity: 0; transition: opacity .18s ease; }
.ras-spot-back.on { opacity: 1; }
.ras-spot { position: fixed; left: 50%; top: 14vh; transform: translateX(-50%) translateY(-8px) scale(.98); width: min(620px, 92vw); z-index: 999999; opacity: 0; transition: opacity .18s ease, transform .18s cubic-bezier(.16,1,.3,1); }
.ras-spot.on { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.ras-spot .ras-search { max-width: none; }
.ras-spot .ras-box { height: 58px; box-shadow: 0 24px 60px -16px rgba(0,0,0,.5); }
.ras-spot .ras-input { font-size: 17px; }
.ras-spot-hint { text-align: center; margin-top: 12px; font-size: 12.5px; color: rgba(255,255,255,.65); }
.ras-spot-hint kbd { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 5px; padding: 1px 6px; font-family: inherit; font-size: 11.5px; }

/* ---- style variants (shortcode style="minimal|square") ---- */
.ras-style-square .ras-box { border-radius: 12px; }
.ras-style-square .ras-panel { border-radius: 12px; }
.ras-style-minimal .ras-box {
    border: 0;
    border-bottom: 1.5px solid var(--ras-border);
    border-radius: 0;
    padding-left: 4px; padding-right: 4px;
}
.ras-style-minimal .ras-box:focus-within {
    border-color: var(--ras-border);
    border-bottom-color: var(--ras-accent);
    box-shadow: none;
}

@media ( max-width: 480px ) {
    .ras-box { height: 46px; }
    .ras-input { font-size: 16px; }
}
