/**
 * Animation System - CSS Keyframes and Utility Classes
 * Requirements: 1.3, 1.4, 5.5, 9.3, 9.4
 * 
 * This file contains all animation keyframes and utility classes
 * for the car accessories store frontend.
 * 
 * GPU-ACCELERATION POLICY (Req 9.3):
 * ================================
 * All animations in this file ONLY use transform and opacity properties
 * to ensure GPU acceleration and smooth 60fps performance.
 * 
 * ALLOWED animated properties:
 * - transform (translate, scale, rotate, skew)
 * - opacity
 * 
 * FORBIDDEN animated properties (cause layout/paint):
 * - width, height
 * - top, left, right, bottom
 * - margin, padding
 * - border-width
 * - font-size
 * 
 * EXCEPTIONS (acceptable for non-critical UI):
 * - box-shadow (for hover effects, GPU composited in modern browsers)
 * - border-color (simple color change, no layout)
 * - background-color (simple color change, no layout)
 * - background-position (for shimmer effects only)
 */

/* ============================================
   CSS Custom Properties for Animation Config
   ============================================ */
:root {
    /* Duration values - max 300ms for standard transitions (Req 1.4) */
    --animation-duration-fast: 150ms;
    --animation-duration-normal: 300ms;
    --animation-duration-slow: 500ms;
    
    /* Micro-interaction duration - max 200ms (Req 5.5) */
    --micro-interaction-duration: 200ms;
    
    /* Easing functions */
    --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --easing-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --easing-ease-out: ease-out;
}

/* ============================================
   Keyframe Definitions
   ============================================ */


/* Fade In - Simple opacity transition */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade Up - Opacity with upward movement */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade Down - Opacity with downward movement */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale In - Grow from smaller size */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Left - Enter from right */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Right - Enter from left */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bounce - Elastic bounce effect */
@keyframes bounce {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(0.95);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Bounce In - Enter with bounce */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Shimmer - Loading skeleton effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Pulse - Subtle pulsing effect */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Spin - Rotation for loaders */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Slide In Toast - For notifications */
@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Out Toast - For notifications exit */
@keyframes slideOutToast {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}


/* ============================================
   Animation Utility Classes
   ============================================ */

/* Base animation class */
.animate {
    animation-fill-mode: both;
    animation-timing-function: var(--easing-default);
}

/* Fade In */
.animate-fade-in {
    animation-name: fadeIn;
    animation-duration: var(--animation-duration-normal);
    animation-timing-function: var(--easing-ease-out);
}

/* Fade Up */
.animate-fade-up {
    animation-name: fadeUp;
    animation-duration: var(--animation-duration-normal);
    animation-timing-function: var(--easing-ease-out);
}

/* Fade Down */
.animate-fade-down {
    animation-name: fadeDown;
    animation-duration: var(--animation-duration-normal);
    animation-timing-function: var(--easing-ease-out);
}

/* Scale In */
.animate-scale-in {
    animation-name: scaleIn;
    animation-duration: var(--animation-duration-normal);
    animation-timing-function: var(--easing-ease-out);
}

/* Slide Left */
.animate-slide-left {
    animation-name: slideLeft;
    animation-duration: var(--animation-duration-normal);
    animation-timing-function: var(--easing-ease-out);
}

/* Slide Right */
.animate-slide-right {
    animation-name: slideRight;
    animation-duration: var(--animation-duration-normal);
    animation-timing-function: var(--easing-ease-out);
}

/* Bounce */
.animate-bounce {
    animation-name: bounce;
    animation-duration: 500ms;
    animation-timing-function: var(--easing-bounce);
}

/* Bounce In */
.animate-bounce-in {
    animation-name: bounceIn;
    animation-duration: 500ms;
    animation-timing-function: var(--easing-bounce);
}

/* Shimmer - for skeleton loading */
.animate-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Pulse */
.animate-pulse {
    animation-name: pulse;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

/* Spin - for loaders */
.animate-spin {
    animation-name: spin;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

/* ============================================
   Staggered Animation Classes
   ============================================ */

.animate-stagger > *:nth-child(1) { animation-delay: 0ms; }
.animate-stagger > *:nth-child(2) { animation-delay: 50ms; }
.animate-stagger > *:nth-child(3) { animation-delay: 100ms; }
.animate-stagger > *:nth-child(4) { animation-delay: 150ms; }
.animate-stagger > *:nth-child(5) { animation-delay: 200ms; }
.animate-stagger > *:nth-child(6) { animation-delay: 250ms; }
.animate-stagger > *:nth-child(7) { animation-delay: 300ms; }
.animate-stagger > *:nth-child(8) { animation-delay: 350ms; }
.animate-stagger > *:nth-child(9) { animation-delay: 400ms; }
.animate-stagger > *:nth-child(10) { animation-delay: 450ms; }

/* ============================================
   Scroll Animation Classes
   ============================================ */

/* Initial state for scroll animations (Req 2.1, 2.2) */
.scroll-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--animation-duration-normal) var(--easing-ease-out);
}

/* Animated state when in viewport (Req 2.1, 2.2) */
.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll animation variants */
.scroll-animate-fade {
    opacity: 0;
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out);
}

.scroll-animate-fade.is-visible {
    opacity: 1;
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--animation-duration-normal) var(--easing-ease-out);
}

