/*
 * Dải exhibitor trang chủ [hxe_featured_exhibitors] (cờ featured_exhibitors — YC-06, spec 08). Màu theo tone site (đỏ đô #9e000a như bộ lọc).
 * Bố cục (lớp trên khối): --marquee (mặc định, IT HAWA #44) hàng tự chạy — featured-exhibitors.js nhân đôi thẻ và chạy; --slider CSS scroll-snap
 * + nút / chấm; --grid lưới tĩnh. Không JS: chỉ tab All, hàng vẫn vuốt / cuộn ngang được. Cột: --hxe-fe-cols (≥ 850 px) / -md (550–849) /
 * -sm (< 550) — mốc của Flatsome. .is-wide: khối rộng --hxe-fe-width % màn hình, canh giữa, vượt khung cột chứa nó.
 */

.hxe-featured {
    --hxe-red: #9e000a;
    --hxe-fe-gap: 30px;
    --hxe-fe-vw: 100vw;
    margin: 0 0 20px;
    color: #111;
}

/* Khung cột của theme hẹp hơn màn hình ⇒ kéo khối ra --hxe-fe-width vw, canh giữa theo màn hình (cột chứa khối canh giữa — trang chủ). */
.hxe-featured.is-wide {
    --hxe-fe-vw: calc(var(--hxe-fe-width, 90) * 1vw);
    width: var(--hxe-fe-vw);
    max-width: none;
    margin-left: calc(50% - var(--hxe-fe-vw) / 2);
}

/* ——— tab ——— */

/* Canh giữa bằng margin auto (không justify-content: center): tràn thì phần đầu vẫn cuộn tới được (center đẩy tràn ra cả hai phía). */
.hxe-featured .hxe-featured__tabs {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0 28px;
    margin: 0 0 26px;
    overflow-x: auto;
    border-bottom: 1px solid #e3e3e3;
    scrollbar-width: none;
}

.hxe-featured .hxe-featured__tabs::-webkit-scrollbar {
    display: none;
}

.hxe-featured .hxe-featured__tabs > :first-child {
    margin-left: auto;
}

.hxe-featured .hxe-featured__tabs > :last-child {
    margin-right: auto;
}

.hxe-featured:not(.hxe-js) .hxe-featured__tabs {
    display: none;
}

.hxe-featured .hxe-featured__tab {
    flex: none;
    min-height: 0;
    margin: 0 0 -1px;
    padding: 10px 0;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #555;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
}

.hxe-featured .hxe-featured__tab:hover,
.hxe-featured .hxe-featured__tab:focus-visible {
    color: var(--hxe-red);
}

.hxe-featured .hxe-featured__tab[aria-selected="true"] {
    border-bottom-color: var(--hxe-red);
    color: var(--hxe-red);
}

/* ——— dải thẻ ——— */

.hxe-featured .hxe-featured__track {
    --cols: var(--hxe-fe-cols, 7);
}

.hxe-featured .hxe-featured__track.is-slider {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--hxe-fe-rows, 1), auto);
    grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--hxe-fe-gap)) / var(--cols));
    gap: 24px var(--hxe-fe-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.hxe-featured .hxe-featured__track.is-slider::-webkit-scrollbar {
    display: none;
}

.hxe-featured .hxe-featured__track.is-slider > .hxe-fe-card {
    scroll-snap-align: start;
}

.hxe-featured .hxe-featured__track.is-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: 24px var(--hxe-fe-gap);
}

@media (max-width: 849px) {
    .hxe-featured .hxe-featured__track {
        --cols: var(--hxe-fe-cols-md, 4);
        --hxe-fe-gap: 20px;
    }
}

@media (max-width: 549px) {
    .hxe-featured .hxe-featured__track {
        --cols: var(--hxe-fe-cols-sm, 2);
        --hxe-fe-gap: 14px;
    }

    .hxe-featured .hxe-featured__tabs {
        gap: 0 20px;
    }
}

/* ——— hàng tự chạy (marquee) ———
 * Thẻ rộng đúng 1/cột của hàng (100cqw — hàng là container) gồm cả khoảng cách (margin hai bên = nửa gap) ⇒ dải = n × bước, bản sao nối đuôi,
 * dịch -50 % là về đúng chỗ cũ. Không chạy (không JS, giảm chuyển động, hàng ít DN hơn số cột): dải canh giữa, tràn thì cuộn ngang. */

