/* ============================================================================================
   quickview.css — popup "Xem nhanh" dự án (14/10/2026). Chép khối "Quick view (modal)" + "Gallery ảnh" trong
   style.css của happyheath; biến màu --sd-* thay bằng màu site cũ: xanh #0a3347 (menu, nút), vàng #ffc107 (nhấn),
   chữ #071d28. Khác happyheath: khung ảnh 4:3 (ảnh kiến trúc ngang — happyheath 1:1 cho ảnh sản phẩm), cột ảnh rộng hơn,
   phần giá/giỏ hàng → bảng thông số + phương án thiết kế + nút gọi tư vấn.
   ============================================================================================ */

/* ── Lớp chồng ── header dính của site cũ z-index 99999999, nút gọi nổi cũng rất cao → nâng popup + nền tối lên trên
   cùng (site không dùng modal Bootstrap nào khác). */
.qv-modal { z-index: 2147483001; }
.modal-backdrop { z-index: 2147483000; }

/* ── Modal ── (mở/đóng: fade + trượt nhẹ 16px, không zoom) */
.qv-modal .modal-dialog { max-width: 1080px; width: 94%; }
.qv-modal.fade .modal-dialog { transform: translateY(-16px); opacity: 0; transition: transform .28s ease, opacity .28s ease; }
.qv-modal.show .modal-dialog { transform: none; opacity: 1; }
.qv-modal .modal-content { position: relative; border: 0; border-radius: 14px; overflow: hidden; }
.qv-modal .modal-body { padding: 26px 28px; }
@media (max-width: 575.98px) { .qv-modal .modal-body { padding: 18px 16px; } }

