/* =====================================================================================================
   MYAN — Trang Wishlist ([myan_wishlist], docs/design/wishlist.md §2, §3, §6 · wishlist-plan Bước 2).
   Chỉ nạp khi trang có shortcode (inc/saved.php; luôn nạp trong iframe UX Builder). Chỉ dùng biến --myan-*.
   Thẻ = thẻ chung (khối "Product card" trong myan.css) biến thể .myan-card--wishlist; ở đây chỉ thêm nút bỏ.
   Bo góc: ảnh vuông, nút / ô / hộp dùng --myan-radius (tokens.md, quyết định Bước 0).
   Bước 4: băng note link chia sẻ, nút Share + ô link dự phòng, băng §2.6 (chữ + Save All). Chờ: nút Send (Bước 5),
   You May Also Like (Bước 6).
   ===================================================================================================== */

/* Bật tắt bằng hidden — các khối dưới có display riêng → ép ẩn */
html .myan-wl [hidden] {
    display: none;
}

/* ---------- Khung trang: padding main desktop 28px 40px 0 · mobile 16px 20px 0 (lề ngang = .myan-container) ---------- */
.myan-wl {
    padding: 28px 0 0; /* đáy: You May Also Like (margin-top 88) / khoảng chừa trước footer khi không có More (Bước 6) */
    color: var(--myan-text);
    font-family: var(--myan-sans);
}

/* ---------- Breadcrumb §2.1: 13px muted, mục hiện tại ink (rule chung), cách 18px ---------- */
html .myan-wl .myan-breadcrumb {
    padding-top: 0;
    margin: 0 0 18px;
    font-size: var(--myan-fs-caption);
}

/* ---------- Hàng tiêu đề §2.3 ---------- */
.myan-wl__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.myan-wl__titles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.myan-wl__title:focus {
    outline: none; /* focus do JS (bỏ mẫu cuối) — không phải phím Tab */
}
html .myan-wl .myan-wl__sub {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--myan-muted);
}

/* ---------- Bộ lọc §2.4: nhóm nút aria-pressed ---------- */
.myan-wl__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
html .myan-wl .myan-wl__filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 38px;
    min-height: 0;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--myan-line);
    border-radius: var(--myan-radius);
    background: var(--myan-surface);
    box-shadow: none;
    color: var(--myan-ink);
    font-family: var(--myan-sans);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition:
        background-color var(--myan-dur-ui) var(--myan-ease),
        border-color var(--myan-dur-ui) var(--myan-ease),
        color var(--myan-dur-ui) var(--myan-ease);
}
html .myan-wl .myan-wl__filter[aria-pressed='true'] {
    border-color: var(--myan-ink);
    background: var(--myan-ink);
    color: var(--myan-surface);
}
html .myan-wl .myan-wl__filter:focus {
    outline: none;
}
html .myan-wl .myan-wl__filter:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
    html .myan-wl .myan-wl__filter[aria-pressed='false']:hover {
        border-color: var(--myan-ink);
    }
}

/* ---------- Lưới §2.5: 4 (≥1100) / 3 (850–1099) / 2 (≤849) cột ---------- */
html :is(.myan-wl, .myan-wlm) .myan-wl-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
html :is(.myan-wl, .myan-wlm) .myan-wl-grid[hidden] {
    display: none; /* rule display:grid ở trên cùng độ ưu tiên với [hidden] chung → lưới bị ẩn (Trống / lỗi) vẫn hiện khung xương */
}
html :is(.myan-wl, .myan-wlm) .myan-wl-grid__item {
    display: flex;
    min-width: 0;
    margin: 0;
}
html .myan-wl .myan-wl-grid__item[hidden] {
    display: none; /* thẻ đang bị lọc ẩn — rule display:flex ở trên cùng độ ưu tiên với [hidden] chung */
}
html :is(.myan-wl, .myan-wlm) .myan-wl-grid__item > .myan-card {
    flex: 1 1 auto;
    min-width: 0;
}
@media (max-width: 1099px) {
    html :is(.myan-wl, .myan-wlm) .myan-wl-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Nút bỏ trên thẻ §2.5: góc phải-trên cách 6px, 40×40, nền trắng 90%, tim ĐẶC 20px ink */
html .myan-card__remove {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 4; /* trên nhãn (2) + khung ảnh lỗi (3) */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--myan-radius);
    background: var(--myan-card-label-bg);
    box-shadow: none;
    color: var(--myan-ink);
    line-height: 1;
    cursor: pointer;
    transition: none; /* bỏ transition nút Flatsome → focus hiện ngay */
}
html .myan-card__remove svg {
    display: block;
    width: 20px;
    height: 20px;
}
html .myan-card__remove:focus,
html .myan-card__remove:active {
    outline: none;
    box-shadow: none;
    background: var(--myan-card-label-bg);
}
html .myan-card__remove:focus-visible {
    outline: 2px solid var(--myan-ink);
    outline-offset: 2px;
}

