/* =========================
   Agency Page
========================= */

.agency-page {
  padding: 24px 0 20px;
  position: relative;
}

/* 페이지 내부 기본 stacking */
.agency-page > * {
  position: relative;
  z-index: 1;
}

.agency-header {
  margin-bottom: 20px;
}

.agency-header h1 {
  font-size: 22px;
  font-weight: 700;
}

.agency-desc {
  font-size: 14px;
  color: var(--text-muted);
}

/* =========================
   Search (Dropdown + Input)
   - 검색창 + 필터를 한 덩어리로 묶기
========================= */

.agency-search {
  margin: 16px 0 24px;
  position: relative;
  z-index: 20; /* 드롭다운이 카드 위로 오게 */
}

/* 전체 래퍼(배경색 있는 pill) */
.agency-searchbar {
  display: flex;
  gap: 10px;
  align-items: center;

  padding: 8px 10px;
  border-radius: 20px;

  background: rgba(255, 255, 255, 0.65);
  border: 1.5px solid #c7d2fe;
  box-shadow: 0 0 0 1px rgba(148, 163, 209, 0.25);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme='dark'] .agency-searchbar {
  background: rgba(18, 20, 24, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* 드롭다운(지역/가격) */
.agency-dd {
  position: relative;
  flex: 0 0 auto;
}

.agency-dd > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  height: 40px;
  padding: 0 14px;
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid #a5b4fc;
  color: var(--text-color);

  box-shadow: none;
}

.agency-dd > summary::-webkit-details-marker {
  display: none;
}

[data-theme='dark'] .agency-dd > summary {
  background: rgba(18, 20, 24, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

.agency-dd-label {
  font-size: 12px;
  opacity: 0.7;
}

.agency-dd-value {
  font-size: 13px;
  font-weight: 600;
}

.agency-dd-caret {
  font-size: 12px;
  opacity: 0.7;
}

/* 드롭다운 메뉴 */
.agency-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;

  min-width: 95px;
  max-height: 280px;
  overflow: auto;

  padding: 8px;
  border-radius: 14px;

  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-theme='dark'] .agency-dd-menu {
  background: #121822;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.agency-dd-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;

  padding: 10px 10px;
  border-radius: 10px;

  color: var(--text-color);
  font-size: 13px;
}

.agency-dd-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme='dark'] .agency-dd-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.agency-dd-item.is-active {
  background: rgba(0, 0, 0, 0.07);
  font-weight: 700;
}

[data-theme='dark'] .agency-dd-item.is-active {
  background: rgba(255, 255, 255, 0.08);
}

/* 검색 input */
.agency-searchbar #agencySearch {
  flex: 1 1 auto;
  min-width: 0;

  height: 40px;
  padding: 0 14px; /* 아이콘을 input 안에 넣는 구조가 아니라면 기본값 */

  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid #a5b4fc;

  color: var(--text-color);
  outline: none;
  box-shadow: none;
}

[data-theme='dark'] .agency-searchbar #agencySearch {
  background: rgba(18, 20, 24, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

/* 검색 아이콘 버튼(현재 HTML: input 오른쪽에 별도 버튼) */
.agency-search-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;

  padding: 0 12px;
  display: inline-flex;
  align-items: center;
}

.agency-search-icon-btn svg {
  transition: stroke 0.15s ease;
}

.agency-search-icon-btn:hover svg {
  stroke: var(--accent);
}

/* 모바일 미세 조정 */
@media (max-width: 480px) {
  .agency-searchbar {
    gap: 8px;
    padding: 8px 8px;
  }

  .agency-dd > summary {
    padding: 0 10px;
  }

  .agency-dd-menu {
    min-width: 95px;
  }
}

/* =========================
   Grid
========================= */

.agency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  justify-items: start;
}

/* 모바일 2열 + 좌우 여백 */
@media (max-width: 768px) {
  .agency-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding-left: 6px;
    padding-right: 6px;
  }
}

@media (max-width: 360px) {
  .agency-grid {
    gap: 12px;
  }
}