/* Nút đóng: không nền, hover xoay + đổi màu */
.qv-close {
    position: absolute; top: 14px; right: 14px; z-index: 5;
    width: 34px; height: 34px; border: 0; background: transparent; color: #6b7280; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: color .18s, transform .18s;
}
.qv-close svg { width: 22px; height: 22px; }
.qv-close:hover { color: #0a3347; transform: rotate(90deg); }

.qv-loading { display: flex; align-items: center; justify-content: center; min-height: 300px; }
.qv-spinner {
    width: 40px; height: 40px; border: 4px solid #e5e7eb; border-top-color: #0a3347;
    border-radius: 50%; animation: qv-spin .7s linear infinite;
}
@keyframes qv-spin { to { transform: rotate(360deg); } }
.qv-error { padding: 40px 10px; text-align: center; color: #b42318; }

/* ── Bố cục 2 cột ── */
.qv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; color: #071d28; }   /* 2 cột BẰNG NHAU (user chốt) */
/* Cột grid mặc định min-width:auto → track slider (n ảnh xếp ngang) kéo cột ảnh rộng ra hết popup. */
.qv > * { min-width: 0; }
@media (max-width: 767.98px) { .qv { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

.qv__name { margin: 0 0 10px; padding-right: 34px; font-size: 20px; font-weight: 600; line-height: 1.4; text-transform: uppercase; }
.qv__name a { color: #071d28; }
.qv__name a:hover { color: #0a3347; text-decoration: none; }
.qv__cat { font-size: 14px; color: #6b7280; margin-bottom: 12px; }
.qv__cat a { color: #0a3347; font-weight: 600; }

/* Thông số dự án — 2 cột, dòng kẻ mảnh như thẻ dự án */
.qv__specs { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #eef0f2; }
/* Nhãn + giá trị CÙNG một hàng: "Mặt tiền : 12m" (user chốt) — như thông số trên thẻ dự án. */
.qv__specs li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; padding: 9px 4px; border-bottom: 1px dashed #e5e7eb; font-size: 14px; line-height: 1.45; }
.qv__specs li span { color: #6b7280; white-space: nowrap; }
.qv__specs li b { color: #071d28; font-weight: 600; }
@media (max-width: 380px) { .qv__specs { grid-template-columns: 1fr; } }

.qv__opt-title { margin: 4px 0 6px; font-size: 15px; font-weight: 700; color: #0a3347; text-transform: uppercase; }
.qv__desc { margin: 0 0 14px; font-size: 14px; color: #444; max-height: 180px; overflow: auto; line-height: 1.6; padding-right: 6px; }
.qv__desc p { margin: 4px 0; }
.qv__desc ul, .qv__desc ol { margin: 6px 0; padding-left: 20px; }

.qv__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.qv__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; min-width: 150px;
    height: 46px; padding: 0 20px; border-radius: 30px; font-size: 15px; font-weight: 600; text-transform: uppercase;
    transition: background .18s, color .18s;
}
.qv__btn:hover { text-decoration: none; }
.qv__btn { white-space: nowrap; }
@media (max-width: 575.98px) {
    .qv__btn { flex: 1 1 100%; }
    /* Mobile: ảnh nằm trên cùng, nút X đè lên góc ảnh → nền tròn trắng cho dễ thấy. */
    .qv-close { top: 22px; right: 22px; background: rgba(255,255,255,.92); border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
}
/* Kèm :visited + tiền tố .qv-modal: style.css site cũ có "a:visited { color: #333 }" đè mất màu chữ nút. */
.qv-modal .qv__btn--primary, .qv-modal .qv__btn--primary:visited { background: #0a3347; color: #ffc107; }
.qv-modal .qv__btn--primary:hover { background: #041823; color: #ffc107; }
.qv-modal .qv__btn--call, .qv-modal .qv__btn--call:visited { background: #fff; color: #0a3347; border: 1px solid #0a3347; }
.qv-modal .qv__btn--call:hover { background: #0a3347; color: #fff; }
.qv-modal .qv__name a:visited { color: #071d28; }
.qv-modal .qv__cat a:visited { color: #0a3347; }

/* ── Gallery ảnh (kéo/vuốt — product-gallery.js) ── */
.pdgal-main { position: relative; }
.pdgal-stage {
    position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #f3f5f7;
    border: 1px solid #eef0f2; border-radius: 12px; cursor: grab; outline: none; touch-action: pan-y;
}
.pdgal-stage.is-dragging { cursor: grabbing; }
.pdgal-stage--empty { display: flex; align-items: center; justify-content: center; cursor: default; }
.pdgal-stage--empty img { width: 40%; opacity: .5; }
.pdgal-track { display: flex; height: 100%; will-change: transform; }
.pdgal-slide { position: relative; flex: 0 0 100%; height: 100%; }
.pdgal-slide::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, #eef0f2 25%, #e3e6ea 37%, #eef0f2 63%);
    background-size: 400% 100%; animation: qv-shimmer 1.2s ease infinite; pointer-events: none;
}
@keyframes qv-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.pdgal-slide.is-loaded::after { display: none; }
.pdgal-slide img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .25s; user-select: none; -webkit-user-drag: none; }
.pdgal-slide.is-loaded img { opacity: 1; }
/* Mũi tên: CHỈ icon, không nền tròn (user chốt) — icon trắng có bóng để nổi trên mọi ảnh. */
.pdgal-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
    width: 40px; height: 56px; padding: 0; border: 0; border-radius: 0; background: none; color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: color .18s, transform .18s;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.65));
}
.pdgal-arrow svg { width: 34px; height: 34px; }
.pdgal-arrow:hover { background: none; color: #ffc107; }
.pdgal-arrow--prev { left: 6px; }
.pdgal-arrow--next { right: 6px; }
.pdgal-arrow:disabled { opacity: .35; cursor: default; }
.pdgal-arrow:disabled:hover { color: #fff; }
.pdgal-count {
    position: absolute; right: 12px; bottom: 10px; z-index: 4; padding: 2px 10px; border-radius: 20px;
    background: rgba(7,29,40,.65); color: #fff; font-size: 12px; pointer-events: none;
}
.pdgal-count b { font-weight: 600; }
/* Dải thumb = SLIDER (không cuộn): [‹] [thumb thumb thumb …] [›] — product-gallery.js dịch .pdgal-thumbs-track. */
.pdgal-nav { margin-top: 12px; display: flex; align-items: center; gap: 4px; }
.pdgal-thumbs { flex: 1 1 auto; min-width: 0; overflow: hidden; }
/* Số thumb mỗi "trang" cố định (--pdgal-per) và độ rộng thumb CHIA ĐỀU theo khung → luôn vừa khít số nguyên thumb,
   không bao giờ lộ nửa thumb ở mép (lỗi bản đầu: thumb 84px cố định trong khung ~455px = 4,8 thumb). */
.pdgal-nav { --pdgal-per: 5; --pdgal-gap: 10px; }
@media (max-width: 575.98px) { .pdgal-nav { --pdgal-per: 4; --pdgal-gap: 8px; } }
.pdgal-thumbs-track { display: flex; gap: var(--pdgal-gap); transition: transform .35s cubic-bezier(.22,.61,.36,1); will-change: transform; }
.pdgal-tarrow {
    flex: 0 0 auto; width: 26px; height: 63px; padding: 0; border: 0; border-radius: 0; background: none;
    color: #0a3347; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color .18s;
}
.pdgal-tarrow svg { width: 24px; height: 24px; }
.pdgal-tarrow:hover { color: #ffc107; }
.pdgal-tarrow:disabled { opacity: .25; cursor: default; color: #0a3347; }
.pdgal-thumb {
    position: relative; flex: 0 0 calc((100% - (var(--pdgal-per) - 1) * var(--pdgal-gap)) / var(--pdgal-per));
    aspect-ratio: 4 / 3; height: auto; padding: 0;
    border: 2px solid transparent; border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; transition: border-color .18s;
}
.pdgal-thumb::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25); transition: opacity .18s; pointer-events: none; }
.pdgal-thumb:hover::after { opacity: .4; }
.pdgal-thumb.is-active::after { opacity: 0; }
.pdgal-thumb.is-active { border-color: #ffc107; }
.pdgal-thumb img { width: 100%; height: 100%; object-fit: cover; }