/* ---------- CTA thẻ §2.5 (Bước 3) — chỉ thẻ biến thể wishlist ----------
   Thẻ (flex cột, myan.css) → khối chữ giãn hết chiều cao ô lưới → CTA margin-top:auto → đáy các thẻ thẳng hàng.
   Khoảng chữ ↔ CTA ≥ 10px (gap khối chữ 6 + padding 4). Nút: cao 44, viền 1px brand, 14/600, .08em, IN HOA, căn giữa.
   View Design: nền trong, chữ --myan-link (tokens: brand không dùng cho chữ) · Add to Bag: nền brand, chữ surface.
   Khóa (aria-disabled): Adding… giữ màu nút; Added to Bag ✓ giữ màu, con trỏ mặc định.
   Selector có .myan-card--wishlist: rule nút chung myan.css `html :is(.button, button, input[type='submit']…)` đạt (0,1,2)
   (đặt text-transform none / letter-spacing 0) → thắng `html .myan-wl-cta` (0,1,1) ở <button>. */
html .myan-card--wishlist .myan-card__body {
    flex: 1 1 auto;
}
.myan-wl-cta-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: stretch;
    margin-top: auto;
    padding-top: 4px;
}
html .myan-card--wishlist .myan-wl-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--myan-brand);
    border-radius: var(--myan-radius);
    background: transparent;
    box-shadow: none;
    color: var(--myan-link);
    font-family: var(--myan-sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color var(--myan-dur-ui) var(--myan-ease),
        border-color var(--myan-dur-ui) var(--myan-ease),
        color var(--myan-dur-ui) var(--myan-ease);
}
html .myan-card--wishlist .myan-wl-cta--bag {
    background: var(--myan-brand);
    color: var(--myan-surface);
}
html .myan-card--wishlist .myan-wl-cta:focus {
    outline: none;
}
html .myan-card--wishlist .myan-wl-cta:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}
html .myan-card--wishlist .myan-wl-cta[aria-disabled='true'] {
    cursor: default;
}
@media (hover: hover) and (pointer: fine) {
    html .myan-card--wishlist a.myan-wl-cta:hover {
        background: var(--myan-brand);
        color: var(--myan-surface);
    }
    html .myan-card--wishlist .myan-wl-cta--bag:not([aria-disabled='true']):hover {
        border-color: var(--myan-brand-hover);
        background: var(--myan-brand-hover);
        color: var(--myan-surface);
    }
}
html .myan-wl .myan-wl-cta__err {
    margin: 0;
    color: var(--myan-error);
    font-size: var(--myan-fs-caption);
    line-height: 1.4;
}

/* ---------- Khối Trống §2.7 ---------- */
.myan-wl__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 72px 40px;
    border: 1px solid var(--myan-line);
    border-radius: var(--myan-radius);
    background: var(--myan-surface);
    text-align: center;
}
.myan-wl__empty-icon {
    display: block;
    color: var(--myan-line-out); /* chỉ trang trí */
}
html .myan-wl .myan-wl__empty-text {
    max-width: 460px;
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--myan-text);
}
.myan-wl__empty-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

/* Trống trước khi JS chạy (Bước 6 — trang thật): script inline sau lưới gắn .is-empty lúc khối Trống / link hỏng CHƯA được
   parse (nằm sau script) → hiện theo class ngay khi tới, không chờ myan-wishlist.js. myan-wishlist.js state() giữ class đồng bộ. */
