/* ===== Gift Finder quiz — reuses the site's brand vars from navigation.php's
   :root and the shop page's .sp-card/.sp-grid for results, so results look
   identical to the regular shop grid. ===== */

.gf-page {
    padding: 40px 20px 80px;
    max-width: 900px;
    margin: 0 auto;
}

.gf-hero {
    text-align: center;
    margin-bottom: 36px;
    position: relative;
}

.gf-hero-sparkle {
    position: absolute;
    color: var(--jv-gold);
    pointer-events: none;
    animation: gf-twinkle 2.4s ease-in-out infinite;
}

.gf-hero-sparkle.s1 { top: -6px; left: 22%; font-size: 16px; animation-delay: 0s; }
.gf-hero-sparkle.s2 { top: 10px; right: 20%; font-size: 11px; animation-delay: 0.6s; }
.gf-hero-sparkle.s3 { bottom: 18px; left: 12%; font-size: 13px; animation-delay: 1.2s; }
.gf-hero-sparkle.s4 { top: 40%; right: 10%; font-size: 15px; animation-delay: 1.8s; }

@keyframes gf-twinkle {
    0%, 100% { opacity: 0.15; transform: scale(0.7) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

.gf-eyebrow {
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--jv-gold-dark);
    font-weight: 600;
    margin-bottom: 10px;
}

.gf-hero h1 {
    font-family: var(--jv-font-serif);
    font-size: clamp(28px, 4vw, 42px);
    color: var(--jv-ink);
    margin: 0 0 10px;
}

.gf-hero p {
    color: var(--jv-muted);
    font-size: 15px;
    margin: 0;
}

.gf-quiz {
    background: #fff;
    border: 1px solid var(--jv-line);
    border-radius: 20px;
    padding: 40px clamp(20px, 5vw, 56px);
    position: relative;
    overflow: hidden;
    min-height: 360px;
    box-shadow: 0 30px 70px -40px rgba(178, 140, 60, 0.35);
}

/* ----- Ambient background sparkles (injected via JS, purely decorative) ----- */
.gf-bg-sparkle {
    position: absolute;
    color: var(--jv-gold);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    animation: gf-float-twinkle linear infinite;
}

@keyframes gf-float-twinkle {
    0%   { opacity: 0; transform: translateY(0) scale(0.6) rotate(0deg); }
    10%  { opacity: 0.55; }
    50%  { opacity: 0.85; transform: translateY(-18px) scale(1) rotate(90deg); }
    90%  { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-34px) scale(0.6) rotate(180deg); }
}

.gf-quiz > *:not(.gf-bg-sparkle) {
    position: relative;
    z-index: 1;
}

/* ----- Progress dots ----- */
.gf-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
}

.gf-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--jv-line);
    position: relative;
    transition: background 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.gf-dot.active {
    background: var(--jv-gold);
    transform: scale(1.25);
    box-shadow: 0 0 0 4px rgba(178, 140, 60, 0.18);
}

.gf-dot.active::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid var(--jv-gold);
    opacity: 0;
    animation: gf-dot-pulse 1.6s ease-out infinite;
}

@keyframes gf-dot-pulse {
    0%   { opacity: 0.6; transform: scale(0.6); }
    100% { opacity: 0; transform: scale(1.8); }
}

.gf-dot-line {
    width: 32px;
    height: 2px;
    background: var(--jv-line);
    position: relative;
    overflow: hidden;
}

.gf-dot-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--jv-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.gf-dot-line.filled::after {
    transform: scaleX(1);
}

/* ----- Steps: each is absolutely stacked, faded/slid in when .active ----- */
.gf-step,
.gf-loading,
.gf-results {
    display: none;
}

