
/* --- Container & Layout (Grid System) --- */
.wcaps-filter-wrapper {
    background-color: #eef0f3;
    padding: 15px 20px;
    direction: rtl;
    width: 100%;
    box-sizing: border-box;
}

#wcaps-filter-form {
    display: grid;
    /* הגדרה למסכים גדולים: 
       auto - עבור הטקסט "בחר קטגוריה"
       1fr - מחלק את המקום שווה בשווה בין כל ה-Selects
       auto - רוחב אוטומטי לכפתור האיפוס
    */
    grid-template-columns: auto repeat(6, 1fr) auto; 
    gap: 10px; /* רווח בין האלמנטים */
    align-items: center; /* יישור אנכי למרכז */
    width: 100%;
}

/* --- Label: "בחר קטגוריה:" --- */
.filter-label {
    font-weight: 800;
    color: #222;
    font-size: 16px;
    white-space: nowrap; /* מונע שבירת שורה של הטקסט */
    margin-left: 5px;
}

/* --- Select Dropdowns --- */
.wcaps-select {
    width: 100%; /* ממלא את תא הגריד שלו */
    background-color: #fff;
    border: 1px solid #dadada;
    border-radius: 4px;
    height: 40px; /* גובה אחיד */
    padding: 0 10px;
    font-size: 14px;
    color: #555;
    outline: none;
    cursor: pointer;
    box-sizing: border-box; /* חשוב למניעת גלישה */
    
    /* עיצוב החץ */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 30px;
}

/* --- Reset Button --- */
.btn-reset {
    background-color: #a90055;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 20px;
    height: 40px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap; /* מונע שבירת טקסט בכפתור */
    width: 100%;
}

.btn-reset:hover {
    background-color: #850042;
}

/* --- Mobile Responsiveness --- */
/* נקודת שבירה לטאבלטים ומובייל - הופך חזרה לטור כשיש פחות מ-1100px */
@media (max-width: 1100px) {
    #wcaps-filter-form {
        /* שינוי לגריד של 2 עמודות בטאבלט */
        grid-template-columns: 1fr 1fr; 
    }
    
    .filter-label {
        grid-column: 1 / -1; /* הכותרת תתפוס את כל הרוחב */
        margin-bottom: 5px;
    }
    
    .btn-reset {
        grid-column: 1 / -1; /* הכפתור יתפוס רוחב מלא למטה */
    }
}

@media (max-width: 600px) {
    #wcaps-filter-form {
        /* שינוי לעמודה אחת במובייל */
        grid-template-columns: 1fr; 
    }
}

.wcaps-select:focus {
    border-color: #a90055; /* צבע מודגש בפוקוס */
}


/* =========================================
   Product Grid Styling - FIXED
   ========================================= */

/* 1. Grid Container Setup */
ul.wcaps-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important; /* רספונסיבי */
    gap: 30px !important;
    
    /* איפוס רשימה מוחלט */
    list-style: none !important;
    margin: 30px 0 0 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* הסרת "פסאודו-אלמנטים" שהתבנית מוסיפה ולפעמים שוברת את הגריד */
ul.wcaps-products-grid::before,
ul.wcaps-products-grid::after {
    display: none !important;
}

/* 2. Product Card Styling */
ul.wcaps-products-grid li.product {
    /* איפוסים קריטיים כדי לדרוס את ה-float של Astra */
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    
    /* עיצוב הכרטיס */
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    
    /* סידור פנימי - Flexbox */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* מרכוז אופקי */
    text-align: center !important;  /* מרכוז טקסט */
    justify-content: space-between !important; /* פיזור לגובה */
    
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover Effect */
ul.wcaps-products-grid li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #a90055;
}

/* 3. Elements Cleanup (Astra specific overrides) */

/* הסתרת כפתור ה"סל" הצף של אסטרה שמופיע על התמונה/בצד */
ul.wcaps-products-grid li.product .ast-on-card-button {
    display: none !important;
}

/* הסתרת תגיות קטגוריה אם הן מופיעות ומפריעות */
ul.wcaps-products-grid li.product .ast-woo-product-category {
    display: none !important;
}

/* 4. Image Styling */
ul.wcaps-products-grid li.product img {
    width: 100% !important;
    height: 220px !important;
    object-fit: cover !important; /* חותך את התמונה שתתאים בדיוק */
    margin-bottom: 15px !important;
    border-radius: 4px;
}

/* 5. Title Styling */
ul.wcaps-products-grid li.product .woocommerce-loop-product__title {
    font-size: 16px !important;
    color: #333;
    line-height: 1.3 !important;
    margin-bottom: 5px !important;
    padding: 0 !important;
    min-height: 42px; /* שומר מקום ל-2 שורות כותרת */
}

/* 6. Price Styling */
ul.wcaps-products-grid li.product .price {
    color: #a90055 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    display: block !important;
    margin-bottom: 15px !important;
}

/* 7. Main "Add to Cart" Button Styling */
/* אנחנו משתמשים בכפתור הרגיל ולא בזה של התבנית */
ul.wcaps-products-grid li.product .button,
ul.wcaps-products-grid li.product .added_to_cart {
    background-color: #222 !important;
    color: #fff !important;
    padding: 10px 25px !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    border: none !important;
    margin-top: auto !important; /* מצמיד את הכפתור לתחתית */
    display: inline-block !important;
    line-height: 1.5 !important;
}

ul.wcaps-products-grid li.product .button:hover {
    background-color: #a90055 !important;
}

ul.wcaps-products-grid li.product .button.loading {
    opacity: 0.7;
}


