/* WooCommerce Fuzzy Search - Top Drawer Style */

.wc-fuzzy-z-index-boost {
    z-index: 9999999 !important;
}

.wc-search-popup-trigger {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer !important;
    padding: 10px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    color: #000;
    min-width: 44px;
    min-height: 44px;
}

.wc-search-popup-trigger:hover {
    transform: scale(1.1);
}

.wc-search-popup-trigger svg,
.wc-search-popup-trigger i,
.wc-search-popup-trigger img,
.wc-fuzzy-search-submit svg,
.wc-fuzzy-search-submit i,
.wc-fuzzy-search-submit img {
    width: 24px !important;
    height: 24px !important;
    font-size: 24px !important;
    display: block;
    object-fit: contain;
}

.wc-search-popup-trigger svg:not([fill="none"]),
.wc-fuzzy-search-submit svg:not([fill="none"]) {
    fill: currentColor !important;
}

.wc-search-popup-trigger svg[fill="none"],
.wc-fuzzy-search-submit svg[fill="none"] {
    stroke: currentColor !important;
    fill: transparent !important;
}

.wc-fuzzy-search-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;
    direction: rtl;
    display: none;
}

.wc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); 
    display: block !important;
    backdrop-filter: blur(3px);
    animation: fadeInFuzzy 0.4s ease forwards;
}

.wc-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    animation: slideDownFuzzy 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDownFuzzy {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes fadeInFuzzy {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wc-modal-header {
    position: absolute;
    right: 40px;
    top: 35px;
    z-index: 20;
    border: none;
    padding: 0;
}

.wc-modal-header .wc-modal-title { display: none; }

.wc-modal-close {
    background: transparent;
    border: 1px solid #eaeaea;
    border-radius: 50%;
    box-sizing: border-box !important;
    width: 44px;
    height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    transition: all 0.3s ease;
    padding: 0 !important;
    box-shadow: none;
    flex-shrink: 0 !important;
}

.wc-modal-close:hover {
    border-color: #000;
    background: #f9f9f9;
}

.wc-modal-close svg {
    width: 16px !important;
    height: 16px !important;
    stroke-width: 1.5;
    color: #000;
}

.wc-modal-body {
    padding: 40px 20px 30px 20px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow-y: auto;
}

.wc-fuzzy-input-wrapper {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    width: 100%;
    margin: 0 auto;
    overflow: hidden; 
    box-sizing: border-box;
}

/* פריסת "כפתורים בחוץ": השדה בצד ימין, שני הכפתורים יחד בצד שמאל (דיבור קרוב לשדה, חיפוש בקצה שמאל) */
.wc-fuzzy-layout-container.layout-outside {
    flex-direction: row !important;
}
.wc-fuzzy-layout-container.layout-outside .wc-fuzzy-input-wrapper {
    order: 1;
}
.wc-fuzzy-layout-container.layout-outside .wc-fuzzy-search-submit {
    order: 2;
}
.wc-fuzzy-layout-container.layout-outside .wc-fuzzy-voice-btn {
    order: 3;
}

.wc-fuzzy-search-submit {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #000;
    width: 40px;
    height: 40px;
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0 !important;
    padding: 0 !important;
    outline: none !important;
}

/* שדה החיפוש - עכשיו נקי מהגדרות כדי שאלמנטור ישלוט בהכל */
.wc-fuzzy-search-input {
    border: none !important;
    background: transparent !important;
    padding: 10px; 
    width: 100%;
    text-align: right;
    box-shadow: none !important;
    outline: none !important;
}

.wc-fuzzy-search-input::placeholder {
    opacity: 1;
}

.wc-fuzzy-search-loading {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
}

.wc-modal-body .wc-fuzzy-search-results {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    margin-top: 40px;
    background: transparent !important;
}

.wc-modal-body .wc-results-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px 20px;
}

.wc-modal-body .wc-result-item {
    background: transparent !important;
    transition: opacity 0.2s;
}

.wc-modal-body .wc-result-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    text-decoration: none;
}

.wc-modal-body .wc-result-item:hover {
    opacity: 0.7;
}

.wc-modal-body .wc-result-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f9f9f9;
    border-radius: 4px;
    overflow: hidden;
}

.wc-modal-body .wc-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wc-modal-body .wc-result-title {
    font-size: 15px;
    font-weight: 400;
    color: #000;
    margin: 0;
    line-height: 1.3;
}

.wc-modal-body .wc-result-price {
    font-size: 15px;
    font-weight: 700;
    color: #000;
}

.wc-modal-body .wc-result-stock { display: none; }

.wc-popular-searches-container {
    text-align: center;
    margin-top: 10px;
    animation: fadeInFuzzy 0.3s ease;
}

.wc-popular-title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    margin-bottom: 25px;
}

.wc-popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
}

.wc-popular-list li { margin: 0; }