.scroll-animate-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--animation-duration-normal) var(--easing-ease-out);
}

.scroll-animate-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--animation-duration-normal) var(--easing-ease-out);
}

.scroll-animate-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Sticky Header Styles (Req 2.4)
   ============================================ */

/* Base sticky header styles */
.header-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform var(--animation-duration-normal) var(--easing-ease-out),
                box-shadow var(--animation-duration-normal) var(--easing-ease-out);
    will-change: transform;
}

/* Header hidden state - slide up */
.header-sticky.header-hidden {
    transform: translateY(-100%);
}

/* Header visible state - slide down (Req 2.4) */
.header-sticky.header-visible {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Alternative: Fixed header that hides/shows */
.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform var(--animation-duration-normal) var(--easing-ease-out),
                box-shadow var(--animation-duration-normal) var(--easing-ease-out);
    will-change: transform;
}

.header-fixed.header-hidden {
    transform: translateY(-100%);
}

.header-fixed.header-visible {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Transition Utility Classes
   ============================================ */

/* Fast transition - 150ms */
.transition-fast {
    transition-duration: var(--animation-duration-fast);
    transition-timing-function: var(--easing-ease-out);
}

/* Normal transition - 300ms (max for standard, Req 1.4) */
.transition-normal {
    transition-duration: var(--animation-duration-normal);
    transition-timing-function: var(--easing-ease-out);
}

/* Micro-interaction transition - 200ms (max, Req 5.5) */
.transition-micro {
    transition-duration: var(--micro-interaction-duration);
    transition-timing-function: var(--easing-ease-out);
}

/* All properties transition */
.transition-all {
    transition-property: all;
}

/* Transform only transition (GPU accelerated) */
.transition-transform {
    transition-property: transform;
}

/* Opacity only transition (GPU accelerated) */
.transition-opacity {
    transition-property: opacity;
}

/* Transform and opacity (GPU accelerated) */
.transition-gpu {
    transition-property: transform, opacity;
}

/* ============================================
   Will-Change Optimization Classes (Req 9.4)
   ============================================ */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-transform-opacity {
    will-change: transform, opacity;
}

.will-change-auto {
    will-change: auto;
}

/* ============================================
   Performance Optimization - Will-Change for Animated Elements (Req 9.4)
   Applied to elements that will be animated for GPU acceleration
   ============================================ */

/* Product cards - will animate transform and opacity on hover */
.product-card {
    will-change: transform, box-shadow;
}

.product-card-actions {
    will-change: opacity, transform;
}

.product-card-image img {
    will-change: transform;
}

/* Scroll animated elements */
.scroll-animate,
.scroll-animate-fade,
.scroll-animate-scale,
.scroll-animate-left,
.scroll-animate-right {
    will-change: opacity, transform;
}

/* Toast notifications */
.toast-notification {
    will-change: transform, opacity;
}

/* Gallery elements */
.lightbox-image {
    will-change: transform, opacity;
}

/* Hero slider elements */
.hero-slider .slide {
    will-change: opacity;
}

.hero-slider .slide-image {
    will-change: transform, opacity;
}

.hero-slider .slide-content {
    will-change: opacity, transform;
}

/* Filter animations */
.filter-product {
    will-change: opacity, transform;
}

/* Buttons with micro-interactions */
.btn-micro,
.btn,
button[type="submit"],
button[type="button"]:not(.lightbox-close):not(.lightbox-nav):not(.toast-close):not(.thumbnail-btn) {
    will-change: transform;
}

/* Icons with hover animations */
.icon-micro,
.material-symbols-outlined,
.icon {
    will-change: transform;
}

/* Loading elements */
.skeleton {
    will-change: background-position;
}

.loading-spinner,
.btn-spinner {
    will-change: transform;
}

/* ============================================
   Reduced Motion Support (Req 9.2)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate,
    .animate-fade-in,
    .animate-fade-up,
    .animate-fade-down,
    .animate-scale-in,
    .animate-slide-left,
    .animate-slide-right,
    .animate-bounce,
    .animate-bounce-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .scroll-animate,
    .scroll-animate-fade,
    .scroll-animate-scale,
    .scroll-animate-left,
    .scroll-animate-right {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    /* Sticky header - always visible with reduced motion */
    .header-sticky,
    .header-fixed {
        transform: none !important;
        transition: none !important;
    }
    
    .header-sticky.header-hidden,
    .header-fixed.header-hidden {
        transform: none !important;
    }
}

/* ============================================
   Toast Notification Styles
   ============================================ */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0;
    background: #333;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    overflow: hidden;
}

.toast-notification .toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.toast-notification .toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-notification .toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.toast-notification .toast-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity var(--micro-interaction-duration) ease;
    flex-shrink: 0;
}

.toast-notification .toast-close:hover {
    opacity: 1;
}

.toast-notification .toast-close .material-symbols-outlined {
    font-size: 20px;
}

.toast-notification.toast-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.toast-notification.toast-success .toast-icon {
    color: #fff;
}

.toast-notification.toast-error {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
}

.toast-notification.toast-info {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
}

/* Toast animation - slide in from right (Req 3.3) */
.toast-notification:not(.toast-exit) {
    animation: slideInToast var(--animation-duration-normal) var(--easing-ease-out);
}

