/* AGGRESSIVE CUSTOM HOVER EFFECTS FOR JOURNAL3 */

/* 1. Ensure the container supports absolute positioning */
.product-thumb {
    position: relative !important;
    background-color: #ffffff !important;
    /* White background */
}

/* Hide stock status */
.product-thumb .stats,
.product-thumb .stats-group,
.product-layout .stats,
.product-grid .stats,
.stat-2 {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 2. Style the buttons wrapper to cover the image and be hidden by default */
.product-thumb .image-group .buttons-wrapper {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99 !important;
    /* High z-index to stay above images */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    background: rgba(0, 0, 0, 0.01) !important;
    /* Subtle background to ensure hover area works */
    pointer-events: none !important;
    /* Allow mouse to "hit" the image group first */
}

/* 3. Show the wrapper when dragging the mouse over the product card */
/* We target the layout or thumb to trigger the hover */
.product-layout:hover .buttons-wrapper,
.product-thumb:hover .buttons-wrapper {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    /* Enable interaction when visible */
}

/* 4. Position Add to Cart at the bottom center */
.product-thumb .cart-group {
    position: absolute !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(10px) !important;
    transition: transform 0.3s ease !important;
    width: auto !important;
}

.product-layout:hover .cart-group {
    transform: translateX(-50%) translateY(0) !important;
}

/* Style for the Add to Cart button itself */
.product-thumb .btn-cart {
    background-color: #000 !important;
    /* Pure black */
    color: #fff !important;
    padding: 12px 28px !important;
    /* Increased inner padding */
    border-radius: 50px !important;
    /* Pill shaped */
    font-size: 14px !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    /* Extra bold */
    display: inline-flex !important;
    align-items: center !important;
    min-width: 160px !important;
    /* Slightly wider */
    justify-content: center !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease !important;
}

.product-thumb .btn-cart:hover {
    background-color: #333 !important;
    /* Dark grey on hover */
    transform: scale(1.05) !important;
    /* Subtle pop effect */
}

/* Custom styling for Add to Cart button text */
.main-products-style.product-grid .product-thumb .btn-cart .btn-text {
    padding: 13px .4em !important;
    color: #FFF !important;
}

/* Hide the quantity input/stepper for this view */
.product-thumb .cart-group .stepper {
    display: none !important;
}

/* 5. Position Wishlist and Compare at the top right */
.product-thumb .wish-group {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.product-thumb .btn-wishlist,
.product-thumb .btn-compare {
    background-color: #fff !important;
    color: #333 !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    transition: background 0.2s ease, color 0.2s ease !important;
}

.product-thumb .btn-wishlist:hover,
.product-thumb .btn-compare:hover {
    background-color: #222 !important;
    color: #fff !important;
}

/* 6. Fix for Journal3 Default Styling Interference */
/* Sometimes the buttons wrapper is height 0 or hidden by overflow */
.product-thumb .image-group {
    position: relative !important;
    overflow: visible !important;
    /* Allow buttons to show even if they spill out slightly */
}

.product-thumb .button-group {
    display: block !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Ensure icons are visible */
.product-thumb .btn-wishlist .btn-text,
.product-thumb .btn-compare .btn-text,
.product-thumb .btn-cart .fa {
    display: none !important;
    /* Hide text for icons, we just want the icon or the button text */
}

/* If the buttons use btn-text span for everything */
.product-thumb .btn-wishlist::before {
    content: "\f006";
    /* FontAwesome Heart far */
    font-family: FontAwesome;
}

.product-thumb .btn-compare::before {
    content: "\f079";
    /* FontAwesome Refresh/Compare */
    font-family: FontAwesome;
}

/* 
   MOBILE FIXES: Sticky Bar Price & Category Button Size 
   Added by Agent to ensure global application and override defaults.
*/
@media (max-width: 768px) {

    /* 1. Mobile Sticky Add-to-Cart Bar - Force Price Visibility using ID selector */
    #sticky-addtocart-bar .sticky-bar-content {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 10px 15px !important;
    }

    #sticky-addtocart-bar .sticky-product-info {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    #sticky-addtocart-bar .sticky-product-details {
        overflow: visible !important;
        flex: 1 !important;
    }

    #sticky-addtocart-bar .sticky-product-price {
        display: block !important;
        margin-top: 0 !important;
        margin-left: 10px !important;
        visibility: visible !important;
        height: auto !important;
        opacity: 1 !important;
    }

    #sticky-addtocart-bar .sticky-product-actions {
        width: 100% !important;
        justify-content: space-between !important;
    }

    #sticky-addtocart-bar .sticky-add-cart {
        flex: 1 !important;
        width: auto !important;
        max-width: none !important;
    }

    /* 2. Mobile Category "Add to Cart" Button - Decrease width & center */
    /* Ensure the container (cart-group) allows centering */
    .product-thumb .button-group .cart-group {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        flex: 0 0 100% !important;
    }

    .product-thumb .button-group .btn-cart {
        padding: 0 15px !important;
        width: 75% !important;
        margin: 5px auto !important;
        display: inline-flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex: 0 0 75% !important;
        float: none !important;
    }

    .product-thumb .button-group .btn-cart .btn-text {
        display: inline-block !important;
    }
}