/* ==========================================================================
   PHỐI MÀU SƠN 3D - WESTOX PAINT (PHIÊN BẢN CHUẨN THEO 3 THIẾT KẾ)
   File: SmartCsm.Web/Content/css/phoi-mau-3d.css
   Mục đích: Định kiểu giao diện cho cả 3 màn hình theo đúng 3 ảnh đính kèm
   ========================================================================== */

#phoi-mau-3d-wrapper {
  font-family:
    "Jura",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  color: #1a1a1a;
  background-color: #ffffff;
  width: 100%;
  padding: 35px 0 60px 0;
  position: relative;
  box-sizing: border-box;
}

#phoi-mau-3d-wrapper * {
  box-sizing: border-box;
}

.pm3d-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   TIÊU ĐỀ & PHỤ ĐỀ CHUNG TRÊN CÙNG (HÌNH 1 & HÌNH 2)
   ========================================================================== */
.pm3d-main-title {
  text-align: center;
  font-size: 52px;
  font-weight: 700;
  color: #111111;
  margin: 0 0 16px 0;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.pm3d-subtitle-link {
  display: block;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #333333;
  text-decoration: underline;
  max-width: 780px;
  margin: 0 auto 38px auto;
  line-height: 1.5;
  cursor: default;
}

/* ==========================================================================
   HÌNH 1: MÀN HÌNH 1 - DANH SÁCH LOẠI KHÔNG GIAN (4 THẺ DỌC BO GÓC)
   ========================================================================== */
.pm3d-cat-carousel-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 30px;
}

.pm3d-cat-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.pm3d-cat-card-tall {
  position: relative;
  height: 430px;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s ease;
  background-color: #1e293b;
}

.pm3d-cat-card-tall:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
}

.pm3d-cat-card-tall img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.pm3d-cat-card-tall:hover img {
  transform: scale(1.06);
}

/* Lớp phủ chuyển màu phía trên để làm nổi bật chữ trắng */
.pm3d-cat-card-tall::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.pm3d-cat-card-name {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  text-align: center;
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  z-index: 3;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* Nút điều hướng Carousel hình tròn (< và >) */
.pm3d-nav-arrows-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 28px 0 45px 0;
}

.pm3d-circle-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #777777;
  background: #ffffff;
  color: #333333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pm3d-circle-arrow-btn:hover {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

/* ==========================================================================
   HÌNH 2: MÀN HÌNH 2 - DANH SÁCH MẪU KHÔNG GIAN (LƯỚI 6 MẪU 2x3)
   ========================================================================== */
.pm3d-sub-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.pm3d-sub-header-title {
  font-size: 15px;
  font-weight: 500;
  color: #333333;
  text-decoration: underline;
  margin: 0;
}

.pm3d-select-dropdown {
  padding: 7px 30px 7px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #111111;
  background: #ffffff;
  border: 1px solid #666666;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.pm3d-spaces-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}

.pm3d-space-card-item {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  background-color: #1e293b;
}

.pm3d-space-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.pm3d-space-card-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.pm3d-space-card-item:hover img {
  transform: scale(1.05);
}

/* ==========================================================================
   HÌNH 3: MÀN HÌNH 3 - WORKSPACE PHỐI MÀU CHI TIẾT (SPLIT LAYOUT)
   ========================================================================== */
.pm3d-customizer-split {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 45px;
}

/* CỘT TRÁI: KHUNG ẢNH LỚN + THUMBNAILS CAROUSEL */
.pm3d-split-left {
  flex: 0 0 63%;
  max-width: 63%;
}

.pm3d-main-room-box {
  position: relative;
  width: 100%;
  aspect-ratio: 570 / 452;
  border-radius: 10px;
  overflow: hidden;
  background-color: #e2e8f0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  margin-bottom: 18px;
}

.pm3d-main-room-box .pm3d-bg-room-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  z-index: 2;
  pointer-events: none;
}

/* Khung SVG tương tác (nằm dưới lớp ảnh trong suốt, click xuyên qua ảnh PNG) */
.pm3d-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

