/*
 * Styles for Custom Product Filter Widget v1.2
 * Designer: Gemini
 * Font: Vazirmatn
*/

/* --- Import Font --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* --- General Wrapper --- */
.custom-product-filter-wrapper {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    width: 100%;
}

/* --- Filter Buttons --- */
.product-filters {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.product-filters .filter-btn {
    background-color: #fff;
    border: 1px solid #dcdcdc;
    padding: 8px 24px;
    margin: 0;
    border-radius: 30px; /* Modern "pill" shape */
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.25s ease;
    line-height: 1.5;
}

.product-filters .filter-btn:hover {
    background-color: #f7f7f7;
    border-color: #0056b3;
    color: #0056b3;
}

.product-filters .filter-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.25);
    transform: translateY(-2px);
}

/* --- Product Grid --- */
.product-grid {
    display: grid;
    /* Controls card size: min 270px, max 1fr (e.g., 4 cols on large screens, 1 on mobile) */
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 25px;
}

/* --- Product Card --- */
.product-card {
    background-color: #fff;
    border-radius: 12px; /* Softer corners */
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e7e7e7;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card.hidden {
    display: none;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Card Image */
.product-image-link {
    display: block;
    overflow: hidden;
}
.product-image-link img {
    width: 100%;
    height: auto;
    display: block;
    background-color: #f9f9f9;
    /* Standardizes image size */
    aspect-ratio: 16 / 10; 
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card:hover .product-image-link img {
    transform: scale(1.05);
}


/* Card Content */
.product-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Pushes price and button to the bottom */
}

.product-title {
    font-size: 17px; /* Clean size */
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.5;
    /* Ensures cards align even with different title lengths */
    min-height: 50px; 
}

.product-title a {
    text-decoration: center;
    color: #111;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #007bff;
}

/* Price (Now "Free") */
.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #326a5f; /* A nice "free" green */
    margin-top: center; /* Pushes price to the bottom */
    margin-bottom: 15px;
}

/* Button */
.view-product-btn {
    background-color: #007bff;
    color: #fff !important;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    text-decoration: center;
    font-weight: 500;
    font-size: 15px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: block;
}
.view-product-btn:hover {
    background-color: #0056b3;
    transform: scale(1.03);
}