/* shophoantien.com — giao diện sáng, bám design token của app/web Longhousee.
   Màu: tailwind.config.js (brand coral/red/warm/crimson) + mobile tokens.ts.
   CSS thuần, không framework — trang cứu hộ phải render được cả khi CDN hỏng. */

:root {
    /* Brand — frontend/tailwind.config.js */
    --brand-coral: #fd6b64;
    --brand-red: #f1582c;
    --brand-warm: #ff8243;
    --brand-crimson: #d12515;
    --primary: #ee4d2d;        /* tokens.ts colors.primary */
    --primary-surface: #fff2f0;

    /* Chữ & nền — tokens.ts */
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;

    /* Semantic */
    --success: #16a34a;
    --success-surface: #f0fdf4;
    --success-border: #bbf7d0;
    --error: #dc2626;
    --error-surface: #fef2f2;
    --error-border: #fecaca;
    --info: #2563eb;

    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);

    --font-body: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-head: "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

h1, h2 { font-family: var(--font-head); }

/* ── Thanh trên cùng ─────────────────────────────── */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
/* Lockup thương hiệu — giống Header.js web chính: mascot + wordmark 2 dòng.
   Ảnh mascot là huy hiệu tròn có sẵn chữ bên trong, nhưng ở cỡ 40px chữ đó không
   đọc nổi → brandname bắt buộc là text riêng. */
.brand { display: flex; align-items: center; gap: 6px; }
.brand-mark {
    height: 42px;
    width: 42px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.brand-word {
    display: flex;
    flex-direction: column;
    font-family: var(--font-head);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: .01em;
    color: var(--brand-coral);
    white-space: nowrap;
}
.topbar-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-red);
    background: var(--primary-surface);
    border: 1px solid #ffd9d0;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ── Khung trang ─────────────────────────────────── */
.page {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 12px 32px;
}

/* ── Hero ────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--brand-red), var(--brand-warm));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-md);
}
.hero-badge {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-badge svg { width: 24px; height: 24px; }
.hero-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; }
.hero-sub { margin: 4px 0 0; font-size: 13px; color: rgba(255, 255, 255, .9); }

/* ── Thẻ ─────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 12px;
    box-shadow: var(--shadow-sm);
}
.section-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
}

/* ── Trường nhập ─────────────────────────────────── */
.field-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.field-label-spaced { margin-top: 18px; }
.field-hint {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 16px; /* >=16px để iOS không tự zoom khi focus */
    font-family: inherit;
    font-weight: 500;
}
.input::placeholder { color: var(--text-muted); font-weight: 500; }
.input:focus {
    outline: none;
    border-color: var(--brand-coral);
    box-shadow: 0 0 0 3px rgba(253, 107, 100, .18);
}

.input-wrap { position: relative; }
.input-with-action { padding-right: 68px; }
.paste-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: var(--primary-surface);
    color: var(--brand-red);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 9px;
    cursor: pointer;
}
.paste-btn:active { transform: translateY(-50%) scale(.95); }

/* Nhãn sàn nhận diện được từ link */
.platform-badge {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--primary-surface);
    color: var(--brand-red);
}

/* ── Nút ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 18px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .1s ease;
}
.btn:active { transform: scale(.985); }
.btn-block { width: 100%; margin-top: 18px; }
.btn-primary {
    background: linear-gradient(90deg, var(--brand-red), var(--brand-warm));
    color: #fff;
    box-shadow: var(--shadow-md);
}
.btn-primary:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: default;
}
.btn-buy { background: var(--brand-red); color: #fff; flex: 1; }
.btn-copy {
    background: var(--success);
    color: #fff;
    flex: 1;
}
.btn-copy.copied { background: #15803d; }

/* ── Lỗi ─────────────────────────────────────────── */
.error-text {
    margin: 12px 0 0;
    padding: 10px 12px;
    background: var(--error-surface);
    border: 1px solid var(--error-border);
    border-radius: var(--radius);
    color: var(--error);
    font-size: 13.5px;
    text-align: center;
}
.alert {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13.5px;
}
.alert-error {
    background: var(--error-surface);
    border: 1px solid var(--error-border);
    color: var(--error);
}
.alert code {
    background: rgba(220, 38, 38, .1);
    padding: 1px 5px;
    border-radius: 5px;
}

