/*
 * Bộ lọc Exhibitor List (cờ filter_v2, #43, spec 07) — /exhibitor-list/ và trang Archive. Màu theo theme: chữ đen, vạch đen trên thanh
 * lọc, đỏ đô #9e000a của nút năm. Nút năm dùng class nút của theme (.blog-detail .btn …).
 * Tiêu đề panel là <p role="heading">: site có `h2 { font-size: 48px !important }` (CSS tuỳ biến, đo 11/11/2026).
 * Panel: ≥ 1024 px ngăn kéo trái 400 px · 600–1023 px min(480px, 85vw) · < 600 px toàn màn hình. Đầu + chân panel dính, phần giữa cuộn.
 * Không JS: panel mở bằng :target; có JS (filter.js thêm .hxe-js): mở bằng .is-open, nhóm thu gọn, Type hiện theo Category.
 */

.hxe-filter {
    --hxe-red: #9e000a;
    --hxe-ink: #111;
    --hxe-muted: #6b6b6b;
    --hxe-line: #e3e3e3;
    margin: 0 0 24px;
    color: var(--hxe-ink);
}

/* ——— thanh trên: ô tìm · Filter | năm · location · tổng ——— */

.hxe-filter .hxe-filter__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 0;
    padding-top: 10px;
    border-top: 1px solid #000;
}

.hxe-filter .hxe-filter__form {
    display: flex;
    flex: 1 1 100%;
    align-items: center;
    gap: 8px 20px;
    min-width: 0;
    margin: 0;
}

.hxe-filter .hxe-filter__search {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
}

.hxe-filter .hxe-filter__go {
    position: absolute;
    top: 50%;
    left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #000;
    line-height: 1;
    transform: translateY(-50%);
}

.hxe-filter .hxe-filter__go svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.hxe-filter .hxe-filter__input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 0 8px 0 38px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: var(--hxe-ink);
    font-size: 16px; /* < 16 px ⇒ Safari iOS phóng to khi bấm */
    -webkit-appearance: none;
    appearance: none;
}

.hxe-filter .hxe-filter__input:focus {
    box-shadow: inset 0 -2px 0 var(--hxe-red);
}

.hxe-filter .hxe-filter__open {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 40px;
    padding: 0 4px 0 32px;
    color: #000;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

/* Biểu tượng thanh trượt — cùng SVG của theme (page-exhibitor.php). */
.hxe-filter .hxe-filter__open::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 70 70' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M29.1 10C27.1 4.2 21.5 0 15 0C6.7 0 0 6.7 0 15C0 23.3 6.7 30 15 30C21.5 30 27.1 25.8 29.1 20H70V10H29.1ZM15 20C12.2 20 10 17.8 10 15C10 12.2 12.2 10 15 10C17.8 10 20 12.2 20 15C20 17.8 17.8 20 15 20Z' fill='black' fill-opacity='0.97'/%3E%3Cpath d='M55 40C48.5 40 42.9 44.2 40.9 50H0V60H40.9C43 65.8 48.5 70 55 70C63.3 70 70 63.3 70 55C70 46.7 63.3 40 55 40ZM55 60C52.2 60 50 57.8 50 55C50 52.2 52.2 50 55 50C57.8 50 60 52.2 60 55C60 57.8 57.8 60 55 60Z' fill='black' fill-opacity='0.97'/%3E%3C/svg%3E") no-repeat center / contain;
    transform: translateY(-50%);
}

.hxe-filter .hxe-filter__badge {
    margin-left: 6px;
    color: var(--hxe-red);
}

.hxe-filter .hxe-filter__totals {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    min-width: 0;
}

/* Nút năm: <a> mang class nút của theme — phần thẻ <a> khác <button>. */
.hxe-filter .hxe-filter__years {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.hxe-filter .hxe-filter__years .btn-season {
    display: inline-block;
    margin: 0;
    text-decoration: none;
}

.hxe-filter .hxe-filter__years .btn-outline-primary:hover,
.hxe-filter .hxe-filter__years .btn-outline-primary:focus-visible {
    background-color: var(--hxe-red);
    color: #fff;
}

.hxe-filter .hxe-filter__location {
    width: auto;
    max-width: 100%;
    height: 40px;
    margin: 0;
    padding: 0 30px 0 14px;
    border: 1px solid var(--hxe-red);
    color: var(--hxe-red);
    letter-spacing: 1.25px;
}

.hxe-filter .hxe-filter__total {
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .hxe-filter .hxe-filter__top {
        flex-wrap: nowrap;
    }

    .hxe-filter .hxe-filter__form {
        flex: 0 1 50%;
        padding-right: 20px;
        border-right: 1px solid #000;
    }

    .hxe-filter .hxe-filter__totals {
        flex: 1 1 50%;
        padding-left: 20px;
    }
}

/* ——— dải "đang lọc" ——— */

.hxe-filter .hxe-filter__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.hxe-filter .hxe-filter__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-height: 32px;
    padding: 4px 10px 4px 14px;
    border: 1px solid #cfcfcf;
    border-radius: 999px;
    background: #fff;
    color: var(--hxe-ink);
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.hxe-filter .hxe-filter__chip > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hxe-filter .hxe-filter__chip:hover,
.hxe-filter .hxe-filter__chip:focus-visible {
    border-color: var(--hxe-red);
    color: var(--hxe-red);
}

.hxe-filter .hxe-filter__x {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
}

.hxe-filter .hxe-filter__clear,
.hxe-filter .hxe-filter__reset {
    color: var(--hxe-red);
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hxe-filter .hxe-filter__clear {
    margin-left: 4px;
}

/* ——— panel ——— */

.hxe-filter .hxe-filter__panel {
    position: fixed;
    inset: 0;
    z-index: 100000; /* trên header dính của Flatsome và popup của theme */
    display: none;
}

.hxe-filter.hxe-js .hxe-filter__panel.is-open,
.hxe-filter:not(.hxe-js) .hxe-filter__panel:target {
    display: block;
}

.hxe-filter .hxe-filter__panel:focus {
    outline: none;
}

.hxe-filter .hxe-filter__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: default;
}

.hxe-filter .hxe-filter__sheet {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.2);
    animation: hxe-filter-in 0.2s ease-out;
}

