/*!
 * rkrcustomerspets — animation effects.
 *
 * A container declares the effect with .rkrcp-effect-* or [data-effect]; every
 * descendant carrying .rkrcp-fx receives it. The same file serves the back
 * office and the front office. All the animations are disabled at once when the
 * visitor asks for reduced motion or when the module switch is off
 * (.rkrcp-no-animations).
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 *
 * @author    Achegatec S.L. (Rekire.com) <info@rekire.com>
 * @copyright 2006-2026 Achegatec S.L. - CIF B27340801
 * @license   http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 */

/* ==========================================================================
   1. Keyframes
   ========================================================================== */

@keyframes rkrcp-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.045); }
    100% { transform: scale(1); }
}

@keyframes rkrcp-zoom {
    0%   { transform: scale(0.92); opacity: 0.4; }
    60%  { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes rkrcp-bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0, 0, 0); }
    40%, 43% { transform: translate3d(0, -9px, 0); }
    70% { transform: translate3d(0, -4px, 0); }
    90% { transform: translate3d(0, -2px, 0); }
}

@keyframes rkrcp-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(119, 166, 50, 0); }
    50%      { box-shadow: 0 0 0 8px rgba(119, 166, 50, 0.22); }
}

@keyframes rkrcp-shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 40%, 60%, 80% { transform: translate3d(3px, 0, 0); }
}

@keyframes rkrcp-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes rkrcp-slide {
    from { transform: translate3d(-14px, 0, 0); opacity: 0; }
    to   { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes rkrcp-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(0, -6px, 0); }
}

@keyframes rkrcp-heartbeat {
    0%   { transform: scale(1); }
    14%  { transform: scale(1.12); }
    28%  { transform: scale(1); }
    42%  { transform: scale(1.12); }
    70%  { transform: scale(1); }
}

@keyframes rkrcp-ripple {
    0%   { box-shadow: 0 0 0 0 rgba(119, 166, 50, 0.5); }
    100% { box-shadow: 0 0 0 16px rgba(119, 166, 50, 0); }
}

@keyframes rkrcp-swing {
    20%  { transform: rotate3d(0, 0, 1, 9deg); }
    40%  { transform: rotate3d(0, 0, 1, -7deg); }
    60%  { transform: rotate3d(0, 0, 1, 4deg); }
    80%  { transform: rotate3d(0, 0, 1, -2deg); }
    100% { transform: rotate3d(0, 0, 1, 0deg); }
}

@keyframes rkrcp-shimmer {
    0%   { background-position: -180% 0; }
    100% { background-position: 180% 0; }
}

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

/* ==========================================================================
   2. Effect bindings
   ========================================================================== */

.rkrcp-effect-pulse .rkrcp-fx,
[data-effect="pulse"] .rkrcp-fx {
    animation: rkrcp-pulse 2.4s ease-in-out infinite;
}

.rkrcp-effect-zoom .rkrcp-fx,
[data-effect="zoom"] .rkrcp-fx {
    animation: rkrcp-zoom 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rkrcp-effect-bounce .rkrcp-fx,
[data-effect="bounce"] .rkrcp-fx {
    animation: rkrcp-bounce 1.6s ease infinite;
}

.rkrcp-effect-glow .rkrcp-fx,
[data-effect="glow"] .rkrcp-fx {
    animation: rkrcp-glow 2.2s ease-in-out infinite;
}

.rkrcp-effect-shake .rkrcp-fx,
[data-effect="shake"] .rkrcp-fx {
    animation: rkrcp-shake 900ms ease-in-out infinite;
}

.rkrcp-effect-fade .rkrcp-fx,
[data-effect="fade"] .rkrcp-fx {
    animation: rkrcp-fade 620ms ease both;
}

.rkrcp-effect-slide .rkrcp-fx,
[data-effect="slide"] .rkrcp-fx {
    animation: rkrcp-slide 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rkrcp-effect-float .rkrcp-fx,
[data-effect="float"] .rkrcp-fx {
    animation: rkrcp-float 3.2s ease-in-out infinite;
}

.rkrcp-effect-heartbeat .rkrcp-fx,
[data-effect="heartbeat"] .rkrcp-fx {
    animation: rkrcp-heartbeat 1.8s ease-in-out infinite;
    transform-origin: center;
}

.rkrcp-effect-ripple .rkrcp-fx,
[data-effect="ripple"] .rkrcp-fx {
    animation: rkrcp-ripple 1.8s ease-out infinite;
}

.rkrcp-effect-swing .rkrcp-fx,
[data-effect="swing"] .rkrcp-fx {
    animation: rkrcp-swing 1.4s ease-in-out infinite;
    transform-origin: top center;
}

.rkrcp-effect-shimmer .rkrcp-fx,
[data-effect="shimmer"] .rkrcp-fx {
    background-image: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0.42) 42%,
        rgba(255, 255, 255, 0) 64%
    );
    background-size: 220% 100%;
    animation: rkrcp-shimmer 2.6s linear infinite;
}

/* ==========================================================================
   3. One-shot helpers (used by the scripts)
   ========================================================================== */

.rkrcp-animate-pulse { animation: rkrcp-pulse 700ms ease-in-out 1; }
.rkrcp-animate-zoom { animation: rkrcp-zoom 420ms cubic-bezier(0.22, 1, 0.36, 1) 1; }
.rkrcp-animate-shake { animation: rkrcp-shake 520ms ease-in-out 1; }
.rkrcp-animate-glow { animation: rkrcp-glow 1.2s ease-in-out 1; }
.rkrcp-animate-fade { animation: rkrcp-fade 420ms ease 1; }

.rkrcp-skeleton {
    background: linear-gradient(90deg, #eef0f2 25%, #f7f8f9 37%, #eef0f2 63%);
    background-size: 400% 100%;
    animation: rkrcp-shimmer 1.4s ease infinite;
    border-radius: 6px;
    color: transparent !important;
    min-height: 14px;
}

.rkrcp-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: rkrcp-spin 720ms linear infinite;
    vertical-align: -2px;
}

/* Hover life on the interactive pieces, independent of the chosen effect.
   Only the inner image of the widget thumb zooms (clipped by its own
   overflow:hidden); scaling the thumb box itself made it grow over the card
   body and the neighbour cards ("products stick together"). */
#rkrcp-root .rkrcp-kpi:hover .rkrcp-kpi-icon {
    transform: scale(1.06);
}

#rkrcp-root .rkrcp-kpi-icon {
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   4. Kill switches
   ========================================================================== */

.rkrcp-no-animations .rkrcp-fx,
.rkrcp-no-animations [class*="rkrcp-animate-"],
.rkrcp-no-animations .rkrcp-skeleton,
.rkrcp-no-animations .rkrcp-spinner {
    animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .rkrcp-fx,
    [class*="rkrcp-animate-"],
    .rkrcp-skeleton,
    .rkrcp-spinner,
    .rkrcp-ripple {
        animation: none !important;
        transition: none !important;
    }
}
