/* Jet Search Location Button and Modal Styles */

/* Location Button */
.jet-ajax-search__location-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    max-width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f8f9fa;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px 16px;
    z-index: 2;
    transition: all 0.2s ease;
    color: #666;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    direction: rtl;
    text-align: center;
}

body:not(.rtl) .jet-ajax-search__location-button {
    right: 1px;
}

body.rtl .jet-ajax-search__location-button {
    left: 1px;
}

.jet-ajax-search__location-button:hover {
    color: #4268C1;
    background: #f0f4ff;
    border-color: #4268C1;
}

.jet-ajax-search__location-button:focus {
    outline: 2px solid #4268C1;
    outline-offset: 2px;
}

.jet-ajax-search__location-button--active {
    color: #4268C1;
    background: #f0f4ff;
    border-color: #4268C1;
}

.jet-ajax-search__location-button--active:hover {
    background: #e6f0ff;
}

.jet-ajax-search__location-text {
    font-size: 14px;
    line-height: 1;
    color: inherit;
    font-family: inherit;
}

.jet-ajax-search__location-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Adjust search input padding to make room for location button */
body:not(.rtl) .jet-ajax-search__field-wrapper .jet-ajax-search__field {
    padding-right: 140px;
}

body.rtl .jet-ajax-search__field-wrapper .jet-ajax-search__field {
    padding-left: 140px;
}

/* Location Modal */
.jet-ajax-search__location-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.jet-ajax-search__location-modal.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.jet-ajax-search__location-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(2px);
    z-index: 999999 !important;
}

.jet-ajax-search__location-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.jet-ajax-search__location-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #E1E5EB;
    background: #f8f9fa;
}

.jet-ajax-search__location-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.jet-ajax-search__location-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.jet-ajax-search__location-modal-close:hover {
    background-color: #E1E5EB;
}

/* Modal Body */
.jet-ajax-search__location-modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Map Container */
.jet-ajax-search__location-map {
    width: 100% !important;
    height: 400px !important;
    min-height: 400px !important;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin: 15px 0;
    display: block !important;
    position: relative !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

/* Ensure Google Maps elements are interactive */
.jet-ajax-search__location-map * {
    pointer-events: auto !important;
}

.jet-ajax-search__location-map .gm-style {
    font-family: Roboto, Arial, sans-serif !important;
}

.jet-ajax-search__location-map .gm-style > div {
    pointer-events: auto !important;
}

/* Fix for Google Maps controls */
.jet-ajax-search__location-map .gmnoprint {
    pointer-events: auto !important;
}

.jet-ajax-search__location-map .gm-bundled-control {
    pointer-events: auto !important;
}

.jet-ajax-search__location-search-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.jet-ajax-search__location-search {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #E1E5EB;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.jet-ajax-search__location-search:focus {
    outline: none;
    border-color: #4268C1;
    box-shadow: 0 0 0 3px rgba(66, 104, 193, 0.1);
}

.jet-ajax-search__location-detect {
    padding: 12px;
    background: #4268C1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jet-ajax-search__location-detect:hover {
    background: #203D5A;
}

.jet-ajax-search__location-detect:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Map Container */
.jet-ajax-search__location-map {
    width: 100%;
    height: 300px;
    border: 1px solid #E1E5EB;
    border-radius: 6px;
    margin-bottom: 20px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Location Details */
.jet-ajax-search__location-details {
    margin-bottom: 20px;
}

.jet-ajax-search__location-address {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.jet-ajax-search__location-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}


/* Modal Footer */
.jet-ajax-search__location-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #E1E5EB;
    background: #f8f9fa;
}

.jet-ajax-search__location-cancel,
.jet-ajax-search__location-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.jet-ajax-search__location-cancel {
    background: #E1E5EB;
    color: #333;
}

.jet-ajax-search__location-cancel:hover {
    background: #d0d5dd;
}

.jet-ajax-search__location-confirm {
    background: #4268C1;
    color: white;
}

.jet-ajax-search__location-confirm:hover:not(:disabled) {
    background: #203D5A;
}

.jet-ajax-search__location-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading State */
.jet-ajax-search__location-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.jet-ajax-search__location-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #E1E5EB;
    border-top: 3px solid #4268C1;
    border-radius: 50%;
    animation: jet-location-spin 1s linear infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .jet-ajax-search__location-button {
        min-width: 100px;
        height: 36px;
        padding: 6px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    .jet-ajax-search__location-text {
        font-size: 12px;
    }
    
    body:not(.rtl) .jet-ajax-search__field-wrapper .jet-ajax-search__field {
        padding-right: 110px;
    }

    body.rtl .jet-ajax-search__field-wrapper .jet-ajax-search__field {
        padding-left: 110px;
    }
    
    .jet-ajax-search__location-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }
    
    .jet-ajax-search__location-modal-header,
    .jet-ajax-search__location-modal-body,
    .jet-ajax-search__location-modal-footer {
        padding: 15px;
    }
    
    .jet-ajax-search__location-map {
        height: 250px;
    }
    
    .jet-ajax-search__location-modal-footer {
        flex-direction: column;
    }
    
    .jet-ajax-search__location-cancel,
    .jet-ajax-search__location-confirm {
        width: 100%;
    }
}


/* Ensure modal content is properly positioned */
.jet-ajax-search__location-modal-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1000000 !important;
} 

/* Active Location Button State */
.jet-ajax-search__location-button--active {
    background-color: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: white !important;
}

.jet-ajax-search__location-button--active:hover {
    background-color: #45a049 !important;
    border-color: #45a049 !important;
}

.jet-ajax-search__location-button--active .jet-ajax-search__location-text {
    color: white !important;
} 


.jet-ajax-search__location-map iframe + div {
    display: none;
}