html .myan-wl.is-empty:not(.is-shared) [data-myan-wl-empty],
html .myan-wl.is-empty.is-shared [data-myan-wl-gone] {
    display: flex;
}

/* ---------- Lỗi tải + noscript ---------- */
.myan-wl__error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}
html .myan-wl .myan-wl__note {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--myan-text);
}

/* ---------- Băng note link chia sẻ §2.2 (Bước 4) ---------- */
.myan-wl__note-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px 18px;
    border-radius: var(--myan-radius);
    background: var(--myan-subtle);
}
.myan-wl__note-icon {
    display: block;
    flex: 0 0 auto;
    color: var(--myan-brand); /* chỉ trang trí */
}
html .myan-wl .myan-wl__note-text {
    flex: 1 1 240px;
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--myan-text);
}
.myan-wl__note-text strong {
    font-weight: 600;
    color: var(--myan-ink);
}

/* ---------- Nút Share §2.3 (Bước 4): cột phải hàng tiêu đề, căn phải (mobile: xuống dưới H1, căn trái) ---------- */
.myan-wl__share {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: 100%;
}
html .myan-wl .myan-wl-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--myan-brand);
    border-radius: var(--myan-radius);
    background: transparent;
    box-shadow: none;
    color: var(--myan-link); /* tokens: brand không dùng cho chữ (như View Design) */
    font-family: var(--myan-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color var(--myan-dur-ui) var(--myan-ease),
        color var(--myan-dur-ui) var(--myan-ease);
}
.myan-wl-share svg {
    display: block;
    flex: 0 0 auto;
}
html .myan-wl .myan-wl-share:focus {
    outline: none;
}
html .myan-wl .myan-wl-share:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
    html .myan-wl .myan-wl-share:hover {
        background: var(--myan-brand);
        color: var(--myan-surface);
    }
}
html .myan-wl :is(.myan-wl__share-limit, .myan-wl__share-status) {
    max-width: 300px;
    margin: 0;
    font-size: var(--myan-fs-caption);
    line-height: 1.4;
    text-align: right;
}
html .myan-wl .myan-wl__share-limit {
    color: var(--myan-muted);
}
html .myan-wl .myan-wl__share-status {
    color: var(--myan-success);
}
html .myan-wl .myan-wl__share-status:empty {
    margin-top: -6px; /* vùng role=status luôn có trong cây (để được đọc) — rỗng thì không chiếm gap */
}
.myan-wl__share-manual {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: min(340px, 100%);
}
html .myan-wl .myan-wl__share-manual-label {
    margin: 0;
    font-size: var(--myan-fs-caption);
    font-weight: 400;
    line-height: 1.4;
    color: var(--myan-text);
}
html .myan-wl .myan-wl__share-input {
    width: 100%;
    margin: 0;
    font-size: 14px;
}

/* ---------- Băng §2.6 (Bước 4: chữ + Save All; nút Send = Bước 5) ---------- */
.myan-wl__band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 56px;
    padding: 32px 36px;
    border-radius: var(--myan-radius);
    background: var(--myan-subtle);
}
.myan-wl__band-text {
    display: flex;
    flex: 1 1 420px;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
html .myan-wl .myan-wl__band-title {
    margin: 0;
}
html .myan-wl .myan-wl__band-p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--myan-text);
}
.myan-wl__band-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
html .myan-wl .myan-wl__save-all {
    min-height: 52px;
    height: auto;
    margin: 0;
    padding: 0 22px;
    font-size: 16px;
    line-height: 1.2;
}
html .myan-wl .myan-wl__save-all:focus {
    outline: none;
}
html .myan-wl .myan-wl__save-all:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}
html .myan-wl .myan-wl__save-all[aria-disabled='true'] {
    cursor: default;
}
@media (hover: hover) and (pointer: fine) {
    html .myan-wl .myan-wl__save-all[aria-disabled='true']:hover {
        background: transparent; /* đã lưu: không tô như nút bấm được */
        color: var(--myan-link);
    }
}

