/* ================================================================
   CHI TIET SAN PHAM — Responsive CSS
   Trọng tâm: Mobile-first, touch-friendly, dễ đọc / dễ dùng
   Base: 375px | Tablet: 600px | Desktop: 960px | Wide: 1200px
   ================================================================ */

/* ── CSS Reset & Box model ────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ================================================================
   GLOBAL OVERFLOW FIX — ngăn tràn ngang toàn trang
   Nguyên nhân thường gặp: table min-width, ảnh, pre, canvas,
   element có width cố định lớn hơn viewport
   ================================================================ */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Mọi element con không được rộng hơn viewport */
* {
    min-width: 0; /* quan trọng: flexbox/grid children hay bị quên */
}

/* Ảnh, video, canvas, svg — không vượt quá container */
img, video, canvas, embed, object, iframe {
    max-width: 100%;
    height: auto;
}

/* Table — scroll ngang thay vì tràn ra */
table {
    max-width: 100%;
}

/* Pre/code — không tràn, scroll ngang nếu cần */
pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Wrapper ──────────────────────────────────────────────────── */
.pd-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 14px 100px;
    overflow-x: hidden;
    width: 100%;
}

@media (min-width: 600px) {
    .pd-wrap {
        padding: 16px 20px 90px;
    }
}

@media (min-width: 960px) {
    .pd-wrap {
        padding: 24px 20px 80px;
    }
}

/* ── Seller Preview Banner ────────────────────────────────────── */
.pd-preview-banner {
    background: linear-gradient(135deg, rgba(234,179,8,.12), rgba(234,179,8,.06));
    border: 1px solid rgba(234,179,8,.35);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

    .pd-preview-banner i {
        color: #ca8a04;
        font-size: 14px;
        margin-top: 1px;
        flex-shrink: 0;
    }

.pd-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(234,179,8,.2);
    color: #92400e;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    margin-left: 4px;
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.pd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
    line-height: 1.6;
}

    .pd-breadcrumb a {
        color: var(--text-muted);
        text-decoration: none;
        transition: color .2s;
        white-space: nowrap;
    }

        .pd-breadcrumb a:hover {
            color: var(--accent-light);
        }

    .pd-breadcrumb .sep {
        font-size: 8px;
        opacity: .45;
    }

.pd-breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

@media (min-width: 600px) {
    .pd-breadcrumb {
        font-size: 12px;
        gap: 6px;
    }

    .pd-breadcrumb-current {
        max-width: 260px;
    }
}

/* ── Main Grid ────────────────────────────────────────────────── */
.pd-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    overflow: hidden;
}

@media (min-width: 960px) {
    .pd-grid {
        grid-template-columns: 1fr 360px;
        gap: 28px;
        align-items: start;
    }
}

/* ── Right column sticky ──────────────────────────────────────── */
.pd-right {
    position: static;
}

@media (min-width: 960px) {
    .pd-right {
        position: sticky;
        top: 80px;
    }
}

/* ── Image Gallery ────────────────────────────────────────────── */
.pd-gallery {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

.pd-gallery-main {
    position: relative;
    padding-top: 56.25%;
    background: var(--bg-secondary);
    cursor: zoom-in;
}

    .pd-gallery-main img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .3s ease, opacity .4s ease;
    }

    .pd-gallery-main:hover img {
        transform: scale(1.02);
    }

    .pd-gallery-main img.fade-out {
        opacity: .15;
        transform: scale(.99);
    }

.pd-gallery-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
}

.pd-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 2;
    /* Touch target đủ lớn */
    min-width: 44px;
    min-height: 44px;
}

    .pd-gallery-nav:hover {
        background: rgba(0,0,0,.7);
    }

    .pd-gallery-nav.prev {
        left: 6px;
    }

    .pd-gallery-nav.next {
        right: 6px;
    }

/* Thumbnails */
.pd-thumbs {
    display: flex;
    gap: 7px;
    padding: 10px 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.pd-thumbs-hint {
    display: none;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    padding: 2px 0 6px;
    opacity: .6;
}

@media (max-width: 599px) {
    .pd-thumbs-hint {
        display: block;
    }
}

.pd-thumb {
    width: 68px;
    height: 52px;
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .2s, transform .15s;
}

    .pd-thumb:hover {
        transform: translateY(-2px);
    }

    .pd-thumb.active {
        border-color: var(--accent);
    }

    .pd-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* ── Lightbox ─────────────────────────────────────────────────── */
.pd-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    .pd-lightbox.open {
        display: flex;
    }

    .pd-lightbox img {
        max-width: 92vw;
        max-height: 88vh;
        border-radius: 10px;
        object-fit: contain;
    }

.pd-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .pd-lightbox-nav.prev {
        left: 12px;
    }

    .pd-lightbox-nav.next {
        right: 12px;
    }

/* ── Section Cards ────────────────────────────────────────────── */
.pd-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
}

