/**
 * Livora Enhanced CSS
 * Modern styling with animations and transitions
 * Version: 4.0.0 Enhanced
 */

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

@keyframes livoraFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes livoraFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes livoraSlideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes livoraBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes livoraPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes livoraShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes livoraSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Animation Classes */
.livora-animated {
    animation: livoraFadeInUp 0.6s ease-out forwards;
}

.livora-fade-in {
    opacity: 0;
    animation: livoraFadeIn 0.6s ease-out forwards;
}

.livora-stagger-animate {
    opacity: 0;
    animation: livoraFadeInUp 0.6s ease-out forwards;
}

.livora-wishlist-bounce {
    animation: livoraBounce 0.6s ease;
}

/* ============================================
   PRODUCT CARDS ENHANCEMENTS
   ============================================ */

.livora-product-card,
.livora-brand-product-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.livora-product-card:hover,
.livora-brand-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.livora-product-card.livora-card-hover {
    transform: translateY(-8px) scale(1.02);
}

/* Quick View Button */
.livora-quick-view-btn {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    background: rgba(34, 113, 177, 0.95);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.livora-product-card:hover .livora-quick-view-btn,
.livora-brand-product-card:hover .livora-quick-view-btn {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.livora-quick-view-btn:hover {
    background: rgba(19, 94, 150, 1);
    transform: translateX(-50%) translateY(0) scale(1.05);
}

/* Wishlist Button */
.livora-wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    z-index: 10;
    backdrop-filter: blur(10px);
    opacity: 0;
}

.livora-product-card:hover .livora-wishlist-btn {
    opacity: 1;
}

.livora-wishlist-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.livora-wishlist-btn.active {
    color: #d63638;
}

/* Compare Button */
.livora-compare-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    z-index: 10;
    backdrop-filter: blur(10px);
    opacity: 0;
}

.livora-product-card:hover .livora-compare-btn {
    opacity: 1;
}

.livora-compare-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.livora-compare-btn.active {
    color: #2271b1;
    background: rgba(34, 113, 177, 0.1);
}

/* Image Overlay Effects */
.livora-product-image-wrapper {
    position: relative;
    overflow: hidden;
}

.livora-product-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.livora-product-card:hover .livora-product-image-wrapper::after {
    opacity: 1;
}

/* Loading States */
.livora-product-image {
    transition: opacity 0.3s, transform 0.3s;
}

.livora-product-image:not(.loaded) {
    opacity: 0;
    filter: blur(10px);
}

.livora-product-image.loaded {
    opacity: 1;
    filter: blur(0);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: livoraSpin 0.6s linear infinite;
    margin-left: 8px;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.livora-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 400px;
    animation: livoraSlideInRight 0.3s ease-out;
    display: none;
}

.livora-notification-success {
    border-right: 4px solid #00a32a;
}

.livora-notification-error {
    border-right: 4px solid #d63638;
}

.livora-notification-info {
    border-right: 4px solid #2271b1;
}

.livora-notification-warning {
    border-right: 4px solid #f0b849;
}

/* ============================================
   FILTER ENHANCEMENTS
   ============================================ */

.livora-filter-group {
    transition: all 0.3s;
}

.livora-filter-group.livora-filter-active {
    background: rgba(34, 113, 177, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.livora-filter-checkbox input:checked + label,
.livora-filter-radio input:checked + label {
    color: #2271b1;
    font-weight: 600;
}

.livora-filter-options {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.livora-filter-options::-webkit-scrollbar {
    width: 6px;
}

.livora-filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.livora-filter-options::-webkit-scrollbar-thumb {
    background: #2271b1;
    border-radius: 3px;
}

.livora-filter-group h4.collapsed::after {
    content: ' ▼';
}

.livora-filter-group h4:not(.collapsed)::after {
    content: ' ▲';
}

/* ============================================
   BUTTON ENHANCEMENTS
   ============================================ */

.livora-add-to-cart-btn,
.button.add_to_cart_button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.livora-add-to-cart-btn::before,
.button.add_to_cart_button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.livora-add-to-cart-btn:active::before,
.button.add_to_cart_button:active::before {
    width: 300px;
    height: 300px;
}

.livora-add-to-cart-btn.processing,
.button.add_to_cart_button.processing {
    pointer-events: none;
    opacity: 0.7;
}

.livora-add-to-cart-btn.added,
.button.add_to_cart_button.added {
    background: #00a32a;
    animation: livoraPulse 0.6s ease;
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */

.livora-back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: rgba(34, 113, 177, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    display: none;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.livora-back-to-top:hover {
    background: rgba(19, 94, 150, 1);
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.livora-back-to-top.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   TOOLTIPS
   ============================================ */

.livora-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 10001;
    pointer-events: none;
    display: none;
}

.livora-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* ============================================
   FORM ENHANCEMENTS
   ============================================ */

.livora-form-group input.error,
.livora-form-group textarea.error,
.livora-form-group select.error {
    border-color: #d63638;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.1);
}

.error-message {
    display: block;
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
    animation: livoraFadeIn 0.3s;
}

/* ============================================
   LOADING STATES
   ============================================ */

.livora-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.livora-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: livoraSpin 0.8s linear infinite;
}

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    .livora-back-to-top {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .livora-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .livora-quick-view-btn {
        bottom: 10px;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .livora-product-card:hover {
        transform: translateY(-4px);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.livora-product-card:focus,
.livora-filter-btn:focus,
.livora-add-to-cart-btn:focus {
    outline: 3px solid #2271b1;
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .livora-back-to-top,
    .livora-quick-view-btn,
    .livora-wishlist-btn,
    .livora-compare-btn {
        display: none !important;
    }
    
    .livora-product-card {
        break-inside: avoid;
    }
}

