/* ==========================================================================
   BYSTECH - XRD 시료 홀더 인터랙티브 갤러리 & 모달 팝업 스타일
   - 영국 Crystal Scientific 정품 20개 모델 4열 그리드
   - 제조사별 탭 필터 (Bruker, Panalytical, Rigaku 등)
   - 원클릭 고해상도 상세 스펙 모달
   ========================================================================== */

/* 🇬🇧 수입 공급 보증 배너 */
.xrd-trust-badge {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.xrd-trust-title {
  font-size: 16px; font-weight: 700; color: #0369a1;
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.xrd-trust-desc { font-size: 13px; color: #0f172a; margin: 0; line-height: 1.5; }
.xrd-trust-features {
  display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; font-weight: 600;
}
.xrd-trust-features span {
  background: #ffffff; padding: 6px 12px; border-radius: 20px; border: 1px solid #7dd3fc; color: #0284c7;
  display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* 🎛️ 인터랙티브 탭 필터 바 */
.filter-wrapper {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tab-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover {
  border-color: #0066ff;
  color: #0066ff;
}
.tab-btn.active {
  background: #0066ff;
  color: #ffffff;
  border-color: #0066ff;
  box-shadow: 0 4px 12px rgba(0,102,255,0.25);
}
.tab-count {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0,0,0,0.08);
}
.tab-btn.active .tab-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* 보조 필터 */
.sub-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  font-size: 13px;
  color: #64748b;
}
.sub-filter-btn {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  transition: all 0.15s;
}
.sub-filter-btn.active {
  background: #0d2247;
  color: #ffffff;
  border-color: #0d2247;
}

/* 📸 제품 그리드: 4열 깔끔한 정렬 */
.xrd-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}
@media (max-width: 1100px) {
  .xrd-product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .xrd-product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .xrd-product-grid { grid-template-columns: 1fr; }
}

/* 4열 카드 디자인 (단정하고 컴팩트) */
.xrd-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  cursor: pointer;
}
.xrd-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(13,34,71,0.12);
  border-color: #38bdf8;
}
.xrd-card.hidden {
  display: none !important;
}

.xrd-card-thumb {
  position: relative;
  width: 100%;
  height: 180px;
  background: #f8fafc;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
}
.xrd-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.xrd-card:hover .xrd-card-thumb img {
  transform: scale(1.05);
}

.thumb-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,34,71,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(2px);
}
.xrd-card:hover .thumb-hover-overlay {
  opacity: 1;
}

.xrd-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  backdrop-filter: blur(4px);
  z-index: 2;
}
.xrd-size-pill {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15,23,42,0.85);
  color: #38bdf8;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(56,189,248,0.3);
  font-family: 'IBM Plex Mono', monospace;
  z-index: 2;
}

.badge-bruker { background: rgba(2,132,199,0.92); }
.badge-panalytical { background: rgba(37,99,235,0.92); }
.badge-rigaku { background: rgba(124,58,237,0.92); }
.badge-rectangular { background: rgba(13,148,136,0.92); }
.badge-custom { background: rgba(71,85,105,0.92); }

.type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.type-badge.cavity { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.type-badge.flat { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.xrd-card-body {
  padding: 14px 14px 16px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.xrd-card-origin {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.xrd-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin: 0 0 6px 0;
  word-break: keep-all;
  min-height: 40px;
}
.xrd-card-summary {
  font-size: 12px;
  color: #0284c7;
  font-weight: 600;
  margin: 0 0 14px 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #f0f9ff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #e0f2fe;
}

.xrd-card-footer {
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.detail-link {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
  transition: color 0.2s;
}
.xrd-card:hover .detail-link {
  color: #0066ff;
}
.xrd-card-btn {
  display: inline-flex;
  align-items: center;
  background: #0066ff;
  color: #ffffff !important;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}
.xrd-card-btn:hover {
  background: #0052cc;
}

/* 🔍 사진 클릭 시 열리는 상세 설명 모달 (원하시던 고화질 상세 뷰어!) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(13,34,71,0.85);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 660px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  position: relative;
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-img-wrap {
  position: relative;
  background: #0f172a;
  width: 100%;
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.modal-body {
  padding: 24px 28px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal-close:hover {
  background: rgba(0,0,0,0.9);
}
.modal-specs-table {
  margin: 14px 0 20px 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.modal-spec-row {
  display: flex;
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
}
.modal-spec-row:last-child {
  border-bottom: none;
}
.modal-spec-k {
  width: 90px;
  flex-shrink: 0;
  font-weight: 700;
  color: #64748b;
}
.modal-spec-v {
  color: #0f172a;
  font-weight: 500;
  flex: 1;
}
