/**
 * 필터·드롭다운·칩 PNG 아이콘 공통 스타일
 * — 버튼 높이 유지, 이모지 폰트 의존 제거
 */

.filter-icon,
.filter-chip-icon,
.dropdown-option-icon,
.dropdown-trigger-icon,
.option-icon,
.select-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: inline-block;
  flex: 0 0 auto;
  line-height: 0;
}

.filter-icon img,
.filter-chip-icon,
.dropdown-option-icon,
.dropdown-trigger-icon,
.option-icon,
.select-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.filter-custom-select-trigger-icon img,
.filter-custom-select-option-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.chip-filter .filter-icon img,
.chip-filter .filter-chip-icon,
.filter-pill .filter-icon img,
.filter-pill .filter-chip-icon {
  width: 16px;
  height: 16px;
}

.filter-chip,
.filter-pill,
.chip-filter.filter-has-icon,
.filter-select-wrapper,
.filter-custom-select-trigger,
.filter-custom-select-option,
.dropdown-option,
.dropdown-trigger {
  /* flex 정렬은 기존 chip/filter 스타일과 병행 */
}

.filter-pill.filter-has-icon,
.chip-filter.filter-has-icon,
.filter-custom-select-trigger,
.filter-custom-select-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.filter-select-wrapper {
  position: relative;
}

.filter-select-wrapper .filter-select-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
}

.filter-select-wrapper--has-icon select {
  padding-left: 36px !important;
}

.shorts-pc-select-row .filter-select-wrapper--has-icon select {
  padding-left: 34px !important;
}

@media (max-width: 768px) {
  .filter-icon img,
  .filter-chip-icon {
    min-width: 16px;
    min-height: 16px;
  }
}

/* ── PC 필터 커스텀 드롭다운 (목록 항목 PNG 아이콘) ── */

.filter-native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 기존 네이티브 select 옆 ▼ 장식 숨김 */
.filter-custom-select-wrapper > select.filter-native-select-hidden + div:not(.filter-custom-select) {
  display: none !important;
}

.filter-custom-select-wrapper {
  position: relative;
}

.filter-custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.filter-custom-select-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 650;
  padding: 9px 32px 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  line-height: 1.2;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.filter-custom-select-trigger:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.filter-custom-select-trigger:focus-visible {
  border-color: var(--border-focus, rgba(201, 134, 26, 0.35));
}

.filter-custom-select-trigger-icon {
  flex-shrink: 0;
}

.filter-custom-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-custom-select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  /* 트리거보다 넓게 펼쳐 긴 라벨(장르·형식 등) 한 줄 표시 — OS 네이티브 select와 유사 */
  min-width: 100%;
  width: max-content;
  max-width: min(420px, calc(100vw - 24px));
  z-index: 1200;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #1a1a1e;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 4px;
  scrollbar-width: thin;
}

.filter-custom-select-option {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-main);
  /* 전역 button(700)보다 가볍게 · 트리거(0.82rem)와 동일 위계 */
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body, inherit);
  line-height: 1.2;
}

.filter-custom-select-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.filter-custom-select-option.is-selected {
  background: rgba(201, 134, 26, 0.12);
  color: var(--accent-orange, #c9861a);
}

.filter-custom-select-option-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.filter-custom-select-option-icon:empty {
  display: none;
}

/* 드롭다운 목록이 잘리지 않도록 (PC 필터 바) */
.filter-bar-section,
.shorts-filter-bar,
.shorts-pc-select-row {
  overflow: visible;
}

/* ── 섹션 타이틀 PNG (내 이어보기 등) ── */
.section-title[data-section-icon],
.library-section-title[data-section-icon],
h1[data-section-icon].hero-title,
h2[data-section-icon].library-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 상세 모달 — 시즌 에피소드 목록 타이틀 행 */
.md-episode-list-title-row[data-section-icon] {
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title-icon {
  display: inline-flex;
  flex: 0 0 auto;
  line-height: 0;
}

.section-title-icon-img,
.section-title-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
