/**
 * Product Cards Styles - Hair Beauty Theme
 * Traditional clean design without glassmorphism
 */

/* ========================================
   PRODUCT GRID LAYOUT
======================================== */
.woocommerce ul.products,
.elementor-widget-woocommerce-products ul.products,
.elementor-widget-archive-products ul.products,
.elementor-element ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ========================================
   PRODUCT CARD BASE
======================================== */
.zhenvo-product-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.zhenvo-product-card {
    background: radial-gradient(50% 50% at 50% 50%, #fff 28.85%, #e7d6c4);
    border-radius: 20px;
    padding: 20px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 52vh;
    min-height: 560px;
    border: 1px solid #f0f0f0;
}

.zhenvo-product-card:hover {
    transform: translateY(-5px);
    border-color: #e0e0e0;
}

/* ========================================
   PRODUCT IMAGE CONTAINER
======================================== */
.zhenvo-product-image-container {
    position: relative;
    border-radius: 12px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    overflow: hidden;
    margin-bottom: 20px;
    flex: 1;
}

.zhenvo-product-image {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zhenvo-product-image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 30px;
    box-sizing: border-box;
}

.zhenvo-product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
    transition: transform 0.3s ease;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}



/* ========================================
   CATEGORY BADGE
======================================== */
.zhenvo-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #8B4513;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 15;
    font-family: 'Instrument Sans', sans-serif;
}

/* ========================================
   PRODUCT INFO - BELOW IMAGE
======================================== */
.zhenvo-product-info-section {
    position: relative;
    margin-top: auto;
}

.zhenvo-product-title a {
    color: inherit;
    text-decoration: none;
}

.zhenvo-product-title a:hover {
    color: #8B4513;
    text-decoration: none;
}

/* Product Details */
.zhenvo-product-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 0;
}

.zhenvo-product-title {
    font-size: 18px;
    letter-spacing: -0.03em;
    line-height: 1.3;
    font-family: 'Instrument Sans', sans-serif;
    color: #333;
    margin: 0;
    font-weight: 500;
    text-transform: capitalize;
    flex: 1;
}

.zhenvo-product-price {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #8B4513;
    flex-shrink: 0;
    text-align: right;
}

.zhenvo-product-price .woocommerce-Price-amount {
    color: inherit;
}

/* Product Details - Hide on hover */
.zhenvo-product-details {
    transition: all 0.2s ease;
}

.zhenvo-product-card:hover .zhenvo-product-details {
    opacity: 0;
    transform: translateY(-5px);
}

/* ========================================
   ADD TO CART BUTTON
======================================== */
.zhenvo-add-to-cart-overlay {
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #8B4513;
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease 0.1s;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.zhenvo-product-card:hover .zhenvo-add-to-cart-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.zhenvo-add-to-cart-overlay:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(139, 69, 19, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.15);
    color: #6d3410;
}