/* ── Kết quả ─────────────────────────────────────── */
/* Cố ý KHÔNG hiện chuỗi link: link affiliate rất dài, hiện ra chỉ gây rối và
   khiến người dùng tưởng phải tự copy dán đâu đó. Chỉ để 2 nút hành động. */
.result {
    margin-top: 16px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--success-surface);
    border: 1px solid var(--success-border);
}
.result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.result-title {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 600;
    color: #15803d;
}
.chip {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--success-border);
    color: #15803d;
    white-space: nowrap;
}
.result-actions { display: flex; gap: 10px; }
.result-note {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ── Logo các sàn ────────────────────────────────── */
.platforms {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.platforms-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.platform-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.platform-logos img {
    height: 24px;
    width: auto;
    /* Logo nhiều màu để cạnh nhau dễ rối — giảm bão hoà cho hài hoà, sáng lên khi chạm */
    opacity: .75;
    transition: opacity .15s ease;
}
.platform-logos img:hover { opacity: 1; }

/* ── Các bước ────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; align-items: flex-start; gap: 12px; }
.step-num {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
}
.step-num-1 { background: var(--brand-warm); }
.step-num-2 { background: var(--brand-coral); }
.step-num-3 { background: var(--brand-red); }
.step-title { margin: 0; font-size: 14px; font-weight: 700; }
.step-desc {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ── Khối giải thích tình trạng ──────────────────── */
.notice-lead { margin: 0 0 14px; font-size: 13.5px; color: var(--text-secondary); }
.notice-cols { display: flex; flex-direction: column; gap: 12px; }
.notice-col {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
}
.notice-head {
    display: block;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}
.notice-head-yes { color: var(--success); }
.notice-head-no { color: var(--text-muted); }
.notice-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
}
.notice-list li { margin-bottom: 4px; }
.notice-foot {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ── Chân trang ──────────────────────────────────── */
.footer {
    text-align: center;
    padding: 24px 16px 32px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.footer-brand { justify-content: center; }
.footer-brand .brand-mark { height: 34px; width: 34px; }
.footer-brand .brand-word { font-size: 11px; }
.footer-text { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); }

/* ── Màn hình rộng: 2 cột cho khối giải thích ────── */
@media (min-width: 480px) {
    .notice-cols { flex-direction: row; }
    .notice-col { flex: 1; }
}

/* ── Thẻ sản phẩm trong khối kết quả ───────────────────────────────────────
   Dữ liệu từ /api/product-info.php (GraphQL Shopee / Open API Lazada / RioHub),
   đúng nguồn app dùng — để user đối chiếu đang mua đúng món trước khi bấm mua. */
.product {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 12px;
    background: var(--bg);
    border-radius: 12px;
}

.product-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex: none;
    background: var(--surface);
}

.product-info { min-width: 0; }

.product-name {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    /* Tên sản phẩm sàn rất dài — cắt 2 dòng cho khỏi vỡ layout */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.product-cashback {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-red);
}

/* ── Khối tra mã người dùng ────────────────────────────────────────────────
   Hiện khi user bấm "Không nhớ mã?" — lúc máy chính chết họ không mở app xem
   mã được, mà nhập sai mã thì tiền hoàn chảy sang tài khoản người khác. */
.link-btn {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--brand-red);
    text-decoration: underline;
    cursor: pointer;
}

.lookup {
    margin: 12px 0 4px;
    padding: 14px;
    background: var(--bg);
    border-radius: 12px;
}

.lookup-title { margin: 0 0 10px; font-weight: 600; font-size: 14px; }
.lookup-label { display: block; margin: 0 0 4px; font-size: 13px; color: var(--text-muted); }
.lookup-or { margin: 8px 0; text-align: center; font-size: 13px; color: var(--text-muted); }
.lookup-btn { width: 100%; margin-top: 10px; }
.lookup-msg { margin: 10px 0 0; font-size: 13px; }
.lookup-msg.ok { color: #15803d; font-weight: 600; }
.lookup-msg.err { color: var(--brand-crimson); }