/* Nút Send §2.6 (Bước 5): cao 52, padding 0 24, 16/600, mũi tên 16px gap 10 */
html .myan-wl .myan-wl__send {
    gap: 10px;
    min-height: 52px;
    margin: 0;
    padding: 0 24px;
    font-size: 16px;
    line-height: 1.2;
}
.myan-wl__send svg {
    display: block;
    flex: 0 0 auto;
}
html .myan-wl .myan-wl__send:focus {
    outline: none;
}
html .myan-wl .myan-wl__send:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
    html .myan-wl .myan-wl__send:hover {
        border-color: var(--myan-brand-hover);
        background: var(--myan-brand-hover);
        color: var(--myan-surface);
    }
}

/* ---------- Dialog "Send Your Wishlist" §4 (Bước 5) ----------
   <dialog> showModal = top-layer. Chính phần tử dialog phủ kín màn (trong suốt) = vùng "nền tối" (bấm → đóng); hộp ở giữa.
   ≥850 hộp giữa max 520, padding lớp phủ 24 · ≤849 bottom sheet sát đáy, cao ≤ 90% vùng nhìn thấy. Bàn phím ảo: JS đặt
   --wl-vvh / --wl-vvt theo visualViewport → dialog (và sheet) nằm trên bàn phím. Chỉ animate transform / opacity. */
html .myan-wl-dialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 24px;
    border: 0;
    background: transparent;
    color: var(--myan-text);
    overflow: hidden;
}
html .myan-wl-dialog:not([open]):not(.is-static) {
    display: none;
}
html .myan-wl-dialog::backdrop {
    background: var(--myan-pdp-drawer-backdrop);
    opacity: 0;
    transition: opacity var(--myan-dur-ui) var(--myan-ease);
}
html .myan-wl-dialog.is-in::backdrop {
    opacity: 1;
}
html.myan-wlsend-lock [data-myan-dock] {
    display: none; /* hộp thoại mở → ẩn nút liên hệ nổi */
}
.myan-wl-dialog__box {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    max-height: 100%;
    border-radius: var(--myan-radius);
    background: var(--myan-surface);
    box-shadow: var(--myan-pdp-drawer-shadow);
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity var(--myan-dur-ui) var(--myan-ease),
        transform var(--myan-dur-ui) var(--myan-ease);
}
.myan-wl-dialog.is-in .myan-wl-dialog__box,
.myan-wl-dialog.is-static .myan-wl-dialog__box {
    opacity: 1;
    transform: none;
}
.myan-wl-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 28px 28px 0;
}
html .myan-wl-dialog .myan-wl-dialog__title {
    margin: 0;
    font-family: var(--myan-serif);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: var(--myan-ls-display);
    color: var(--myan-ink);
}
.myan-wl-dialog__title:focus {
    outline: none; /* focus do JS (màn đã gửi) */
}
html .myan-wl-dialog .myan-wl-dialog__close {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: -6px -8px 0 0;
    padding: 0;
    border: 0;
    border-radius: var(--myan-radius);
    background: transparent;
    box-shadow: none;
    color: var(--myan-ink);
    cursor: pointer;
}
html .myan-wl-dialog .myan-wl-dialog__close:focus {
    outline: none;
}
html .myan-wl-dialog .myan-wl-dialog__close:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 0;
}
.myan-wl-dialog__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 28px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
html .myan-wl-dialog .myan-wl-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}
html .myan-wl-dialog .myan-wl-form[hidden] {
    display: none;
}
html .myan-wl-dialog .myan-wl-form__intro {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--myan-text);
}
.myan-wl-form__summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--myan-radius);
    background: var(--myan-bg);
}
html .myan-wl-dialog .myan-wl-form__summary-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--myan-muted);
}
html .myan-wl-dialog .myan-wl-form__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
/* Bước 7b: <li> chỉ là vỏ của nút chip → bỏ margin list của Flatsome (giữ gap 8 như trước) */
html .myan-wl-dialog .myan-wl-form__chips > li {
    display: flex;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}
