/* Thai Address Autocomplete - WooCommerce */

.taa-wrapper {
    position: relative;
}

.taa-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 280px;
    overflow-y: auto;
    display: none;
    font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
}

.taa-dropdown.taa-open {
    display: block;
    animation: taaSlideDown 0.15s ease-out;
}

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

.taa-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.1s ease;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.taa-dropdown-item:last-child {
    border-bottom: none;
}

.taa-dropdown-item:hover,
.taa-dropdown-item.taa-active {
    background: #f0f7ff;
}

.taa-dropdown-item .taa-subdistrict-name {
    font-weight: 600;
    color: #1a73e8;
    font-size: 14px;
}

.taa-dropdown-item .taa-location-detail {
    color: #666;
    font-size: 12px;
    margin-top: 1px;
}

.taa-dropdown-item .taa-postcode-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 12px;
    padding: 0 8px;
    font-size: 11px;
    margin-left: 6px;
    font-weight: 500;
}

.taa-dropdown-item mark {
    background: #fff3cd;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.taa-loading,
.taa-no-results {
    padding: 12px 14px;
    color: #999;
    font-size: 13px;
    text-align: center;
}

.taa-loading::before {
    content: '⏳ ';
}

.taa-no-results::before {
    content: '🔍 ';
}

/* Input styling when active */
input.taa-input-active {
    border-color: #1a73e8 !important;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2) !important;
    border-radius: 4px 4px 0 0 !important;
}

/* Scrollbar */
.taa-dropdown::-webkit-scrollbar {
    width: 4px;
}
.taa-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
}
.taa-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Group separator */
.taa-group-header {
    padding: 6px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .taa-dropdown {
        font-size: 16px; /* prevent iOS zoom */
        max-height: 200px;
    }

    .taa-dropdown-item .taa-subdistrict-name {
        font-size: 15px;
    }
}
