/**
 * Giao diện eSIM — dùng chung cho MỌI theme.
 *
 * Quy tắc bắt buộc (đã trả giá 3 vòng sửa ở thanh tìm kiếm modules/Voyage):
 *  · CHỈ dùng class tiền tố `.es-`, không mượn class của theme (`.row`, `.form-control`,
 *    `.btn-primary`, `.g-field-search`…). Mỗi theme style một kiểu, nhiều rule kèm
 *    !important, nên cùng markup sẽ ra 6 giao diện khác nhau và đều lỗi.
 *  · Màu bám biến của theme: `--primary-color` (theme nào cũng khai) và `--primary-color-2`.
 *  · Không dùng !important. Cần tới nó nghĩa là đang giẫm lên class của theme.
 *  · Bố cục bằng grid + gap, không margin rời từng phần tử.
 */

.es-wrap {
    --es-primary: var(--primary-color, #0b7285);
    --es-primary-2: var(--primary-color-2, var(--primary-color, #0f9b8e));
    /**
     * Màu CHỮ đặt trên nền `--es-primary`. Theme có màu chủ đạo SÁNG (VNE vàng #FEC529) chỉ
     * cần khai đè một dòng `--es-on-primary: #1a1400` trong `:root` là mọi nút, thẻ giá và
     * ô phân trang đang chọn đọc được ngay — không phải đụng vào CSS của module.
     */
    --es-on-primary: var(--primary-contrast, #fff);
    --es-ink: #0c1a1d;
    --es-muted: #5c6e72;
    --es-line: #dfe8e9;
    --es-surface: #fff;
    --es-ground: #f5f8f8;
    --es-ok: #2c6e49;
    --es-warn: #a85b0b;
    --es-danger: #b42318;
    --es-radius: 12px;

    color: var(--es-ink);
    font-size: 15px;
    line-height: 1.6;
}
.es-wrap *, .es-wrap *::before, .es-wrap *::after { box-sizing: border-box; }
.es-wrap a { color: inherit; text-decoration: none; }

.es-container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.es-stack { display: flex; flex-direction: column; gap: 28px; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.es-hero {
    background: linear-gradient(135deg, var(--es-primary) 0%, var(--es-primary-2) 100%);
    color: #fff;
    padding: 44px 0 38px;
}
.es-hero h1 { color: #fff; font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 8px; line-height: 1.2; }
.es-hero p { margin: 0; opacity: .9; font-size: 15px; }
.es-hero-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.es-hero-form input[type="search"], .es-hero-form input[type="text"] {
    flex: 1 1 260px; min-width: 0;
    border: none; border-radius: 9px; padding: 13px 15px;
    font-size: 15px; font-family: inherit; color: var(--es-ink);
}
.es-hero-form button {
    border: none; border-radius: 9px; padding: 13px 26px;
    background: #fff; color: var(--es-primary);
    font-weight: 600; font-size: 15px; font-family: inherit; cursor: pointer;
}
.es-hero-form button:hover { opacity: .92; }

/**
 * Ô "Bạn đi đâu?" — gõ thẳng trong ô, gợi ý rơi xuống ngay dưới.
 *
 * Không dùng select2: ở chế độ một-lựa-chọn nó đặt ô tìm kiếm BÊN TRONG bảng thả xuống, tức bấm
 * vào ô chính thì con trỏ nhảy xuống một ô khác — với ô tìm kiếm chính của trang thì đó là một
 * nhịp thừa và trông như hai ô lồng nhau. Bộ này tự viết, vanilla, xem `country-suggest.js`.
 *
 * `.es-sug-nguon` là thẻ <select> gốc sau khi JS tiếp quản: PHẢI giữ trong form (nó mang `name`
 * và giá trị gửi lên) nhưng không được chiếm chỗ. `display:none` là đủ — trình duyệt vẫn gửi.
 */
.es-hero-form select { flex: 1 1 260px; min-width: 0; border: none; border-radius: 9px;
    padding: 13px 15px; font-size: 15px; font-family: inherit; color: var(--es-ink); background: #fff; }
.es-hero-form select.es-sug-nguon { display: none; }

.es-sug { position: relative; flex: 1 1 260px; min-width: 0; }
.es-sug-input {
    width: 100%; box-sizing: border-box; border: none; border-radius: 9px;
    padding: 13px 15px; font-size: 15px; font-family: inherit; color: var(--es-ink); background: #fff;
}
.es-sug-input::placeholder { color: #8b8f96; }
.es-sug-input:focus { outline: 2px solid rgba(255,255,255,.65); outline-offset: 1px; }

/* z-index cao vì bảng gợi ý phải phủ lên dải chip vùng ngay bên dưới. */
.es-sug-list {
    position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px);
    margin: 0; padding: 6px; list-style: none; max-height: 320px; overflow: auto;
    background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(12,26,29,.22);
}
.es-sug-item {
    padding: 9px 12px; border-radius: 7px; font-size: 14.5px; color: var(--es-ink); cursor: pointer;
}
.es-sug-item:hover, .es-sug-item.is-on { background: var(--es-primary); color: var(--es-on-primary); }

.es-hero-note { margin-top: 10px; font-size: 13.5px; color: #fff; opacity: .95; }
.es-hero-note a { color: #fff; text-decoration: underline; margin-left: 6px; }

.es-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.es-chip {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    background: rgba(255,255,255,.16); color: #fff; font-size: 13.5px;
    border: 1px solid rgba(255,255,255,.25);
}
.es-chip:hover { background: rgba(255,255,255,.28); color: #fff; }
.es-chip.is-on { background: #fff; color: var(--es-primary); border-color: #fff; font-weight: 600; }

/* ── Bố cục hai cột ──────────────────────────────────────────────────── */
.es-layout { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 32px 0 56px; }
@media (min-width: 900px) { .es-layout { grid-template-columns: 250px 1fr; } }

/* ── Bộ lọc ──────────────────────────────────────────────────────────── */
.es-filter {
    background: var(--es-surface); border: 1px solid var(--es-line);
    border-radius: var(--es-radius); padding: 18px; align-self: start;
}
.es-filter h3 { font-size: 15px; margin: 0 0 14px; }
.es-filter-group { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--es-line); }
.es-filter-group:first-of-type { border-top: none; padding-top: 0; }
.es-filter-group > b { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--es-muted); font-weight: 600; }
.es-filter label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.es-filter-apply {
    width: 100%; border: none; border-radius: 8px; padding: 11px;
    background: var(--es-primary); color: #fff; font-weight: 600; font-size: 14px;
    font-family: inherit; cursor: pointer; margin-top: 6px;
}
.es-filter-clear { display: block; text-align: center; margin-top: 10px; font-size: 13px; color: var(--es-muted); }

/* ── Bộ lọc: thu gọn trên màn hẹp ────────────────────────────────────────
   Trên điện thoại năm nhóm lọc chiếm trọn màn hình đầu tiên và đẩy danh sách gói —
   thứ khách vào để xem — xuống dưới nếp gấp.

   Nút gấp CHỈ hiện khi script đã gắn được class `is-collapsible`: trình duyệt không
   chạy JS thì bộ lọc giữ nguyên hành vi cũ (luôn mở) thay vì bị khoá kín. */
.es-filter-toggle { display: none; }
.es-filter-body { overflow: hidden; transition: height .28s ease; }
.es-filter-body[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .es-filter-body { transition: none; } }

@media (max-width: 899.98px) {
    /* Gấp lại thì tiêu đề nằm luôn trong nút — hai chữ "Lọc gói" chồng nhau là thừa. */
    .es-filter.is-collapsible > .es-filter-title { display: none; }

    /* Lề âm nuốt trọn padding của thẻ để vùng bấm phủ hết hàng đầu (đủ 44px cho ngón tay),
       chứ không chỉ mấy chữ ở giữa. Padding đáy của thẻ dời vào phần trượt (quy tắc dưới)
       nên lúc gấp không còn khoảng trắng lửng ở đáy hộp. */
    .es-filter.is-collapsible { padding-bottom: 0; }
    .es-filter.is-collapsible > .es-filter-toggle {
        display: flex; align-items: center; gap: 10px;
        width: 100%; margin: -18px -18px 0; padding: 16px 18px;
        border: none; background: none; color: inherit; font: inherit;
        text-align: left; cursor: pointer;
    }
    .es-filter.is-collapsible > .es-filter-toggle:focus-visible {
        outline: 2px solid var(--es-primary); outline-offset: -2px;
    }
    .es-filter.is-collapsible .es-ft-ic { display: flex; color: var(--es-primary); }
    .es-filter.is-collapsible .es-ft-txt { font-weight: 600; font-size: 15px; }
    .es-filter.is-collapsible .es-ft-dem {
        display: inline-flex; align-items: center; justify-content: center;
        min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
        background: var(--es-primary); color: var(--es-on-primary);
        font-size: 12px; font-weight: 600; line-height: 1;
    }
    .es-filter.is-collapsible .es-ft-caret {
        width: 8px; height: 8px; margin: -4px 0 0 auto;
        border-right: 2px solid var(--es-muted); border-bottom: 2px solid var(--es-muted);
        transform: rotate(45deg); transition: transform .2s ease;
    }
    .es-filter.is-collapsible.is-open .es-ft-caret { margin-top: 2px; transform: rotate(-135deg); }

    /* Vạch ngăn và khoảng thở nằm TRONG phần trượt: để chúng ở nút hay ở thẻ thì lúc gấp
       vẫn còn một vệt trống lửng, và `padding` đặt thẳng lên phần trượt sẽ chặn không cho
       chiều cao co về 0 (thẻ dùng `box-sizing: border-box`). */
    .es-filter.is-collapsible > .es-filter-body > .es-filter-group:first-of-type {
        margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--es-line);
    }
    .es-filter.is-collapsible > .es-filter-body > :last-child { margin-bottom: 18px; }
}

/* ── Lưới quốc gia ───────────────────────────────────────────────────── */
.es-grid-country { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .es-grid-country { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .es-grid-country { grid-template-columns: repeat(4, 1fr); } }

.es-country {
    display: flex; flex-direction: column; gap: 4px;
    background: var(--es-surface); border: 1px solid var(--es-line);
    border-radius: var(--es-radius); padding: 16px;
    transition: border-color .15s, transform .15s;
}
.es-country:hover { border-color: var(--es-primary); transform: translateY(-2px); }
.es-country b { font-size: 15px; }
.es-country small { color: var(--es-muted); font-size: 12.5px; }
.es-country .es-from { color: var(--es-primary); font-weight: 700; font-size: 15px; margin-top: 4px; }

/**
 * ── Ô cờ ─────────────────────────────────────────────────────────────
 *
 * Hai lớp chồng nhau trong cùng một ô: lá cờ, và bên dưới là mã nước dạng chữ. Ảnh tải được
 * thì che kín chữ; ảnh hỏng thì `onerror` ẩn thẻ `img` và chữ lộ ra. Nhờ vậy nguồn ảnh của
 * bên thứ ba chết cũng không để lại ô vỡ — thứ trông tệ hơn hẳn so với không có ảnh.
 *
 * ⚠️⚠️ Ô phải VUÔNG và BO TRÒN, không phải hình chữ nhật kiểu lá cờ.
 *
 * Đo thật nguồn ảnh (`p.qrsim.net/img/flags/*.png`, 08/09/2026): mọi tệp đều **vuông tỉ lệ
 * 1:1** — 184×184 px với phần lớn nước, tới 767×767 và 1024×1024 với Mexico/Panama/Mỹ — và cờ
 * được vẽ dưới dạng huy hiệu TRÒN. Bản đầu đặt ô 34×24 (tỉ lệ 1,42) kèm `object-fit: cover`,
 * tức ép ảnh vuông vào khung chữ nhật ⇒ **cắt mất mép trên và dưới của hình tròn**, nhìn ra
 * đúng như ảnh bị vỡ. Độ phân giải chưa bao giờ là vấn đề: ảnh gốc lớn hơn khung hiển thị
 * 7–40 lần, thừa nét cho cả màn hình mật độ cao.
 *
 * Ô vuông + `object-fit: cover` với ảnh vuông thì không cắt gì cả, nên đây cũng là lựa chọn
 * an toàn cho nguồn ảnh khác tỉ lệ (BLC-01 trả ảnh minh hoạ của Airalo, không phải cờ).
 *
 * Kích thước cố định (không để ảnh tự quyết) nên thẻ không nhảy layout lúc ảnh về muộn.
 */
.es-flag {
    position: relative; flex: none; overflow: hidden;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--es-ground);
    display: inline-flex; align-items: center; justify-content: center;
}
.es-flag img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* Viền chỉ vẽ khi KHÔNG có ảnh: cờ tròn của hãng đã có nét viền riêng, thêm một vòng nữa là
   thành hai đường tròn lồng nhau. `is-off` do `onerror` gắn vào. */
.es-flag.is-off { border: 1px solid var(--es-line); }
.es-flag i {
    font-style: normal; font-size: 10px; font-weight: 700;
    letter-spacing: .02em; color: var(--es-muted); line-height: 1;
}
.es-country .es-flag { margin-bottom: 6px; }
.es-pkg-head .es-flag { width: 32px; height: 32px; margin-top: 1px; }

/* ── Thẻ gói ─────────────────────────────────────────────────────────── */
.es-grid-pkg { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .es-grid-pkg { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .es-grid-pkg { grid-template-columns: repeat(3, 1fr); } }

.es-pkg {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--es-surface); border: 1px solid var(--es-line);
    border-radius: var(--es-radius); padding: 18px;
    transition: border-color .15s, box-shadow .15s;
}
.es-pkg:hover { border-color: var(--es-primary); box-shadow: 0 6px 22px -14px rgba(0,0,0,.35); }
.es-pkg-head { display: flex; align-items: flex-start; gap: 10px; }
.es-pkg-head > div { min-width: 0; }
.es-pkg-name { font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.es-pkg-where { color: var(--es-muted); font-size: 12.5px; margin-top: 2px; }

.es-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.es-spec {
    font-size: 12.5px; padding: 3px 9px; border-radius: 6px;
    background: var(--es-ground); border: 1px solid var(--es-line); color: var(--es-muted);
}
.es-spec.is-key { color: var(--es-ink); font-weight: 600; }
.es-spec.is-unl { color: var(--es-ok); border-color: var(--es-ok); background: transparent; }

.es-pkg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--es-line); }
.es-price { font-size: 19px; font-weight: 700; color: var(--es-primary); }
.es-price small { display: block; font-size: 11.5px; color: var(--es-muted); font-weight: 400; }
/**
 * ⚠️ PHẢI viết `.es-wrap .es-btn`, KHÔNG được viết `.es-btn` trần.
 *
 * Ngay đầu file có `.es-wrap a { color: inherit }` — đặc hiệu (0,1,1). Một selector `.es-btn`
 * trần chỉ (0,1,0) nên THUA, và mọi nút dựng bằng thẻ `<a>` (nút "Xem gói" ở thẻ gói, nút
 * "Đặt mua" ở trang quốc gia…) lấy màu chữ của thân trang — chữ đen trên nền xanh đậm, gần
 * như không đọc được. Lỗi này im lặng vì nút dựng bằng `<button>` thì vẫn trắng, nên nhìn
 * lướt tưởng chỉ vài nút bị.
 *
 * Màu chữ chốt bằng `--es-on-primary` thay vì `#fff` cứng: theme nào đặt `--primary-color`
 * sáng (VNE vàng #FEC529) thì chữ trắng trên nền vàng cũng không đọc được — theme đó chỉ cần
 * khai `--es-on-primary: #1a1400` là xong, không phải sửa CSS của module.
 */
.es-wrap .es-btn {
    border: none; border-radius: 8px; padding: 9px 18px;
    background: var(--es-primary); color: var(--es-on-primary); font-weight: 600; font-size: 14px;
    font-family: inherit; cursor: pointer; display: inline-block; text-align: center;
}
.es-wrap .es-btn:hover { color: var(--es-on-primary); opacity: .92; }
.es-wrap .es-btn.is-ghost { background: transparent; color: var(--es-primary); border: 1px solid var(--es-primary); }
.es-wrap .es-btn.is-ghost:hover { color: var(--es-primary); }
.es-wrap .es-btn[disabled] { opacity: .55; cursor: not-allowed; }
.es-more { font-size: 12.5px; color: var(--es-muted); }

/* ── Trang chi tiết ──────────────────────────────────────────────────── */
.es-detail { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 28px 0 56px; }
@media (min-width: 920px) { .es-detail { grid-template-columns: 1fr 330px; } }

.es-card {
    background: var(--es-surface); border: 1px solid var(--es-line);
    border-radius: var(--es-radius); padding: 20px;
}
.es-card + .es-card { margin-top: 16px; }
.es-card h2 { font-size: 17px; margin: 0 0 12px; }
.es-card h3 { font-size: 15px; margin: 0 0 10px; }

.es-buy { position: sticky; top: 18px; align-self: start; }
.es-buy .es-price { font-size: 26px; }
.es-buy .es-btn { width: 100%; text-align: center; padding: 13px; font-size: 15px; margin-top: 12px; }

.es-kv { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .es-kv { grid-template-columns: repeat(2, 1fr); } }
.es-kv > div { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; background: var(--es-ground); border-radius: 9px; }
.es-kv b { font-size: 14px; }
.es-kv small { color: var(--es-muted); font-size: 12px; }

.es-note {
    border-left: 3px solid var(--es-warn); background: #fdf6ec;
    border-radius: 0 9px 9px 0; padding: 12px 15px; font-size: 13.5px; line-height: 1.55;
}
.es-note.is-info { border-left-color: var(--es-primary); background: var(--es-ground); }

/* Bảng vùng phủ — cuộn ngang trong khung riêng, không để thân trang trượt */
.es-cov-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--es-line); border-radius: 9px; }
.es-cov { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.es-cov th, .es-cov td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--es-line); }
.es-cov th { background: var(--es-ground); position: sticky; top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--es-muted); }
.es-cov tr:last-child td { border-bottom: none; }
.es-cov-search { width: 100%; border: 1px solid var(--es-line); border-radius: 8px; padding: 9px 12px; font-size: 14px; font-family: inherit; margin-bottom: 10px; }

/* ── Trạng thái rỗng ─────────────────────────────────────────────────── */
.es-empty { text-align: center; padding: 56px 20px; color: var(--es-muted); background: var(--es-surface); border: 1px dashed var(--es-line); border-radius: var(--es-radius); }
.es-empty b { display: block; color: var(--es-ink); font-size: 16px; margin-bottom: 6px; }

.es-crumb { font-size: 13px; color: var(--es-muted); padding: 16px 0 0; }
.es-crumb a:hover { color: var(--es-primary); }

.es-head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.es-head-row h2 { font-size: 19px; margin: 0; }
.es-sort { border: 1px solid var(--es-line); border-radius: 8px; padding: 8px 11px; font-size: 13.5px; font-family: inherit; background: var(--es-surface); color: var(--es-ink); }

/**
 * ── Phân trang ───────────────────────────────────────────────────────
 *
 * Markup do `EsimConnect::frontend.partials.pager` sinh, KHÔNG dùng bộ class Bootstrap của
 * theme. Lý do: nhiều theme cho `.page-link` một ô tròn bề rộng cố định nhưng để `padding`
 * và `line-height` lệch nhau, nên CON SỐ nằm trồi ra khỏi hình tròn (thấy rõ ở trang 2 trở đi
 * vì ô "‹" một ký tự và ô số rộng khác nhau).
 *
 * Cách chắc chắn không lệch ở bất kỳ theme nào: ô là hình VUÔNG cố định (`width` = `height`),
 * nội dung căn giữa bằng flex, và `line-height: 1` để không thừa nửa dòng ở dưới.
 */
.es-pager { margin-top: 26px; }
.es-pg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.es-wrap .es-pg-i {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0; line-height: 1;
    border: 1px solid var(--es-line); border-radius: 50%;
    background: var(--es-surface); color: var(--es-ink);
    font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
    text-decoration: none; transition: border-color .15s, color .15s;
}
.es-wrap a.es-pg-i:hover { border-color: var(--es-primary); color: var(--es-primary); }
.es-wrap .es-pg-i.is-now { background: var(--es-primary); border-color: var(--es-primary); color: var(--es-on-primary); }
.es-wrap .es-pg-i.is-off { opacity: .4; cursor: default; }
.es-pg-gap { display: inline-flex; align-items: center; padding: 0 4px; color: var(--es-muted); }

/* ═══════════════════════════════════════════════════════════════════════
   PHA 2 — MUA · THANH TOÁN · NHẬN eSIM
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Form mua ────────────────────────────────────────────────────────── */
.es-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.es-field { display: flex; flex-direction: column; gap: 5px; }
.es-field > label { font-size: 12.5px; font-weight: 600; color: var(--es-muted); }
/* Dấu bắt buộc: đỏ để nhận ra ngay, nhưng KHÔNG dùng màu làm nghĩa duy nhất — ô nào bắt buộc
   thì thẻ input cũng mang `required`, nên trình đọc màn hình vẫn biết mà không cần thấy dấu. */
.es-req { color: var(--es-danger); font-style: normal; font-weight: 700; }
.es-req-note { font-size: 12px; color: var(--es-muted); margin: 0; }
.es-field .es-hint { font-size: 12px; color: var(--es-muted); }
.es-input {
    width: 100%; border: 1px solid var(--es-line); border-radius: 9px;
    padding: 10px 12px; font-size: 14.5px; font-family: inherit;
    background: var(--es-surface); color: var(--es-ink);
}
.es-input:focus { outline: 2px solid var(--es-primary); outline-offset: -1px; border-color: var(--es-primary); }
.es-input.is-bad { border-color: var(--es-danger); }

.es-qty { display: flex; align-items: center; border: 1px solid var(--es-line); border-radius: 9px; overflow: hidden; width: max-content; }
.es-qty button {
    width: 40px; height: 40px; border: 0; background: var(--es-ground);
    font-size: 18px; line-height: 1; cursor: pointer; color: var(--es-ink); font-family: inherit;
}
.es-qty button:disabled { opacity: .4; cursor: not-allowed; }
.es-qty input {
    width: 56px; height: 40px; border: 0; text-align: center; font-size: 15px;
    font-family: inherit; background: var(--es-surface); color: var(--es-ink);
    -moz-appearance: textfield; appearance: textfield;
}
.es-qty input::-webkit-outer-spin-button, .es-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.es-users { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--es-ground); border-radius: 10px; }
.es-users > b { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--es-muted); }

/* ── Thanh tiến trình ────────────────────────────────────────────────── */
.es-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 22px; }
.es-steps span {
    display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--es-muted);
    background: var(--es-surface); border: 1px solid var(--es-line); border-radius: 999px; padding: 7px 14px;
}
.es-steps span i {
    width: 20px; height: 20px; border-radius: 50%; background: var(--es-line); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-style: normal; font-weight: 700;
}
.es-steps span.is-on { color: var(--es-ink); border-color: var(--es-primary); font-weight: 600; }
.es-steps span.is-on i, .es-steps span.is-done i { background: var(--es-primary); }
.es-steps span.is-done { color: var(--es-ink); }

