/**
 * WowMart Toolkit Base Styles
 * Common utilities and variables
 */

:root {
    --toolkit-primary: #d32f2f;
    --toolkit-text: #333333;
    --toolkit-bg: #ffffff;
    --toolkit-border: #e0e0e0;
    --toolkit-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --toolkit-radius: 8px;
    --toolkit-transition: all 0.2s ease;
}

/* Base touch optimization */
.toolkit-touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ripple effect utility */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.toolkit-ripple {
    position: relative;
    overflow: hidden;
}

.toolkit-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.toolkit-ripple:active::after {
    width: 100px;
    height: 100px;
}

/* Loading spinner */
.toolkit-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--toolkit-border);
    border-top-color: var(--toolkit-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton loader */
.toolkit-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Fade transitions */
.toolkit-fade-enter {
    opacity: 0;
}

.toolkit-fade-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.toolkit-fade-exit {
    opacity: 1;
}

.toolkit-fade-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Slide up animation */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toolkit-slide-up {
    animation: slideUp 0.3s ease;
}

/* Mobile-specific utilities */
@media (max-width: 768px) {
    .toolkit-hide-mobile {
        display: none !important;
    }
    
    .toolkit-full-width-mobile {
        width: 100% !important;
    }
    
    .toolkit-center-mobile {
        text-align: center !important;
    }
}

/* Desktop-specific utilities */
@media (min-width: 769px) {
    .toolkit-hide-desktop {
        display: none !important;
    }
}

/* Accessibility */
.toolkit-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.toolkit-focus-visible:focus-visible {
    outline: 2px solid var(--toolkit-primary);
    outline-offset: 2px;
}

/* Disable animations on reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode utilities */
@media (prefers-color-scheme: dark) {
    :root {
        --toolkit-bg: #1a1a1a;
        --toolkit-text: #e0e0e0;
        --toolkit-border: #404040;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --toolkit-border: currentColor;
    }
}

/* Print styles */
@media print {
    .bottom-navigation,
    .mobile-filter-button,
    .mobile-search-overlay,
    .mobile-filter-sheet {
        display: none !important;
    }
}
