/* 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 h2 { 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-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%;
}

.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-fuzzy-input-wrapper { margin-top: 30px; }
    .wc-modal-body .wc-results-list { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }
    .wc-popular-list { gap: 15px; }
}