.zhenvo-add-to-cart-overlay svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.zhenvo-add-to-cart-overlay:hover svg {
    transform: scale(1.1);
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 1200px) {
    .woocommerce ul.products,
    .elementor-widget-woocommerce-products ul.products,
    .elementor-widget-archive-products ul.products,
    .elementor-element ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 25px !important;
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products,
    .elementor-widget-woocommerce-products ul.products,
    .elementor-widget-archive-products ul.products,
    .elementor-element ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .zhenvo-product-card {
        padding: 15px;
        min-height: 280px;
    }

    .zhenvo-product-image-container {
        height: 200px;
        margin-bottom: 15px;
    }

    .zhenvo-product-title {
        font-size: 16px;
    }

    .zhenvo-product-price {
        font-size: 16px;
    }

    /* Mobile cart button - always visible as round icon */
    .zhenvo-add-to-cart-overlay {
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        width: 52px !important;
        height: 52px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        right: 15px !important;
        left: auto !important;
        bottom: 15px !important;
        background: #f8b060 !important;
        color: white !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 52px !important;
        box-shadow: 0 6px 20px rgba(248, 176, 96, 0.4) !important;
    }

    .zhenvo-add-to-cart-overlay span {
        display: none !important;
    }

    .zhenvo-add-to-cart-overlay svg {
        width: 24px !important;
        height: 24px !important;
        stroke-width: 2.5 !important;
        stroke: white !important;
    }

    .zhenvo-add-to-cart-overlay:hover {
        transform: scale(1.08) !important;
        background: #e6a054 !important;
        box-shadow: 0 8px 25px rgba(248, 176, 96, 0.5) !important;
    }

    /* Don't hide product details on mobile */
    .zhenvo-product-card:hover .zhenvo-product-details {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    .elementor-widget-woocommerce-products ul.products,
    .elementor-widget-archive-products ul.products,
    .elementor-element ul.products {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .zhenvo-product-card {
        padding: 12px;
        min-height: 250px;
    }

    .zhenvo-product-image-container {
        height: 160px;
        margin-bottom: 12px;
    }

    .zhenvo-product-details {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }

    .zhenvo-product-price {
        text-align: left;
    }

    .zhenvo-product-title {
        font-size: 15px;
    }

    .zhenvo-product-price {
        font-size: 15px;
    }

    /* Mobile cart button - optimized for very small screens */
    .zhenvo-add-to-cart-overlay {
        width: 48px !important;
        height: 48px !important;
        right: 12px !important;
        bottom: 12px !important;
        min-width: 48px !important;
        background: #f8b060 !important;
        border: none !important;
        box-shadow: 0 4px 16px rgba(248, 176, 96, 0.4) !important;
    }

    .zhenvo-add-to-cart-overlay svg {
        width: 22px !important;
        height: 22px !important;
        stroke: white !important;
    }
    
    .zhenvo-add-to-cart-overlay:hover {
        background: #e6a054 !important;
        box-shadow: 0 6px 20px rgba(248, 176, 96, 0.5) !important;
    }
}

/* ========================================
   AJAX CART ANIMATIONS & STATES
======================================== */

/* Loading state for add to cart button */
.zhenvo-add-to-cart-overlay.loading {
    pointer-events: none;
    opacity: 0.7;
}

.zhenvo-add-to-cart-overlay.loading span {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Success state for add to cart */
.zhenvo-add-to-cart-overlay.added {
    background: rgba(76, 175, 80, 0.95) !important;
    color: white !important;
    border-color: rgba(76, 175, 80, 0.6) !important;
}

/* Product card loading state */
.zhenvo-product-card.adding-to-cart {
    position: relative;
}

.zhenvo-product-card.adding-to-cart::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    z-index: 100;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

/* Success animation for product card */
.zhenvo-product-card.cart-success-animation {
    animation: successPulse 0.8s ease-out;
}

/* Cart widget update animation */
.zhenvo-cart-container.cart-updated {
    animation: cartBounce 0.6s ease-out;
}

.zhenvo-cart-container.cart-updated .zhenvo-cart-quantity {
    animation: badgePulse 0.6s ease-out;
}

/* Mobile cart animation */
.zhenvo-cart-mobile-sticky.cart-updated {
    animation: cartBounce 0.6s ease-out;
}

.zhenvo-cart-mobile-sticky.cart-updated .zhenvo-cart-quantity {
    animation: badgePulse 0.6s ease-out;
}

/* Enhanced bounce animation for cart icons */
.cart-bounce {
    animation: cartBounce 0.6s ease-out;
}

/* Notifications */
.zhenvo-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-out;
    min-width: 280px;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.zhenvo-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.zhenvo-notification-success {
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.zhenvo-notification-error {
    border-left: 4px solid #f44336;
    color: #c62828;
}

/* Keyframe animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    20% { transform: scale(1.1); }
    40% { transform: scale(0.95); }
    60% { transform: scale(1.05); }
    80% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

@keyframes badgePulse {
    0% { transform: scale(1); background-color: var(--current-bg, #f8b060); }
    50% { transform: scale(1.3); background-color: #4caf50; }
    100% { transform: scale(1); background-color: var(--current-bg, #f8b060); }
}

/* Mobile responsive notifications */
@media (max-width: 480px) {
    .zhenvo-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        font-size: 13px;
        padding: 14px 16px;
    }
}

/* ========================================
   LEGACY WOOCOMMERCE OVERRIDES
======================================== */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.elementor-widget-woocommerce-products ul.products li.product,
.elementor-widget-archive-products ul.products li.product {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    float: none !important;
}

.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img {
    width: 100% !important;
    height: 100% !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}


.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    display: none !important;
} 