/* Fancy hover tips — Popover API + anchor positioning (with fallback) */
:root {
    --fx-tip-brand: #7fc945;
    --fx-tip-ink: #14201a;
    --fx-tip-mute: #5f6b62;
}

#fxHoverTip {
    position: fixed;
    inset: auto;
    margin: 0;
    border: 0;
    padding: 0;
    background: transparent;
    overflow: visible;
    z-index: 10050;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale(.96);
    transition:
        opacity .18s cubic-bezier(.2, .8, .2, 1),
        transform .22s cubic-bezier(.2, .8, .2, 1);
}
#fxHoverTip:popover-open,
#fxHoverTip.is-on {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}
#fxHoverTip[hidden] { display: none !important; }

.fx-tip-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: min(280px, calc(100vw - 24px));
    padding: .55rem .8rem .55rem .7rem;
    border-radius: 14px;
    color: #f4fff0;
    font-family: "Vazirmatn", tahoma, sans-serif;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.45;
    letter-spacing: -.01em;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(143, 216, 79, .35), transparent 55%),
        linear-gradient(145deg, #173220 0%, #0f1a14 55%, #1a2e20 100%);
    border: 1px solid rgba(143, 216, 79, .28);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .08) inset,
        0 16px 40px rgba(8, 14, 10, .35),
        0 0 0 1px rgba(0, 0, 0, .2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.fx-tip-card::before {
    content: "";
    width: .42rem;
    height: .42rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #c6f08a, var(--fx-tip-brand));
    box-shadow: 0 0 0 3px rgba(127, 201, 69, .22), 0 0 14px rgba(127, 201, 69, .45);
    animation: fxTipPulse 1.6s ease-in-out infinite;
}
.fx-tip-card::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: #122018;
    border-right: 1px solid rgba(143, 216, 79, .28);
    border-bottom: 1px solid rgba(143, 216, 79, .28);
    transform: rotate(45deg);
}
#fxHoverTip[data-place="below"] .fx-tip-card::after {
    bottom: auto;
    top: -5px;
    border: 0;
    border-left: 1px solid rgba(143, 216, 79, .28);
    border-top: 1px solid rgba(143, 216, 79, .28);
}
.fx-tip-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Price variant — bigger, money feel */
#fxHoverTip.is-price .fx-tip-card {
    gap: .55rem;
    padding: .7rem .95rem .7rem .8rem;
    border-radius: 16px;
    font-size: .92rem;
    background:
        radial-gradient(100% 120% at 100% 0%, rgba(254, 160, 0, .22), transparent 50%),
        radial-gradient(120% 140% at 0% 100%, rgba(143, 216, 79, .28), transparent 55%),
        linear-gradient(150deg, #102016, #1a2f22 60%, #0d1712);
}
#fxHoverTip.is-price .fx-tip-card::before {
    width: .55rem;
    height: .55rem;
    background: radial-gradient(circle at 35% 30%, #ffe08a, #fea000);
    box-shadow: 0 0 0 3px rgba(254, 160, 0, .2), 0 0 16px rgba(254, 160, 0, .4);
}
#fxHoverTip.is-price .fx-tip-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
#fxHoverTip.is-price .fx-tip-unit {
    display: inline-block;
    margin-inline-start: .25rem;
    padding: .12rem .4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #d7f0c0;
    font-size: .68rem;
    font-weight: 800;
    vertical-align: middle;
}

@keyframes fxTipPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: .85; }
}

.fx-tip-hot {
    filter: brightness(1.03);
}
.rt-price-final.fx-tip-hot,
.pd-price-main.fx-tip-hot,
.ph-plan .price.fx-tip-hot,
[data-fx-price].fx-tip-hot {
    transform: translateY(-1px);
    transition: transform .18s ease, filter .18s ease;
}

@media (prefers-reduced-motion: reduce) {
    #fxHoverTip { transition: opacity .12s ease; }
    .fx-tip-card::before { animation: none; }
}
