/* ==========================================================================
   SECTION 06: CẤU TRÚC MÁY & CÁC CỤM CHỨC NĂNG (MACHINE STRUCTURE)
   Namespace: .mrd-structure-*
   ========================================================================== */

.mrd-structure-wrapper {
  padding: 80px 0;
  background-color: #f8fafc;
  position: relative;
  border-top: 1px solid #e2e8f0;
}

.mrd-structure-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   TOP SECTION: HEADER (NHÃN - TIÊU ĐỀ - MÔ TẢ RIÊNG BIỆT TRÊN CÙNG)
   -------------------------------------------------------------------------- */
.mrd-structure-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin-bottom: 36px;
  width: 100%;
}

/* Pill Tag Badge */
.mrd-structure-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(0, 159, 227, 0.08);
  border: 1px solid rgba(0, 159, 227, 0.25);
  border-radius: 30px;
  color: #009fe3;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.mrd-structure-tag-dot {
  width: 8px;
  height: 8px;
  background-color: #009fe3;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 159, 227, 0.6);
  flex-shrink: 0;
}

/* Heading H2 */
.mrd-structure-title {
  font-size: 34px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  text-align: left;
}

.mrd-structure-title .mrd-highlight {
  color: #009fe3;
  white-space: nowrap;
}

/* Description */
.mrd-structure-desc {
  font-size: 15px;
  color: #475569;
  line-height: 1.6;
  text-align: left;
  max-width: 680px;
}

.mrd-structure-desc strong {
  color: #0f172a;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   LOWER SECTION: 2 CỘT NGANG HÀNG NHAU TUYỆT ĐỐI (CHIỀU CAO KHÓA CHUẨN 440PX)
   -------------------------------------------------------------------------- */
.mrd-structure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   COLUMNS (BỐ CỤC 2 CỘT CHIỀU CAO ĐỒNG BỘ 480PX)
   -------------------------------------------------------------------------- */
.mrd-structure-col-left,
.mrd-structure-col-right {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* CỘT PHẢI: KHUNG ẢNH PHỐI CẢNH 3D */
.mrd-structure-visual-box {
  width: 100%;
  height: 480px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.mrd-structure-visual-box:hover {
  border-color: #009fe3;
  box-shadow: 0 14px 32px rgba(0, 159, 227, 0.16);
  transform: translateY(-2px);
}

.mrd-structure-visual-inner {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #eef4fa 0%, #dbe7f2 100%);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0, 20, 50, 0.04);
  box-sizing: border-box;
}

/* Badge góc trên khung ảnh 3D */
.mrd-structure-visual-top-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  height: 28px;
  padding: 0 14px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  text-transform: none;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.mrd-structure-visual-top-badge span:not(.mrd-structure-visual-top-dot) {
  display: inline-block;
  line-height: 1;
}

.mrd-structure-visual-top-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #00e5ff;
  box-shadow: 0 0 6px #00e5ff;
  flex-shrink: 0;
}

.mrd-structure-visual-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 14px 22px rgba(10, 37, 64, 0.22));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mrd-structure-visual-box:hover .mrd-structure-visual-img {
  transform: scale(1.03);
}

.mrd-structure-visual-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #64748b;
}

.mrd-structure-visual-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #004b87;
  font-size: 12px;
}

.mrd-structure-visual-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #009fe3;
}

.mrd-structure-visual-model {
  font-weight: 700;
  color: #009fe3;
  font-size: 12px;
  letter-spacing: 0.3px;
}

/* --------------------------------------------------------------------------
   ALBUM SẢN PHẨM (PRODUCT GALLERY STYLE)
   -------------------------------------------------------------------------- */
.mrd-mod-gallery-box {
  width: 100%;
  height: 480px;
  /* Bằng chính xác 480px của cột trái */
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

/* Khung ảnh Module lớn phía trên */
.mrd-mod-gallery-main {
  position: relative;
  width: 100%;
  flex: 1 1 0%;
  min-height: 0;
  background-color: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
  border: 1.5px solid #cbd5e1;
}

.mrd-mod-gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

.mrd-mod-gallery-img.fading {
  opacity: 0.2;
}

/* Badge góc trên bên trái khung ảnh lớn (Nhãn phân loại chức năng Module) */
.mrd-mod-gallery-top-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  height: 28px;
  padding: 0 14px;
  box-sizing: border-box;
  background: rgba(10, 25, 47, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 229, 255, 0.5);
  color: #00e5ff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(0, 229, 255, 0.15);
  transition: all 0.3s ease;
  line-height: 1;
}

.mrd-mod-gallery-top-badge #mrdModEyebrow {
  display: inline-block;
  line-height: 1;
}

.mrd-mod-gallery-top-dot {
  width: 7px;
  height: 7px;
  background-color: #00e5ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00e5ff;
  flex-shrink: 0;
}

/* Khung thông tin module dạng Floating Card kính mờ nền đen opacity */
.mrd-mod-gallery-caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(10, 25, 47, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 14px 18px;
  color: #ffffff;
  z-index: 3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  box-sizing: border-box;
}

.mrd-mod-gallery-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

/* Dòng mô tả 14.5px - 15px chuẩn, màu chữ sáng rõ */
.mrd-mod-gallery-desc {
  font-size: 14.5px;
  color: #cbd5e1;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* Hàng 6 hình nhỏ (Thumbnails) phía dưới */
.mrd-mod-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  height: 76px;
  flex-shrink: 0;
}

/* Từng ô thumbnail */
.mrd-mod-thumb-item {
  position: relative;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #e2e8f0;
  background-color: #0f172a;
  padding: 0;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.mrd-mod-thumb-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.9);
  transition: transform 0.35s ease, filter 0.3s ease;
}

.mrd-mod-thumb-item:hover {
  border-color: #009fe3;
  transform: translateY(-2px);
}

.mrd-mod-thumb-item:hover img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.mrd-mod-thumb-item.active {
  border-color: #009fe3;
  box-shadow: 0 0 0 2px rgba(0, 159, 227, 0.25), 0 6px 16px rgba(0, 159, 227, 0.25);
  transform: translateY(-2px);
}

.mrd-mod-thumb-item.active img {
  filter: brightness(1.05);
}

/* Nhãn Floating Capsule tinh tế, hiện đại */
.mrd-mod-thumb-pill {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
  pointer-events: none;
}

.mrd-mod-thumb-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #00e5ff;
  box-shadow: 0 0 4px #00e5ff;
}

.mrd-mod-thumb-item.active .mrd-mod-thumb-pill {
  background: #009fe3;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 159, 227, 0.6);
}

.mrd-mod-thumb-item:hover .mrd-mod-thumb-pill {
  background: #009fe3;
  border-color: #38bdf8;
  color: #ffffff;
}

/* Responsive cho Gallery Clone */
@media (max-width: 1024px) {
  .mrd-mod-gallery-box {
    height: auto;
  }

  .mrd-mod-gallery-main {
    height: 340px;
  }
}

@media (max-width: 640px) {
  .mrd-mod-thumbs-grid {
    grid-template-columns: repeat(3, 1fr);
    height: auto;
    gap: 6px;
  }

  .mrd-mod-thumb-item {
    height: 60px;
  }

  .mrd-mod-gallery-main {
    height: 260px;
  }

  .mrd-mod-gallery-title {
    font-size: 15px;
  }
}