.gf-step.active,
.gf-loading.active,
.gf-results.active {
    display: block;
    animation: gf-step-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.gf-step.active.dir-back {
    animation-name: gf-step-in-back;
}

@keyframes gf-step-in {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes gf-step-in-back {
    from { opacity: 0; transform: translateX(-28px); }
    to   { opacity: 1; transform: translateX(0); }
}

.gf-step-title {
    font-family: var(--jv-font-serif);
    font-size: 26px;
    text-align: center;
    color: var(--jv-ink);
    margin: 0 0 28px;
}

.gf-back {
    background: none;
    border: none;
    color: var(--jv-muted);
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.gf-back:hover {
    color: var(--jv-gold-dark);
}

/* ----- Option buttons ----- */
.gf-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.gf-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 26px 18px;
    background: var(--jv-cream, #f4f2ee);
    border: 1.5px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.gf-option:hover {
    border-color: var(--jv-gold);
    transform: translateY(-3px);
    background: #fff;
    box-shadow: 0 12px 24px -14px rgba(178, 140, 60, 0.4);
}

.gf-option.is-picked {
    border-color: var(--jv-gold);
    background: #fff;
    transform: scale(0.97);
    box-shadow: 0 0 0 3px rgba(178, 140, 60, 0.22);
}

.gf-option.is-picked::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(178, 140, 60, 0.35) 0%, rgba(178, 140, 60, 0) 70%);
    animation: gf-ripple 0.5s ease-out;
}

@keyframes gf-ripple {
    from { opacity: 1; transform: scale(0.3); }
    to   { opacity: 0; transform: scale(1.6); }
}

/* ----- Click sparkle burst (small particles spawned via JS on option pick) ----- */
.gf-burst-particle {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--jv-gold);
    pointer-events: none;
    z-index: 9999;
    animation: gf-burst-out 0.6s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes gf-burst-out {
    from {
        opacity: 1;
        transform: translate(var(--gf-x0), var(--gf-y0)) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(var(--gf-x1), var(--gf-y1)) scale(0.2);
    }
}

.gf-option-icon {
    font-size: 26px;
    color: var(--jv-gold-dark);
}

.gf-option-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--jv-ink);
}

/* ----- Loading state: a wand orbited by sparkles, not a plain spinner ----- */
.gf-loading {
    text-align: center;
    padding: 60px 0;
}

.gf-loading p {
    margin-top: 22px;
    color: var(--jv-muted);
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    min-height: 20px;
    transition: opacity 0.25s ease;
}

.gf-wand {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto;
}

.gf-wand-core {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--jv-gold-dark);
    animation: gf-wand-bob 1.6s ease-in-out infinite;
}

.gf-wand-orbit {
    position: absolute;
    inset: 0;
    animation: gf-spin 2.6s linear infinite;
}

.gf-wand-orbit i {
    position: absolute;
    color: var(--jv-gold);
    font-size: 12px;
}

.gf-wand-orbit i:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); animation: gf-twinkle 1.2s ease-in-out infinite; }
.gf-wand-orbit i:nth-child(2) { top: 50%; right: -4px; transform: translateY(-50%); animation: gf-twinkle 1.2s ease-in-out infinite 0.3s; }
.gf-wand-orbit i:nth-child(3) { bottom: -2px; left: 50%; transform: translateX(-50%); animation: gf-twinkle 1.2s ease-in-out infinite 0.6s; }
.gf-wand-orbit i:nth-child(4) { top: 50%; left: -4px; transform: translateY(-50%); animation: gf-twinkle 1.2s ease-in-out infinite 0.9s; }

@keyframes gf-wand-bob {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50%      { transform: translateY(-6px) rotate(8deg); }
}

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

/* ----- Results ----- */
.gf-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.gf-results-header h2 {
    font-family: var(--jv-font-serif);
    font-size: 24px;
    color: var(--jv-ink);
    margin: 0;
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg, var(--jv-ink) 0%, var(--jv-ink) 40%, var(--jv-gold) 50%, var(--jv-ink) 60%, var(--jv-ink) 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gf-shimmer-sweep 1.4s ease-out;
}

@keyframes gf-shimmer-sweep {
    from { background-position: 100% 0; }
    to   { background-position: 0 0; }
}

.gf-restart {
    background: none;
    border: 1px solid var(--jv-line);
    border-radius: 999px;
    padding: 8px 18px;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--jv-ink);
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.gf-restart:hover {
    border-color: var(--jv-gold);
    color: var(--jv-gold-dark);
}

.gf-empty {
    text-align: center;
    color: var(--jv-muted);
    padding: 40px 0;
    font-family: 'Jost', sans-serif;
}

/* Results cards cascade in one after another rather than all popping in
   at once — noticeably livelier for a "we found these for you" reveal. */
#gf_results_grid .sp-card {
    opacity: 0;
    animation: gf-card-in 0.5s ease forwards;
}

#gf_results_grid .sp-card:nth-child(1) { animation-delay: 0.05s; }
#gf_results_grid .sp-card:nth-child(2) { animation-delay: 0.12s; }
#gf_results_grid .sp-card:nth-child(3) { animation-delay: 0.19s; }
#gf_results_grid .sp-card:nth-child(4) { animation-delay: 0.26s; }
#gf_results_grid .sp-card:nth-child(5) { animation-delay: 0.33s; }
#gf_results_grid .sp-card:nth-child(n+6) { animation-delay: 0.4s; }

@keyframes gf-card-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .gf-step.active, .gf-loading.active, .gf-results.active,
    #gf_results_grid .sp-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

@media (max-width: 575px) {
    .gf-quiz {
        padding: 28px 18px;
    }

    .gf-options {
        grid-template-columns: 1fr 1fr;
    }
}