.toast-notification.toast-exit {
    animation: slideOutToast var(--animation-duration-normal) var(--easing-ease-out) forwards;
}

/* ============================================
   Flying Cart Item Animation (Req 3.1)
   ============================================ */

.flying-cart-item {
    pointer-events: none;
    will-change: transform, left, top, opacity;
}

/* ============================================
   Cart Icon Bounce Animation (Req 3.2)
   ============================================ */

.cart-icon-bounce {
    animation: bounce 300ms var(--easing-bounce);
}

/* Cart count badge pulse */
.cart-count-pulse {
    animation: pulse 300ms var(--easing-bounce);
}

@keyframes cartBounce {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(0.9);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   Reduced Motion Support for Cart Animations
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .toast-notification,
    .toast-notification:not(.toast-exit),
    .toast-notification.toast-exit {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .flying-cart-item {
        display: none !important;
    }
    
    .cart-icon-bounce,
    .cart-count-pulse {
        animation: none !important;
    }
}

/* ============================================
   Skeleton Loading Styles
   ============================================ */

.skeleton {
    background: #e0e0e0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
    background-size: 200% 100%;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-image {
    width: 100%;
    padding-bottom: 100%;
}

/* ============================================
   Product Card Animations (Req 1.1, 1.2, 1.3)
   ============================================ */

/* Product Card Base Styles */
.product-card {
    transition: transform var(--animation-duration-normal) var(--easing-ease-out),
                box-shadow var(--animation-duration-normal) var(--easing-ease-out),
                border-color var(--animation-duration-normal) var(--easing-ease-out);
}

/* Product Card Hover Effect (Req 1.1) - scale(1.05) and larger shadow */
.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(var(--color-primary-rgb, 59, 130, 246), 0.15);
}

/* Product Card Image Hover */
.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

/* Product Card Actions - Hidden by default (Req 1.2) */
.product-card-actions {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--animation-duration-normal) var(--easing-ease-out);
    pointer-events: none;
}

/* Product Card Actions - Visible on hover (Req 1.2) - fade-in from bottom */
.product-card:hover .product-card-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Staggered Animation for Product Cards (Req 1.3) */
.product-cards-container .product-card {
    opacity: 0;
    transform: translateY(20px);
}

.product-cards-container .product-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--animation-duration-normal) var(--easing-ease-out);
}

/* Staggered delays for product cards */
.product-cards-container .product-card:nth-child(1) { transition-delay: 0ms; }
.product-cards-container .product-card:nth-child(2) { transition-delay: 50ms; }
.product-cards-container .product-card:nth-child(3) { transition-delay: 100ms; }
.product-cards-container .product-card:nth-child(4) { transition-delay: 150ms; }
.product-cards-container .product-card:nth-child(5) { transition-delay: 200ms; }
.product-cards-container .product-card:nth-child(6) { transition-delay: 250ms; }
.product-cards-container .product-card:nth-child(7) { transition-delay: 300ms; }
.product-cards-container .product-card:nth-child(8) { transition-delay: 350ms; }
.product-cards-container .product-card:nth-child(9) { transition-delay: 400ms; }
.product-cards-container .product-card:nth-child(10) { transition-delay: 450ms; }
.product-cards-container .product-card:nth-child(11) { transition-delay: 500ms; }
.product-cards-container .product-card:nth-child(12) { transition-delay: 550ms; }

/* Reduced Motion Support for Product Cards */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card:hover {
        transform: none !important;
        transition: none !important;
    }
    
    .product-card-actions {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        pointer-events: auto !important;
    }
    
    .product-cards-container .product-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}


/* ============================================
   Gallery Viewer Styles (Req 4.1, 4.2, 4.3)
   ============================================ */

/* Main Image Crossfade (Req 4.1) */
.gallery-container .main-image,
#mainProductImage {
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out);
    will-change: opacity;
}

/* Thumbnail Active State */
.thumbnail-btn {
    transition: border-color var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--micro-interaction-duration) var(--easing-ease-out);
}

.thumbnail-btn:hover {
    transform: scale(1.05);
}

.thumbnail-btn.active,
.thumbnail-btn.border-primary {
    border-color: var(--color-primary, #3b82f6) !important;
}

/* ============================================
   Lightbox Styles (Req 4.2)
   ============================================ */

.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                visibility var(--animation-duration-normal) var(--easing-ease-out);
}

.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

/* Lightbox Content */
.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox Image Container */
.lightbox-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Lightbox Image - Zoom-in animation (Req 4.2) */
.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform var(--animation-duration-normal) var(--easing-ease-out),
                opacity var(--animation-duration-normal) var(--easing-ease-out);
    will-change: transform, opacity;
}

/* Lightbox Close Button */
.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--micro-interaction-duration) var(--easing-ease-out),
                transform var(--micro-interaction-duration) var(--easing-ease-out);
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-close .material-symbols-outlined {
    font-size: 24px;
}

/* Lightbox Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--micro-interaction-duration) var(--easing-ease-out),
                transform var(--micro-interaction-duration) var(--easing-ease-out);
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav .material-symbols-outlined {
    font-size: 28px;
}

.lightbox-prev {
    right: calc(100% + 20px);
}

.lightbox-next {
    left: calc(100% + 20px);
}

/* Lightbox Counter */
.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: inherit;
}

