/* ============================================================
   DENEX - Product Page Stylesheet
   ============================================================ */

/* ── 제품 그리드 ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.product-card:hover {
  border-color: rgba(200,34,41,.25);
  box-shadow: 0 8px 28px rgba(200,34,41,.08);
  transform: translateY(-4px);
}

/* 제품 이미지 */
.product-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--white);
  padding: 16px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
}
.product-card-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform .3s var(--ease);
}
.product-card:hover .product-card-img img { transform: scale(1.04); }

/* 이미지 플레이스홀더 */
.product-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}

/* 제품 카드 텍스트 */
.product-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-card-category {
  font-size: 11px; font-weight: 700;
  color: var(--red); letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--red-lt);
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}
.product-card-name {
  font-family: var(--font-en);
  font-size: 14px; font-weight: 700;
  color: var(--charcoal); line-height: 1.5;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.product-card-more {
  font-size: 12px; font-weight: 600;
  color: var(--red); align-self: flex-end;
  transition: gap .15s;
}
.product-card:hover .product-card-more {
  letter-spacing: 0.5px;
}

/* 빈 목록 */
.product-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 80px 0;
  color: var(--gray); font-size: 15px;
}

/* ── 탭 패널 ─────────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── 모달 ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
  backdrop-filter: blur(4px);
}
.modal-overlay.active {
  opacity: 1; pointer-events: auto;
}

.modal-box {
  background: var(--white);
  border-radius: 20px;
  max-width: 800px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform .3s var(--ease);
}
.modal-overlay.active .modal-box { transform: translateY(0); }

/* 닫기 버튼 */
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gray-lt); border: none; cursor: pointer;
  font-size: 14px; color: var(--charcoal);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  z-index: 1;
}
.modal-close:hover { background: rgba(200,34,41,.1); color: var(--red); }

/* 모달 본문 */
.modal-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* 모달 이미지 */
.modal-img-wrap {
  background: var(--white);
  border-radius: 20px 0 0 20px;
  display: flex; flex-direction: column;
  min-height: 300px;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

/* 메인 이미지 */
.modal-img-main {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 28px; min-height: 260px;
}
.modal-img-main img {
  max-width: 100%; max-height: 240px;
  object-fit: contain;
  transition: opacity .2s;
}
.modal-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 72px; width: 100%; min-height: 260px;
}

/* 썸네일 목록 */
.modal-img-thumbs {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.modal-thumb {
  width: 56px; height: 56px; border-radius: 8px;
  border: 2px solid var(--border);
  overflow: hidden; cursor: pointer;
  background: var(--gray-lt);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
  flex-shrink: 0;
}
.modal-thumb:hover  { border-color: var(--red); }
.modal-thumb.active { border-color: var(--red); }
.modal-thumb img {
  width: 100%; height: 100%; object-fit: contain; padding: 4px;
}

/* 모달 정보 */
.modal-info { padding: 36px 32px; }

.modal-category {
  font-family: var(--font-en); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--red); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.modal-category::before {
  content: ''; width: 16px; height: 2px; background: var(--red);
}
.modal-title {
  font-family: var(--font-en); font-size: 22px; font-weight: 800;
  color: var(--charcoal); letter-spacing: -0.5px;
  margin-bottom: 24px; line-height: 1.3;
}

/* 모달 섹션 */
.modal-section { margin-bottom: 20px; }
.modal-section-title {
  font-size: 12px; font-weight: 700;
  color: var(--gray); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 10px;
}

/* 목록 */
.modal-list {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
}
.modal-list li {
  font-size: 14px; color: var(--charcoal); line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
}
.modal-list li::before {
  content: '\00B7'; color: var(--red);
  font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.modal-features li {
  background: var(--gray-lt);
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px;
}

/* ── 반응형 ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-body { grid-template-columns: 1fr; }
  .modal-img-wrap { border-radius: 20px 20px 0 0; min-height: 200px; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .search-filter select { width: 100%; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ── 검색 바 ─────────────────────────────────────────────── */
.search-bar {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap;
}
.search-filter select {
  height: 48px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: var(--font-body);
  color: var(--charcoal); background: var(--white);
  cursor: pointer; outline: none; transition: border-color .15s;
}
.search-filter select:focus { border-color: var(--red); }

.search-input-wrap {
  display: flex; flex: 1; gap: 0; min-width: 260px;
}
.search-input-wrap input {
  flex: 1; height: 48px; padding: 0 16px;
  border: 1px solid var(--border); border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 14px; font-family: var(--font-body);
  color: var(--charcoal); outline: none; transition: border-color .15s;
}
.search-input-wrap input:focus { border-color: var(--red); }
.search-input-wrap button {
  height: 48px; padding: 0 24px;
  background: var(--charcoal); color: var(--white);
  font-size: 14px; font-weight: 600;
  border: none; border-radius: 0 10px 10px 0;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.search-input-wrap button:hover { background: var(--red); }

.search-result-info {
  font-size: 13px; color: var(--gray); margin-bottom: 24px;
}

/* ── 페이지네이션 ─────────────────────────────────────────── */
.pagination {
  display: flex; justify-content: center;
  gap: 6px; margin-top: 48px; flex-wrap: wrap;
}
.pg-btn {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--white);
  font-size: 14px; font-weight: 500; color: var(--charcoal);
  cursor: pointer; transition: all .15s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.pg-btn.active { background: var(--red); color: var(--white); border-color: var(--red); font-weight: 700; }
.pg-btn:disabled { opacity: .35; cursor: default; }

/* 제품 카드 카테고리 라벨 */
.product-card-category {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--red); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 4px;
}

/* ── Xilinx 하위 필터 ─────────────────────────────────── */
.sub-filter {
  display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap;
}
.sub-filter-btn {
  padding: 7px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--char-lt);
  cursor: pointer; transition: all .15s;
}
.sub-filter-btn:hover { border-color: var(--red); color: var(--red); }
.sub-filter-btn.active {
  background: var(--charcoal); color: var(--white);
  border-color: var(--charcoal);
}

/* ── 모달 인터페이스 서브 항목 ────────────────────────────── */
.modal-list-sub {
  font-size: 12px !important;
  color: var(--gray) !important;
  padding-left: 20px;
  margin-top: -2px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
}
.modal-list-sub::before {
  content: '└' !important;
  color: var(--border) !important;
  font-size: 11px;
}

/* ── Lucide 플레이스홀더 아이콘 ──────────────────────────── */
.product-lucide-icon {
  width: 48px; height: 48px;
  stroke: var(--red);
  stroke-width: 1.5;
}
.modal-img-placeholder .product-lucide-icon {
  width: 80px; height: 80px;
}

/* ── 스켈레톤 로딩 ── */
.skeleton { pointer-events: none; }
.skeleton-box {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 160px;
  border-radius: 8px;
}
.skeleton-line {
  height: 14px;
  border-radius: 4px;
  margin: 8px 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
@keyframes shimmer {
  0% { background-position: 200% 0;}
  100% { background-position: -200% 0;}
}