@media (min-width: 600px) {
    .pd-card {
        border-radius: 14px;
        margin-bottom: 20px;
    }
}

.pd-card-hd {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

    .pd-card-hd i {
        font-size: 13px;
        color: var(--accent-light);
    }

.pd-card-bd {
    padding: 14px 16px;
}

@media (min-width: 600px) {
    .pd-card-hd {
        padding: 16px 20px;
        font-size: 14px;
    }

    .pd-card-bd {
        padding: 20px;
    }
}

/* ── Description & Install text ──────────────────────────────── */
.pd-desc {
    color: var(--text-secondary);
    line-height: 1.85;
    font-size: 13.5px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

    .pd-desc table {
        width: 100% !important;
        display: block;
        overflow-x: auto;
        border-collapse: collapse;
        -webkit-overflow-scrolling: touch;
        margin: 12px 0;
    }

    .pd-desc img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px;
        margin: 8px 0;
        display: block;
    }

.pd-install-raw {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.8;
    font-family: 'Consolas', 'Courier New', monospace;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px 14px;
    white-space: pre-wrap;
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── Tags ─────────────────────────────────────────────────────── */
.pd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pd-tag {
    background: rgba(37,99,235,.09);
    color: var(--accent-light);
    border: 1px solid rgba(37,99,235,.18);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: background .2s;
    cursor: default;
    /* Touch target */
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

    .pd-tag:hover {
        background: rgba(37,99,235,.18);
    }

/* ── Video ────────────────────────────────────────────────────── */
.pd-video-wrap {
    position: relative;
    padding-top: 56.25%;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

    .pd-video-wrap iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: none;
    }

.pd-video-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all .2s ease;
    min-height: 56px;
}

    .pd-video-link:hover {
        border-color: var(--accent);
        transform: translateY(-1px);
    }

.pd-demo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    text-decoration: none;
    transition: border-color .2s, background .2s;
    min-height: 44px;
}

    .pd-demo-link:hover {
        border-color: var(--accent-light);
        background: rgba(37,99,235,.07);
    }

/* ── Rating Summary ───────────────────────────────────────────── */
.pd-rating-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 14px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

@media (min-width: 600px) {
    .pd-rating-wrap {
        flex-direction: row;
        align-items: stretch;
        gap: 28px;
        padding: 22px 24px;
        border-radius: 14px;
    }
}

.pd-rating-score {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

@media (min-width: 600px) {
    .pd-rating-score {
        min-width: 200px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.pd-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}

    .pd-rating-badge i {
        font-size: 11px;
        color: var(--accent);
    }

.pd-rating-big {
    font-size: 52px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 600px) {
    .pd-rating-big {
        font-size: 62px;
    }
}

.pd-stars-row {
    color: var(--accent);
    font-size: 15px;
    letter-spacing: 1.2px;
}

.pd-rating-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.pd-rating-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
}

.pd-rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
}

    .pd-rating-pill i {
        color: var(--accent);
        font-size: 11px;
    }

/* Rating bars */
.pd-rating-bars {
    flex: 1;
    display: grid;
    gap: 8px;
}

.pd-rating-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.pd-bar-row {
    display: grid;
    grid-template-columns: 48px 1fr 38px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pd-bar-label {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 700;
}

    .pd-bar-label i {
        color: #f8b136;
        font-size: 10px;
    }

.pd-bar-track {
    height: 7px;
    background: var(--bg-card);
    border-radius: 999px;
    overflow: hidden;
}

.pd-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width .7s cubic-bezier(.4,0,.2,1);
}

.pd-bar-num {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    font-weight: 700;
}

/* ── Review Form ──────────────────────────────────────────────── */
.star-rating-input {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

    .star-rating-input i {
        font-size: 26px;
        color: var(--border);
        cursor: pointer;
        transition: color .15s, transform .1s;
        /* Mobile touch */
        padding: 4px;
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .star-rating-input i:hover,
        .star-rating-input i.active {
            color: var(--gold, #f59e0b);
        }

        .star-rating-input i:hover {
            transform: scale(1.15);
        }

/* Prevent iOS font size zoom on focus */
#formDanhGia textarea,
#formDanhGia input[type="text"] {
    font-size: 16px !important;
}

@media (min-width: 600px) {
    #formDanhGia textarea,
    #formDanhGia input[type="text"] {
        font-size: 13px !important;
    }
}

/* ── Review List ──────────────────────────────────────────────── */
.pd-review {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

    .pd-review:last-child {
        border: none;
    }

.pd-review-hd {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pd-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

    .pd-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.pd-review-meta {
    flex: 1;
    min-width: 0;
}

.pd-review-name {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pd-review-stars {
    color: var(--gold, #f59e0b);
    font-size: 11px;
}

.pd-review-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.pd-review-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    word-break: break-word;
}

.pd-review-mine-badge {
    font-size: 10px;
    background: rgba(37,99,235,.1);
    color: var(--accent-light);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 400;
}

.pd-review-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pd-review-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s;
    min-height: 34px;
}

    .pd-review-action-btn:hover {
        border-color: var(--accent-light);
        color: var(--accent-light);
    }

    .pd-review-action-btn.danger:hover {
        border-color: var(--danger);
        color: var(--danger);
    }

/* ── Review body indent — responsive ─────────────────────────── */
.review-body-content {
    padding-left: 0;
}

.review-images--indent {
    padding-left: 0 !important;
}

.review-act-row {
    padding-left: 0;
}

@media (min-width: 500px) {
    .review-body-content {
        padding-left: 52px;
    }

    .review-images--indent {
        padding-left: 52px !important;
    }

    .review-act-row {
        padding-left: 52px;
    }
}

/* ── Review images ────────────────────────────────────────────── */
.review-images {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.review-img-thumb {
    width: 72px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    cursor: zoom-in;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

    .review-img-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .2s;
        display: block;
    }

    .review-img-thumb:hover img {
        transform: scale(1.05);
    }

/* ── Upload preview ───────────────────────────────────────────── */
.upload-preview-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.upload-preview-item {
    width: 64px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

    .upload-preview-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.upload-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,.65);
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .2s, color .2s;
    min-height: 40px;
}

    .file-upload-btn:hover {
        border-color: var(--accent-light);
        color: var(--accent-light);
    }

/* ── Reply section ────────────────────────────────────────────── */
.review-reply-wrap {
    margin-top: 10px;
    padding-left: 0;
}

@media (min-width: 500px) {
    .review-reply-wrap {
        padding-left: 40px;
    }
}

.review-reply-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding: 11px 12px;
    background: rgba(37,99,235,.06);
    border: 1px solid rgba(37,99,235,.12);
    border-radius: 10px;
    position: relative;
}

    .review-reply-item.seller-reply {
        background: rgba(245,158,11,.06);
        border-color: rgba(245,158,11,.18);
    }

    .review-reply-item.admin-reply {
        background: rgba(139,92,246,.08);
        border-color: rgba(139,92,246,.22);
    }

.reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

    .reply-avatar.seller {
        background: linear-gradient(135deg,#f59e0b,#d97706);
    }

    .reply-avatar.buyer {
        background: linear-gradient(135deg,#3b82f6,#1d4ed8);
    }

    .reply-avatar.admin {
        background: linear-gradient(135deg,#8b5cf6,#6d28d9);
    }

.reply-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    letter-spacing: .3px;
}

    .reply-badge.seller {
        background: rgba(245,158,11,.15);
        color: #b45309;
    }

    .reply-badge.buyer {
        background: rgba(37,99,235,.12);
        color: var(--accent-light);
    }

    .reply-badge.admin {
        background: rgba(139,92,246,.18);
        color: #6d28d9;
    }

.review-badge-admin {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(139,92,246,.18);
    color: #6d28d9;
    letter-spacing: .2px;
}

.reply-form-wrap {
    margin-top: 10px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 10px;
    display: none;
}

    .reply-form-wrap.open {
        display: block;
    }

/* ── Right column: Buy Card ───────────────────────────────────── */
.pd-buy-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

.pd-buy-price {
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    background: linear-gradient(135deg, rgba(37,99,235,.05), rgba(37,99,235,.02));
}

.pd-buy-price-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 5px;
}

.pd-price-val {
    font-size: 30px;
    font-weight: 800;
    color: var(--accent-light);
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

@media (min-width: 960px) {
    .pd-price-val {
        font-size: 34px;
    }
}

.pd-price-perma {
    font-size: 12px;
    color: var(--success, #22c55e);
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.pd-buy-actions {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    /* Ensure all buttons in buy-actions are touch-friendly */
    .pd-buy-actions .btn {
        min-height: 46px;
        font-size: 13px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
    }

    .pd-buy-actions .btn-lg {
        min-height: 52px;
        font-size: 15px;
        font-weight: 700;
    }

/* ── Meta list ────────────────────────────────────────────────── */
.pd-meta-list {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

.pd-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 9px 0;
    font-size: 12.5px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

    .pd-meta-row:last-child {
        border: none;
    }

.pd-meta-key {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

    .pd-meta-key i {
        width: 14px;
        text-align: center;
    }

.pd-meta-val {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── Status badges ────────────────────────────────────────────── */
.pd-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

    .pd-status-badge.ok {
        background: rgba(34,197,94,.12);
        color: #16a34a;
    }

    .pd-status-badge.wait {
        background: rgba(234,179,8,.12);
        color: #b45309;
    }

    .pd-status-badge.reject {
        background: rgba(239,68,68,.12);
        color: #dc2626;
    }

    .pd-status-badge.hidden {
        background: var(--bg-secondary);
        color: var(--text-muted);
    }

/* ── Owned box ────────────────────────────────────────────────── */
.pd-owned-box {
    background: rgba(34,197,94,.08);
    border: 1px solid rgba(34,197,94,.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--success, #16a34a);
    text-align: center;
}

/* ── Seller card (inside buy card) ───────────────────────────── */
.pd-seller-card {
    border-top: 1px solid var(--border);
    padding: 14px 16px 12px;
    background: linear-gradient(180deg, rgba(37,99,235,.03), transparent);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pd-seller-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pd-seller-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(37,99,235,.12);
    color: var(--accent-light);
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

    .pd-seller-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.pd-seller-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pd-seller-role {
    font-size: 12px;
    color: var(--text-muted);
}

.pd-seller-pill {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px dashed rgba(22,163,74,.4);
    background: rgba(22,163,74,.08);
    color: #16a34a;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

@media (max-width: 380px) {
    .pd-seller-pill-text {
        display: none;
    }

    .pd-seller-pill {
        padding: 5px 8px;
    }
}

/* Seller stats grid */
.pd-seller-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 420px) {
    .pd-seller-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pd-seller-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
    min-height: 64px;
    justify-content: center;
}

    .pd-seller-stat .stat-number {
        font-weight: 800;
        font-size: 13px;
        color: var(--text-primary);
        line-height: 1.2;
    }

    .pd-seller-stat .stat-label {
        font-size: 11px;
        color: var(--text-muted);
    }

/* Trust badges */
.pd-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fdf7ed;
    border: 1px dashed #f59e0b;
    border-radius: 10px;
    padding: 11px 13px;
}

@media (min-width: 500px) {
    .pd-trust-badges {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
}

.pd-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: #b45309;
}

    .pd-trust-item i {
        color: #4caf50;
        font-size: 13px;
    }

    .pd-trust-item.muted {
        color: var(--text-muted);
        opacity: .85;
    }

        .pd-trust-item.muted i {
            color: var(--text-muted);
        }

/* ── Related products ─────────────────────────────────────────── */
.pd-related-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.pd-related-hd {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
}

.pd-related-item {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
    /* Touch target */
    min-height: 60px;
    align-items: center;
}

    .pd-related-item:last-child {
        border: none;
    }

    .pd-related-item:hover {
        background: var(--bg-secondary);
    }

.pd-related-thumb {
    width: 56px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

    .pd-related-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.pd-related-info {
    flex: 1;
    min-width: 0;
}

.pd-related-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.pd-related-price {
    font-size: 12px;
    color: var(--accent-light);
    font-weight: 700;
    margin-top: 3px;
}

.pd-related-stars {
    font-size: 10px;
    color: var(--gold, #f59e0b);
}

/* ── Sticky Bottom Bar — Mobile ───────────────────────────────── */
.pd-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13,17,23,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line2, rgba(255,255,255,.1));
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -8px 24px rgba(0,0,0,.3);
    animation: barSlideIn .35s ease;
    gap: 10px;
    align-items: center;
}

@keyframes barSlideIn {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Show on mobile */
@media (max-width: 600px) {
    .pd-sticky-bar {
        display: flex;
    }
    /* Push content above sticky bar */
    .pd-wrap {
        padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
    }
}

.pd-sticky-price {
    flex-shrink: 0;
}

.pd-sticky-price-val {
    font-size: 17px;
    font-weight: 800;
    color: var(--accent-light);
    display: block;
}

.pd-sticky-price-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .5px;
}

.pd-sticky-btn {
    flex: 1;
    min-height: 48px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.pd-sticky-icon-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid var(--line2, rgba(255,255,255,.12));
    background: rgba(255,255,255,.06);
    color: var(--t2, #94a3b8);
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}

    .pd-sticky-icon-btn.report {
        color: var(--red, #ef4444);
        border-color: rgba(239,68,68,.3);
    }

    .pd-sticky-icon-btn:active {
        transform: scale(.92);
    }

/* ── Modals ───────────────────────────────────────────────────── */
/* Delete confirm modal */
#deleteConfirmModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.78);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    #deleteConfirmModal.open {
        display: flex;
    }

/* Report modal */
#reportModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

    #reportModal.open,
    #reportModal[style*="flex"] { /* fallback for inline style */
    }

/* On mobile: report modal slides from bottom */
@media (max-width: 600px) {
    #reportModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

        #reportModal > div {
            border-radius: 20px 20px 0 0 !important;
            width: 100% !important;
            max-width: 100% !important;
            padding-bottom: env(safe-area-inset-bottom);
        }

    #deleteConfirmModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

        #deleteConfirmModal > div {
            border-radius: 20px 20px 0 0 !important;
            width: 100% !important;
            max-width: 100% !important;
            padding-bottom: calc(16px + env(safe-area-inset-bottom));
        }
}

/* Review lightbox */
#reviewLightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

/* ── Modal Mua Ngay ───────────────────────────────────────────── */
.mn-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: mnFadeIn .2s ease;
    -webkit-overflow-scrolling: touch;
}

    .mn-overlay.open {
        display: flex;
    }

@keyframes mnFadeIn {
    from {
        opacity: 0;
    }
}

.mn-modal {
    background: var(--bg2, var(--bg-card));
    border: 1px solid var(--line2, var(--border));
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 24px 64px rgba(0,0,0,.7);
    animation: mnSlideUp .25s cubic-bezier(.34,1.56,.64,1);
}

@keyframes mnSlideUp {
    from {
        transform: translateY(28px) scale(.97);
        opacity: 0;
    }
}

/* Mobile: sheet from bottom */
@media (max-width: 600px) {
    .mn-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .mn-modal {
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
        width: 100%;
    }
}

.mn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(37,99,235,.03));
    border-bottom: 1px solid var(--line, var(--border));
    border-radius: 16px 16px 0 0;
}

.mn-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mn-header-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.mn-header-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .4px;
    color: var(--t1, var(--text-primary));
}

.mn-header-sub {
    font-size: 11px;
    color: var(--t3, var(--text-muted));
    margin-top: 2px;
}

.mn-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: rgba(255,255,255,.06);
    color: var(--t3, var(--text-muted));
    font-size: 14px;
    transition: all .15s;
}

    .mn-close:hover {
        background: var(--bg4, var(--bg-secondary));
    }

.mn-userbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 18px;
    background: rgba(255,255,255,.025);
    border-bottom: 1px solid var(--line, var(--border));
    flex-wrap: wrap;
}

.mn-userbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--t2, var(--text-secondary));
}

.mn-body {
    padding: 16px 18px;
}

.mn-product-title {
    font-size: 13.5px;
    color: var(--t2, var(--text-secondary));
    margin-bottom: 16px;
    line-height: 1.7;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.mn-highlight {
    font-weight: 700;
    color: var(--accent2, var(--accent-light));
    font-size: 14px;
}

.mn-price-badge {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.22);
    color: #f87171;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Content grid inside modal */
.mn-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (min-width: 500px) {
    .mn-content-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Note / calc boxes */
.mn-note-box {
    background: rgba(16,185,129,.05);
    border: 1px solid rgba(16,185,129,.15);
    border-radius: 10px;
    padding: 12px;
}

.mn-note-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--green, #10b981);
    margin-bottom: 9px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.mn-note-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .mn-note-list li {
        font-size: 12px;
        color: var(--t2, var(--text-secondary));
        display: flex;
        align-items: flex-start;
        gap: 7px;
        line-height: 1.5;
    }

        .mn-note-list li i {
            color: var(--green, #10b981);
            font-size: 11px;
            margin-top: 2px;
            flex-shrink: 0;
        }

.mn-calc-box {
    background: var(--bg3, var(--bg-secondary));
    border: 1px solid var(--line, var(--border));
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.mn-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mn-calc-label {
    font-size: 12.5px;
    color: var(--t2, var(--text-secondary));
}

.mn-calc-val {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--mono, monospace);
}

.mn-calc-divider {
    height: 1px;
    background: var(--line, var(--border));
}

.mn-calc-divider--total {
    background: linear-gradient(to right, var(--line, var(--border)), var(--accent), var(--line, var(--border)));
    height: 2px;
}

.mn-calc-remain {
    font-size: 18px !important;
    color: var(--yellow, #f59e0b);
}

    .mn-calc-remain.negative {
        color: var(--red, #ef4444) !important;
    }

/* Captcha */
.mn-captcha-wrap {
    background: var(--bg3, var(--bg-secondary));
    border: 1px solid var(--line, var(--border));
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.mn-captcha-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--t2, var(--text-secondary));
    margin-bottom: 9px;
}

.mn-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mn-captcha-display {
    background: var(--bg1, var(--bg-secondary));
    border: 1px solid var(--line2, var(--border));
    border-radius: 8px;
    padding: 9px 14px;
    font-family: var(--mono, monospace);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 7px;
    color: var(--accent2, var(--accent-light));
    min-width: 100px;
    text-align: center;
    user-select: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

    .mn-captcha-display::before {
        content: '';
        position: absolute;
        inset: 0;
        background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(37,99,235,.04) 4px, rgba(37,99,235,.04) 8px);
        pointer-events: none;
    }

.mn-captcha-input {
    flex: 1;
    min-width: 100px;
    background: var(--bg1, var(--bg-card));
    border: 1px solid var(--line, var(--border));
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--t1, var(--text-primary));
    font-size: 16px;
    font-family: var(--mono, monospace);
    letter-spacing: 4px;
    outline: none;
    transition: border-color .18s;
}

    .mn-captcha-input:focus {
        border-color: var(--accent);
    }

.mn-captcha-refresh {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg4, var(--bg-secondary));
    border: 1px solid var(--line, var(--border));
    border-radius: 8px;
    cursor: pointer;
    color: var(--t3, var(--text-muted));
    font-size: 13px;
    transition: all .15s;
    flex-shrink: 0;
}

    .mn-captcha-refresh:hover {
        color: var(--accent2, var(--accent-light));
        border-color: var(--accent);
    }

.mn-captcha-err {
    font-size: 11px;
    color: var(--red, #ef4444);
    margin-top: 6px;
    min-height: 16px;
}

/* Success banner */
.mn-success-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(16,185,129,.08);
    border: 1px solid rgba(16,185,129,.22);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.mn-success-icon {
    font-size: 28px;
    color: var(--green, #10b981);
    flex-shrink: 0;
}

.mn-success-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--green, #10b981);
}

.mn-success-sub {
    font-size: 12px;
    color: var(--t3, var(--text-muted));
    margin-top: 3px;
}

/* Download box */
.mn-dl-box {
    background: var(--bg3, var(--bg-secondary));
    border: 1px solid var(--line2, var(--border));
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.mn-dl-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(37,99,235,.08);
    border-bottom: 1px solid var(--line, var(--border));
    font-size: 12.5px;
    font-weight: 600;
    color: var(--t1, var(--text-primary));
    flex-wrap: wrap;
    gap: 8px;
}

.mn-dl-timer-badge {
    font-size: 11px;
    font-weight: 600;
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.22);
    color: var(--yellow, #f59e0b);
    border-radius: 20px;
    padding: 2px 9px;
    font-family: var(--mono, monospace);
}

.mn-dl-link-row {
    display: flex;
    align-items: stretch;
    padding: 10px;
    gap: 0;
}

@media (max-width: 600px) {
    .mn-dl-link-row {
        flex-direction: column;
        gap: 6px;
    }
}

.mn-dl-link-input {
    flex: 1;
    background: var(--bg1, var(--bg-card));
    border: 1px solid var(--line, var(--border));
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 9px 12px;
    color: var(--accent2, var(--accent-light));
    font-size: 12px;
    font-family: var(--mono, monospace);
    outline: none;
    min-width: 0;
}

.mn-dl-copy-btn {
    padding: 9px 14px;
    background: var(--bg4, var(--bg-secondary));
    border: 1px solid var(--line, var(--border));
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    color: var(--t2, var(--text-secondary));
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .mn-dl-link-input {
        border-right: 1px solid var(--line, var(--border)) !important;
        border-radius: 8px !important;
    }

    .mn-dl-copy-btn {
        border-radius: 8px !important;
        justify-content: center;
    }
}

.mn-dl-copy-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.mn-dl-info {
    padding: 9px 14px;
    border-top: 1px solid var(--line, var(--border));
    font-size: 11px;
    color: var(--t3, var(--text-muted));
    line-height: 1.6;
}

/* Seller contact */
.mn-seller-contact {
    background: rgba(37,99,235,.05);
    border: 1px solid rgba(37,99,235,.15);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.mn-seller-contact-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--t3, var(--text-muted));
    margin-bottom: 9px;
}

.mn-seller-contact-body {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.mn-seller-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--t1, var(--text-primary));
    word-break: break-all;
}

/* Modal footer */
.mn-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 18px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line, var(--border));
    flex-wrap: wrap;
}

.mn-btn-confirm {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    border: none;
    font-weight: 800;
    font-size: 13px;
    padding: 11px 20px;
    border-radius: 8px;
    letter-spacing: .3px;
    cursor: pointer;
    transition: all .18s;
    min-height: 44px;
}

    .mn-btn-confirm:hover {
        transform: translateY(-1px);
    }

    .mn-btn-confirm:disabled {
        opacity: .5;
        cursor: not-allowed;
        transform: none;
    }

.mn-btn-dl {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 13px;
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
}

    .mn-btn-dl:hover {
        transform: translateY(-1px);
        color: #fff;
    }

/* Mobile modal: full-width buttons */
@media (max-width: 600px) {
    .mn-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

        .mn-footer .btn,
        .mn-footer .mn-btn-confirm,
        .mn-footer .mn-btn-dl {
            flex: 1 1 auto;
            justify-content: center;
            text-align: center;
            font-size: 13px;
            min-height: 48px;
            padding: 11px 12px;
        }

    .mn-header {
        padding: 13px 14px 11px;
    }

    .mn-header-title {
        font-size: 13px;
    }

    .mn-header-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
        border-radius: 9px;
    }

    .mn-userbar {
        padding: 8px 14px;
        gap: 8px;
        flex-direction: column;
        align-items: flex-start;
    }

    .mn-userbar-item {
        font-size: 11.5px;
    }

    .mn-body {
        padding: 13px 14px;
    }

    .mn-captcha-display {
        font-size: 18px;
        letter-spacing: 5px;
    }

    .mn-calc-remain {
        font-size: 16px !important;
    }
}

