/* Trang công khai cho khách quét QR. Thiết kế mobile-first: phần lớn lượt xem
   đến từ camera điện thoại, màn hình hẹp và mạng di động. */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #14181f;
    --text-muted: #5c6672;
    --border: #e2e5ea;
    --accent: #0f7b4f;
    --accent-text: #ffffff;
    --ok-bg: #e6f4ec;
    --ok-text: #0f6c45;
    --warn-bg: #fdf1dc;
    --warn-text: #8a5a08;
    --danger-bg: #fdeaea;
    --danger-text: #a32020;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #10131a;
        --surface: #191d26;
        --text: #eef1f5;
        --text-muted: #a0a9b6;
        --border: #2a303c;
        --accent: #2ea36c;
        --accent-text: #06120c;
        --ok-bg: #16301f;
        --ok-text: #7fd6a3;
        --warn-bg: #34260f;
        --warn-text: #f0c274;
        --danger-bg: #3a1a1a;
        --danger-text: #f09b9b;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- Hero ---------- */

.hero {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero__image {
    display: block;
    width: 100%;
    /* Tỉ lệ cố định giúp trang không bị giật layout khi ảnh tải xong. */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--bg);
}

.hero__image--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: .875rem;
    border-bottom: 1px solid var(--border);
}

.hero__body { padding: 18px 18px 20px; }

.hero__brand {
    margin: 0 0 4px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero__title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.hero__code {
    margin: 0;
    font-size: .9rem;
    color: var(--text-muted);
}

.hero__sep { margin: 0 .4em; }

.hero__price {
    margin: 10px 0 0;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--accent);
}

/* ---------- Badges ---------- */

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.badges:empty { display: none; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge--ok { background: var(--ok-bg); color: var(--ok-text); }
.badge--warn { background: var(--warn-bg); color: var(--warn-text); }
.badge--danger { background: var(--danger-bg); color: var(--danger-text); }

/* ---------- Cards ---------- */

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.card--center { text-align: center; }

.card__title {
    margin: 0 0 12px;
    font-size: 1.0625rem;
    font-weight: 700;
}

.card__subtitle {
    margin: 14px 0 4px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.card__subtitle:first-of-type { margin-top: 0; }

.prose {
    margin: 0;
    /* Giữ nguyên xuống dòng người dùng nhập ở phần mô tả / hướng dẫn. */
    white-space: pre-line;
    overflow-wrap: break-word;
}

.prose + .prose { margin-top: 10px; }

.prose--muted {
    margin-top: 14px;
    font-size: .875rem;
    color: var(--text-muted);
}

/* ---------- Bảng thông số ---------- */

.spec { margin: 0; }

.spec__row {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--border);
}

.spec__row:first-child { border-top: none; padding-top: 0; }

.spec dt {
    color: var(--text-muted);
    font-size: .9rem;
}

.spec dd {
    margin: 0;
    font-weight: 500;
    overflow-wrap: break-word;
}

/* ---------- Chứng nhận ---------- */

.certs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cert {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.cert__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.cert__name { font-weight: 600; }

.cert__meta {
    margin: 6px 0 0;
    font-size: .875rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.cert__link {
    display: inline-block;
    margin-top: 8px;
    font-size: .875rem;
    color: var(--accent);
}

/* ---------- Gallery ---------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.gallery__item {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg);
}

/* ---------- Liên hệ ---------- */

.contacts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contacts a {
    color: var(--accent);
    overflow-wrap: anywhere;
}

/* ---------- CTA ---------- */

.cta {
    display: block;
    padding: 15px 20px;
    background: var(--accent);
    color: var(--accent-text);
    text-align: center;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cta:hover { filter: brightness(1.06); }

.verify-note {
    margin: 0;
    padding: 0 4px;
    font-size: .8125rem;
    color: var(--text-muted);
    text-align: center;
}

.site-footer {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 32px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: .75rem;
    color: var(--text-muted);
}

a { color: inherit; }

/* Người dùng bật "giảm chuyển động" thì tắt mọi transition. */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