/* ============================================
   Lightbox Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .lightbox-content {
        width: 95%;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev {
        right: auto;
        left: 10px;
    }
    
    .lightbox-next {
        left: auto;
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .lightbox-counter {
        bottom: 20px;
    }
}

/* ============================================
   Reduced Motion Support for Gallery
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .gallery-container .main-image,
    #mainProductImage {
        transition: none !important;
    }
    
    .thumbnail-btn {
        transition: none !important;
    }
    
    .thumbnail-btn:hover {
        transform: none !important;
    }
    
    .gallery-lightbox {
        transition: none !important;
    }
    
    .lightbox-image {
        transition: none !important;
        transform: none !important;
    }
    
    .lightbox-close,
    .lightbox-nav {
        transition: none !important;
    }
    
    .lightbox-close:hover,
    .lightbox-nav:hover {
        transform: translateY(-50%) !important;
    }
}


/* ============================================
   Micro-interactions (Req 5.1, 5.2, 5.4, 5.5)
   ============================================ */

/* ============================================
   Button Hover Effects (Req 5.1)
   Scale transform and color transitions for buttons
   Duration max 200ms (Req 5.5)
   ============================================ */

/* Base button micro-interaction class */
.btn-micro,
button.btn-micro,
.btn,
button[type="submit"],
button[type="button"]:not(.lightbox-close):not(.lightbox-nav):not(.toast-close):not(.thumbnail-btn) {
    transition: transform var(--micro-interaction-duration) var(--easing-ease-out),
                background-color var(--micro-interaction-duration) var(--easing-ease-out),
                border-color var(--micro-interaction-duration) var(--easing-ease-out),
                box-shadow var(--micro-interaction-duration) var(--easing-ease-out);
    will-change: transform;
}

/* Button hover effect - subtle scale (1.02-1.05) and color transition (Req 5.1) */
.btn-micro:hover,
button.btn-micro:hover,
.btn:hover,
button[type="submit"]:hover,
button[type="button"]:not(.lightbox-close):not(.lightbox-nav):not(.toast-close):not(.thumbnail-btn):hover {
    transform: scale(1.03);
}

/* Primary button hover - enhanced effect */
.btn-primary:hover,
button.bg-primary:hover,
.bg-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
}

/* Secondary/outline button hover */
.btn-secondary:hover,
.btn-outline:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Button active state - slight press effect */
.btn-micro:active,
button.btn-micro:active,
.btn:active,
button[type="submit"]:active,
button[type="button"]:not(.lightbox-close):not(.lightbox-nav):not(.toast-close):not(.thumbnail-btn):active {
    transform: scale(0.98);
}

/* Disabled button - no hover effects */
.btn-micro:disabled,
button.btn-micro:disabled,
.btn:disabled,
button:disabled {
    transform: none !important;
    cursor: not-allowed;
    opacity: 0.6;
}


/* ============================================
   Input Focus Effects (Req 5.2)
   Glow effect with box-shadow and border color transition
   Duration max 200ms (Req 5.5)
   ============================================ */

/* Base input micro-interaction class */
.input-micro,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="url"],
textarea,
select {
    transition: border-color var(--micro-interaction-duration) var(--easing-ease-out),
                box-shadow var(--micro-interaction-duration) var(--easing-ease-out),
                background-color var(--micro-interaction-duration) var(--easing-ease-out);
}

/* Input focus effect - glow with primary color (Req 5.2) */
.input-micro:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary, #ff6600);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2), 0 0 8px rgba(255, 102, 0, 0.15);
}

/* Input focus within container (for custom input wrappers) */
.input-wrapper:focus-within {
    border-color: var(--color-primary, #ff6600);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2), 0 0 8px rgba(255, 102, 0, 0.15);
}

/* Input hover state - subtle border change */
.input-micro:hover:not(:focus),
input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="tel"]:hover:not(:focus),
input[type="search"]:hover:not(:focus),
input[type="url"]:hover:not(:focus),
textarea:hover:not(:focus),
select:hover:not(:focus) {
    border-color: rgba(255, 102, 0, 0.5);
}

/* Input error state */
.input-error,
input.error,
input:invalid:not(:placeholder-shown) {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2), 0 0 8px rgba(220, 53, 69, 0.15) !important;
}

/* Input success state */
.input-success,
input.success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2), 0 0 8px rgba(40, 167, 69, 0.15) !important;
}

/* Disabled input - no focus effects */
.input-micro:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none !important;
}


/* ============================================
   Loading States - Skeleton Components (Req 6.1, 6.2)
   ============================================ */

/* Base Skeleton Styles */
.skeleton {
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

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

/* Skeleton text line */
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text:last-child {
    width: 70%;
}

/* Skeleton title */
.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
    border-radius: 4px;
}

/* Skeleton image placeholder */
.skeleton-image {
    width: 100%;
    padding-bottom: 100%; /* 1:1 aspect ratio */
    border-radius: 8px;
}

.skeleton-image-rect {
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border-radius: 8px;
}

/* Skeleton button */
.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

/* Skeleton avatar */
.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* Skeleton badge */
.skeleton-badge {
    height: 24px;
    width: 60px;
    border-radius: 12px;
}

