/* Postal Code Search Widget Styles */
.postal-search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

/* Special styles for search form integration */
.search-form .postal-search-container {
    max-width: none;
    width: 100%;
}

.search-form .postal-search-container .postal-search-results {
    top: calc(100% + 8px);
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    z-index: 1001;
}

.postal-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background-color: #fff;
}

.postal-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.postal-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.postal-search-results .search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.postal-search-results .search-result-item:hover {
    background-color: #f8f9fa;
}

.postal-search-results .search-result-item:last-child {
    border-bottom: none;
}

.postal-search-results .postal-code {
    font-weight: 600;
    color: #007bff;
    font-size: 14px;
    min-width: 60px;
}

.postal-search-results .city-name {
    color: #495057;
    font-size: 14px;
    flex: 1;
    text-align: right;
}

.search-loading,
.search-error,
.search-no-results {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: #6c757d;
}

.search-loading {
    color: #007bff;
}

.search-error {
    color: #dc3545;
}

.search-no-results {
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .postal-search-container {
        max-width: 100%;
    }
    
    .postal-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .postal-search-results .search-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .postal-search-results .city-name {
        text-align: left;
        font-size: 13px;
    }
}

/* Animation for results appearing */
.postal-search-results {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
