/* Shop Page Custom Overrides */

/* Container width 1380px instead of 1200px */
@media (min-width: 1200px) {
    .container {
        max-width: 1380px;
    }
}

/* Ensure product rating stars and review text consistency */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.product-rating .fi-rs-star,
.product-rating .fi-rs-star-half {
    color: #e2185e;
    font-size: 14px;
}

.product-rating .fi-rs-star.empty {
    color: #E0E0E0;
}

.product-rating .review-count {
    margin-left: 2px;
    font-size: 13px;
}

/* Product Card - Fixed Structure & Equal Heights */
.product-cart-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Fixed Height Image Container - Prevents Variable Heights */
.product-cart-wrap .product-img-action-wrap {
    position: relative;
    background-color: #fff;
    padding: 10px 12px;
    overflow: hidden;
    height: 280px; /* Fixed height for desktop */
    flex-shrink: 0; /* Prevent image area from shrinking */
}

.product-cart-wrap .product-img-action-wrap .product-img {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-cart-wrap .product-img-action-wrap .product-img a {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-cart-wrap .product-img-action-wrap .product-img a img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Preserve aspect ratio without distortion */
}

/* Hover Image - Also Use Contain */
.product-cart-wrap .product-img-action-wrap .product-img a img.hover-img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: 0.25s opacity, 0.25s visibility;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-cart-wrap:hover .product-img-action-wrap .product-img a img.hover-img {
    opacity: 1;
    visibility: visible;
}

/* Content Area - Grows to Fill Remaining Space */
.product-cart-wrap .product-content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Responsive Adjustments */
@media (max-width: 991px) and (min-width: 768px) {
    .product-cart-wrap .product-img-action-wrap {
        height: 240px; /* Slightly smaller for tablet */
    }
}

@media (max-width: 767px) {
    .product-cart-wrap .product-img-action-wrap {
        height: 220px; /* Smaller for mobile */
    }
}

@media (max-width: 576px) {
    .product-cart-wrap .product-img-action-wrap {
        height: 200px;
    }
}

/* ====================================================================
   SHOP PAGE - PRODUCT CARD SPACING FIXES
   ================================================================== */

/* Reduce Card Internal Spacing */
.product-cart-wrap .product-content-wrap {
    padding: 0px 12px 6px 12px !important; /* tightened: no top padding, compact layout */
}

.product-cart-wrap .product-category {
    margin-bottom: 6px !important; /* Reduced from 10px */
}

.product-cart-wrap .product-content-wrap h2 {
    margin-bottom: 6px !important; /* Reduced from default spacing */
    line-height: 1.3 !important;
}

.product-cart-wrap .product-rating {
    margin-top: 6px !important;
    margin-bottom: 6px !important; /* Reduced from 10px */
}

.product-cart-wrap .product-content-wrap .product-price {
    margin-top: 8px !important; /* Reduced from 10px or more */
}

/* Reduce Card-to-Card Spacing */
.product-cart-wrap {
    margin-bottom: 20px !important; /* Reduced from 30px (mb-30 class) */
}

/* Responsive Spacing Adjustments */
@media (max-width: 991px) {
    .product-cart-wrap {
        margin-bottom: 18px !important;
    }
    
    .product-cart-wrap .product-content-wrap {
        padding: 0px 12px 6px 12px !important;
    }
}

@media (max-width: 767px) {
    .product-cart-wrap {
        margin-bottom: 16px !important;
    }
    
    .product-cart-wrap .product-content-wrap {
        padding: 0px 12px 6px 12px !important;
    }
    
    .product-cart-wrap .product-category {
        margin-bottom: 5px !important;
    }
    
    .product-cart-wrap .product-content-wrap h2 {
        margin-bottom: 5px !important;
    }
    
    .product-cart-wrap .product-rating {
        margin-top: 5px !important;
        margin-bottom: 5px !important;
    }
    
    .product-cart-wrap .product-content-wrap .product-price {
        margin-top: 6px !important;
    }
}

/* ====================================================================
   GLOBAL BUTTON HOVER FIX - btn btn-sm
   ================================================================== */

/* Fix white-on-white hover issue for all btn-sm buttons */
.btn.btn-sm:hover,
.button.btn-sm:hover,
button.btn-sm:hover,
a.btn-sm:hover {
    background-color: #3BB77E !important; /* Brand primary color */
    border-color: #3BB77E !important;
    color: #ffffff !important; /* White text for contrast */
}

/* Ensure secondary button variants also have proper hover */
.btn.btn-sm.btn-secondary:hover,
.btn.btn-sm.btn-default:hover {
    background-color: #3BB77E !important;
    border-color: #3BB77E !important;
    color: #ffffff !important;
}
