/* ===================================
   SHOP PAGE STYLES
   =================================== */

/* Skeleton loader animation */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

.dark .skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 1000px 100%;
}

/* Product card animations */
@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.product-card {
    animation: fadeInUp 0.6s ease-out forwards;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .product-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Prevent layout shift during loading */
.product-card-wrapper {
    min-height: 400px;
}

@media (max-width: 640px) {
    .product-card-wrapper {
        min-height: 380px;
    }
}

/* Filter animations */
.category-filter {
    transition: all 0.2s ease;
}

.category-filter:checked {
    transform: scale(1.1);
}

/* Search input focus effects */
.search-input:focus {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), rgba(168, 85, 247, 0.05));
}

/* Sort dropdown styling */
#sort-select {
    cursor: pointer;
    transition: all 0.2s ease;
}

#sort-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.3);
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ec4899;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Favorite button animation */
.favorite-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn.active {
    animation: heartbeat 0.6s ease-in-out;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Empty state styling */
.empty-state {
    transition: opacity 0.5s ease;
}

/* Pagination hover effects */
.pagination-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.pagination-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.2), transparent);
    transition: left 0.5s;
}

.pagination-btn:hover::before {
    left: 100%;
}

/* Mobile filter sidebar */
@media (max-width: 1024px) {
    .mobile-filter-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-filter-sidebar.active {
        transform: translateX(0);
    }
}

/* Responsive grid adjustments */
@media (min-width: 1280px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Brand link hover effects */
.brand-link {
    position: relative;
}

.brand-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background: #ec4899;
    transition: width 0.3s ease;
}

.brand-link:hover::after {
    width: 100%;
}

/* Price display styling */
.price-display {
    font-variant-numeric: tabular-nums;
}

/* Tag styling improvements */
.product-tag {
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Sticky sidebar scroll shadow */
.sidebar-sticky {
    position: relative;
}

.sidebar-sticky::after {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

/* Performance optimizations */
.product-card img {
    will-change: transform;
}

/* Disable hover effect for 2D layered previews - must come BEFORE general hover rule */
.no-hover-scale,
.no-hover-scale *,
.no-hover-scale img,
.product-card:hover .no-hover-scale,
.product-card:hover .no-hover-scale *,
.product-card:hover .no-hover-scale img {
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
}

.product-card:hover img:not(.no-hover-scale *) {
    transform: scale(1.05);
}

/* Focus states for accessibility */
.product-card:focus-within {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid currentColor;
    }
    
    .skeleton {
        background: repeating-linear-gradient(
            90deg,
            currentColor 0px,
            transparent 1px,
            transparent 2px,
            currentColor 3px
        );
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .skeleton {
        animation: none;
        background: #f0f0f0;
    }
    
    .dark .skeleton {
        background: rgba(255,255,255,0.1);
    }
}