/* ============================================
   Skeleton Product Card (Req 6.1)
   ============================================ */

.skeleton-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.skeleton-product-card .skeleton-image {
    margin-bottom: 16px;
}

.skeleton-product-card .skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-product-card .skeleton-price {
    height: 24px;
    width: 80px;
    margin-top: 8px;
    border-radius: 4px;
}

.skeleton-product-card .skeleton-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.skeleton-product-card .skeleton-action-btn {
    height: 36px;
    flex: 1;
    border-radius: 8px;
}

/* ============================================
   Skeleton Product Detail (Req 6.1)
   ============================================ */

.skeleton-product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .skeleton-product-detail {
        grid-template-columns: 1fr;
    }
}

.skeleton-product-detail .skeleton-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-product-detail .skeleton-main-image {
    width: 100%;
    padding-bottom: 100%;
    border-radius: 12px;
}

.skeleton-product-detail .skeleton-thumbnails {
    display: flex;
    gap: 8px;
}

.skeleton-product-detail .skeleton-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    flex-shrink: 0;
}

.skeleton-product-detail .skeleton-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-product-detail .skeleton-product-title {
    height: 32px;
    width: 80%;
    border-radius: 4px;
}

.skeleton-product-detail .skeleton-product-price {
    height: 28px;
    width: 120px;
    border-radius: 4px;
}

.skeleton-product-detail .skeleton-description {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-product-detail .skeleton-description .skeleton-text {
    height: 14px;
}

.skeleton-product-detail .skeleton-description .skeleton-text:nth-child(1) {
    width: 100%;
}

.skeleton-product-detail .skeleton-description .skeleton-text:nth-child(2) {
    width: 90%;
}

.skeleton-product-detail .skeleton-description .skeleton-text:nth-child(3) {
    width: 75%;
}

.skeleton-product-detail .skeleton-specs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.skeleton-product-detail .skeleton-spec-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.skeleton-product-detail .skeleton-spec-label {
    height: 14px;
    width: 80px;
    border-radius: 4px;
}

.skeleton-product-detail .skeleton-spec-value {
    height: 14px;
    width: 100px;
    border-radius: 4px;
}

.skeleton-product-detail .skeleton-add-to-cart {
    height: 48px;
    width: 100%;
    border-radius: 8px;
    margin-top: 16px;
}

/* ============================================
   Skeleton to Content Transition (Req 6.2)
   ============================================ */

/* Container for skeleton/content transition */
.loading-container {
    position: relative;
}

/* Skeleton wrapper - visible during loading */
.skeleton-wrapper {
    opacity: 1;
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out);
}

.skeleton-wrapper.is-hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* Content wrapper - hidden during loading */
.content-wrapper {
    opacity: 0;
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out);
}

.content-wrapper.is-visible {
    opacity: 1;
}

/* Alternative: Skeleton fade-out, content fade-in */
.skeleton-fade-out {
    animation: skeletonFadeOut var(--animation-duration-normal) var(--easing-ease-out) forwards;
}

@keyframes skeletonFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.content-fade-in {
    animation: contentFadeIn var(--animation-duration-normal) var(--easing-ease-out) forwards;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   Button Loading State (Req 6.3)
   ============================================ */

/* Button with loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpinner 0.8s linear infinite;
}

/* Dark button spinner */
.btn-loading.btn-light::after,
.btn-loading.btn-outline::after {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #333;
}

@keyframes btnSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* Button disabled state during loading */
.btn-loading,
.btn[disabled],
button[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Inline spinner for buttons */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpinner 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.btn-light .btn-spinner,
.btn-outline .btn-spinner {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #333;
}

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                visibility var(--animation-duration-normal) var(--easing-ease-out);
}

.loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--color-primary, #ff6600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   Reduced Motion Support for Loading States (Req 9.2)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none !important;
        background: #e8e8e8 !important;
    }
    
    .skeleton-wrapper,
    .content-wrapper {
        transition: none !important;
    }
    
    .skeleton-fade-out,
    .content-fade-in {
        animation: none !important;
    }
    
    .skeleton-fade-out {
        opacity: 0;
        visibility: hidden;
    }
    
    .content-fade-in {
        opacity: 1;
    }
    
    .btn-loading::after,
    .btn-spinner,
    .loading-spinner {
        animation: none !important;
    }
    
    .loading-overlay {
        transition: none !important;
    }
}


/* ============================================
   Icon Hover Animations (Req 5.4)
   Rotate or bounce for icons
   Duration max 200ms (Req 5.5)
   ============================================ */

/* Base icon micro-interaction class */
.icon-micro,
.material-symbols-outlined,
.icon,
i.fa,
i.fas,
i.far,
i.fab {
    transition: transform var(--micro-interaction-duration) var(--easing-ease-out),
                color var(--micro-interaction-duration) var(--easing-ease-out);
    display: inline-block; /* Required for transform to work */
}

/* Icon hover - subtle scale effect (Req 5.4) */
.icon-micro:hover,
a:hover .material-symbols-outlined,
button:hover .material-symbols-outlined,
.icon-hover:hover .material-symbols-outlined,
a:hover .icon,
button:hover .icon {
    transform: scale(1.15);
}

/* Icon rotate on hover */
.icon-rotate:hover,
.icon-rotate:hover .material-symbols-outlined,
.icon-rotate:hover .icon {
    transform: rotate(15deg);
}

