/* ============================================
   PRODUCT CARD STYLES - MOBILE FIRST
   Supports: Main Shop & Custom Product Sections
   ============================================ */

/* Base Styles (Mobile Default) */
.product-card,
.product-section-wrapper .product-card {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.product-card-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto;
}

/* Image Wrapper */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Links & Images */
.woocommerce ul.products li.product a,
.product-section-wrapper ul.products li.product a {
    text-decoration: none;
    display: block;
}

.woocommerce ul.products li.product a img,
.product-section-wrapper ul.products li.product a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Secondary Image */
.secondary-image {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.woocommerce ul.products li.product:hover .secondary-image,
.woocommerce ul.products li.product.hover-active .secondary-image,
.product-section-wrapper ul.products li.product:hover .secondary-image,
.product-section-wrapper ul.products li.product.hover-active .secondary-image {
    opacity: 1;
}

/* Product Content Container */
.product-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Price */
.woocommerce ul.products li.product .price,
.product-section-wrapper ul.products li.product .price {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c2c2c;
    margin: 0;
    order: 1;
}

/* Title */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.product-section-wrapper ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    margin: 0;
    color: #555;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    order: 2;
}

/* Remove underline from title links */
.woocommerce ul.products li.product .woocommerce-loop-product__title a,
.product-section-wrapper ul.products li.product .woocommerce-loop-product__title a {
    text-decoration: none;
    border-bottom: none;
}

/* Hide "Select options" button - only show Add to Cart */
.woocommerce ul.products li.product .button.product_type_variable,
.product-section-wrapper ul.products li.product .button.product_type_variable {
    display: none !important;
}

/* Buttons */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart,
.product-section-wrapper ul.products li.product .button,
.product-section-wrapper ul.products li.product .added_to_cart {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-align: center;
    background: #2c2c2c;
    color: #fff;
    text-transform: uppercase;
    border: 1px solid #2c2c2c;
    text-decoration: none;
    margin: 0;
    order: 3;
}

.woocommerce ul.products li.product .added_to_cart,
.product-section-wrapper ul.products li.product .added_to_cart {
    background: #4caf50;
    border-color: #4caf50;
}

/* Badges */
.product-badge,
.woocommerce ul.products li.product .onsale,
.product-section-wrapper ul.products li.product .onsale {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 20;
    background: #e74c3c;
    color: #fff;
    border-radius: 2px;
    min-height: auto;
    line-height: normal;
}

/* ============================================
   DESKTOP SCALING (Min-Width 769px+)
   ============================================ */
@media (min-width: 769px) {
    .product-card,
    .product-section-wrapper .product-card {
        height: 540px; 
    }

    .product-card-inner {
        height: 100%;
        justify-content: space-between;
    }

    .product-image-wrapper {
        margin-bottom: 16px;
    }

    .product-content {
        gap: 12px;
    }
    
    .woocommerce ul.products li.product .price,
    .product-section-wrapper ul.products li.product .price {
        font-size: 1rem;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .product-section-wrapper ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.95rem;
    }

    .woocommerce ul.products li.product .button,
    .product-section-wrapper ul.products li.product .button {
        padding: 12px 20px;
        font-size: 0.85rem;
        letter-spacing: 1.5px;
    }
    
    .product-badge,
    .woocommerce ul.products li.product .onsale,
    .product-section-wrapper ul.products li.product .onsale {
        top: 10px;
        left: 10px;
        padding: 5px 12px;
        font-size: 0.75rem;
    }
}

/* ============================================
   PRODUCT IMAGE TRANSITIONS (MOBILE & DESKTOP)
   ============================================ */

/* Base Transition Styles */
.product-image-wrapper a img:not(.secondary-image) {
    will-change: transform, opacity;
}

.secondary-image {
    will-change: transform, opacity;
}

/* -------------------------------------------
   EFFECT 1: CROSSFADE WITH ZOOM
   ------------------------------------------- */
.transition-zoom .product-image-wrapper a img:not(.secondary-image) {
    transition: transform 1s ease, opacity 0.6s ease;
}

.transition-zoom .secondary-image {
    transform: scale(1.05);
    transition: opacity 0.6s ease, transform 1s ease;
}

.transition-zoom:hover .product-image-wrapper a img:not(.secondary-image),
.transition-zoom.hover-active .product-image-wrapper a img:not(.secondary-image) {
    transform: scale(0.95);
}

.transition-zoom:hover .secondary-image,
.transition-zoom.hover-active .secondary-image {
    opacity: 1;
    transform: scale(1);
}

/* -------------------------------------------
   EFFECT 2: KEN BURNS (Zoom + Pan)
   ------------------------------------------- */
.transition-kenburns .product-image-wrapper a img:not(.secondary-image) {
    transition: transform 1s ease, opacity 0.6s ease;
    transform-origin: center center;
}

.transition-kenburns .secondary-image {
    transform: scale(1.08) translate(2%, -2%);
    transition: opacity 0.6s ease, transform 1s ease;
    transform-origin: center center;
}

.transition-kenburns:hover .product-image-wrapper a img:not(.secondary-image),
.transition-kenburns.hover-active .product-image-wrapper a img:not(.secondary-image) {
    transform: scale(1.05) translate(-1%, 1%);
}

.transition-kenburns:hover .secondary-image,
.transition-kenburns.hover-active .secondary-image {
    opacity: 1;
    transform: scale(1) translate(0, 0);
}

/* -------------------------------------------
   EFFECT 3: BLUR TRANSITION
   ------------------------------------------- */
.transition-blur .product-image-wrapper a img:not(.secondary-image) {
    transition: filter 0.8s ease, opacity 0.5s ease;
    filter: blur(0px);
}

.transition-blur .secondary-image {
    filter: blur(8px);
    transition: opacity 0.8s ease, filter 0.4s ease;
}

.transition-blur:hover .product-image-wrapper a img:not(.secondary-image),
.transition-blur.hover-active .product-image-wrapper a img:not(.secondary-image) {
    filter: blur(8px);
    opacity: 0;
}

.transition-blur:hover .secondary-image,
.transition-blur.hover-active .secondary-image {
    opacity: 1;
    filter: blur(0px);
}

/* -------------------------------------------
   EFFECT 4: SLIDE CROSSFADE
   ------------------------------------------- */
.transition-slide .product-image-wrapper a img:not(.secondary-image) {
    transition: transform 1s ease, opacity 0.5s ease;
}

.transition-slide .secondary-image {
    transform: translateX(8%);
    transition: opacity 0.5s ease, transform 1s ease;
}

.transition-slide:hover .product-image-wrapper a img:not(.secondary-image),
.transition-slide.hover-active .product-image-wrapper a img:not(.secondary-image) {
    transform: translateX(-3%);
}

.transition-slide:hover .secondary-image,
.transition-slide.hover-active .secondary-image {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   MOBILE ANIMATION TWEAKS
   ============================================ */
@media (max-width: 768px) {
    .transition-zoom .product-image-wrapper a img:not(.secondary-image),
    .transition-zoom .secondary-image,
    .transition-kenburns .product-image-wrapper a img:not(.secondary-image),
    .transition-kenburns .secondary-image,
    .transition-blur .product-image-wrapper a img:not(.secondary-image),
    .transition-blur .secondary-image,
    .transition-slide .product-image-wrapper a img:not(.secondary-image),
    .transition-slide .secondary-image {
        transition-duration: 0.5s !important;
    }
}