/* ===================================
   KAWAII ANIMATIONS & TRANSITIONS
   Magical effects for Tiendita Iker y Darling
   =================================== */

/* ── PAGE LOADER ── */
.kawaii-loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #FFF8F5, #FFF0F5, #E8F4FD);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.kawaii-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.kawaii-loader-content {
    text-align: center;
}

/* Cat Loader */
.kawaii-loader-cat {
    margin-bottom: 25px;
}

.cat-body {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    animation: catBounce 1s ease-in-out infinite;
}

@keyframes catBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

.cat-face {
    width: 80px;
    height: 70px;
    background: #FFB6C1;
    border-radius: 50% 50% 45% 45%;
    position: relative;
}

.cat-ear {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    top: -15px;
}

.cat-ear-left {
    border-width: 0 12px 20px 12px;
    border-color: transparent transparent #FFB6C1 transparent;
    left: 8px;
    transform: rotate(-10deg);
}

.cat-ear-right {
    border-width: 0 12px 20px 12px;
    border-color: transparent transparent #FFB6C1 transparent;
    right: 8px;
    transform: rotate(10deg);
}

.cat-eye {
    width: 10px;
    height: 12px;
    background: #2D1B69;
    border-radius: 50%;
    position: absolute;
    top: 22px;
    animation: loaderBlink 3s ease-in-out infinite;
}

.cat-eye-left { left: 20px; }
.cat-eye-right { right: 20px; }

@keyframes loaderBlink {
    0%, 85%, 100% { transform: scaleY(1); }
    90% { transform: scaleY(0.1); }
}

.cat-mouth {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    border-bottom: 2px solid #FF69B4;
    border-radius: 0 0 50% 50%;
}

.cat-blush {
    width: 14px;
    height: 8px;
    background: #FF69B4;
    border-radius: 50%;
    position: absolute;
    top: 35px;
    opacity: 0.4;
}

.cat-blush-left { left: 5px; }
.cat-blush-right { right: 5px; }

.cat-tail {
    position: absolute;
    right: -15px;
    bottom: 5px;
    width: 25px;
    height: 25px;
    border-right: 4px solid #FFB6C1;
    border-top: 4px solid #FFB6C1;
    border-radius: 0 20px 0 0;
    animation: tailWiggle 1s ease-in-out infinite;
    transform-origin: bottom left;
}

@keyframes tailWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

/* Loader Dots */
.kawaii-loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.kawaii-loader-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FF69B4;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.kawaii-loader-dots span:nth-child(1) { animation-delay: 0s; }
.kawaii-loader-dots span:nth-child(2) { animation-delay: 0.2s; background: #7EC8E3; }
.kawaii-loader-dots span:nth-child(3) { animation-delay: 0.4s; background: #B794D6; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

.kawaii-loader-text {
    font-family: 'Quicksand', sans-serif;
    color: #5C4A8A;
    font-size: 0.9rem;
    font-weight: 700;
    animation: textFade 1.5s ease-in-out infinite;
}

@keyframes textFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ── SCROLL REVEAL ANIMATIONS ── */
.kawaii-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--delay, 0s);
}

.kawaii-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ── BOUNCE ANIMATION ── */
.kawaii-bounce {
    animation: kawaiBounce 2s ease-in-out infinite;
}

@keyframes kawaiBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-6px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-3px); }
}

/* ── WIGGLE ANIMATION ── */
.kawaii-wiggle {
    animation: kawaiWiggle 3s ease-in-out infinite;
}

@keyframes kawaiWiggle {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-3deg); }
    20% { transform: rotate(3deg); }
    30% { transform: rotate(-2deg); }
    40% { transform: rotate(2deg); }
    50%, 100% { transform: rotate(0deg); }
}

/* ── GENTLE PULSE ── */
.kawaii-pulse {
    animation: kawaiPulse 2s ease-in-out infinite;
}

@keyframes kawaiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ── SPARKLE EFFECT ── */
@keyframes sparkleEffect {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1) rotate(180deg); opacity: 1; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* ── HEART BURST (for add to cart) ── */
.heart-burst {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
}

.heart-particle {
    position: absolute;
    font-size: 1.2rem;
    animation: heartBurst 1s ease-out forwards;
    opacity: 0;
}

@keyframes heartBurst {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1) rotate(var(--rot));
        opacity: 0;
    }
}

/* ── CARD HOVER SPARKLE ── */
.product-card::after {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2rem;
    pointer-events: none;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10;
}

.product-card.sparkle-effect::after {
    animation: cardSparkle 0.6s ease-out forwards;
}

@keyframes cardSparkle {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ── SMOOTH PAGE TRANSITIONS ── */
.kawaii-main,
.kawaii-shop-main,
.kawaii-product-single {
    animation: pageIn 0.6s ease-out;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── CATEGORY CARD HOVER EFFECTS ── */
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.category-card:hover::before {
    left: 100%;
}

/* ── BUTTON CLICK RIPPLE ── */
.kawaii-btn.ripple {
    position: relative;
    overflow: hidden;
}

.kawaii-btn .ripple-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ── NOTIFICATION SLIDE ── */
.kawaii-notification .notif-stars {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* ── HERO PANEL ENTRANCE ── */
.manga-panel {
    animation: panelSlide 0.8s ease-out forwards;
    opacity: 0;
}

.panel-main { animation-delay: 0.1s; }
.panel-promo { animation-delay: 0.3s; }
.panel-action { animation-delay: 0.5s; }
.panel-category { animation-delay: 0.7s; }

@keyframes panelSlide {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── SKELETON LOADING ── */
.kawaii-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── SCROLLBAR KAWAII ── */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #FFF0F5;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFB6C1, #FF69B4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FF69B4, #DB7093);
}

/* ── SELECTION COLOR ── */
::selection {
    background: rgba(255, 105, 180, 0.3);
    color: #2D1B69;
}

/* ── FOCUS STYLES ── */
*:focus-visible {
    outline: 3px solid #FF69B4;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── ADD TO CART ANIMATION ── */
.kawaii-btn-add-cart.adding,
.kawaii-btn-add-cart-single.adding {
    pointer-events: none;
    position: relative;
}

.kawaii-btn-add-cart.adding::after,
.kawaii-btn-add-cart-single.adding::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.kawaii-btn-add-cart.added,
.kawaii-btn-add-cart-single.added {
    background: linear-gradient(135deg, #4CAF50, #45a049) !important;
}

/* ── CONFETTI EFFECT ── */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99998;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ── HOVER TILT SHADOW ── */
.manga-panel[data-tilt]:hover {
    box-shadow: 0 15px 40px rgba(45, 27, 105, 0.15);
}

/* ── SMOOTH NUMBER COUNTER ── */
.kawaii-counter {
    display: inline-block;
    transition: all 0.3s;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .kawaii-loader {
        display: none !important;
    }
    
    .kawaii-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