/* Icon bounce on hover */
.icon-bounce:hover,
.icon-bounce:hover .material-symbols-outlined,
.icon-bounce:hover .icon {
    animation: iconBounce var(--micro-interaction-duration) var(--easing-bounce);
}

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

/* Icon shake on hover (for attention) */
.icon-shake:hover,
.icon-shake:hover .material-symbols-outlined,
.icon-shake:hover .icon {
    animation: iconShake var(--micro-interaction-duration) var(--easing-ease-out);
}

@keyframes iconShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    75% {
        transform: translateX(3px);
    }
}

/* Cart icon specific hover */
.cart-icon:hover .material-symbols-outlined,
[data-cart-icon]:hover .material-symbols-outlined {
    transform: scale(1.15);
}

/* Heart/favorite icon hover */
.favorite-icon:hover .material-symbols-outlined,
.wishlist-icon:hover .material-symbols-outlined {
    transform: scale(1.2);
    color: #e74c3c;
}

/* Search icon hover */
.search-icon:hover .material-symbols-outlined {
    transform: scale(1.1) rotate(-10deg);
}

/* Arrow icons hover */
.arrow-icon:hover .material-symbols-outlined,
.nav-arrow:hover .material-symbols-outlined {
    transform: translateX(3px);
}

/* RTL arrow adjustment */
[dir="rtl"] .arrow-icon:hover .material-symbols-outlined,
[dir="rtl"] .nav-arrow:hover .material-symbols-outlined {
    transform: translateX(-3px);
}


/* ============================================
   Reduced Motion Support for Micro-interactions (Req 9.2)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    /* Disable button hover effects */
    .btn-micro:hover,
    button.btn-micro:hover,
    .btn:hover,
    button[type="submit"]:hover,
    button[type="button"]:hover,
    .btn-primary:hover,
    button.bg-primary:hover,
    .bg-primary:hover,
    .btn-secondary:hover,
    .btn-outline:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .btn-micro:active,
    button.btn-micro:active,
    .btn:active,
    button[type="submit"]:active,
    button[type="button"]:active {
        transform: none !important;
    }
    
    /* Disable input focus glow animation */
    .input-micro:focus,
    input:focus,
    textarea:focus,
    select:focus {
        transition: none !important;
    }
    
    /* Disable icon hover animations */
    .icon-micro:hover,
    a:hover .material-symbols-outlined,
    button:hover .material-symbols-outlined,
    .icon-hover:hover .material-symbols-outlined,
    a:hover .icon,
    button:hover .icon,
    .icon-rotate:hover,
    .icon-bounce:hover,
    .icon-shake:hover,
    .cart-icon:hover .material-symbols-outlined,
    .favorite-icon:hover .material-symbols-outlined,
    .wishlist-icon:hover .material-symbols-outlined,
    .search-icon:hover .material-symbols-outlined,
    .arrow-icon:hover .material-symbols-outlined,
    .nav-arrow:hover .material-symbols-outlined {
        transform: none !important;
        animation: none !important;
    }
}



/* ============================================
   Hero Slider Animations (Req 7.1, 7.2, 7.3, 7.4, 7.5)
   ============================================ */

/* Hero Slider Container */
.hero-slider {
    position: relative;
    overflow: hidden;
}

/* Slides Wrapper */
.hero-slider .slides-wrapper {
    position: relative;
    width: 100%;
}

/* Individual Slide */
.hero-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--animation-duration-slow) var(--easing-ease-out),
                visibility var(--animation-duration-slow) var(--easing-ease-out);
    will-change: opacity;
}

.hero-slider .slide.active {
    position: relative;
    opacity: 1;
    visibility: visible;
}

/* Parallax Fade Effect for Slide Image (Req 7.1) */
.hero-slider .slide-image {
    transition: transform var(--animation-duration-slow) var(--easing-ease-out),
                opacity var(--animation-duration-slow) var(--easing-ease-out);
    will-change: transform, opacity;
}

.hero-slider .slide.active .slide-image {
    animation: heroParallaxFade var(--animation-duration-slow) var(--easing-ease-out) forwards;
}

@keyframes heroParallaxFade {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered Text Animations (Req 7.2) */
.hero-slider .slide-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--animation-duration-normal) var(--easing-ease-out);
    will-change: opacity, transform;
}

.hero-slider .slide.active .slide-content {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for text elements */
.hero-slider .slide.active .slide-badge {
    animation: heroSlideUp var(--animation-duration-normal) var(--easing-ease-out) forwards;
    animation-delay: 100ms;
    opacity: 0;
}

.hero-slider .slide.active .slide-title {
    animation: heroSlideUp var(--animation-duration-normal) var(--easing-ease-out) forwards;
    animation-delay: 200ms;
    opacity: 0;
}

.hero-slider .slide.active .slide-description {
    animation: heroSlideUp var(--animation-duration-normal) var(--easing-ease-out) forwards;
    animation-delay: 300ms;
    opacity: 0;
}

.hero-slider .slide.active .slide-cta {
    animation: heroSlideUp var(--animation-duration-normal) var(--easing-ease-out) forwards;
    animation-delay: 400ms;
    opacity: 0;
}

@keyframes heroSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation Dots (Req 7.4) */
.hero-slider .slider-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hero-slider .slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: background var(--animation-duration-normal) var(--easing-ease-out),
                width var(--animation-duration-normal) var(--easing-ease-out),
                transform var(--micro-interaction-duration) var(--easing-ease-out);
}

