/**
 * STROBODELIA - Premium Animations
 * Animaciones sutiles y elegantes para el sitio
 * Compatible con Hostinger (solo CSS, sin costo extra)
 */

/* ======================================
   FADE IN ON SCROLL ANIMATIONS
====================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for children */
.stagger-1 {
    transition-delay: 0.1s;
}

.stagger-2 {
    transition-delay: 0.2s;
}

.stagger-3 {
    transition-delay: 0.3s;
}

.stagger-4 {
    transition-delay: 0.4s;
}

.stagger-5 {
    transition-delay: 0.5s;
}

.stagger-6 {
    transition-delay: 0.6s;
}

.stagger-7 {
    transition-delay: 0.7s;
}

.stagger-8 {
    transition-delay: 0.8s;
}

/* ======================================
   HERO ANIMATIONS
====================================== */
@keyframes heroTextReveal {
    from {
        opacity: 0;
        transform: translateY(60px);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.hero-title {
    animation: heroTextReveal 1s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.hero-title span:nth-child(2) {
    animation-delay: 0.5s;
}

.hero-brand {
    animation: heroFadeIn 1s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.hero-description {
    animation: heroFadeIn 1s ease forwards;
    animation-delay: 0.7s;
    opacity: 0;
}

.hero .btn {
    animation: heroFadeIn 0.8s ease forwards;
    animation-delay: 0.9s;
    opacity: 0;
}

.hero .btn:nth-child(2) {
    animation-delay: 1s;
}

/* ======================================
   PRODUCT CARD ANIMATIONS
====================================== */
.product-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.product-card-image img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.4s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.08);
}

.product-card-add {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Shimmer loading effect */
.product-card.loading .product-card-image {
    background: linear-gradient(90deg,
            var(--color-bg-secondary) 0%,
            var(--color-bg-card) 50%,
            var(--color-bg-secondary) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ======================================
   BUTTON ANIMATIONS
====================================== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* ======================================
   CATEGORY CARDS
====================================== */
.category-card {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
    transform: scale(1.02);
}

.category-card-title {
    transition: transform 0.4s ease, letter-spacing 0.4s ease;
}

.category-card:hover .category-card-title {
    transform: scale(1.1);
    letter-spacing: 0.1em;
}

/* ======================================
   HEADER ANIMATIONS
====================================== */
.header {
    transition: background 0.3s ease,
        padding 0.3s ease,
        box-shadow 0.3s ease;
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-white);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.cart-icon {
    transition: transform 0.3s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    animation: pulse 2s infinite;
}

/* ======================================
   PAGE TRANSITIONS - COOL EFFECTS
====================================== */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes pageSlideUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Apply transition to main content */
main, .product-page, .catalog-page, .cart-page, .checkout-page, .login-container, .account-container {
    animation: pageSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stagger content elements */
.page-header {
    animation: pageFadeIn 0.5s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.page-title {
    animation: heroTextReveal 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

/* ======================================
   FORM ANIMATIONS
====================================== */
.form-group input,
.form-group textarea {
    transition: border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

/* ======================================
   PAYMENT OPTION ANIMATIONS
====================================== */
.payment-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.payment-option:hover {
    transform: translateX(8px);
}

.payment-option.selected {
    transform: translateX(0);
}

/* ======================================
   CART ANIMATIONS
====================================== */
.cart-item {
    transition: background 0.3s ease, transform 0.3s ease;
}

.cart-item:hover {
    background: var(--color-bg-card);
    transform: translateX(4px);
}

/* ======================================
   SUCCESS PAGE ANIMATION
====================================== */
@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    animation: checkmark 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ======================================
   SCROLL BAR ANIMATION
====================================== */
::-webkit-scrollbar-thumb {
    transition: background 0.3s ease;
}

/* ======================================
   LOADING SPINNER
====================================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ======================================
   NOTIFICATION TOAST
====================================== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.cart-notification {
    animation: slideInRight 0.4s ease;
}

/* ======================================
   HOVER GLOW EFFECTS
====================================== */
.glow-on-hover {
    transition: box-shadow 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
}

/* ======================================
   TEXT GRADIENT ANIMATION (OPTIONAL)
====================================== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient-text {
    background: linear-gradient(90deg,
            #ffffff,
            #888888,
            #ffffff);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

/* ======================================
   REDUCED MOTION
====================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}