/**
 * Query Filter Block Custom Styles
 * Theme: anm-block-theme
 * Scoped root: .wp-block-anm-query-filter
 */

.wp-block-anm-query-filter,
.anm-query-filter {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}

.wp-block-anm-query-filter *,
.anm-query-filter * {
    box-sizing: border-box;
}

.wp-block-anm-query-filter .components-server-side-render {
    width: 100%;
}

/* 1. Hàng trên: Search & Dropdowns */
.wp-block-anm-query-filter .anm-qf-row--top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.wp-block-anm-query-filter .anm-qf-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 280px;
    min-width: 240px;
}

.wp-block-anm-query-filter .anm-qf-search-icon {
    position: absolute;
    left: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    pointer-events: none;
}

.wp-block-anm-query-filter .anm-qf-search-input {
    width: 100%;
    height: 46px;
    padding: 10px 36px 10px 42px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14.5px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wp-block-anm-query-filter .anm-qf-search-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.wp-block-anm-query-filter .anm-qf-search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
}

.wp-block-anm-query-filter .anm-qf-search-clear:hover {
    color: #ef4444;
}

.wp-block-anm-query-filter .anm-qf-dropdowns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.wp-block-anm-query-filter .anm-qf-select-wrap,
.wp-block-anm-query-filter .anm-qf-sort-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.wp-block-anm-query-filter .anm-qf-select,
.wp-block-anm-query-filter .anm-qf-sort-select {
    appearance: none;
    -webkit-appearance: none;
    height: 46px;
    padding: 0 38px 0 16px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wp-block-anm-query-filter .anm-qf-select:focus,
.wp-block-anm-query-filter .anm-qf-sort-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.wp-block-anm-query-filter .anm-qf-chevron {
    position: absolute;
    right: 14px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    pointer-events: none;
    margin-top: -3px;
}

/* 2. Hàng giữa: Chips / Pills */
.wp-block-anm-query-filter .anm-qf-row--chips {
    margin-top: 2px;
}

.wp-block-anm-query-filter .anm-qf-chips-scroll {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none; /* Firefox */
}

.wp-block-anm-query-filter .anm-qf-chips-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.wp-block-anm-query-filter .anm-qf-chip {
    flex-shrink: 0;
    height: 38px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wp-block-anm-query-filter .anm-qf-chip:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.wp-block-anm-query-filter .anm-qf-chip.is-active {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

/* 3. Hàng dưới: Meta Bar (Count + Sort) */
.wp-block-anm-query-filter .anm-qf-row--meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
}

.wp-block-anm-query-filter .anm-qf-count-text {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

.wp-block-anm-query-filter .anm-qf-sort-select {
    height: 38px;
    padding: 0 34px 0 14px;
    border-radius: 10px;
    font-size: 13.5px;
}

/* 4. Responsive */
@media (max-width: 768px) {
    .wp-block-anm-query-filter .anm-qf-row--top {
        flex-direction: column;
        align-items: stretch;
    }

    .wp-block-anm-query-filter .anm-qf-search-wrapper {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
    }

    .wp-block-anm-query-filter .anm-qf-dropdowns {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        width: 100%;
    }

    .wp-block-anm-query-filter .anm-qf-select-wrap {
        width: 100%;
    }

    .wp-block-anm-query-filter .anm-qf-select {
        width: 100%;
    }

    .wp-block-anm-query-filter .anm-qf-row--meta {
        flex-wrap: wrap;
        gap: 10px;
    }
}

