/*
 * Du Lịch Vàng – danh sách tour, trang điểm đến / loại tour, trang "Điểm đến", "Phong cách du lịch".
 * Giai đoạn 15 (1.17.0, docs/nang-cap-giao-dien.md mục 5.4). Nạp sau sections.css, components.css.
 *
 *  1. Thông tin nhanh (trang điểm đến)   .dlv-quick
 *  2. Thanh bộ lọc                        .dlv-filterbar, .dlv-fchip
 *  3. Kết quả                             .dlv-results (lưới / danh sách)
 *  4. Dải "Chưa tìm được tour"            .dlv-list-cta
 *  5. Lưới term                           .dlv-term-grid, .dlv-term-group
 */

.dlv-list ul,
.dlv-list li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Khung thông báo WooCommerce chỉ có thẻ bọc rỗng: ẩn để không thành dải trắng thừa */
.dlv-list__notices:empty,
.dlv-list__notices:not(:has(.woocommerce-message, .woocommerce-error, .woocommerce-info, .message-container)) {
    display: none;
}

.dlv-list__notices {
    padding-top: var(--dlv-space-5);
}

/* ---------- 1. Thông tin nhanh ---------- */
.dlv-quick {
    padding: var(--dlv-space-6) 0;
    background: var(--dlv-ivory);
    border-bottom: 1px solid var(--dlv-line);
}

.dlv-quick__title {
    margin: 0 0 var(--dlv-space-4);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--dlv-brown-800);
}

.dlv-quick__title em {
    font-style: italic;
    font-weight: 400;
    color: var(--dlv-gold-700);
}

.dlv-quick__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--dlv-space-4) var(--dlv-space-6);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

/* Icon đặt tuyệt đối bên trái (icon chiếm 2 hàng lưới kéo cao hàng nhãn, nhãn cách xa giá trị) */
.dlv-quick__list div {
    position: relative;
    padding-left: 36px;
}

.dlv-quick__list .dlv-icon {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 22px;
    color: var(--dlv-gold-700);
}

.dlv-quick__list dt,
.dlv-quick__list dd {
    display: block; /* Flatsome: dl dt, dl dd hiển thị cùng dòng */
}

.dlv-quick__list dt {
    margin: 0;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--dlv-muted);
}

.dlv-quick__list dd {
    margin: 4px 0 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--dlv-text);
}

/* ---------- 2. Thanh bộ lọc ---------- */
.dlv-filterbar {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid var(--dlv-line);
    background: var(--dlv-white);
}

.dlv-filterbar__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dlv-space-3) var(--dlv-space-4);
    margin: 0;
    padding: var(--dlv-space-4) 0;
}

.dlv-filterbar__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dlv-muted);
}

.dlv-filterbar__label .dlv-icon {
    font-size: 18px;
    color: var(--dlv-gold-700);
}

.dlv-filterbar__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dlv-space-2);
}

.dlv-filterbar__sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.dlv-filterbar__sort label {
    margin: 0;
    font-size: var(--dlv-fs-small);
    font-weight: 600;
    color: var(--dlv-muted);
    white-space: nowrap;
}

.dlv-filterbar__sort select {
    min-width: 190px;
    height: 40px;
    margin: 0;
    padding: 0 32px 0 14px;
    border: 1px solid var(--dlv-line);
    border-radius: var(--dlv-radius-pill);
    background-color: var(--dlv-white);
    box-shadow: none;
    font-size: var(--dlv-fs-small);
    font-weight: 500;
    color: var(--dlv-brown-800);
}

/* Nút nhóm (<details>) và bảng chọn */
.dlv-fchip {
    position: relative;
}

.dlv-fchip > summary {
    list-style: none;
}

.dlv-fchip > summary::-webkit-details-marker {
    display: none;
}

.dlv-fchip > summary .dlv-fchip__arrow {
    font-size: 15px;
    transition: transform var(--dlv-dur-2) var(--dlv-ease);
}

.dlv-fchip[open] > summary {
    border-color: var(--dlv-brown-800);
}

.dlv-fchip[open] > summary .dlv-fchip__arrow {
    transform: rotate(180deg);
}

.dlv-fchip > summary:focus-visible {
    outline: 2px solid var(--dlv-brown-800);
    outline-offset: 2px;
}

.dlv-fchip__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: 300px;
    max-height: min(440px, 70vh);
    padding: var(--dlv-space-3);
    border: 1px solid var(--dlv-line);
    border-radius: var(--dlv-radius-lg);
    background: var(--dlv-white);
    box-shadow: var(--dlv-shadow-2);
}

