/* ============================================
   MICRO-INTERACTIONS STYLES
   ============================================ */

/* 1. Button Ripple Effect */
button,
.btn,
.filter-btn,
.whatsapp-btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Enhanced ripple for primary buttons */
.btn-primary .ripple {
    background: rgba(255, 255, 255, 0.5);
}

/* Enhanced ripple for secondary buttons */
.btn-secondary .ripple {
    background: rgba(90, 62, 43, 0.3);
}

/* WhatsApp button ripple */
.whatsapp-btn .ripple {
    background: rgba(255, 255, 255, 0.4);
}

/* 2. Magnetic Buttons - Enhanced hover states */
button,
.btn {
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Smooth transition when magnetic effect deactivates */
button:not(:hover),
.btn:not(:hover) {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 3. Page Transition Overlay */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c1a10 0%, #5a3e2b 50%, #3d2817 100%);
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.3s ease;
}

.page-transition-overlay.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Add decorative pattern to transition overlay */
.page-transition-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 3px solid rgba(245, 242, 237, 0.3);
    border-radius: 50%;
    animation: pulse-ring 1.5s ease-in-out infinite;
}

@keyframes pulse-ring {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.5;
    }
}

/* 4. Statistics Section with Counter Animation */
.statistics-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 4rem 0;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.statistics-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(90deg,
            transparent,
            transparent 50px,
            rgba(245, 242, 237, 0.02) 50px,
            rgba(245, 242, 237, 0.02) 100px);
    pointer-events: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
    color: var(--secondary);
    padding: 2rem 1rem;
    position: relative;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-10px);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary);
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.stat-item:hover::before {
    opacity: 1;
    width: 80px;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.5rem;
    line-height: 1;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #fff 0%, rgba(245, 242, 237, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
    margin-top: 1rem;
}

/* Add shimmer effect to numbers */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.stat-number[data-counted="true"] {
    animation: shimmer 3s ease-in-out;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 1) 50%,
            rgba(255, 255, 255, 0.8) 100%);
    background-size: 1000px 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Button Interactions */
.btn,
button {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover,
button:hover {
    filter: brightness(1.1);
}

.btn:active,
button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Product Card Enhanced Magnetic Effect */
.product-card,
.category-card {
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Smooth entrance animation for dynamically loaded content */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card,
.category-card {
    animation: fadeInScale 0.5s ease-out backwards;
}

.product-card:nth-child(1),
.category-card:nth-child(1) {
    animation-delay: 0.05s;
}

.product-card:nth-child(2),
.category-card:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card:nth-child(3),
.category-card:nth-child(3) {
    animation-delay: 0.15s;
}

.product-card:nth-child(4),
.category-card:nth-child(4) {
    animation-delay: 0.2s;
}

.product-card:nth-child(5),
.category-card:nth-child(5) {
    animation-delay: 0.25s;
}

.product-card:nth-child(6),
.category-card:nth-child(6) {
    animation-delay: 0.3s;
}

/* Loading state shimmer for images */
.product-image,
.category-card-image {
    background: linear-gradient(90deg,
            var(--secondary) 0%,
            rgba(245, 242, 237, 0.8) 50%,
            var(--secondary) 100%);
    background-size: 200% 100%;
    animation: shimmerLoading 1.5s ease-in-out infinite;
}

.product-image[src],
.category-card-image[src] {
    animation: none;
}

@keyframes shimmerLoading {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-number {
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* Disable magnetic effect on mobile */
    button[data-magnetic],
    .btn[data-magnetic] {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .statistics-section {
        padding: 3rem 0;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .ripple,
    .page-transition-overlay,
    .stat-item,
    button,
    .btn {
        animation: none !important;
        transition: none !important;
    }
}