/**
 * Product Custom List CSS
 * Custom styling for product cards in shop page
 */

/* Product Card Custom Styling */
.product-small.box {
    background: none !important;
    border-radius: 0 !important;
    padding: 12px !important;
    transition: none !important;
}

.product-small.box:hover {
    box-shadow: none !important;
}

/* Product image border-radius */
.product-small .box-image img,
.product-small .box-image .image-cover {
    border-radius: 10px !important;
}

/* Remove padding-bottom for product text only */
.product-small .box-text {
    padding-bottom: 0 !important;
}

/* Custom Rating Stars Styling */
.custom-product-rating {
    margin-bottom: 4px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.custom-product-rating .star-rating {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 1px;
    display: block !important;
}

.custom-product-rating span {
    font-size: 12px;
    display: inline-block;
}

/* Hide YITH Points and Rewards message */
.yith-par-message,
.yith-par-message-loop,
.yith-par-message-loop .product_point_loop {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide ALL default WooCommerce ratings except our custom one */
.product-small .star-rating:not(.yith-ywar-product-rating .star-rating),
.product-small .yith-ywar-product-rating:not(.page-loop) {
    display: none !important;
}

/* Hide rating from other positions */
.product-small .rating-wrapper,
.product-small .woocommerce-product-rating,
.product-small .yith-ywar-product-rating:not(.page-loop) {
    display: none !important;
}

/* Only show our custom rating */
.custom-product-info .yith-ywar-product-rating.page-loop {
    display: block !important;
}

/* Product Title */
.product-small .title-wrapper {
    margin-bottom: 5px;
}

.product-small .woocommerce-loop-product__title,
.custom-product-info .woocommerce-loop-product__title {
    color: #2d8659 !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

/* Product Subtitle */
.product-subtitle {
    color: #646464 !important;
    font-size: 12px !important;
    opacity: 0.8;
    line-height: 1.3 !important;
}

/* Price */
.custom-product-info .price-wrapper {
    margin-bottom: 0;
}

.custom-product-info .price-wrapper .price {
    color: #646464 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* Override span.amount color */
.custom-product-info .price-wrapper .price span.amount,
.custom-product-info .price-wrapper span.amount {
    color: #646464 !important;
}

/* Also target product-small price */
.product-small .price span.amount {
    color: #646464 !important;
}

/* Custom Action Buttons Row (+ and cart icon) */
.product-actions-top {
    display: flex !important;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 10px;
    margin-bottom: 10px;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Add to Cart Button (+) */
.add-to-cart-btn-plus {
    transition: all 0.3s ease;
    overflow: hidden;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
}

/* SVG icon transitions */
.add-to-cart-btn-plus .icon-plus,
.add-to-cart-btn-plus .icon-cart {
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: absolute;
}

/* Default state: show plus, hide cart */
.add-to-cart-btn-plus .icon-plus {
    opacity: 1 !important;
    display: block;
}

.add-to-cart-btn-plus .icon-cart {
    opacity: 0 !important;
    display: block;
}

/* Hover state: only change icon, no background color change */
.add-to-cart-btn-plus:hover {
    transform: scale(1.05);
}

/* Plus icon fades out on hover */
.add-to-cart-btn-plus:hover .icon-plus {
    opacity: 0 !important;
    transform: scale(0.8);
}

/* Cart icon fades in on hover (keep green color) */
.add-to-cart-btn-plus:hover .icon-cart {
    opacity: 1 !important;
    transform: scale(1);
}

/* Ensure cart icon stroke stays green */
.add-to-cart-btn-plus .icon-cart path {
    stroke: #2d8659 !important;
}

.add-to-cart-btn-plus:hover .icon-cart path {
    stroke: #2d8659 !important;
}

/* Shopee Button */
.shopee-btn {
    transition: all 0.3s ease;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
}

.shopee-btn:hover:not(:disabled) {
    background: #d43d1f !important;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(238, 77, 45, 0.3);
}

.shopee-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shopee-btn svg {
    width: 20px;
    height: 20px;
}

/* Buy Now Button */
.product-buy-now-btn {
    transition: all 0.3s ease;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
}

.product-buy-now-btn:hover {
    background: #236b46 !important;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(45, 134, 89, 0.3);
}

/* Hide default Flatsome add to cart */
.product-small .box-text .button {
    display: none !important;
}

/* Loading state for buttons */
.add-to-cart-btn-plus.loading,
.product-buy-now-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.add-to-cart-btn-plus.loading::after,
.product-buy-now-btn.loading::after {
    content: "...";
    animation: dots 1s infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}