/* ── Cổng thanh toán ─────────────────────────────────────────────────── */
.es-gw { display: flex; flex-direction: column; gap: 8px; }
.es-gw label {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer;
    border: 1px solid var(--es-line); border-radius: 10px; background: var(--es-surface); font-size: 14.5px;
}
.es-gw label.is-on { border-color: var(--es-primary); background: var(--es-ground); }
.es-gw input { accent-color: var(--es-primary); }
.es-gw-info { padding: 0 4px 6px; font-size: 13px; color: var(--es-muted); }

.es-sum { display: flex; flex-direction: column; gap: 8px; }
.es-sum > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.es-sum > div.is-total { border-top: 1px solid var(--es-line); padding-top: 10px; font-size: 17px; font-weight: 700; }
.es-sum > div.is-total span:last-child { color: var(--es-primary); }

/* ── Chờ giao hàng ───────────────────────────────────────────────────── */
.es-wait { text-align: center; padding: 40px 20px; }
.es-spin {
    width: 40px; height: 40px; margin: 0 auto 16px; border-radius: 50%;
    border: 3px solid var(--es-line); border-top-color: var(--es-primary);
    animation: es-spin 900ms linear infinite;
}
@keyframes es-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .es-spin { animation-duration: 2.4s; } }

/* ── Thẻ eSIM đã giao ────────────────────────────────────────────────── */
.es-sim { border: 1px solid var(--es-line); border-radius: var(--es-radius); background: var(--es-surface); padding: 18px; }
.es-sim + .es-sim { margin-top: 14px; }
.es-sim-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.es-sim-head b { font-size: 15.5px; }
.es-sim-body { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .es-sim-body { grid-template-columns: 220px 1fr; } }

