/*
 * Product Cards Interactions CSS
 * Styles for JavaScript interactions and animations
 */

/* ==========================================================================
   Quick View Modal Styles
   ========================================================================== */

.mkdf-quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mkdf-quick-view-modal.mkdf-visible {
    opacity: 1;
    visibility: visible;
}

.mkdf-quick-view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.mkdf-quick-view-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.mkdf-quick-view-modal.mkdf-visible .mkdf-quick-view-content {
    transform: translate(-50%, -50%) scale(1);
}

.mkdf-quick-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.mkdf-quick-view-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    font-family: "Rajdhani", sans-serif;
}

.mkdf-quick-view-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mkdf-quick-view-close:hover {
    background: #eeb332;
    color: white;
    transform: rotate(90deg);
}

.mkdf-quick-view-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.mkdf-quick-view-loading {
    text-align: center;
    padding: 40px;
}

.mkdf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #eeb332;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.mkdf-quick-view-footer {
    padding: 25px 30px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    background: #f8f9fa;
}

.mkdf-quick-view-footer .mkdf-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #eeb332;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mkdf-quick-view-footer .mkdf-btn:hover {
    background: #d4a429;
    transform: translateY(-2px);
    color: white;
}

/* ==========================================================================
   Quick View Button Styles
   ========================================================================== */

.mkdf-quick-view-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.mkdf-quick-view-btn i {
    font-size: 1.1rem;
}

.mkdf-quick-view-btn:hover {
    background: rgba(238, 179, 50, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.mkdf-quick-view-btn.mkdf-loading {
    pointer-events: none;
}

.mkdf-quick-view-btn.mkdf-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

/* ==========================================================================
   Add to Cart Animations
   ========================================================================== */

.mkdf-adding-to-cart {
    pointer-events: none;
}

.mkdf-adding-to-cart .add_to_cart_button {
    position: relative;
    overflow: hidden;
}

.mkdf-adding-to-cart .add_to_cart_button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

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

.mkdf-add-to-cart-success {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.mkdf-add-to-cart-success.mkdf-visible {
    opacity: 1;
    transform: translateY(0);
}

.mkdf-add-to-cart-success i {
    font-size: 1rem;
}

/* ==========================================================================
   Hover Effects and Animations
   ========================================================================== */

.mkdf-hovered {
    transform: translateY(-8px) scale(1.02) !important;
}

.mkdf-touch-hover {
    transform: translateY(-4px) scale(1.01) !important;
}

.mkdf-animate {
    animation: elementFadeIn 0.3s ease forwards;
}

@keyframes elementFadeIn {
    from {
        opacity: 0.7;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mkdf-card-visible {
    animation: cardSlideIn 0.6s ease forwards;
}

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

.mkdf-in-viewport {
    animation: cardParallax 0.3s ease forwards;
}

@keyframes cardParallax {
    to {
        transform: translateY(-2px);
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.mkdf-loading {
    position: relative;
    pointer-events: none;
}

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

/* ==========================================================================
   Lazy Loading Styles
   ========================================================================== */

.mkdf-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mkdf-loaded {
    opacity: 1;
}

.mkdf-image-loaded {
    animation: imageLoadFade 0.5s ease;
}

@keyframes imageLoadFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   Responsive Design for Interactions
   ========================================================================== */

@media (max-width: 768px) {
    .mkdf-quick-view-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .mkdf-quick-view-header {
        padding: 20px 25px;
    }
    
    .mkdf-quick-view-header h3 {
        font-size: 1.3rem;
    }
    
    .mkdf-quick-view-body {
        padding: 25px;
        max-height: 70vh;
    }
    
    .mkdf-quick-view-footer {
        padding: 20px 25px;
    }
    
    .mkdf-quick-view-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .mkdf-quick-view-btn span {
        display: none;
    }
    
    .mkdf-add-to-cart-success {
        top: 15px;
        right: 15px;
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .mkdf-quick-view-content {
        width: 98%;
        border-radius: 15px;
    }
    
    .mkdf-quick-view-header {
        padding: 15px 20px;
    }
    
    .mkdf-quick-view-body {
        padding: 20px;
        max-height: 75vh;
    }
    
    .mkdf-quick-view-footer {
        padding: 15px 20px;
    }
    
    .mkdf-quick-view-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus states for keyboard navigation */
.mkdf-quick-view-btn:focus {
    outline: 2px solid #eeb332;
    outline-offset: 2px;
}

.mkdf-quick-view-close:focus {
    outline: 2px solid #2c3e50;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mkdf-quick-view-modal,
    .mkdf-quick-view-content,
    .mkdf-quick-view-btn,
    .mkdf-add-to-cart-success,
    .mkdf-ripple,
    .mkdf-spinner {
        animation: none !important;
        transition: none !important;
    }
    
    .mkdf-hovered,
    .mkdf-touch-hover {
        transform: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mkdf-quick-view-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .mkdf-quick-view-btn {
        background: rgba(0, 0, 0, 0.95);
        border: 2px solid white;
    }
    
    .mkdf-add-to-cart-success {
        background: #000;
        border: 2px solid #fff;
        color: #fff;
    }
} 