/* Shake animation */
@keyframes mnShake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* ── Info box ─────────────────────────────────────────────────── */
.pd-info-box {
    background: rgba(37,99,235,.07);
    border: 1px solid rgba(37,99,235,.15);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13px;
    color: var(--accent-light);
    margin-bottom: 16px;
}

/* ── Toast notifications ──────────────────────────────────────── */
#pdToastContainer {
    position: fixed;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    /* Mobile: bottom center */
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    top: auto;
}

@media (min-width: 600px) {
    #pdToastContainer {
        top: 18px;
        right: 18px;
        bottom: auto;
        left: auto;
        width: 320px;
    }
}

/* ── General button touch targets ─────────────────────────────── */
.btn {
    min-height: 44px;
}

/* ── Global utility — prevent horizontal overflow ─────────────── */
/* (đã xử lý ở phần đầu file, giữ lại để tương thích) */
img {
    max-width: 100%;
    height: auto;
}

/* ── section-desc (dùng trong _LichSuGia) ────────────────────── */
.section-desc {
    overflow: hidden;
    width: 100%;
}

/* Canvas biểu đồ không vượt container */
#giaBieuDo {
    max-width: 100% !important;
}

/* Biểu đồ wrapper */
#lichSuGiaSection [style*="position:relative"],
#lichSuGiaSection > div[style*="height"] {
    max-width: 100%;
    overflow: hidden;
}