/* =========================
   Glass Card (세로형)
========================= */

.agency-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 18px;

  min-height: 260px;
  max-width: 340px;
  width: 100%;

  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);

  display: flex;
  flex-direction: column;
  gap: 12px;

  transition: transform 140ms ease, box-shadow 140ms ease,
    border-color 140ms ease;

  overflow: hidden;
}

/* 카드 반사광 */
.agency-card::before {
  content: '';
  position: absolute;
  inset: -60% -40% auto -40%;
  height: 180px;
  background: radial-gradient(
    closest-side,
    rgba(255, 255, 255, 0.5),
    transparent 70%
  );
  transform: rotate(-8deg);
  opacity: 0.55;
  pointer-events: none;
}

.agency-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

/* 다크모드 카드 */
[data-theme='dark'] .agency-card {
  background: rgba(18, 20, 24, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .agency-card::before {
  opacity: 0.22;
}

/* =========================
   Card Header
========================= */

.agency-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.agency-logo {
  width: 52px;
  height: 52px;
  padding: 8px;
  border-radius: 14px;
  object-fit: contain;

  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

[data-theme='dark'] .agency-logo {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.agency-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* =========================
   Card Info
========================= */

.agency-info {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.agency-info span {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(40, 48, 60, 0.78);
}

[data-theme='dark'] .agency-info span {
  color: rgba(225, 232, 242, 0.78);
}

.agency-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  opacity: 0.9;
}

/* 특징 리스트 */
.agency-point-list {
  list-style: none;
  padding: 0;
  margin: 2px 0 0;
  display: grid;
  gap: 8px;
}

.agency-point-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
  color: rgba(40, 48, 60, 0.78);
}

[data-theme='dark'] .agency-point-item {
  color: rgba(225, 232, 242, 0.78);
}

.agency-point-item .agency-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  opacity: 0.9;
}

/* 모바일 카드 */
@media (max-width: 480px) {
  .agency-card {
    padding: 14px 14px 12px;
    border-radius: 16px;
    min-height: 190px;
  }
}

/* =========================
   Disclaimer
========================= */

.agency-page-disclaimer {
  margin: 24px auto 0;
  padding-top: 12px;
  max-width: 960px;

  border-top: 1px dashed rgba(0, 0, 0, 0.08);

  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: rgba(40, 48, 60, 0.5);
}

[data-theme='dark'] .agency-page-disclaimer {
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  color: rgba(225, 232, 242, 0.45);
}

@media (max-width: 768px) {
  .agency-page-disclaimer {
    padding-left: 10px;
    padding-right: 10px;
  }
}
/* ✅ 각 정보 row(아이콘 + 텍스트)가 flex일 때, 자식이 줄어들 수 있게 */
.agency-info > span {
  min-width: 0;
}

/* ✅ location 텍스트: flex에서 줄어들 공간 확보 + 말줄임 */
.agency-location-text {
  flex: 1 1 auto; /* 중요 */
  min-width: 0; /* 중요 */
  padding-right: 12px; /* 끝 숨통 */

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 검색 input 래퍼 */
.agency-search-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

/* 검색 input */
.agency-search-input-wrap #agencySearch {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 14px; /* ✅ 오른쪽 아이콘 공간 확보 */

  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid #a5b4fc;

  color: var(--text-color);
  outline: none;
}

/* 다크모드 */
[data-theme='dark'] .agency-search-input-wrap #agencySearch {
  background: rgba(18, 20, 24, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

/* 검색 아이콘 버튼 → input 안쪽 오른쪽 */
.agency-search-icon-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);

  border: none;
  background: transparent;
  padding: 0;
  cursor: default; /* 아이콘 느낌 */

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agency-search-icon-btn svg {
  pointer-events: none; /* 클릭 시 input 포커스 방해 X */
}
@media (max-width: 768px) {
  .agency-header {
    padding-left: 12px;
    padding-right: 12px;
  }

  .agency-header h1 {
    margin-bottom: 6px;
  }

  .agency-desc {
    line-height: 1.55;
  }
}
