/**
 * Custom Product Card Styles
 * 
 * @package Leuven Child Theme
 * @since 1.0.0
 */

.leuven-product-card {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(212, 184, 150, 0.15);
}

.product-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--color-secondary);
    border: 1px solid #e3dede;
    border-radius: 20px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.leuven-product-card:hover .product-card-inner {
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(212, 184, 150, 0.15);
}

.product-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.leuven-product-card:hover .product-card-image img {
    transform: scale(1.08);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--color-accent);
    color: var(--color-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.product-wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: var(--color-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 2;
    display: grid;
    justify-content: center;
}

.product-wishlist svg {
    width: 30px;
    height: 20px;
    stroke: var(--color-primary);
    transition: stroke 0.3s ease, fill 0.3s ease;
}

.product-wishlist svg .heart-path {
    fill: none;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.product-wishlist.is-favourite svg .heart-path {
    fill: #e74c3c;
    stroke: #e74c3c;
}

.product-wishlist.animating {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(0.95);
    }
    75% {
        transform: scale(1.1);
    }
}

.product-wishlist.processing {
    pointer-events: none;
    opacity: 0.7;
}

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

.product-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card-title a:hover {
    color: var(--color-accent);
}

.product-card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 10px;
}

.product-card-price del {
    opacity: 0.5;
    font-weight: 400;
    font-size: 14px;
    margin-right: 8px;
}

.product-card-price ins {
    text-decoration: none;
    color: var(--color-accent);
}

.product-card-footer {
    padding: 0 20px 20px;
}

.product-card-footer .button,
.product-card-footer .add_to_cart_button,
.product-card-footer .product_type_simple,
.product-card-footer .product_type_variable {
    width: 100%;
    padding: 14px 24px;
    background: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: block;
}

.product-card-footer .button:hover,
.product-card-footer .add_to_cart_button:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.product-card-footer .added_to_cart {
    display: none;
}

.product-card-footer .loading {
    opacity: 0.6;
    pointer-events: none;
}

.product-card-footer .loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid var(--color-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

@media (max-width: 768px) {

    .leuven-product-card .e-con {
        padding-inline-start: 0 !important;
        padding-inline-end: 0 !important;
    }
    
    /* Override Astra button styles */
    .leuven-product-card .button,
    .leuven-product-card .add_to_cart_button,
    .leuven-product-card .product_type_simple,
    .leuven-product-card .product_type_variable {
        padding: 10px 16px !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
        min-height: auto !important;
    }
    
    .product-card-content {
        padding: 16px;
    }

    .product-card-title {
        font-size: 14px;
    }

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

    .product-card-footer {
        padding: 0 16px 16px;
    }

    .product-card-footer .button,
    .product-card-footer .add_to_cart_button,
    .product-card-footer .product_type_simple,
    .product-card-footer .product_type_variable {
        padding: 10px 16px !important;
        font-size: 11px !important;
        letter-spacing: 0.3px !important;
    }

    .product-badge {
        top: 8px;
        left: 8px;
        padding: 4px 10px;
        font-size: 11px;
    }

    .product-wishlist {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }

    .product-wishlist svg {
        width: 20px;
        height: 20px;
    }
}

.elementor-widget-loop-grid .leuven-product-card,
.elementor-loop-container .leuven-product-card {
    height: 100%;
}