/* ================================================================
   LỊCH SỬ GIÁ — table-wrapper fix
   veKhungBang() inject HTML dùng class này
   ================================================================ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Hint scroll trên mobile bằng shadow gradient */
    background: linear-gradient(to right, var(--bg-secondary) 20px, transparent 20px) left, linear-gradient(to left, var(--bg-secondary) 20px, transparent 20px) right, radial-gradient(ellipse at left, rgba(0,0,0,.12) 0%, transparent 70%) left, radial-gradient(ellipse at right, rgba(0,0,0,.12) 0%, transparent 70%) right;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
    border-radius: 8px;
}

    .table-wrapper table {
        width: 100%;
        min-width: 440px;
        border-collapse: collapse;
        font-size: 13px;
    }

    .table-wrapper thead th {
        padding: 9px 12px;
        text-align: left;
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .5px;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
        background: var(--bg-secondary);
    }

    .table-wrapper tbody td {
        padding: 10px 12px;
        font-size: 12.5px;
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
        white-space: nowrap;
    }

    .table-wrapper tbody tr:last-child td {
        border-bottom: none;
    }

    .table-wrapper tbody tr:hover td {
        background: var(--bg-secondary);
    }

    /* Cột Lý do — cho phép wrap */
    .table-wrapper tbody td:last-child {
        white-space: normal;
        min-width: 100px;
        max-width: 180px;
        word-break: break-word;
    }

    /* Số liệu tiền — font mono */
    .table-wrapper .text-mono {
        font-family: var(--font-mono, 'Consolas', monospace);
        font-weight: 600;
    }

