/* ==========================================================================
   Popup Quick View – template: woocommerce/content-single-product-lightbox.php · JS: assets/quick-view.js
   ========================================================================== */

.product-lightbox.ms-qv-box, .product-lightbox:has(.ms-qv-wrap) { max-width: 880px; padding: 0; overflow: hidden; border-radius: 18px; background: #fff; }
.ms-qv-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); color: var(--ms-ink, #171717); text-align: left; }
.ms-qv-wrap *, .ms-qv-wrap *::before, .ms-qv-wrap *::after { box-sizing: border-box; }
.ms-qv-wrap [hidden], .ms-qv-native { display: none !important; }
.ms-qv-wrap .ms-ico { flex-shrink: 0; }
.ms-qv-wrap .ms-ico.is-filled { fill: currentColor; }
.ms-qv-wrap button { min-height: 0; margin: 0; font-family: inherit; letter-spacing: inherit; text-transform: none; line-height: inherit; }

/* Ảnh */
.ms-qv-media { padding: 20px; border-right: 1px solid #f0f0f0; background: #fafafa; }
.ms-qv-stage { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid #e5e5e5; border-radius: 14px; background: #f5f5f7; }
.ms-qv-wrap .ms-qv-main { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.ms-qv-sale { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 3px 10px; border-radius: 8px; background: var(--ms-sale-from, #e11d48); background: linear-gradient(135deg, var(--ms-sale-from, #e11d48) 0%, var(--ms-sale-to, var(--ms-accent, #f54a00)) 100%); color: #fff; font-size: 13px; font-weight: 900; line-height: 20px; }
.ms-qv-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.ms-qv-thumbs::-webkit-scrollbar { display: none; }
.ms-qv-thumb { flex: 0 0 58px; width: 58px; height: 58px; padding: 3px; overflow: hidden; border: 2px solid #e5e5e5; border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s; }
.ms-qv-thumb img { display: block; width: 100%; height: 100%; border-radius: 6px; object-fit: cover; }
.ms-qv-thumb:hover { border-color: var(--ms-accent-300, #fdba74); }
.ms-qv-thumb.is-active { border-color: var(--ms-accent, #f54a00); }

/* Thông tin */
.ms-qv-info { display: flex; flex-direction: column; gap: 14px; max-height: min(86vh, 660px); padding: 28px 28px 22px; overflow-y: auto; }
.ms-qv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-right: 32px; }
.ms-qv-brand { padding: 3px 9px; border-radius: 6px; background: #000; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.ms-qv-sku { color: #737373; font-size: 12px; }
.ms-qv-sku b { color: #262626; }
.ms-qv-wrap .ms-qv-title { margin: 0; padding-right: 24px; font-size: 22px; font-weight: 900; line-height: 1.3; letter-spacing: -.02em; }
.ms-qv-title a { color: #000; }
.ms-qv-title a:hover { color: var(--ms-accent, #f54a00); }
.ms-qv-rating { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: -6px; color: #a3a3a3; font-size: 12px; }
.ms-qv-rating b { color: var(--ms-accent, #f54a00); font-weight: 800; }
.ms-qv-rating:hover span { color: #000; text-decoration: underline; }
.ms-qv-wrap .ms-pd-stars-ico { position: relative; display: inline-flex; line-height: 0; }
.ms-qv-wrap .ms-pd-stars-bg { display: inline-flex; color: #e5e5e5; }
.ms-qv-wrap .ms-pd-stars-fg { position: absolute; top: 0; left: 0; display: inline-flex; overflow: hidden; color: var(--ms-accent-500, #f97316); white-space: nowrap; }

/* Giá */
.ms-qv-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 14px 16px; border: 1px solid #ececec; border-radius: 12px; background: #fafafa; }
.ms-qv-now { color: var(--ms-accent, #f54a00); font-size: 28px; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ms-qv-old { color: #a3a3a3; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ms-qv-save { align-self: center; padding: 2px 8px; border-radius: 6px; background: var(--ms-sale-from, #e11d48); background: linear-gradient(135deg, var(--ms-sale-from, #e11d48) 0%, var(--ms-sale-to, var(--ms-accent, #f54a00)) 100%); color: #fff; font-size: 12px; font-weight: 800; }
.ms-qv-price .amount, .ms-qv-price .woocommerce-Price-currencySymbol { color: inherit; font-size: inherit; font-weight: inherit; vertical-align: baseline; top: 0; }

/* Phân loại */
.ms-qv-attrs { display: flex; flex-direction: column; gap: 14px; }
.ms-qv-attr-h { margin-bottom: 8px; color: #404040; font-size: 12px; font-weight: 700; }
.ms-qv-attr-h b { color: #000; font-weight: 800; }
.ms-qv-attr.is-missing .ms-qv-attr-h { color: #dc2626; }
.ms-qv-attr.is-missing .ms-qv-opt { border-color: #fca5a5; }
.ms-qv-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-qv-wrap .ms-qv-opt { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 2px solid #e5e5e5; border-radius: 10px; background: #fff; color: #262626; font-size: 12px; font-weight: 700; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.ms-qv-wrap .ms-qv-opt:hover { border-color: #a3a3a3; }
.ms-qv-wrap .ms-qv-opt.is-active { border-color: #000; background: #f5f5f5; box-shadow: 0 0 0 1px #000; }
.ms-qv-opt.is-unavailable { opacity: .45; }
.ms-qv-opt.is-out .ms-qv-opt-name { color: #a3a3a3; text-decoration: line-through; }
.ms-qv-dot { flex-shrink: 0; width: 14px; height: 14px; border: 1px solid #d4d4d4; border-radius: 50%; }

/* Số lượng + nút */
.ms-qv-wrap .ms-qv-form { display: flex; flex-direction: column; flex-wrap: nowrap; flex-shrink: 0; gap: 14px; width: 100%; margin: 0; }
.ms-qv-buy { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 8px; }
.ms-qv-qty { display: inline-flex; overflow: hidden; border: 1px solid #d4d4d4; border-radius: 10px; background: #fff; }
.ms-qv-wrap .ms-qv-qty button { width: 32px; padding: 0; border: 0; border-radius: 0; background: #f5f5f5; color: #000; font-size: 15px; font-weight: 800; cursor: pointer; }
.ms-qv-wrap .ms-qv-qty button:hover { background: #e5e5e5; }
.ms-qv-wrap .ms-qv-qty input.qty { width: 40px; height: 44px; margin: 0; padding: 0; border: 0; box-shadow: none; background: #fff; color: #000; font-size: 14px; font-weight: 800; text-align: center; -moz-appearance: textfield; }
.ms-qv-qty input.qty::-webkit-outer-spin-button, .ms-qv-qty input.qty::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.ms-qv-wrap .ms-qv-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 1.5px solid #000; border-radius: 10px; background: #fff; color: #000; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.ms-qv-wrap .ms-qv-btn:hover { background: #f5f5f5; }
.ms-qv-wrap .ms-qv-btn:active { transform: scale(.98); }
/* Đồng bộ với trang chi tiết: Thêm vào giỏ = cam, Mua ngay = xanh lá (nút bán qua sàn khác – thẻ <a> – vẫn đen) */
.ms-qv-wrap button.ms-qv-btn.is-add { border-color: var(--ms-accent, #f54a00); background: var(--ms-accent, #f54a00); color: #fff; box-shadow: 0 6px 14px -6px rgb(var(--ms-accent-rgb, 245 74 0) / 0.55); }
.ms-qv-wrap button.ms-qv-btn.is-add:hover { border-color: var(--ms-accent-hover, #dc4300); background: var(--ms-accent-hover, #dc4300); }
.ms-qv-wrap button.ms-qv-btn.is-buy { border-color: var(--ms-green, #16a34a); background: var(--ms-green, #16a34a); color: #fff; box-shadow: 0 6px 14px -6px rgb(var(--ms-green-rgb, 22 163 74) / 0.55); }
.ms-qv-wrap button.ms-qv-btn.is-buy:hover { border-color: var(--ms-green-dark, #15803d); background: var(--ms-green-dark, #15803d); }
.ms-qv-wrap a.ms-qv-btn.is-buy { background: #000; color: #fff; }
.ms-qv-wrap a.ms-qv-btn.is-buy:hover { background: #262626; }
.ms-qv-btn.is-wide { width: 100%; }
.ms-qv-wrap .ms-qv-btn.disabled, .ms-qv-wrap .ms-qv-btn:disabled { opacity: 1; cursor: pointer; } /* WooCommerce làm mờ khi chưa chọn phân loại – popup tự hiện lời nhắc */
.ms-qv-btn.is-loading > * { visibility: hidden; }
.ms-qv-btn.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ms-qv-spin .7s linear infinite; }
@keyframes ms-qv-spin { to { transform: rotate(360deg); } }
.ms-qv-msg { margin: 0; padding: 8px 12px; border-radius: 8px; background: #fef2f2; color: #b91c1c; font-size: 13px; font-weight: 600; }
.ms-qv-out { margin: 0; padding: 12px 14px; border: 1px dashed #d4d4d4; border-radius: 10px; color: var(--ms-text, #525252); font-size: 14px; }
.ms-qv-more { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: auto; padding-top: 4px; color: var(--ms-text, #525252); font-size: 12px; font-weight: 700; }
.ms-qv-more:hover { color: #000; }
.ms-qv-more .ms-ico { transition: transform .2s; }
.ms-qv-more:hover .ms-ico { transform: translateX(3px); }
.ms-qv-locked { padding: 30px; }

/* Điện thoại / máy tính bảng dọc */
@media (max-width: 849px) {
	.product-lightbox.ms-qv-box, .product-lightbox:has(.ms-qv-wrap) { border-radius: 14px; }
	.ms-qv-wrap { grid-template-columns: minmax(0, 1fr); }
	.ms-qv-media { padding: 14px 14px 10px; border-right: 0; border-bottom: 1px solid #f0f0f0; }
	.ms-qv-stage { max-width: 240px; margin: 0 auto; }
	.ms-qv-thumb { flex-basis: 46px; width: 46px; height: 46px; }
	.ms-qv-thumb:first-child { margin-left: auto; } /* căn giữa nhưng vẫn cuộn được khi nhiều ảnh */
	.ms-qv-thumb:last-child { margin-right: auto; }
	.ms-qv-old { font-size: 14px; }
	.ms-qv-info { max-height: none; padding: 18px 16px 18px; overflow: visible; }
	.ms-qv-wrap .ms-qv-title { font-size: 19px; }
	.ms-qv-now { font-size: 24px; }
	.ms-qv-buy { grid-template-columns: auto minmax(0, 1fr); }
	.ms-qv-btn.is-add { grid-column: 1 / -1; } /* [số lượng] [mua ngay] / [thêm giỏ] – giống trang sản phẩm */
}