html .myan-wl-dialog .myan-wl-form__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: 0;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--myan-line);
    border-radius: var(--myan-radius);
    background: var(--myan-surface);
    font-size: 14px;
    line-height: 1.3;
    color: var(--myan-ink);
    /* Bước 7b: chip là <button> bật / tắt → gỡ style nút của Flatsome. Cao 40 (ảnh 30 + 8 + viền) ≥ 32 mobile */
    width: auto;
    min-height: 0;
    height: auto;
    font-family: inherit;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    text-align: left;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    transition: none;
}
html .myan-wl-dialog .myan-wl-form__chip:focus {
    outline: none;
}
html .myan-wl-dialog .myan-wl-form__chip:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}
@media (hover: hover) {
    html .myan-wl-dialog .myan-wl-form__chip:hover {
        border-color: var(--myan-muted);
    }
}
/* Bỏ chọn: ảnh mờ, chữ muted (≥ 4.5:1 — không làm mờ cả chip), nền trong, viền nét đứt; không đổi cỡ → không nhảy chỗ */
html .myan-wl-dialog .myan-wl-form__chip.is-off {
    border-style: dashed;
    border-color: var(--myan-muted);
    background: transparent;
    color: var(--myan-muted);
}
.myan-wl-form__chip.is-off img {
    opacity: 0.4;
}
.myan-wl-form__chip img {
    display: block;
    flex: 0 0 auto;
    width: 24px;
    height: 30px;
    object-fit: cover;
    transition: none;
}
.myan-wl-form__chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Icon ✕ (đang chọn) / + (bỏ chọn): cùng 1 svg 12px, chỉ đổi path */
.myan-wl-form__chip-ico {
    display: block;
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    color: var(--myan-muted);
}
.myan-wl-form__chip[aria-pressed="true"] .myan-wl-form__chip-plus,
.myan-wl-form__chip[aria-pressed="false"] .myan-wl-form__chip-x {
    display: none;
}
html .myan-wl-dialog :is(.myan-wl-form__limit, .myan-wl-form__privacy, .myan-wl-form__keep, .myan-wl-form__pick) {
    margin: 0;
    font-size: var(--myan-fs-caption);
    line-height: 1.5;
    color: var(--myan-muted);
}
/* Bước 7b: "Unselected…" / "Choose at least one design." chung 1 ô lưới — dòng ẩn giữ chỗ (visibility) → cao không đổi */
.myan-wl-form__notes {
    display: grid;
    margin-top: -8px; /* sát hộp tóm tắt (form gap 16) */
}
.myan-wl-form__notes > * {
    grid-area: 1 / 1;
}
.myan-wl-form__notes > [hidden] {
    display: block;
    visibility: hidden;
}
html .myan-wl-dialog .myan-wl-form__pick {
    font-weight: 500;
    color: var(--myan-text);
}
.myan-wl-form__privacy a {
    color: var(--myan-link);
    text-decoration: underline;
}
html .myan-wl-dialog .myan-wl-form__privacy a:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}
html .myan-wl-dialog .myan-wl-form__opt {
    font-weight: 400;
    color: var(--myan-muted);
}
html .myan-wl-dialog .myan-enq__input {
    font-size: 16px; /* ≥ 16px: iOS không tự phóng to khi focus */
}
html .myan-wl-dialog .myan-wl-form__submit {
    width: 100%;
    min-height: 54px;
    margin: 0;
    font-size: 16px;
}
html .myan-wl-dialog .myan-wl-form__submit[aria-disabled='true'] {
    cursor: progress;
    opacity: 0.85;
}
/* Bước 7b: khóa vì bỏ chọn hết (không phải đang gửi) */
html .myan-wl-dialog .myan-wl-form__submit[aria-disabled='true']:not([aria-busy]) {
    cursor: not-allowed;
    opacity: 0.55;
}
html .myan-wl-dialog :is(.myan-wl-form__submit, .myan-wl-sent__btn):focus {
    outline: none;
}
html .myan-wl-dialog :is(.myan-wl-form__submit, .myan-wl-sent__btn):focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}

/* Đã gửi §4.2 */
.myan-wl-sent {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.myan-wl-sent:empty {
    display: none;
}
html .myan-wl-dialog .myan-wl-sent__lead {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--myan-success);
}
.myan-wl-sent__lead svg {
    display: block;
    flex: 0 0 auto;
}
html .myan-wl-dialog .myan-wl-sent__text {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--myan-text);
    overflow-wrap: anywhere;
}
.myan-wl-sent__text strong {
    font-weight: 600;
    color: var(--myan-ink);
}
html .myan-wl-dialog .myan-wl-sent__btn {
    width: 100%;
    min-height: 52px;
    margin: 4px 0 0;
    font-size: 16px;
}