/* padding dọc: hàng cắt phần tràn ⇒ vòng focus bàn phím của thẻ (ngoài viền thẻ) cần chỗ trên / dưới; hai bên đã có nửa gap. */
.hxe-featured--marquee .hxe-featured__row {
    container-type: inline-size;
    padding: 4px 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.hxe-featured--marquee .hxe-featured__row + .hxe-featured__row {
    margin-top: 18px;
}

.hxe-featured--marquee .hxe-featured__row.is-running {
    overflow: hidden;
    overflow: clip; /* không là khung cuộn ⇒ focus vào thẻ không cuộn hàng (JS tự đưa thẻ vào khung) */
}

.hxe-featured .hxe-featured__track.is-marquee {
    --hxe-fe-gap: 20px;
    position: relative;
    display: flex;
    width: max-content;
    margin: 0 auto;
}

.hxe-featured .hxe-featured__track.is-marquee > .hxe-fe-card {
    flex: none;
    width: calc(var(--hxe-fe-vw) / var(--cols) - var(--hxe-fe-gap));
    width: calc(100cqw / var(--cols) - var(--hxe-fe-gap));
    margin: 0 calc(var(--hxe-fe-gap) / 2);
}

.hxe-featured.hxe-featured--marquee .hxe-fe-card__name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@media (max-width: 849px) {
    .hxe-featured .hxe-featured__track.is-marquee {
        --hxe-fe-gap: 16px;
    }
}

@media (max-width: 549px) {
    .hxe-featured .hxe-featured__track.is-marquee {
        --hxe-fe-gap: 12px;
    }

    .hxe-featured--marquee .hxe-featured__row + .hxe-featured__row {
        margin-top: 10px;
    }

    .hxe-featured.hxe-featured--marquee .hxe-fe-card__name {
        font-size: 13px;
    }
}

/* ——— thẻ ——— */

.hxe-featured .hxe-fe-card {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.hxe-featured .hxe-fe-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4f4f4;
}

.hxe-featured .hxe-fe-card__img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s;
}

.hxe-featured .hxe-fe-card:hover .hxe-fe-card__img,
.hxe-featured .hxe-fe-card:focus-visible .hxe-fe-card__img {
    transform: scale(1.04);
}

.hxe-featured .hxe-fe-card__name {
    display: block;
    margin-top: 12px;
    color: #333;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.hxe-featured .hxe-fe-card:hover .hxe-fe-card__name,
.hxe-featured .hxe-fe-card:focus-visible .hxe-fe-card__name {
    color: var(--hxe-red);
}

@media (max-width: 549px) {
    .hxe-featured .hxe-fe-card__name {
        margin-top: 8px;
        font-size: 14px;
    }
}

/* ——— nút trước / sau + chấm (featured-exhibitors.js) ——— */

.hxe-featured .hxe-featured__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}

.hxe-featured .hxe-featured__nav[hidden] {
    display: none;
}

.hxe-featured .hxe-featured__prev,
.hxe-featured .hxe-featured__next {
    position: relative;
    flex: none;
    width: 36px;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
}

.hxe-featured .hxe-featured__prev::before,
.hxe-featured .hxe-featured__next::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
}

.hxe-featured .hxe-featured__prev::before {
    transform: translate(-30%, -50%) rotate(-135deg);
}

.hxe-featured .hxe-featured__next::before {
    transform: translate(-70%, -50%) rotate(45deg);
}

.hxe-featured .hxe-featured__prev:hover,
.hxe-featured .hxe-featured__next:hover,
.hxe-featured .hxe-featured__prev:focus-visible,
.hxe-featured .hxe-featured__next:focus-visible {
    border-color: var(--hxe-red);
}

.hxe-featured .hxe-featured__prev:disabled,
.hxe-featured .hxe-featured__next:disabled {
    opacity: 0.35;
    cursor: default;
}

.hxe-featured .hxe-featured__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 70%;
}

.hxe-featured .hxe-featured__dot {
    flex: none;
    width: 10px;
    height: 10px;
    min-width: 0; /* nút của Flatsome có min-width ⇒ chấm thành bầu dục (đo 17/11) */
    min-height: 0;
    font-size: 0;
    line-height: 0;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ccc;
    box-shadow: none;
    cursor: pointer;
    transition: none; /* nút Flatsome có transition nền 0,3 s ⇒ chấm vừa dựng lại hiện xám một lúc (đo 17/11) */
}

.hxe-featured .hxe-featured__dot[aria-current="true"] {
    background: #111;
}

/* ——— Type của Category + View all ——— */

.hxe-featured .hxe-featured__types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.hxe-featured .hxe-featured__types li {
    margin: 0;
}

.hxe-featured .hxe-featured__types a {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid #d6d6d6;
    border-radius: 999px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
}

.hxe-featured .hxe-featured__types a:hover,
.hxe-featured .hxe-featured__types a:focus-visible {
    border-color: var(--hxe-red);
    color: var(--hxe-red);
}

.hxe-featured .hxe-featured__all {
    margin: 20px 0 0;
    text-align: center;
}

.hxe-featured .hxe-featured__all a {
    display: inline-block;
    padding-bottom: 4px;
    border-bottom: 1px solid currentColor;
    color: var(--hxe-red);
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .hxe-featured .hxe-featured__track.is-slider {
        scroll-behavior: auto;
    }

    .hxe-featured .hxe-fe-card__img {
        transition: none;
    }
}