.wc-popular-term {
    display: inline-block;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    padding: 5px 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.wc-popular-term:hover {
    color: #000;
}

.wc-view-all {
    text-align: center;
    margin-top: 40px;
    width: 100%;
    padding-bottom: 20px;
}

.wc-view-all-button {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    padding: 10px 30px;
    background-color: #f1f1f1;
    color: #000;
    border-radius: 5px;
}

@media (max-width: 992px) {
    .wc-modal-body .wc-results-list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .wc-modal-header { right: 15px; top: 15px; }
    .wc-modal-close { width: 36px; height: 36px; }
    .wc-modal-body { padding: 30px 15px 20px 15px; }
    .wc-modal-body .wc-fuzzy-input-wrapper { margin-top: 30px; }
    .wc-fuzzy-mode-inline .wc-fuzzy-input-wrapper { margin-top: 0 !important; }
    .wc-modal-body .wc-results-list { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }
    .wc-popular-list { gap: 15px; }
}


/* --- חיפוש קולי (מיקרופון) --- */
.wc-fuzzy-voice-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #888;
    width: 40px;
    height: 40px;
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0 !important;
    padding: 0 !important;
    outline: none !important;
    transition: all 0.3s ease;
}

.wc-fuzzy-voice-btn:hover {
    color: #000;
}

.wc-fuzzy-voice-btn.listening {
    color: #ff0000;
    animation: pulseMic 1.5s infinite;
}

@keyframes pulseMic {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}


/* --- עיצוב שורת תוצאה חדשה (אופקי - כמו בתמונה) --- */
.wc-result-item {
    border-bottom: 1px solid #eaeaea;
    transition: background 0.2s ease;
}
.wc-result-item:last-child {
    border-bottom: none;
}
.wc-result-item:hover, .wc-result-item.active {
    background-color: #f7f7f7;
}
.wc-result-link {
    display: flex;
    flex-direction: row;
    padding: 15px;
    gap: 15px;
    text-decoration: none !important;
    color: inherit;
}
.wc-result-thumbnail {
    flex-shrink: 0;
    width: 80px; /* רוחב ברירת מחדל - נשלט מאלמנטור */
}
.wc-result-thumbnail img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
}
.wc-result-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}
.wc-result-text-area {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}
.wc-result-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    color: #222;
}
.wc-result-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}
.wc-result-price {
    align-self: flex-end; /* דוחף את המחיר לצד שמאל (ב-RTL) */
    margin-top: 8px;
    font-weight: bold;
    font-size: 15px;
    color: #000;
    direction: ltr; /* שומר על סמל השקל בצד הנכון */
    text-align: left;
}
.wc-result-price del {
    font-weight: normal;
    font-size: 0.85em;
    color: #999;
    margin-right: 5px;
}
.wc-result-price ins {
    text-decoration: none;
}

/* --- הגדרת תפריט תוצאות צף (Inline - כדי שלא ידחוף את האתר למטה) --- */

/* הופך את טופס החיפוש לעוגן שעליו תרחף החלונית */
.elementor-fuzzy-search[data-mode="inline"] .wc-fuzzy-search-form {
    position: relative;
}

/* הגדרות החלונית הצפה */
.elementor-fuzzy-search[data-mode="inline"] .wc-fuzzy-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999; /* תמיד יופיע מעל כל שאר האלמנטים באתר */
    background-color: #ffffff;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.15); /* צל אלגנטי */
    border: 1px solid #eaeaea;
    border-radius: 8px;
    margin-top: 8px; /* מרווח קטן מהפס האמצעי */
    max-height: 65vh; /* מגביל גובה */
    overflow-y: auto; /* מוסיף פס גלילה בעת הצורך */
}

/* עיצוב לפס הגלילה של החלונית הצפה */
.elementor-fuzzy-search[data-mode="inline"] .wc-fuzzy-search-results::-webkit-scrollbar {
    width: 6px;
}
.elementor-fuzzy-search[data-mode="inline"] .wc-fuzzy-search-results::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 8px;
}
.elementor-fuzzy-search[data-mode="inline"] .wc-fuzzy-search-results::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 8px;
}
.elementor-fuzzy-search[data-mode="inline"] .wc-fuzzy-search-results::-webkit-scrollbar-thumb:hover {
    background: #999; 
}
/* ============================================================
   נגישות (WCAG 2.0 AA / ת"י 5568)
   ============================================================ */

/* טקסט לקורא מסך בלבד (אזור הכרזות חי + תוויות נסתרות) */
.wc-fuzzy-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* חיווי פוקוס נראה למשתמשי מקלדת (שדה החיפוש עצמו ללא outline, לכן מוצג על העטיפה) */
.wc-fuzzy-input-wrapper:focus-within {
    outline: 2px solid #1a73e8 !important;
    outline-offset: 2px;
}
.wc-search-popup-trigger:focus-visible,
.wc-fuzzy-search-submit:focus-visible,
.wc-fuzzy-voice-btn:focus-visible,
.wc-modal-close:focus-visible,
.wc-result-link:focus-visible,
.wc-view-all-button:focus-visible,
.wc-popular-term:focus-visible,
.wc-suggestion-link:focus-visible {
    outline: 2px solid #1a73e8 !important;
    outline-offset: 2px;
}

/* גיבוי לדפדפנים ללא תמיכה ב-:focus-visible */
.wc-search-popup-trigger:focus,
.wc-modal-close:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* כיבוד העדפת "צמצום אנימציות" של מערכת ההפעלה */
@media (prefers-reduced-motion: reduce) {
    .wc-fuzzy-voice-btn.listening { animation: none !important; }
}