.hero-slider .slider-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.hero-slider .slider-dot.active {
    background: var(--color-primary, #ff6600);
    width: 32px;
    border-radius: 6px;
}

/* Navigation Arrows */
.hero-slider .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--micro-interaction-duration) var(--easing-ease-out),
                transform var(--micro-interaction-duration) var(--easing-ease-out);
    z-index: 30;
}

.hero-slider .slider-nav:hover {
    background: var(--color-primary, #ff6600);
    transform: translateY(-50%) scale(1.1);
}

.hero-slider .slider-prev {
    right: 16px;
}

.hero-slider .slider-next {
    left: 16px;
}

/* Auto-play Progress Indicator - Using scaleX for GPU acceleration (Req 9.3) */
.hero-slider .autoplay-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--color-primary, #ff6600);
    width: 100%;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform linear;
    z-index: 40;
}

.hero-slider.autoplay-paused .autoplay-progress {
    animation-play-state: paused;
}

/* Swipe Indicator (Mobile) */
.hero-slider .swipe-indicator {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    animation: swipeHint 2s ease-in-out infinite;
}

@media (max-width: 768px) {
    .hero-slider .swipe-indicator {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .hero-slider .slider-nav {
        width: 40px;
        height: 40px;
    }
    
    .hero-slider .slider-prev {
        right: 8px;
    }
    
    .hero-slider .slider-next {
        left: 8px;
    }
}

@keyframes swipeHint {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(-50%);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateX(-10px);
    }
}

/* ============================================
   Reduced Motion Support for Hero Slider (Req 9.2)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .hero-slider .slide {
        transition: none !important;
    }
    
    .hero-slider .slide.active .slide-image {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
    
    .hero-slider .slide.active .slide-badge,
    .hero-slider .slide.active .slide-title,
    .hero-slider .slide.active .slide-description,
    .hero-slider .slide.active .slide-cta {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
    
    .hero-slider .slide-content {
        transition: none !important;
        opacity: 1;
        transform: none;
    }
    
    .hero-slider .slider-dot {
        transition: none !important;
    }
    
    .hero-slider .slider-nav {
        transition: none !important;
    }
    
    .hero-slider .slider-nav:hover {
        transform: translateY(-50%) !important;
    }
    
    .hero-slider .autoplay-progress {
        display: none;
    }
    
    .hero-slider .swipe-indicator {
        animation: none !important;
    }
}


/* ============================================
   Filter Animations
   Requirements: 8.1, 8.2, 8.3
   ============================================ */

/**
 * Filter Animation Keyframes
 */

/* Filter Fade Out - For non-matching products (Req 8.1) */
@keyframes filterFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Filter Fade In - For matching products (Req 8.2) */
@keyframes filterFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Stagger Animation */
@keyframes filterStaggerIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/**
 * Filter Product Base Styles
 */
.filter-product {
    /* Initial state for animation */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--animation-duration-normal) var(--easing-default),
                transform var(--animation-duration-normal) var(--easing-default);
    will-change: opacity, transform;
}

/* Visible state after animation */
.filter-product.filter-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade out state for non-matching products (Req 8.1) */
.filter-product.filter-fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/**
 * Filter Animation Utility Classes
 */

/* Apply fade-out animation */
.filter-animate-out {
    animation: filterFadeOut 200ms var(--easing-default) forwards;
}

/* Apply fade-in animation */
.filter-animate-in {
    animation: filterFadeIn 300ms var(--easing-default) forwards;
}

/* Staggered animation with CSS custom property for delay */
.filter-stagger {
    animation: filterStaggerIn 300ms var(--easing-default) forwards;
    animation-delay: var(--stagger-delay, 0ms);
}

/**
 * FLIP Animation Support (Req 8.3)
 * These styles support the JavaScript FLIP technique for smooth reordering
 */
.filter-flip-active {
    /* During FLIP animation, disable pointer events */
    pointer-events: none;
}

.filter-flip-transition {
    transition: transform var(--animation-duration-slow) var(--easing-default);
    will-change: transform;
}

/**
 * Sort Reorder Animation (Req 8.3)
 */
.sort-reorder {
    transition: transform 400ms var(--easing-default);
    will-change: transform;
}

/**
 * Products Grid Animation Container
 */
#productsGrid {
    /* Ensure grid maintains layout during animations */
    position: relative;
}

#productsGrid.filter-animating {
    /* Prevent layout shifts during animation */
    min-height: var(--grid-min-height, auto);
}

/**
 * Filter Loading State
 */
.filter-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 200ms var(--easing-default);
}

