.delivery-checker-container {
    max-width: 400px;
    margin: 15px auto;
    padding: 0;
    font-family: inherit;
    direction: rtl;
}

.delivery-checker-container.delivery-compact {
    max-width: 300px;
}

.delivery-form {
    position: relative;
    margin-bottom: 15px;
}

.delivery-city-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: right;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    background: #fff;
}

.delivery-city-input:focus {
    outline: none;
    border-color: #115C3A;
    box-shadow: 0 0 0 2px rgba(17, 92, 58, 0.1);
}

.delivery-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.delivery-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    color: #333;
    border-bottom: 1px solid #eee;
    text-align: right;
    transition: background-color 0.2s ease;
}

.delivery-suggestion:hover {
    background: #f5f5f5;
}

.delivery-suggestion:last-child {
    border-bottom: none;
}

.delivery-button {
    background: #115C3A;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.delivery-button:hover {
    background: #0d4529;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 92, 58, 0.3);
}

.delivery-button:active {
    transform: translateY(0);
}

.delivery-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.delivery-result {
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    margin-top: 15px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.delivery-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.delivery-result.partial {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* עיצוב קומפקטי */
.delivery-checker-container.delivery-compact .delivery-city-input,
.delivery-checker-container.delivery-compact .delivery-button {
    padding: 10px 15px;
    font-size: 14px;
}

.delivery-checker-container.delivery-compact .delivery-result {
    padding: 12px;
    font-size: 14px;
}

/* פופאפ מנודל על ידי הפלאגין */
.delivery-popup-trigger-container {
    text-align: center;
    margin: 20px 0;
}

.delivery-popup-trigger-btn {
    background: linear-gradient(135deg, #115C3A 0%, #0d4529 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(17, 92, 58, 0.3);
    text-transform: none;
}

.delivery-popup-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 92, 58, 0.4);
    background: linear-gradient(135deg, #0d4529 0%, #115C3A 100%);
}

.delivery-popup-trigger-btn:active {
    transform: translateY(0);
}

.delivery-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.delivery-popup-container {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh; /* הגדלנו מ 90vh ל 80vh כדי לתת מקום */
    min-height: 400px; /* הוספנו גובה מינימלי */
    overflow-y: auto;
    animation: popupSlideIn 0.3s ease-out;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.delivery-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0; /* מונע התכווצות של ההדר */
}

.delivery-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.delivery-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.3s ease;
}

.delivery-popup-close:hover {
    color: #333;
}

.delivery-popup-content {
    padding: 25px;
    flex: 1; /* תופס את כל השטח הפנוי */
    overflow-y: auto; /* מאפשר גלילה בתוכן אם צריך */
    display: flex;
    flex-direction: column;
}

.delivery-popup-content .delivery-checker-container {
    margin: 0;
    max-width: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.delivery-popup-content .delivery-form {
    position: relative;
    flex-shrink: 0; /* מונע התכווצות של הטופס */
}

/* התאמה מיוחדת לאוטוקומפליט בפופאפ */
.delivery-popup-content .delivery-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10000; /* z-index גבוה יותר מהפופאפ */
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

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

@keyframes popupSlideIn {
    from {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* רספונסיב */
@media (max-width: 480px) {
    .delivery-checker-container {
        margin: 10px;
    }
    
    .delivery-city-input,
    .delivery-button {
        font-size: 16px; /* למנוע זום במובייל */
    }
    
    .delivery-popup-container {
        width: 95%;
        margin: 20px;
        max-height: 85vh; /* התאמה למובייל */
        min-height: 350px;
    }
    
    .delivery-popup-header,
    .delivery-popup-content {
        padding: 15px 20px;
    }
    
    .delivery-popup-trigger-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
}

/* תמיכה מיוחדת למובייל קטן */
@media (max-width: 320px) {
    .delivery-popup-container {
        min-height: 300px;
        max-height: 90vh;
    }
    
    .delivery-popup-content {
        padding: 12px 15px;
    }
    
    .delivery-popup-header {
        padding: 12px 15px 10px 15px;
    }
}

/* תאמות עם אלמנטור */
.elementor-widget-container .delivery-checker-container {
    margin: 0;
}

.elementor-widget-container .delivery-popup-trigger-container {
    margin: 0;
}

/* הסתרת אוטו-קומפליט של הדפדפן */
.delivery-city-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.delivery-city-input::-webkit-input-placeholder {
    color: #999;
}

.delivery-city-input::-moz-placeholder {
    color: #999;
}

.delivery-city-input:-ms-input-placeholder {
    color: #999;
}

.delivery-city-input::placeholder {
    color: #999;
}

/* שיפורים נוספים לחוויית משתמש */
.delivery-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.delivery-suggestion .city-name {
    flex: 1;
    text-align: right;
}

.delivery-suggestion .city-badge {
    font-size: 11px;
    background: #115C3A;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

.delivery-suggestion:hover .city-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #115C3A;
}

/* אנימציות משופרות */
.delivery-suggestions {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* התמקדות משופרת */
.delivery-city-input:focus + .delivery-suggestions {
    border-color: #115C3A;
}

/* טוען */
.delivery-button.loading {
    position: relative;
}

.delivery-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* גרסת מעלית לפופאפ */
.delivery-popup-overlay.show {
    display: flex !important;
}

.delivery-popup-overlay.hide {
    display: none !important;
}

/* סגנון מיוחד לתוצאות בפופאפ */
.delivery-popup-content .delivery-result {
    margin-top: 20px;
    border-radius: 12px;
    padding: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.delivery-popup-content .delivery-result.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #115C3A;
}

.delivery-popup-content .delivery-result.partial {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
}