/* Thẻ sản phẩm tương tác (landing + blog): chỉ dùng token màu, font, bo góc hiện có. */
.mtg-pc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0 2rem; }
.mtg-pc { display: flex; flex-direction: column; min-width: 0; background: var(--mtg-white); border: 1px solid var(--mtg-line); border-radius: var(--mtg-radius-lg); overflow: hidden; }
.mtg-pc-media { position: relative; }
.mtg-pc-media > a { display: block; aspect-ratio: 1; background: var(--mtg-cream); cursor: zoom-in; }
.mtg-pc-media img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 0; }
.mtg-pc-save { position: absolute; top: .6rem; right: .6rem; min-height: 36px; padding: 0 .8rem; border: 1px solid var(--mtg-line); border-radius: 999px; background: var(--mtg-white); color: var(--mtg-text-brown); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; box-shadow: 0 2px 10px #0000001a; }
.mtg-pc-save[aria-pressed="true"] { background: var(--mtg-gold); border-color: var(--mtg-gold); color: var(--mtg-ink); }
.mtg-pc-body { display: flex; flex-direction: column; gap: .35rem; padding: .85rem 1rem 1rem; flex: 1; }
.mtg-pc-title { margin: 0; font-size: .9375rem; line-height: 1.45; font-weight: 600; }
.mtg-pc-title a { text-decoration: none; color: var(--mtg-text-brown); }
.mtg-pc-price { margin: 0; font-size: .9375rem; color: var(--mtg-muted); line-height: 1.5; }
.mtg-pc-zalo { margin-top: auto; display: inline-flex; gap: .35rem; justify-content: center; align-items: center; min-height: 44px; padding: 0 .75rem; white-space: nowrap; border: 0; border-radius: 999px; background: var(--mtg-gold); color: var(--mtg-ink) !important; font-weight: 600; font-size: .9375rem; line-height: 1.3; text-align: center; text-decoration: none; cursor: pointer; }
.mtg-pc-zalo:hover { background: var(--mtg-gold-light, var(--mtg-gold)); }

/* Kho mẫu: tab nhóm + phân trang số, dùng lại kiểu nút lọc/phân trang của trang danh mục. */
.mtg-kho { margin: 1.25rem 0 2.25rem; scroll-margin-top: 1rem; }
.mtg-kho-tabs { margin-bottom: 1rem; }
.mtg-kho-tabs small { opacity: .7; font-size: .8125em; }
.mtg-kho-body { transition: opacity .15s; }
.mtg-kho-meta { margin: 0 0 .75rem; font-size: .875rem; color: var(--mtg-muted); }
.mtg-kho .mtg-pc-grid { margin: 0; }
.mtg-kho-pages { justify-content: center; margin-top: 1.25rem; }
.mtg-kho-pages .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.mtg-kho-pages a.page-numbers:hover { border-color: var(--mtg-gold); }
.mtg-kho-all { text-align: center; margin: .75rem 0 0; font-size: .9375rem; }
.mtg-kho-empty { color: var(--mtg-muted); }

/* Ảnh thực tế từ Thư viện ảnh. */
.mtg-photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1.25rem 0 .5rem; }
.mtg-photo-item { margin: 0; min-width: 0; }
.mtg-photo-item a { display: block; aspect-ratio: 1; border-radius: var(--mtg-radius); overflow: hidden; background: var(--mtg-cream); cursor: zoom-in; }
.mtg-photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; transition: transform .25s; }
.mtg-photo-item a:hover img { transform: scale(1.03); }
.mtg-photo-item figcaption { margin-top: .4rem; font-size: .8125rem; line-height: 1.45; color: var(--mtg-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mtg-photos-more { margin: .5rem 0 2rem; font-size: .9375rem; }
.mtg-qv.is-photo .mtg-qv-content { display: block; }
/* Xem ảnh kiểu kính mờ: trang phía sau được làm mờ, ảnh nổi lên, nút và chú thích trong suốt. */
.mtg-qv.is-photo { width: min(1040px, calc(100vw - 2rem)); max-height: 94dvh; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.mtg-qv.is-photo::backdrop { background: rgb(24 18 12 / 45%); -webkit-backdrop-filter: blur(22px) saturate(1.15); backdrop-filter: blur(22px) saturate(1.15); }
.mtg-photo-view { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.mtg-photo-view img { display: block; max-width: 100%; max-height: 80dvh; width: auto; height: auto; object-fit: contain; margin: 0 auto; border-radius: 20px; box-shadow: 0 24px 70px rgb(0 0 0 / 35%); background: transparent; }
.mtg-photo-view figcaption { display: inline-flex; align-items: center; gap: 1rem; max-width: 100%; padding: .55rem 1.1rem; border-radius: 999px; color: #fff; font-size: .9375rem; line-height: 1.45; background: rgb(255 255 255 / 16%); border: 1px solid rgb(255 255 255 / 22%); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); text-shadow: 0 1px 2px rgb(0 0 0 / 35%); }
.mtg-photo-count { flex: none; opacity: .8; }
.mtg-photo-nav, .mtg-qv.is-photo .mtg-qv-close { color: #fff; background: rgb(255 255 255 / 18%); border: 1px solid rgb(255 255 255 / 30%); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 6px 20px rgb(0 0 0 / 20%); }
.mtg-photo-nav { position: absolute; top: calc(40dvh - 24px); width: 48px; height: 48px; border-radius: 50%; font-size: 1.75rem; line-height: 1; cursor: pointer; transition: background .2s; }
.mtg-photo-nav:hover, .mtg-qv.is-photo .mtg-qv-close:hover { background: rgb(255 255 255 / 32%); }
.mtg-photo-nav.is-prev { left: -.25rem; } .mtg-photo-nav.is-next { right: -.25rem; }
.mtg-qv.is-photo .mtg-qv-close { top: -.25rem; right: -.25rem; }
@media (prefers-reduced-transparency: reduce) { .mtg-qv.is-photo::backdrop { background: rgb(24 18 12 / 85%); } }

/* Ảnh có chú thích (thẻ gợi ý). */
.mtg-lp-figure { margin: 0 0 .75rem; }
.mtg-lp-figure .mtg-pc-media > a { aspect-ratio: 4 / 3; border-radius: var(--mtg-radius); overflow: hidden; }
.mtg-lp-figure figcaption { margin-top: .5rem; font-size: .875rem; color: var(--mtg-muted); line-height: 1.5; }
.mtg-lp-figure figcaption a { color: inherit; }

/* Cửa sổ Xem nhanh: giữa màn hình trên máy tính. */
.mtg-qv { width: min(920px, calc(100vw - 2rem)); max-height: 90dvh; padding: 0; outline: none; border: 1px solid var(--mtg-line); border-radius: var(--mtg-radius-lg); background: var(--mtg-white); color: var(--mtg-ink); overflow: auto; overscroll-behavior: contain; }
.mtg-qv::backdrop { background: #100d0ba6; }
.mtg-qv-grip { display: none; }
.mtg-qv-close { position: absolute; top: .75rem; right: .75rem; z-index: 2; width: 44px; height: 44px; border: 1px solid var(--mtg-line); border-radius: 50%; background: var(--mtg-white); color: var(--mtg-ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.mtg-qv-content { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.mtg-qv-gallery { background: var(--mtg-cream); padding: 1rem; }
.mtg-qv-main { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: var(--mtg-radius); background: var(--mtg-white); margin: 0; }
.mtg-qv-thumbs { display: flex; gap: .5rem; margin-top: .75rem; }
.mtg-qv-thumbs button { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: var(--mtg-radius-sm); overflow: hidden; background: var(--mtg-white); cursor: pointer; }
.mtg-qv-thumbs button[aria-current="true"] { border-color: var(--mtg-gold); }
.mtg-qv-thumbs img { width: 100%; height: 100%; object-fit: cover; margin: 0; }
.mtg-qv-info { padding: 1.75rem 1.75rem 1.5rem; display: flex; flex-direction: column; gap: .6rem; }
.mtg-qv-info h2 { margin: 0 2.5rem 0 0; font-size: 1.375rem; line-height: 1.35; color: var(--mtg-text-brown); }
.mtg-qv-sku { margin: 0; color: var(--mtg-muted); font-size: .875rem; }
.mtg-qv-price { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--mtg-text-brown); }
.mtg-qv-specs { margin: .25rem 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .9375rem; }
.mtg-qv-specs dt { color: var(--mtg-muted); }
.mtg-qv-specs dd { margin: 0; }
.mtg-qv-actions { display: grid; gap: .5rem; margin-top: .5rem; }
.mtg-qv-actions .mtg-pc-zalo { min-height: 50px; font-size: 1rem; }
.mtg-qv-add { min-height: 46px; border: 1px solid var(--mtg-line); border-radius: 999px; background: var(--mtg-white); color: var(--mtg-text-brown); font: inherit; font-weight: 600; cursor: pointer; }
.mtg-qv-add[aria-pressed="true"] { border-color: var(--mtg-gold); background: var(--mtg-cream); }
.mtg-qv-loading { grid-column: 1 / -1; padding: 4rem 1rem; text-align: center; color: var(--mtg-muted); }

/* Danh sách hỏi giá. */
.mtg-quote-dialog { width: min(560px, calc(100vw - 2rem)); padding: 1.5rem; }
.mtg-quote-dialog h2 { margin: 0 3rem 1rem 0; font-size: 1.25rem; color: var(--mtg-text-brown); }
.mtg-quote-items { margin: 0; padding: 0; list-style: none; }
.mtg-quote-items li { display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid var(--mtg-line); font-size: .9375rem; line-height: 1.45; }
.mtg-quote-items small { display: block; color: var(--mtg-muted); }
.mtg-quote-items button { flex: none; min-height: 40px; padding: 0 .8rem; border: 1px solid var(--mtg-line); border-radius: 999px; background: var(--mtg-white); color: var(--mtg-ink); font: inherit; font-size: .8125rem; cursor: pointer; }
.mtg-quote-help { font-size: .8125rem; color: var(--mtg-muted); }
.mtg-quote-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.mtg-quote-actions .mtg-pc-zalo { flex: 1; }
.mtg-quote-clear { min-height: 44px; padding: 0 1rem; border: 1px solid var(--mtg-line); border-radius: 999px; background: transparent; color: var(--mtg-muted); font: inherit; cursor: pointer; }

/* Thanh chọn nhiều mẫu: chỉ hiện khi đã lưu ≥ 1 mẫu. */
.mtg-quote-bar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: .6rem; width: max-content; max-width: calc(100vw - 2rem); padding: .5rem .5rem .5rem 1.1rem; background: var(--mtg-white); border: 1px solid var(--mtg-line); border-radius: 999px; box-shadow: 0 8px 30px #00000024; font-size: .9375rem; }
.mtg-quote-bar[hidden] { display: none; }
.mtg-quote-bar > button { min-height: 44px; padding: 0 1rem; border: 1px solid var(--mtg-line); border-radius: 999px; background: var(--mtg-white); color: var(--mtg-text-brown); font: inherit; font-weight: 600; cursor: pointer; }
.mtg-quote-bar .mtg-pc-zalo { margin: 0; }
.mtg-quote-count strong { color: var(--mtg-text-brown); }
body.mtg-has-quote .mtg-floating { bottom: 5.5rem; }

/* Thông báo sao chép. */
.mtg-lp-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2147483000; max-width: calc(100vw - 32px); background: var(--mtg-ink); color: var(--mtg-white); padding: .75rem 1.1rem; border-radius: 999px; font-size: .9375rem; box-shadow: 0 8px 28px #0003; }
body.mtg-has-quote .mtg-lp-toast { bottom: calc(160px + env(safe-area-inset-bottom)); }
@media (min-width: 769px) { .mtg-lp-toast { bottom: 2rem; } body.mtg-has-quote .mtg-lp-toast { bottom: 6rem; } }

@media (max-width: 768px) {
  .mtg-pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .mtg-kho-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; margin-inline: -1rem; padding-inline: 1rem; scrollbar-width: none; }
  .mtg-kho-tabs a { white-space: nowrap; flex: none; }
  .mtg-kho-pages { gap: .35rem; }
  .mtg-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .mtg-qv.is-photo { margin: auto; width: calc(100vw - 1.5rem); max-width: none; border-radius: 0; padding: 0; }
  .mtg-qv.is-photo[open] { animation: none; }
  .mtg-qv.is-photo .mtg-qv-grip { display: none; }
  .mtg-photo-view img { border-radius: 16px; max-height: 70dvh; }
  .mtg-photo-nav { width: 42px; height: 42px; top: calc(35dvh - 21px); }
  .mtg-photo-nav.is-prev { left: .4rem; } .mtg-photo-nav.is-next { right: .4rem; }
  .mtg-qv.is-photo .mtg-qv-close { top: .4rem; right: .4rem; }
  .mtg-pc-body { padding: .7rem .75rem .85rem; }
  .mtg-pc-zalo { padding: 0 .4rem; font-size: .8125rem; gap: .25rem; }
  .mtg-pc-zalo svg { width: 16px; height: 16px; }
  .mtg-pc-save { top: .45rem; right: .45rem; padding: 0 .6rem; font-size: .75rem; }
  /* Xem nhanh dạng bottom sheet trượt từ dưới lên. */
  .mtg-qv { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88dvh; border-radius: 24px 24px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .mtg-qv[open] { animation: mtg-sheet-up .25s ease-out; }
  .mtg-qv-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--mtg-line); margin: .6rem auto .2rem; }
  .mtg-qv-close { top: .6rem; right: .6rem; width: 40px; height: 40px; }
  .mtg-qv-content { grid-template-columns: 1fr; }
  .mtg-qv-gallery { padding: .5rem 1rem 0; background: transparent; }
  .mtg-qv-main { aspect-ratio: 4 / 3; }
  .mtg-qv-info { padding: 1rem 1.25rem 1.25rem; }
  .mtg-quote-dialog { padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); }
  /* Thanh hỏi giá nằm ngay trên thanh điều hướng 5 nút. */
  .mtg-quote-bar { bottom: calc(62px + env(safe-area-inset-bottom)); width: calc(100vw - 1.5rem); border-radius: 18px; padding: .45rem; gap: .4rem; justify-content: space-between; font-size: .875rem; }
  .mtg-quote-count { padding-left: .5rem; }
  .mtg-quote-bar > button { padding: 0 .7rem; font-size: .8125rem; }
  .mtg-quote-bar .mtg-pc-zalo { padding: 0 .75rem; font-size: .8125rem; }
  body.mtg-has-quote .mtg-floating { bottom: calc(130px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .mtg-quote-bar > button { display: none; }
  .mtg-quote-count { cursor: pointer; text-decoration: underline; }
}
@keyframes mtg-sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mtg-qv[open] { animation: none; } }

/* Hướng dẫn gửi Zalo (Zalo không cho điền sẵn tin nhắn) */
.mtg-zalo-guide { max-width: 460px; padding: 1.4rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); box-sizing: border-box; }
.mtg-zalo-guide h2 { font-size: 1.2rem; margin: 0 2rem .75rem 0; }
.mtg-zalo-steps { margin: 0 0 .9rem; padding-left: 1.2rem; font-size: .9375rem; line-height: 1.6; }
.mtg-zalo-steps li { margin-bottom: .35rem; }
.mtg-zalo-preview-label { font-size: .8125rem; color: var(--mtg-muted); margin: 0 0 .3rem; }
.mtg-zalo-preview { width: 100%; font: inherit; font-size: .8125rem; line-height: 1.5; padding: .6rem .7rem; border: 1px solid var(--mtg-line); border-radius: 10px; background: var(--mtg-cream); color: var(--mtg-ink); resize: vertical; }
.mtg-zalo-guide-actions { display: flex; gap: .6rem; margin-top: .9rem; flex-wrap: wrap; }
.mtg-zalo-guide-actions .mtg-pc-zalo { flex: 1 1 auto; justify-content: center; }
