/* One-screen gift finder at the top of the shop (views/partials/gift-finder.php) */

.gift-finder {
    display: grid;
    gap: 0.85rem;
    width: 100%;
    padding: 1.25rem;
    border-radius: var(--radius-lg, 20px);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(167, 139, 250, 0.12));
    border: 1px solid rgba(124, 58, 237, 0.25);
    scroll-margin-top: calc(var(--site-header-h, 6rem) + 12px);
    transition: box-shadow 0.3s ease;
}

.gift-finder.is-spotlit {
    animation: gf-spotlight 1.8s ease-out;
}

@keyframes gf-spotlight {
    0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.55); }
    35% { box-shadow: 0 0 0 10px rgba(124, 58, 237, 0.18); }
    100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .gift-finder.is-spotlit { animation: none; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.4); }
}

.gift-finder__title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--ink);
}

.gift-finder__lead {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.gift-finder__ask {
    display: flex;
    gap: 0.6rem;
    align-items: stretch;
}

.gift-finder__input {
    flex: 1;
    min-width: 0;
    height: 3.4rem;
    min-height: 3.4rem;
    resize: none;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 14px);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 1rem; /* 16px keeps iOS from zooming in on focus */
    line-height: 1.4;
}

.gift-finder__input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.gift-finder__go {
    flex: none;
    align-self: stretch;
    height: auto;
    min-height: 3.4rem;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md, 14px);
    white-space: nowrap;
}

.gift-finder.is-busy .gift-finder__go {
    opacity: 0.8;
    cursor: progress;
}

.gift-finder__tip {
    display: none;
    margin: -0.35rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

/* Only on touch screens, where the keyboard has a dictation microphone. */
@media (hover: none) and (pointer: coarse) {
    .gift-finder__tip { display: block; }
}

.gift-finder__examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.85rem;
}

.gift-finder__examples-label {
    color: var(--muted);
}

.gift-finder__example {
    padding: 0.25rem 0.6rem;
    border: 1px dashed rgba(124, 58, 237, 0.45);
    border-radius: 999px;
    background: transparent;
    color: var(--accent-dark);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.gift-finder__example:hover {
    background: rgba(124, 58, 237, 0.08);
}

.gift-finder__rows {
    display: grid;
    gap: 0.5rem;
}

.gift-finder__row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius-md, 14px);
    transition: background 0.3s ease;
}

.gift-finder__row.is-asking {
    background: rgba(124, 58, 237, 0.1);
    padding: 0.3rem 0.4rem;
}

.gift-finder__row-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.gift-finder__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.gift-finder__chip {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gift-finder__chip:hover {
    border-color: var(--accent);
}

.gift-finder__chip.is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Picked up from what they typed rather than tapped: shown, but lighter. */
.gift-finder__chip.is-guess {
    background: rgba(124, 58, 237, 0.14);
    border: 1px dashed var(--accent);
    color: var(--accent-dark);
}

.gift-finder__budget {
    display: grid;
    gap: 0.35rem;
    max-width: 30rem;
}

.gift-finder__budget-top {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.gift-finder__budget-value {
    font-weight: 700;
    color: var(--accent-dark);
}

.gift-finder__budget-note {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

/* Big, easy-to-grab slider; the filled part of the track shows the chosen budget. */
.gift-finder__slider {
    --gf-fill: 100%;
    width: 100%;
    height: 2.2rem;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    touch-action: pan-y;
}

/* The site's general input styles (white box, border, padding) don't belong on a slider. */
.gift-finder input.gift-finder__slider {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    min-height: 0;
}

.gift-finder__slider:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 999px;
}

.gift-finder__slider::-webkit-slider-runnable-track {
    height: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(to right, var(--accent) 0 var(--gf-fill), rgba(124, 58, 237, 0.18) var(--gf-fill) 100%);
}

.gift-finder__slider::-moz-range-track {
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.18);
}

.gift-finder__slider::-moz-range-progress {
    height: 0.5rem;
    border-radius: 999px;
    background: var(--accent);
}

.gift-finder__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: -0.625rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.gift-finder__slider::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.gift-finder__budget-ticks {
    position: relative;
    height: 1rem;
    /* line the labels up with the thumb's centre at each end */
    margin: 0 0.875rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.gift-finder__budget-ticks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.gift-finder__result {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
}

.gift-finder__understood {
    margin: 0;
    flex: 1 1 100%;
    color: var(--ink);
}

.gift-finder__quote {
    color: var(--muted);
    font-style: italic;
}

.gift-finder__note {
    margin: 0;
    flex: 1 1 100%;
    color: var(--accent-dark);
    font-size: 0.92rem;
}

.gift-finder__clear {
    font-size: 0.88rem;
}

/* The toolbar row that keeps the manual "Filters" dropdowns under the finder. */
.sf-interests-bar--toggle-only {
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .gift-finder {
        padding: 1rem;
    }

    .gift-finder__ask {
        flex-direction: column;
    }

    .gift-finder__input {
        height: 4.6rem;
    }

    .gift-finder__go {
        min-height: 2.9rem;
    }

    /* Examples: one swipeable line, like the chips. */
    .gift-finder__examples {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .gift-finder__examples::-webkit-scrollbar {
        display: none;
    }

    .gift-finder__example {
        flex: none;
        white-space: nowrap;
    }

    .gift-finder__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.3rem;
    }

    /* One swipeable line of chips per row on phones. */
    .gift-finder__chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .gift-finder__chips::-webkit-scrollbar {
        display: none;
    }

    .gift-finder__chip {
        flex: none;
    }
}
