/* =========================================
   REFINED PRODUCT CARD COMPONENT (MINIMALIST BOUTIQUE)
   Shared between Products Page and Homepage
   ========================================= */

:root {
    --card-bg-white: #FFFFFF;
    --card-border-color: #f0f0f0;
    --card-accent-gold: #d4a574;
    --card-text-main: #1a1a1a;
    --card-text-muted: #999999;
}

/* Base Card Container */
.product_card_minimal {
    background: #ffffff !important;
    border: none !important;
    border-radius: 0 !important; /* Sharp, high-end look */
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    transition: all 0.3s ease !important;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product_card_minimal:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* Image/Media Area */
.product_image_minimal {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product_image_minimal img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: none !important;
}

/* Floating Badges (Top Left) */
.badge_sale_minimal {
    position: absolute;
    top: 10px;
    left: 10px; /* Moved to left */
    background: #ff6b35;
    color: white;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 2px;
    z-index: 5;
}

.badge_new_minimal {
    position: absolute;
    top: 38px; /* Offset if sale badge exists */
    left: 10px;
    background: #1a1a1a;
    color: white;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 2px;
    z-index: 5;
}

/* Floating Action Icons (Bottom Hover) */
.product_quick_actions {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.product_card_minimal:hover .product_quick_actions {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.action_btn {
    width: 42px !important;
    height: 42px !important;
    aspect-ratio: 1/1 !important;
    padding: 0 !important;
    min-width: unset !important;
    border-radius: 50% !important;
    background: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action_btn:hover {
    background: #fafafa !important;
    color: var(--card-accent-gold) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}

.action_btn.active:hover {
    background: #059669 !important; /* Darker green on hover for active state */
    color: #ffffff !important;
}

/* Specific button styles for more polish */
.btn_add_cart {
    background: #1a1a1a !important;
    color: #ffffff !important;
}

.btn_quick_view_mini {
    background: #ffffff !important;
    color: #444 !important;
    border: 1px solid #f0f0f0 !important;
}

/* Favorite Pin (Top Right - Always Accessible) */
.btn_fav_minimal {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 15;
    background: rgba(255, 255, 255, 0.95);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #bbb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn_fav_minimal:hover {
    transform: scale(1.1);
    background: #ffffff;
    color: #ff6b6b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.btn_fav_minimal.active {
    color: #ff6b6b;
}

.btn_fav_minimal i {
    font-size: 16px;
}

/* Info Area (Neat & Organized) */
.product_info_minimal {
    padding: 15px 10px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product_name_minimal {
    margin: 0;
}

.product_name_minimal a {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
    font-family: 'Inter', sans-serif;
}

.product_price_minimal {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
}

.price_current_minimal {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    font-family: 'Outfit', sans-serif;
}

.price_old_minimal {
    font-size: 13px;
    color: #b0b0b0;
    text-decoration: line-through;
    font-weight: 400;
}

/* =========================================
   LIST VIEW VARIATION (Products Page)
   ========================================= */
.productsGrid.list_view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.productsGrid.list_view .product_card_minimal {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #f0f0f0 !important;
    padding-bottom: 20px !important;
}

.productsGrid.list_view .product_image_minimal {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.productsGrid.list_view .product_info_minimal {
    padding: 0;
    flex-grow: 1;
}

.productsGrid.list_view .product_name_minimal a {
    font-size: 18px;
    height: auto;
    -webkit-line-clamp: 1;
}

.productsGrid.list_view .product_quick_actions {
    position: relative;
    bottom: 0;
    left: 0;
    transform: none;
    opacity: 1;
    margin-top: 15px;
}

/* =========================================
   BACKWARD COMPATIBILITY & UTILITIES
   Map old classes to new minimalist styles
   ========================================= */
.home-product-card {
    background: #fff;
}

@media (max-width: 768px) {
    .product_name_minimal a {
        font-size: 13px;
    }
    .productsGrid.list_view .product_image_minimal {
        width: 120px;
        height: 120px;
    }
    .action_btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* --- MOBILE ADD TO CART FIX (PERMANENT FLOATING RIGHT NEXT TO PRICE) --- */
@media (max-width: 991px) {
    .product_card_minimal {
        position: relative !important;
        padding-bottom: 2px !important;
    }
    
    .product_card_minimal .product_image_minimal {
        position: static !important; /* Allow absolute children to escape */
    }

    .product_card_minimal .product_quick_actions {
        position: absolute !important;
        bottom: 12px !important;
        right: 12px !important;
        left: auto !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
        z-index: 50 !important;
    }

    .product_card_minimal .action_btn.btn_quick_view_mini {
        display: none !important;
    }

    .product_card_minimal .action_btn.btn_add_cart {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        background: #ffffff !important; 
        color: transparent !important; /* Hide text */
        font-size: 0 !important; /* Hide text */
        box-shadow: 0 4px 10px rgba(0,0,0,0.06) !important;
        border: 1px solid #eaeaea !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: all 0.3s ease !important;
        overflow: hidden !important; /* Prevent text overflow */
        position: relative !important; /* For absolute centering of icon */
    }

    .product_card_minimal .action_btn.btn_add_cart i {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        font-size: 13px !important;
        color: #333333 !important; /* Icon default color */
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    .product_card_minimal .action_btn.btn_add_cart.active {
        background: #0d2b1a !important;
        border-color: #0d2b1a !important;
    }

    .product_card_minimal .action_btn.btn_add_cart.active i {
        color: #ffffff !important; /* Icon active color */
    }

    .product_card_minimal .product_info_minimal {
        padding-right: 45px !important; 
    }
}