/* ============================================
   Filter Animations - Reduced Motion Support
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .filter-product {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
    
    .filter-product.filter-visible {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .filter-product.filter-fade-out {
        opacity: 0 !important;
        transform: none !important;
    }
    
    .filter-animate-out,
    .filter-animate-in,
    .filter-stagger {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .filter-flip-transition,
    .sort-reorder {
        transition: none !important;
    }
}


/* ============================================
   Mobile-Specific Performance Optimizations (Req 9.1)
   Simplifies animations on mobile devices for better performance
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animation durations on mobile */
    :root {
        --animation-duration-fast: 100ms;
        --animation-duration-normal: 200ms;
        --animation-duration-slow: 300ms;
        --micro-interaction-duration: 150ms;
    }
    
    /* Simplify product card hover effects */
    .product-card {
        will-change: auto; /* Remove will-change on mobile to save memory */
    }
    
    .product-card:hover {
        transform: scale(1.02); /* Smaller scale on mobile */
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }
    
    .product-card-actions {
        will-change: auto;
        /* Always show actions on mobile for better touch accessibility */
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    /* Simplify scroll animations */
    .scroll-animate {
        will-change: auto;
        transform: translateY(10px); /* Smaller movement */
    }
    
    .scroll-animate-left,
    .scroll-animate-right {
        transform: translateX(15px); /* Smaller horizontal movement */
    }
    
    /* Disable complex hover effects on touch devices */
    .btn-micro:hover,
    .btn:hover,
    button[type="submit"]:hover,
    button[type="button"]:hover {
        transform: none; /* No scale on mobile hover */
    }
    
    .btn-micro:active,
    .btn:active,
    button[type="submit"]:active,
    button[type="button"]:active {
        transform: scale(0.98); /* Keep active state feedback */
    }
    
    /* Simplify icon animations */
    .icon-micro:hover,
    a:hover .material-symbols-outlined,
    button:hover .material-symbols-outlined {
        transform: none;
    }
    
    /* Simplify gallery lightbox */
    .lightbox-image {
        will-change: auto;
    }
    
    /* Simplify hero slider */
    .hero-slider .slide {
        will-change: auto;
    }
    
    .hero-slider .slide-image {
        will-change: auto;
    }
    
    .hero-slider .slide.active .slide-image {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    /* Simplify staggered text animations */
    .hero-slider .slide.active .slide-badge,
    .hero-slider .slide.active .slide-title,
    .hero-slider .slide.active .slide-description,
    .hero-slider .slide.active .slide-cta {
        animation-duration: 200ms;
        animation-delay: 0ms !important; /* Remove stagger delay on mobile */
    }
    
    /* Simplify filter animations */
    .filter-product {
        will-change: auto;
        transform: translateY(10px);
    }
    
    .filter-animate-out {
        animation-duration: 150ms;
    }
    
    .filter-animate-in {
        animation-duration: 200ms;
    }
    
    .filter-stagger {
        animation-duration: 200ms;
        animation-delay: 0ms !important; /* Remove stagger on mobile */
    }
    
    /* Simplify sort reorder */
    .sort-reorder {
        transition-duration: 250ms;
        will-change: auto;
    }
    
    /* Simplify skeleton animations */
    .skeleton {
        will-change: auto;
        animation-duration: 2s; /* Slower shimmer for less CPU usage */
    }
    
    /* Simplify toast notifications */
    .toast-notification {
        will-change: auto;
        /* Position at bottom on mobile for better UX */
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    /* Disable flying cart animation on mobile (handled in JS) */
    .flying-cart-item {
        display: none !important;
    }
    
    /* Simplify cart icon bounce */
    .cart-icon-bounce {
        animation-duration: 200ms;
    }
}

/* Extra small devices - further simplifications */
@media (max-width: 480px) {
    :root {
        --animation-duration-fast: 80ms;
        --animation-duration-normal: 150ms;
        --animation-duration-slow: 250ms;
        --micro-interaction-duration: 100ms;
    }
    
    /* Disable most transform animations on very small devices */
    .scroll-animate,
    .scroll-animate-fade,
    .scroll-animate-scale,
    .scroll-animate-left,
    .scroll-animate-right {
        transform: none;
        opacity: 0;
    }
    
    .scroll-animate.is-visible,
    .scroll-animate-fade.is-visible,
    .scroll-animate-scale.is-visible,
    .scroll-animate-left.is-visible,
    .scroll-animate-right.is-visible {
        opacity: 1;
        transform: none;
    }
    
    /* Disable product card scale on very small devices */
    .product-card:hover {
        transform: none;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    }
}

/* Touch device detection - disable hover animations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover-based animations on touch devices */
    .product-card:hover {
        transform: none;
    }
    
    .product-card:hover .product-card-image img {
        transform: none;
    }
    
    .btn-micro:hover,
    .btn:hover,
    button:hover {
        transform: none;
    }
    
    .icon-micro:hover,
    a:hover .material-symbols-outlined,
    button:hover .material-symbols-outlined {
        transform: none;
    }
    
    .thumbnail-btn:hover {
        transform: none;
    }
    
    /* Keep active states for touch feedback */
    .product-card:active {
        transform: scale(0.98);
    }
    
    .btn-micro:active,
    .btn:active,
    button:active {
        transform: scale(0.98);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .skeleton {
        background: #ccc;
        animation: none;
    }
    
    .skeleton::after {
        display: none;
    }
}

/* Battery saver / low power mode hint */
@media (prefers-reduced-data: reduce) {
    /* Disable non-essential animations when data saving is enabled */
    .animate-shimmer,
    .skeleton::after {
        animation: none !important;
    }
    
    .hero-slider .autoplay-progress {
        display: none;
    }
}