@keyframes hxe-filter-in {
    from {
        transform: translateX(-24px);
        opacity: 0;
    }
}

@media (max-width: 1023px) {
    .hxe-filter .hxe-filter__sheet {
        width: min(480px, 85vw);
    }
}

@media (max-width: 599px) {
    .hxe-filter .hxe-filter__sheet {
        width: 100%;
        height: 100dvh;
        box-shadow: none;
    }
}

.hxe-filter .hxe-filter__head,
.hxe-filter .hxe-filter__foot {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 20px;
    background: #fff;
}

.hxe-filter .hxe-filter__head {
    border-bottom: 1px solid var(--hxe-line);
}

.hxe-filter .hxe-filter__title {
    margin: 0;
    color: #000;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.hxe-filter .hxe-filter__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #000;
    font-size: 30px;
    line-height: 1;
    text-decoration: none;
}

.hxe-filter .hxe-filter__close:hover,
.hxe-filter .hxe-filter__close:focus-visible {
    background: #f2f2f2;
}

.hxe-filter .hxe-filter__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 4px 20px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.hxe-filter .hxe-filter__foot {
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--hxe-line);
}

.hxe-filter .hxe-filter__apply {
    flex: 0 1 auto;
    min-width: 170px;
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0 20px;
    border: 0;
    border-radius: 4px;
    background: var(--hxe-red);
    color: #fff;
    font-size: 14px;
    line-height: 44px;
    letter-spacing: 1.25px;
    text-transform: uppercase;
}

.hxe-filter .hxe-filter__apply:hover,
.hxe-filter .hxe-filter__apply:focus-visible {
    background: #7a0008;
}

.hxe-filter .hxe-filter__locked {
    margin: 14px 0 4px;
    padding: 10px 12px;
    border-radius: 4px;
    background: #f6f6f6;
    font-size: 14px;
}

.hxe-filter .hxe-filter__locked span {
    display: block;
    color: var(--hxe-muted);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ——— nhóm (accordion) ——— */

.hxe-filter .hxe-filter__group {
    border-bottom: 1px solid var(--hxe-line);
}

.hxe-filter .hxe-filter__heading {
    margin: 0;
    font-size: inherit;
}

.hxe-filter .hxe-filter__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 10px 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
}

.hxe-filter .hxe-filter__toggle::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.15s;
}

.hxe-filter .hxe-filter__toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg) translateX(-3px);
}

.hxe-filter:not(.hxe-js) .hxe-filter__toggle::after {
    display: none; /* không JS: nhóm luôn mở, nút không làm gì */
}

.hxe-filter .hxe-filter__n {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--hxe-red);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.hxe-filter.hxe-js .hxe-filter__group:not(.is-open) > .hxe-filter__options {
    display: none;
}

/* Theme đặt mọi `ul` trong .exhibitor_list thành lưới thẻ (flex, li rộng 33% / 50%) ⇒ đặt lại cho danh sách của panel. */
.hxe-filter .hxe-filter__options,
.hxe-filter .hxe-filter__types {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hxe-filter .hxe-filter__options {
    padding-bottom: 12px;
}

.hxe-filter .hxe-filter__option {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    float: none;
    list-style: none;
}

.hxe-filter .hxe-filter__label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 7px 0;
    color: var(--hxe-ink);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
    cursor: pointer;
}

.hxe-filter .hxe-filter__label input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--hxe-red);
    cursor: pointer;
}

.hxe-filter .hxe-filter__text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word; /* chỉ gãy giữa từ khi một từ dài hơn cả dòng */
}

.hxe-filter .hxe-filter__count {
    flex: 0 0 auto;
    color: var(--hxe-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.hxe-filter .hxe-filter__option--cat > .hxe-filter__label {
    font-weight: 600;
}

.hxe-filter .hxe-filter__types {
    margin: 0 0 6px 8px;
    padding-left: 18px;
    border-left: 2px solid var(--hxe-line);
}

.hxe-filter.hxe-js .hxe-filter__option--cat:not(.is-open) > .hxe-filter__types {
    display: none;
}

@media (min-width: 600px) {
    .hxe-filter .hxe-filter__group--cols > .hxe-filter__options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 16px;
    }
}

@media (max-width: 599px) {
    .hxe-filter .hxe-filter__label {
        min-height: 44px;
        align-items: center;
        padding: 6px 0;
    }

    .hxe-filter .hxe-filter__label input {
        margin-top: 0;
    }
}

/* Khoá cuộn trang khi panel mở (filter.js). */
html.hxe-filter-lock,
html.hxe-filter-lock body {
    overflow: hidden;
}

.hxe-filter a:focus-visible,
.hxe-filter button:focus-visible,
.hxe-filter input:focus-visible,
.hxe-filter select:focus-visible {
    outline: 2px solid var(--hxe-red);
    outline-offset: 2px;
}

.hxe-filter__none {
    padding: 0 0 24px;
}

@media (prefers-reduced-motion: reduce) {
    .hxe-filter .hxe-filter__sheet {
        animation: none;
    }

    .hxe-filter .hxe-filter__toggle::after,
    .hxe-filter .hxe-filter__chip {
        transition: none;
    }
}