/* Stat boxes tóm tắt — responsive */
#giaTomTat {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

@media (min-width: 500px) {
    #giaTomTat {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gia-stat-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
}

    /* Số trong stat box — nhỏ lại trên mobile */
    .gia-stat-box > div:last-child {
        font-size: 15px;
        font-weight: 700;
        font-family: var(--font-mono, monospace);
        line-height: 1.3;
        word-break: break-all;
    }

@media (min-width: 400px) {
    .gia-stat-box > div:last-child {
        font-size: 17px;
    }
}

/* Scroll hint label */
#bangLichSuGia::before {
    content: none; /* dùng JS inject label thay thế */
}

/* Biểu đồ — chiều cao linh hoạt trên mobile */
#lichSuGiaSection [style*="height:280px"] {
    height: 220px !important;
}

@media (min-width: 600px) {
    #lichSuGiaSection [style*="height:280px"],
    #lichSuGiaSection [style*="height:220px"] {
        height: 280px !important;
    }
}

/* Chart type buttons — touch target */
.chart-type-btn {
    min-height: 36px;
    padding: 6px 12px;
}

/* ================================================================
   OVERFLOW NUCLEAR FIX — chặn mọi thứ tràn ngang khỏi layout
   Áp dụng riêng cho trang chi tiết sản phẩm
   ================================================================ */

