/* Material Design 3 Product Card Global Overrides */

/* 1. Global Radius & Borders */
.product-grid,
.default-style .project,
.product-style-1 .product-grid,
.product-style-2 .product-grid,
.item.project .rounded {
    border-radius: 12px !important;
    border: none !important;
    overflow: hidden;
}

/* 2. MD3 Elevation (Shadows) */
/* State Layer: standard container elevation 1 */
.product-grid,
.default-style,
.product-bg {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24) !important;
    transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
    background: #fff;
    /* Ensure strict white background */
}

/* Hover State: elevation 2 */
.product-grid:hover,
.default-style:hover,
.product-bg:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.20) !important;
    transform: translateY(-2px);
    /* Slight lift */
}

/* 3. Image Radius Consistency */
.product-grid figure,
.default-style figure,
.project figure,
.product-image img,
.fig_image {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* 4. Cleaner Spacing */
.product-grid .product-content,
.post-header {
    padding: 12px 8px !important;
}

/* 5. Mobile "Add to Cart" Button */
.mobile-add-cart-btn {
    display: none;
    /* Hidden by default on desktop */
}

@media (max-width: 991px) {

    /* Show only on mobile/tablet */
    .mobile-add-cart-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        bottom: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        background: var(--primary-color);
        color: #fff;
        border-radius: 50%;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        z-index: 10;
        border: none;
        transition: transform 0.2s;
        text-decoration: none;
    }

    .mobile-add-cart-btn:active {
        transform: scale(0.9);
    }

    .mobile-add-cart-btn i {
        font-size: 18px;
        line-height: 1;
        margin: 0;
    }

    /* Ensure parent has relative positioning for absolute placement */
    .product-grid figure,
    .default-style figure,
    .project figure {
        position: relative;
    }

    /* Small Rating Text Fix */
    .product-grid .rating,
    .rating-container .rating-stars {
        font-size: 10px !important;
    }
}

/* 6. Product Title Truncation */
.product-grid .title,
.default-style .title,
.project .title,
.post-title.title_wrap {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    max-width: 100% !important;
}