/**
 * Kafraty - click feedback layer (see assets/js/buy-feedback.js).
 *
 * Two fixed, pointer-events:none elements that only exist while a cart request
 * is in flight. No layout impact: nothing is inserted into the document flow.
 */

#kf-buy-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 99998;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.12s linear;
}

#kf-buy-bar[data-on] {
    opacity: 1;
}

#kf-buy-bar::before {
    content: "";
    display: block;
    width: 40%;
    height: 100%;
    background: #d3020e;
    border-radius: 0 3px 3px 0;
    animation: kf-buy-bar-slide 1.1s ease-in-out infinite;
}

#kf-buy-pill {
    position: fixed;
    top: 12px;
    left: 50%;
    z-index: 99997;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 32px);
    padding: 9px 16px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-family: Almarai, Tahoma, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

#kf-buy-pill[data-on] {
    opacity: 1;
    transform: translate(-50%, 0);
}

#kf-buy-pill i {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: kf-buy-spin 0.7s linear infinite;
}

@keyframes kf-buy-bar-slide {
    0%   { transform: translateX(-110%); }
    100% { transform: translateX(260%); }
}

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

@media (prefers-reduced-motion: reduce) {
    #kf-buy-bar::before,
    #kf-buy-pill i {
        animation-duration: 2.4s;
    }

    #kf-buy-pill {
        transition: opacity 0.12s linear;
    }
}
