/**
 * 24LAW 공통 필터 UI — 빠른 의뢰 / 추천 / 검색 등 재사용
 */

.filter-section {
  margin-bottom: 10px;
}

.filter-section:last-of-type {
  margin-bottom: 8px;
}

.filter-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: thin;
}

.filter-row::-webkit-scrollbar {
  height: 6px;
}

.filter-row::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

/* 칩이 filter-row 직접 자식일 때 줄바꿈 방지 */
.filter-row > .filter-chip {
  flex: 0 0 auto;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 18px;
  border: 1px solid #d9dee8;
  background: #f5f7fb;
  color: #1f2a44;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  margin: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-chip:hover:not(:disabled):not(.disabled) {
  background: #e8ecf4;
}

.filter-chip.active {
  background: var(--color-primary, #2f6df3);
  color: #fff;
  border-color: var(--color-primary, #2f6df3);
}

.filter-chip.active:hover {
  background: #0066dd;
  border-color: #0066dd;
  color: #fff;
}

.filter-chip.disabled,
.filter-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.filter-placeholder {
  display: inline-block;
  padding: 6px 2px;
  font-size: 13px;
  color: #9ca3af;
  white-space: nowrap;
  flex: 0 0 auto;
}

.compact-select {
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #d9dee8;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #1f2a44;
  font-family: inherit;
  cursor: pointer;
  min-width: 0;
}

.compact-action-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #cfd8ea;
  background: #f7faff;
  color: #1f2a44;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.compact-action-btn:hover:not(:disabled) {
  background: #eef4ff;
  border-color: #b8c9e8;
}

.compact-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 3단계: 셀렉트 + 버튼 한 줄 */
.filter-row--region {
  flex-wrap: nowrap;
  gap: 8px;
}

.filter-row--region .compact-select {
  max-width: min(160px, 46vw);
  flex: 0 1 auto;
}

.filter-status-line {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #166534;
  line-height: 1.4;
}

/* 빠른 의뢰 블록 — 상단 광고 카드와 톤 통일 */
.case-quick-panel {
  padding-top: 12px;
  border-color: #cfe0fb;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: 0 8px 24px rgba(15, 40, 89, 0.06);
}

.case-quick-panel .filter-label {
  font-size: 13px;
  font-weight: 800;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.case-quick-panel-head h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  color: #0f2859;
}

.case-quick-eyebrow {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
  line-height: 1.35;
}

.case-quick-stepper {
  list-style: none;
  margin: 0 0 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  border-radius: 12px;
  border: 1px solid #dbe7fb;
  background: linear-gradient(120deg, #eff6ff 0%, #f8fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.case-quick-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.case-quick-step-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 800;
  color: #1d4ed8;
  flex-shrink: 0;
}

.case-quick-step-text {
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  white-space: nowrap;
}

.case-quick-step-connector {
  flex: 0 0 12px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #bfdbfe, #93c5fd);
  opacity: 0.85;
  min-width: 8px;
}

.case-quick-row--cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  overflow: visible;
  white-space: normal;
  padding-bottom: 2px;
}

.case-quick-row--subtype {
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
}

/* 선택형 카드 (유형·세부) */
.case-quick-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid #dbe7fb;
  background: #fff;
  color: #0f2859;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 40, 89, 0.05);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.case-quick-card:hover:not(:disabled):not(.disabled) {
  border-color: #93c5fd;
  background: #f0f7ff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.case-quick-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.case-quick-card.active {
  background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.case-quick-card.active:hover {
  background: linear-gradient(145deg, #1d4ed8 0%, #1e40af 100%);
  color: #fff;
}

.case-quick-card--subtype {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 12px;
}

.case-quick-card-grid .filter-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: rgba(255, 255, 255, 0.7);
  color: #64748b;
  font-weight: 600;
  white-space: normal;
}

/* 현재 위치 — primary */
.case-quick-location-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.case-quick-location-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.42);
  transform: translateY(-1px);
}

.case-quick-location-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.case-quick-nudge {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.case-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.case-quick-cta-main {
  min-height: 48px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.case-quick-cta-main:hover:not(:disabled) {
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.42);
}

.case-quick-secondary-outline {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-weight: 600;
}

.case-quick-panel .case-submit-note {
  margin-top: 8px;
  margin-bottom: 0;
  line-height: 1.5;
}

.case-quick-panel #case-quick-hint {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .filter-chip {
    font-size: 13px;
    height: 32px;
    padding: 0 10px;
  }

  .compact-select,
  .compact-action-btn {
    height: 34px;
    font-size: 13px;
  }

  .filter-row--region .compact-select {
    max-width: min(150px, 44vw);
  }

  .case-quick-stepper {
    padding: 10px;
  }

  .case-quick-step-text {
    font-size: 12px;
  }

  .case-quick-step-connector {
    display: none;
  }

  .case-quick-step {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .case-quick-row--cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-quick-location-btn {
    height: 34px;
    font-size: 13px;
    padding: 0 12px;
  }
}
