/* Product Card Customizations */

/* Icon Only Buttons */
/* Explicitly set width/height and override any full-width defaults */
.ceit-btn--icon-only {
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    /* Optional: adds a bit of radius */
    flex: 0 0 50px !important;
    /* Prevent shrinking/growing in flex containers */
    margin: 0;
    /* Reset margins */
}

.ceit-btn--icon-only .ceit-compare-btn__text,
.ceit-btn--icon-only .ceit-wishlist-btn__text {
    display: none;
}

/* Positioning: On Image - LEFT Side */
.ceit-btn--pos-on-image,
.ceit-btn--pos-on-image-wishlist {
    position: absolute;
    z-index: 20;
    top: 10px;
    background: #fff;
    /* Ensure visibility */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: none;
    transition: all 0.3s ease;
}

.ceit-btn--pos-on-image:hover,
.ceit-btn--pos-on-image-wishlist:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

/* Compare button on image - Top Left */
.ceit-btn--pos-on-image {
    left: 10px;
    right: auto;
    /* Ensure no conflict */
}

/* Wishlist button on image - Below Compare (Vertical Stack) */
.ceit-btn--pos-on-image-wishlist {
    left: 10px;
    right: auto;
    top: 70px;
    /* 10px + 50px height + 10px gap */
}

/* Ensure container allows absolute positioning */
.astra-shop-thumbnail-wrap,
.woocommerce-loop-product__link {
    position: relative;
    display: block;
    /* Ensure correct block formatting */
}

/* Remove default styling interference */
.ast-shop-product-out-of-stock {
    z-index: 11;
    /* Keep out of stock label on top */
}

/* Fix SVG alignment */
.ceit-btn--icon-only svg {
    margin: 0 !important;
}

/* Positioning: After Summary (Bottom Layout) */
.ceit-product-actions-wrapper {
    display: flex;
    margin-top: 10px;
    width: 100%;
    clear: both;
}

/* Icon Buttons Layout: Row, Right Aligned */
.ceit-product-actions-wrapper--icons {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

/* Full Buttons Layout: Column, Right Aligned (Stacked) */
.ceit-product-actions-wrapper--full {
    flex-direction: column;
    align-items: flex-end;
    /* Align right */
    gap: 5px;
}

/* Ensure buttons in icon wrapper don't stretch */
.ceit-product-actions-wrapper--icons .ceit-btn--icon-only {
    margin: 0;
    max-width: 50px;
}

/* Full buttons specific styling if needed */
.ceit-product-actions-wrapper--full .ceit-compare-btn,
.ceit-product-actions-wrapper--full .ceit-wishlist-btn {
    width: 100%;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
}

/* Positioning: Default (After Title/Rating) */
.ceit-product-actions-default-wrapper {
    display: flex;
    width: 100%;
    margin-bottom: 10px;
    /* Space before Add to Cart */
    pointer-events: none;
    /* Allow clicks pass through transparent areas if needed, but flex children will be clickable */
}

/* Enable pointer events on children */
.ceit-product-actions-default-wrapper>* {
    pointer-events: auto;
}

.ceit-product-actions-default-wrapper--full {
    flex-direction: column;
    align-items: flex-end;
    /* Revert to Right */
    gap: 4px;
}

/* Full buttons in default position styling */
.ceit-product-actions-default-wrapper--full .ceit-compare-btn,
.ceit-product-actions-default-wrapper--full .ceit-wishlist-btn {
    width: 100%;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 13px;
}

/* Icon buttons layout in Default position */
.ceit-product-actions-default-wrapper--icons {
    flex-direction: row;
    justify-content: flex-end;
    /* Revert to Right */
    gap: 5px;
}

/* 
   Hover/Active Visibility Logic for "On Image" Position
   - Default: Hidden (opacity 0)
   - Hover on Product: Visible
   - Active (In Wishlist/Compare): Visible
*/
.ceit-btn--pos-on-image,
.ceit-btn--pos-on-image-wishlist {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    /* Slide effect */
}

/* Ensure transition is always applied for smooth effect */
.ceit-btn--pos-on-image,
.ceit-btn--pos-on-image-wishlist {
    transition: all 0.3s ease;
}

.product:hover .ceit-btn--pos-on-image,
.product:hover .ceit-btn--pos-on-image-wishlist,
.ast-article-post:hover .ceit-btn--pos-on-image,
.ast-article-post:hover .ceit-btn--pos-on-image-wishlist,
.ceit-compare-btn--active.ceit-btn--pos-on-image,
.ceit-wishlist-btn--active.ceit-btn--pos-on-image-wishlist {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}


/**/
@media (max-width: 768px) {
    .woocommerce ul.products:not(.elementor-grid).columns-3,
    .woocommerce-page ul.products:not(.elementor-grid).columns-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}