.es-qr { padding: 10px; background: #fff; border: 1px solid var(--es-line); border-radius: 10px; line-height: 0; }
.es-qr svg, .es-qr img { width: 100%; height: auto; display: block; }
.es-qr-cap { font-size: 12px; color: var(--es-muted); text-align: center; margin-top: 8px; line-height: 1.5; }

.es-lpa { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.es-lpa label { font-size: 12px; font-weight: 600; color: var(--es-muted); text-transform: uppercase; letter-spacing: .04em; }
.es-lpa-row { display: flex; gap: 6px; }
.es-lpa code {
    flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; padding: 9px 11px;
    background: var(--es-ground); border: 1px solid var(--es-line); border-radius: 8px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--es-ink);
}
.es-copy {
    flex: 0 0 auto; border: 1px solid var(--es-line); background: var(--es-surface); border-radius: 8px;
    padding: 0 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; color: var(--es-ink);
}
.es-copy:hover { border-color: var(--es-primary); color: var(--es-primary); }

.es-install { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.es-install .es-btn { padding: 10px 16px; font-size: 14px; }

/* ── Nhãn trạng thái ─────────────────────────────────────────────────── */
.es-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.es-badge.is-ok { color: var(--es-ok); border-color: var(--es-ok); background: rgba(44,110,73,.07); }
.es-badge.is-wait { color: var(--es-warn); border-color: var(--es-warn); background: rgba(168,91,11,.07); }
.es-badge.is-bad { color: var(--es-danger); border-color: var(--es-danger); background: rgba(180,35,24,.07); }
.es-badge.is-off { color: var(--es-muted); border-color: var(--es-line); background: var(--es-ground); }

/* ── Thông báo ───────────────────────────────────────────────────────── */
.es-alert { border-radius: 10px; padding: 13px 15px; font-size: 14px; border: 1px solid; margin-bottom: 16px; }
.es-alert.is-ok { color: #1c4b33; border-color: rgba(44,110,73,.35); background: rgba(44,110,73,.08); }
.es-alert.is-warn { color: #7a4208; border-color: rgba(168,91,11,.35); background: rgba(168,91,11,.08); }
.es-alert.is-bad { color: #8a1b12; border-color: rgba(180,35,24,.35); background: rgba(180,35,24,.08); }
.es-alert b { display: block; margin-bottom: 3px; }

/* ── Hai cột trang thanh toán / hoàn tất ─────────────────────────────── */
.es-two { display: grid; gap: 22px; grid-template-columns: 1fr; padding: 24px 0 56px; }
@media (min-width: 920px) { .es-two { grid-template-columns: 1fr 340px; } }
.es-side { position: sticky; top: 18px; align-self: start; }

/* ── Danh sách eSIM của tôi ──────────────────────────────────────────── */
.es-list { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .es-list { grid-template-columns: repeat(2, 1fr); } }
.es-list-item {
    display: flex; flex-direction: column; gap: 6px; padding: 15px 16px;
    border: 1px solid var(--es-line); border-radius: var(--es-radius); background: var(--es-surface);
}
.es-list-item:hover { border-color: var(--es-primary); }
.es-list-item b { font-size: 15px; }
.es-list-item small { color: var(--es-muted); font-size: 12.5px; }

/* ── Thanh dung lượng ────────────────────────────────────────────────── */
.es-bar { height: 8px; border-radius: 999px; background: var(--es-line); overflow: hidden; }
.es-bar > i { display: block; height: 100%; background: var(--es-primary); transition: width .3s ease; }

/* ── Hậu mãi: hàng nút hành động (nạp thêm · huỷ) ─────────────────────── */
.es-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.es-acts form { margin: 0; }

/* Nút việc-không-hoàn-tác. Cố ý là kiểu VIỀN chứ không phải nền đỏ đặc: nút đỏ đặc hút mắt
   hơn cả nút chính, mà huỷ eSIM là việc hiếm và không hoàn tác được — không nên là thứ dễ
   bấm nhất trên trang. Màu chỉ đủ để phân biệt với nút lành tính bên cạnh. */
.es-btn.es-danger { color: var(--es-danger); border-color: var(--es-danger); background: transparent; }
.es-btn.es-danger:hover { color: #fff; background: var(--es-danger); opacity: 1; }