/* UX Builder: hộp dialog in tĩnh dưới băng để chỉnh chữ (màn đã gửi hiện từ mẫu) */
html .myan-wl-dialog.is-static {
    position: static;
    height: auto;
    margin-top: 36px;
    padding: 0;
}
.myan-wl-dialog.is-static .myan-wl-sent__tpl {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 28px 28px;
    border-top: 1px solid var(--myan-line);
}

@media (prefers-reduced-motion: reduce) {
    html .myan-wl-dialog::backdrop,
    .myan-wl-dialog__box {
        transition: none;
    }
}

/* ---------- You May Also Like §2.8 (Bước 6, [myan_wishlist_more]) ----------
   Lưới dùng chung .myan-wl-grid (4 / 3 / 2 cột). Thẻ dự phòng .is-spare ẩn (script inline gỡ / hiện đúng count; không JS chỉ
   hiện count thẻ đầu). margin-top 88 (mobile 56), đáy 88 / 56 trước footer. */
.myan-wlm {
    padding: 88px 0;
    color: var(--myan-text);
    font-family: var(--myan-sans);
}
html .myan-wlm[hidden] {
    display: none;
}
html .myan-wlm .myan-wlm__title {
    margin: 0 0 20px;
}
html .myan-wlm .myan-wl-grid__item.is-spare {
    display: none;
}
/* Trang chỉ có [myan_wishlist] (không More) → chừa đáy trước footer */
.myan-wl:not(:has(~ .myan-wlm)):last-child {
    padding-bottom: 88px;
}
.myan-wlm__builder-note {
    padding: 16px;
    border: 1px dashed var(--myan-line-strong);
}

/* ---------- UX Builder: mọi khối hiện để chỉnh chữ ---------- */
.myan-wl.is-builder :is(.myan-wl__empty, .myan-wl__band) {
    margin-top: 36px;
}

/* ---------- Mobile ≤849 §3 ---------- */
@media (max-width: 849px) {
    .myan-wl {
        padding: 16px 0 0;
    }
    html :is(.myan-wl, .myan-wlm) .myan-wl-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
    }
    .myan-wl__empty {
        padding: 40px 20px;
    }
    .myan-wlm {
        padding: 56px 0;
    }
    .myan-wl:not(:has(~ .myan-wlm)):last-child {
        padding-bottom: 56px;
    }
    /* Share xuống dưới H1, căn trái */
    .myan-wl__share {
        flex: 1 1 100%;
        align-items: flex-start;
    }
    html .myan-wl :is(.myan-wl__share-limit, .myan-wl__share-status) {
        text-align: left;
    }
    .myan-wl__band {
        margin-top: 36px;
        padding: 24px 20px;
    }
    .myan-wl__band-text {
        flex-basis: 100%;
    }
    .myan-wl__band-btns {
        flex: 1 1 100%;
    }
    html .myan-wl :is(.myan-wl__save-all, .myan-wl__send) {
        width: 100%;
    }
    /* Bottom sheet: sát đáy vùng nhìn thấy (trên bàn phím ảo), cao ≤ 90% */
    html .myan-wl-dialog:not(.is-static) {
        top: var(--wl-vvt, 0px);
        bottom: auto;
        align-items: flex-end;
        height: var(--wl-vvh, 100%);
        padding: 0;
    }
    .myan-wl-dialog:not(.is-static) .myan-wl-dialog__box {
        max-width: none;
        max-height: 90%;
        border-radius: var(--myan-radius) var(--myan-radius) 0 0;
        transform: translateY(24px);
    }
    .myan-wl-dialog.is-in .myan-wl-dialog__box {
        transform: none;
    }
    .myan-wl-dialog__head {
        padding: 22px 20px 0;
    }
    .myan-wl-dialog__body {
        padding: 16px 20px 28px;
        padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    }
    /* khối chữ thẻ mobile gap 3px (myan.css) → bù để chữ ↔ CTA vẫn ≥ 10px */
    .myan-wl-cta-wrap {
        padding-top: 7px;
    }
}