.dlv-fchip__head {
    display: none;
}

.dlv-fchip__opts {
    display: grid;
    gap: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dlv-fchip__opt {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--dlv-radius-sm);
    font-size: 15px;
    font-weight: 400;
    color: var(--dlv-text);
    cursor: pointer;
    transition: background-color var(--dlv-dur-1);
}

.dlv-fchip__opt:hover {
    background: var(--dlv-ivory);
}

.dlv-fchip__opt input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--dlv-brown-800);
}

.dlv-fchip__opt span {
    flex: 1;
}

.dlv-fchip__opt small {
    font-size: 12.5px;
    color: var(--dlv-muted);
}

.dlv-fchip__opt:has(input:checked) {
    background: var(--dlv-ivory);
    font-weight: 600;
    color: var(--dlv-brown-800);
}

.dlv-fchip__opt:has(input:focus-visible) {
    outline: 2px solid var(--dlv-brown-800);
    outline-offset: -2px;
}

.dlv-fchip__apply.dlv-button {
    margin-top: var(--dlv-space-3);
}

/* Có JS: chọn bằng chuột là lọc ngay, nút "Áp dụng" chỉ hiện khi chọn bằng bàn phím (.is-dirty) */
.js .dlv-fchip:not(.is-dirty) .dlv-fchip__apply.dlv-button {
    display: none;
}

/* ---------- 3. Kết quả ---------- */
.dlv-results {
    padding-top: var(--dlv-space-6);
    padding-bottom: var(--dlv-space-section);
    transition: opacity var(--dlv-dur-2);
}

.dlv-results.is-loading {
    opacity: .45;
    pointer-events: none;
}

.dlv-results__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--dlv-space-4);
    margin-bottom: var(--dlv-space-4);
}

.dlv-results__count {
    margin: 0;
    font-size: 15px;
    color: var(--dlv-muted);
}

.dlv-results__count strong {
    font-family: var(--dlv-font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    font-variant-numeric: lining-nums;
    color: var(--dlv-brown-800);
}

.dlv-results__view {
    display: flex;
    gap: 6px;
}

.dlv-results__view .dlv-button--icon {
    --dlv-btn-h: 40px;
}

.dlv-results__view .dlv-button--icon[aria-pressed="true"] {
    border-color: var(--dlv-brown-800);
    background: var(--dlv-brown-800);
    color: var(--dlv-white);
}

.dlv-results__active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dlv-space-2);
    margin-bottom: var(--dlv-space-5) !important;
}

.dlv-results__active .dlv-tag {
    gap: 6px;
    padding: 6px 10px;
}

.dlv-results__active .dlv-tag .dlv-icon {
    font-size: 13px;
}

.dlv-results__active .dlv-tag:hover {
    background: var(--dlv-gold-100);
}

.dlv-results__clear {
    font-size: var(--dlv-fs-small);
    font-weight: 600;
    color: var(--dlv-brown-600);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dlv-results__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--dlv-space-6) var(--dlv-space-5);
}

/* Dạng danh sách: ảnh trái, nội dung phải */
.dlv-results__grid.is-list {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--dlv-space-4);
}

.dlv-results__grid.is-list .dlv-tour-card {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
}

.dlv-results__grid.is-list .dlv-tour-card__media {
    aspect-ratio: auto;
    min-height: 220px;
}

.dlv-results__grid.is-list .dlv-tour-card__body {
    padding: var(--dlv-space-5) var(--dlv-space-6);
}

.dlv-results__grid.is-list .dlv-tour-card__title {
    font-size: 1.5rem;
}

/* ---------- 4. Dải "Chưa tìm được tour" ---------- */
.dlv-list-cta {
    padding: var(--dlv-space-7) 0;
    border-top: 1px solid var(--dlv-line);
    background: var(--dlv-ivory);
}

.dlv-list-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dlv-space-5) var(--dlv-space-7);
}

.dlv-list-cta__inner::before,
.dlv-list-cta__inner::after {
    display: none;
}

.dlv-list-cta .dlv-eyebrow {
    margin-bottom: var(--dlv-space-2);
}

.dlv-list-cta__title {
    margin: 0;
    font-family: var(--dlv-font-heading);
    font-size: clamp(1.6rem, 1.4vw + 1rem, 2.2rem);
    line-height: 1.2;
    color: var(--dlv-brown-800);
}

.dlv-list-cta__title em {
    font-weight: 400;
    color: var(--dlv-gold-700);
}

.dlv-list-cta__text {
    margin: var(--dlv-space-2) 0 0;
    color: var(--dlv-muted);
}