.pm3d-svg-overlay svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pm3d-svg-overlay path {
  cursor: pointer;
  vector-effect: non-scaling-stroke;
  transition:
    fill 0.3s ease,
    opacity 0.2s ease,
    stroke 0.25s ease,
    stroke-width 0.25s ease,
    filter 0.25s ease;
}

/* Hiệu ứng nhận diện vùng có thể phối màu (khi chưa sơn) */
.pm3d-svg-overlay path:not(.pm3d-wall-painted) {
  stroke: rgba(37, 99, 235, 0.55);
  stroke-width: 1.8px;
  stroke-dasharray: 6 4;
  stroke-linejoin: round;
  animation: pm3dWallBreath 2.6s ease-in-out infinite;
}

@keyframes pm3dWallBreath {
  0%,
  100% {
    stroke: rgba(37, 99, 235, 0.45);
    filter: brightness(1);
  }
  50% {
    stroke: rgba(37, 99, 235, 0.85);
    filter: brightness(0.97);
  }
}

/* Highlight rõ nét khi hover vào vùng tường hoặc hotspot */
.pm3d-svg-overlay path:hover,
.pm3d-svg-overlay path.is-hovered {
  opacity: 0.92;
  stroke: #2563eb;
  stroke-width: 2.5px;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.45));
  animation: none;
}

/* ==========================================================================
   HIỆU ỨNG HOTSPOT PIN & GỢI Ý VÙNG PHỐI MÀU CHUYÊN NGHIỆP
   ========================================================================== */
.pm3d-wall-hotspots-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pm3d-wall-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.35s ease,
    transform 0.25s ease;
}

.pm3d-wall-hotspot.is-painted {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.6);
}