/* Bất kỳ element nào trực tiếp trong pd-wrap đều không được tràn */
.pd-wrap > *,
.pd-wrap > * > *,
.pd-left > *,
.pd-right > * {
    max-width: 100%;
    overflow-x: hidden;
}

/* Exception: các wrapper có scroll ngang hợp lệ */
.table-wrapper,
.pd-thumbs,
.lichsu-gia-wrap,
.mn-modal {
    overflow-x: auto !important;
}

/* mn-modal không bị overflow hidden cắt nội dung */
.mn-overlay {
    overflow-x: hidden;
}

/* _LichSuGia: giaTomTat grid không tràn */
#giaTomTat {
    width: 100%;
    overflow: hidden;
}

/* Chart.js canvas wrapper */
#lichSuGiaSection > div {
    width: 100% !important;
    max-width: 100% !important;
}

/* Inline style width fixed — override nếu gây tràn */
@media (max-width: 600px) {
    [style*="min-width"] {
        min-width: 0 !important;
    }

    /* Các card/box inline style không tràn */
    .pd-card,
    .pd-buy-card,
    .pd-related-card,
    .pd-seller-card,
    .pd-rating-wrap {
        width: 100%;
        max-width: 100%;
    }

    /* Modal mua ngay — không bị clip */
    .mn-modal {
        overflow-x: hidden;
        overflow-y: auto;
    }
}