.dlv-list-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dlv-space-3);
}

/* ---------- 5. Lưới term (Phong cách du lịch, Điểm đến) ---------- */
.dlv-term-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--dlv-space-5) var(--dlv-space-4);
}

.dlv-term-group + .dlv-term-group {
    margin-top: var(--dlv-space-7);
}

.dlv-term-group__title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 var(--dlv-space-4);
    padding-bottom: var(--dlv-space-3);
    border-bottom: 1px solid var(--dlv-line);
    font-size: clamp(1.5rem, 1vw + 1rem, 2rem);
    font-weight: 500;
    color: var(--dlv-brown-800);
}

.dlv-term-group__title small {
    font-family: var(--dlv-font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--dlv-muted);
}

/* Ô ảnh term kiểu cũ (giữ cho nội dung nhập tay còn dùng class .dlv-tile) */
.dlv-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 220px;
    padding: 20px;
    border-radius: var(--dlv-radius-lg);
    overflow: hidden;
    background-color: var(--dlv-brown-600);
    background-image:
        linear-gradient(180deg, rgba(46, 28, 16, 0) 35%, rgba(46, 28, 16, .85) 100%),
        var(--dlv-tile-image, none);
    background-size: cover;
    background-position: center;
    color: var(--dlv-white);
}

.dlv-tile__name {
    font-family: var(--dlv-font-heading);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
}

.dlv-tile__count {
    margin-top: 4px;
    font-size: 13.5px;
    color: var(--dlv-gold-100);
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
    .dlv-results__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dlv-term-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dlv-results__grid.is-list .dlv-tour-card {
        grid-template-columns: 260px minmax(0, 1fr);
    }
}

@media (max-width: 849px) {
    /* Nhóm lọc cuộn ngang một hàng; bảng chọn thành khung trượt từ dưới lên */
    .dlv-filterbar__form {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding: var(--dlv-space-3) 0;
    }

    .dlv-filterbar__form::-webkit-scrollbar {
        display: none;
    }

    .dlv-filterbar__label {
        display: none;
    }

    .dlv-filterbar__chips {
        flex-wrap: nowrap;
    }

    .dlv-filterbar__chips .dlv-pill {
        white-space: nowrap;
    }

    .dlv-filterbar__sort label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .dlv-filterbar__sort select {
        min-width: 150px;
    }

    .dlv-fchip__panel {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1100; /* trên thanh nút đáy */
        width: auto;
        max-height: 78vh;
        padding: var(--dlv-space-4) var(--dlv-space-4) calc(var(--dlv-space-4) + env(safe-area-inset-bottom, 0px));
        border: 0;
        border-radius: var(--dlv-radius-lg) var(--dlv-radius-lg) 0 0;
        box-shadow: 0 -20px 60px -10px rgba(31, 20, 11, .45);
    }

    .dlv-fchip__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--dlv-space-2);
        padding-bottom: var(--dlv-space-3);
        border-bottom: 1px solid var(--dlv-line);
    }

    .dlv-fchip__title {
        margin: 0;
        font-family: var(--dlv-font-heading);
        font-size: 1.3rem;
        color: var(--dlv-brown-800);
    }

    .dlv-fchip__close:not(.icon) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 0;
        padding: 0;
        border: 1px solid var(--dlv-line);
        border-radius: var(--dlv-radius-pill) !important;
        background: var(--dlv-white);
        color: var(--dlv-brown-800);
        font-size: 18px;
    }

    /* Nền tối sau khung trượt */
    html.dlv-fchip-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(31, 20, 11, .45);
    }

    html.dlv-fchip-open .dlv-mbar {
        display: none;
    }

    /* .dlv-filterbar có z-index riêng (lớp xếp chồng): nâng lên trên nền tối khi khung đang mở */
    html.dlv-fchip-open .dlv-filterbar {
        z-index: 1100;
    }

    .dlv-fchip__opt {
        padding: 13px 12px;
        font-size: 16px;
    }

    .dlv-results__grid.is-list .dlv-tour-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .dlv-results__grid.is-list .dlv-tour-card__media {
        aspect-ratio: 4 / 3;
        min-height: 0;
    }
}

@media (max-width: 549px) {
    .dlv-results__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dlv-term-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--dlv-space-3);
    }

    .dlv-term-grid .dlv-place-card__name {
        font-size: 1.25rem;
    }

    .dlv-term-grid .dlv-place-card__body {
        padding: var(--dlv-space-4);
    }

    .dlv-list-cta__actions,
    .dlv-list-cta__actions .dlv-button {
        width: 100%;
    }
}