.pm3d-hotspot-pulse {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  animation: pm3dHotspotPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes pm3dHotspotPulse {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.45);
    opacity: 0;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.pm3d-hotspot-dot {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #2563eb;
  border: 2px solid #2563eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.pm3d-wall-hotspot:hover .pm3d-hotspot-dot {
  transform: scale(1.15);
  background-color: #2563eb;
  color: #ffffff;
}

.pm3d-hotspot-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.pm3d-wall-hotspot:hover .pm3d-hotspot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Thanh gợi ý nổi nhẹ nhàng trên góc ảnh */
.pm3d-room-hint-pill {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

.pm3d-room-hint-pill i {
  color: #60a5fa;
}

.pm3d-room-hint-pill.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

@media (max-width: 767px) {
  .pm3d-hotspot-dot {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .pm3d-hotspot-pulse {
    width: 34px;
    height: 34px;
  }
  .pm3d-room-hint-pill {
    font-size: 11px;
    padding: 5px 12px;
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Điều khiển dưới ảnh lớn */
.pm3d-workspace-subnav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pm3d-subnav-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pm3d-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 22px;
  background-color: #111111;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #111111;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.pm3d-btn-download:hover {
  background-color: #333333;
  border-color: #333333;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pm3d-thumbnails-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.pm3d-thumbnails-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pm3d-thumbnails-list::-webkit-scrollbar {
  display: none;
}

.pm3d-thumb-item {
  flex: 0 0 calc(33.333% - 7px);
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #e2e8f0;
  transition: all 0.2s ease;
}

.pm3d-thumb-item:hover {
  border-color: #777777;
  transform: translateY(-2px);
}

.pm3d-thumb-item.active {
  border-color: #111111;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.pm3d-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* CỘT PHẢI: BẢNG CHỌN MÀU, THÊM MÀU & MÀU ĐÃ CHỌN */
.pm3d-split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pm3d-palette-title {
  font-size: 20px;
  font-weight: 700;
  color: #111111;
  margin: 0 0 10px 0;
}

/* Danh sách màu 2 cột có thanh cuộn */
.pm3d-color-scrollbox {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  max-height: 230px;
  overflow-y: auto;
  padding: 3px;
  scrollbar-width: thin;
}

.pm3d-color-scrollbox::-webkit-scrollbar {
  width: 6px;
}

.pm3d-color-scrollbox::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.pm3d-color-grid-2cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.pm3d-swatch-rect {
  position: relative;
  height: 48px;
  border-radius: 2px;
  cursor: pointer;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  line-height: 1.15;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.pm3d-swatch-rect:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.pm3d-swatch-rect.selected {
  box-shadow:
    0 0 0 2px #111111,
    0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 5;
}

.pm3d-swatch-rect .swatch-name {
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm3d-swatch-rect .swatch-code {
  font-size: 9.5px;
  font-weight: 500;
  opacity: 0.9;
}

/* Tương phản chữ trong ô swatch */
.pm3d-swatch-rect.text-dark .swatch-name,
.pm3d-swatch-rect.text-dark .swatch-code {
  color: #1a1a1a;
}
.pm3d-swatch-rect.text-light .swatch-name,
.pm3d-swatch-rect.text-light .swatch-code {
  color: #ffffff;
}

/* Pill tiêu đề khối: Thêm màu & Màu đã chọn */
.pm3d-pill-header {
  display: inline-block;
  background: #222222;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 4px;
  margin-bottom: 6px;
  width: fit-content;
}

/* Hộp trống/danh sách viền mảnh theo đúng hình 3 */
.pm3d-bordered-box {
  border: 1px solid #333333;
  border-radius: 4px;
  background: #ffffff;
  min-height: 85px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm3d-applied-color-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 10px;
}

.pm3d-applied-color-tag .tag-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.pm3d-applied-color-tag .tag-info {
  flex: 1;
  font-size: 12px;
  line-height: 1.2;
}

.pm3d-applied-color-tag .tag-name {
  font-weight: 700;
  color: #111111;
}

.pm3d-applied-color-tag .tag-code {
  color: #64748b;
}

.pm3d-applied-color-tag .tag-remove {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
}

.pm3d-applied-color-tag .tag-remove:hover {
  color: #ef4444;
}

/* ==========================================================================
   BANNER TƯ VẤN PHỐI MÀU 3D (CHUNG CHO CẢ 3 HÌNH Ở DƯỚI CÙNG)
   ========================================================================== */
.pm3d-consultation-banner {
  width: 100%;
  background-color: #f2f4f7;
  border-radius: 20px;
  padding: 45px 42px;
  margin-top: 50px;
}

.pm3d-consultation-row {
  display: flex;
  align-items: center;
  gap: 45px;
}

.pm3d-consult-left {
  flex: 1;
}

.pm3d-consult-title {
  font-size: 38px;
  font-weight: 700;
  color: #111111;
  margin: 0 0 14px 0;
  letter-spacing: -0.5px;
}

.pm3d-consult-intro {
  font-size: 14.5px;
  color: #333333;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.pm3d-step-heading {
  font-size: 16px;
  font-weight: 700;
  color: #111111;
  margin: 0 0 4px 0;
}

.pm3d-step-desc {
  font-size: 14px;
  color: #475569;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.pm3d-consult-contacts {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm3d-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #111111;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pm3d-contact-link:hover {
  color: #2563eb;
}

.pm3d-consult-right {
  flex: 0 0 450px;
  max-width: 450px;
}

.pm3d-consult-img-wrap {
  width: 100%;
  aspect-ratio: 340 / 235;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.pm3d-consult-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 1023px) {
  .pm3d-cat-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .pm3d-cat-card-tall {
    height: 360px;
  }
  .pm3d-spaces-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  .pm3d-customizer-split {
    flex-direction: column;
  }
  .pm3d-split-left {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .pm3d-split-right {
    width: 100%;
  }
  .pm3d-consultation-row {
    flex-direction: column;
  }
  .pm3d-consult-right {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .pm3d-main-title {
    font-size: 34px;
  }
  .pm3d-subtitle-link {
    font-size: 13.5px;
    margin-bottom: 26px;
  }
  .pm3d-cat-grid-4 {
    grid-template-columns: 1fr;
  }
  .pm3d-cat-card-tall {
    height: 280px;
  }
  .pm3d-spaces-grid-6 {
    grid-template-columns: 1fr;
  }
  .pm3d-consultation-banner {
    padding: 30px 20px;
  }
  .pm3d-consult-title {
    font-size: 26px;
  }
  .pm3d-contact-link {
    font-size: 16px;
  }
}
