/* ==========================================================================
   PSE Shuttle Search
   ========================================================================== */

/* ── 래퍼 ──────────────────────────────────────────────────────────────── */
.pse-shuttle-search {
  max-width: 1200px;
  margin: 0 auto;
}

/* ── 검색 폼 ────────────────────────────────────────────────────────────── */
.pse-search-form {
  position: relative;  /* 토스트 위치 기준점 */
  margin-bottom: 24px;
}

.pse-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: top;
  gap: 8px;
}

.pse-search-row input[type="text"] {
  height: 40px;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: .875rem;
  background: #fff;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}

.pse-search-row input[type="text"]:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,.15);
}

/* 각 필드 너비 */
.pse-search-row input[name="s_last"]  { flex: 0 0 20%; }   /* 성씨 */
.pse-search-row input[name="s_date"]  { flex: 0 0 20%; }   /* 항공날짜 */
.pse-search-row input[name="s_phone"] { flex: 0 0 20%; }   /* 연락처 */
.pse-search-row input[name="s_order"] { flex: 0 0 20%;  }   /* 주문번호 4자리 */

/* 구분선 — 방법 2(주문번호) 앞에 시각적 분리 */
.pse-search-row input[name="s_order"] {
  border-left: 2px solid #1a73e8;
}

/* 예약조회 버튼 */
.pse-search-row .button.alt {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 20px;
  font-size: .875rem;
  line-height: 40px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

/* ── 검색 결과 ──────────────────────────────────────────────────────────── */
.pse-search-results {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pse-no-results {
  padding: 16px 0;
  color: #666;
  font-size: .9rem;
}

.pse-result-count {
  margin-top: 8px;
  font-size: .85rem;
  color: #888;
  text-align: right;
}

/* ── 결과 테이블 ────────────────────────────────────────────────────────── */
.pse-search-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .825rem;
  white-space: nowrap;
}

.pse-search-table thead tr {
  background: #2c3e50;
  color: #fff;
}

.pse-search-table th,
.pse-search-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid #e4e4e4;
  vertical-align: middle;
}

.pse-search-table th {
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .03em;
}

.pse-search-table tbody tr:hover {
  background: #f0f6ff;
}

.pse-search-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.pse-search-table tbody tr:nth-child(even):hover {
  background: #f0f6ff;
}

/* 주문번호 열 — 숫자 고정폭 */
.pse-search-table td:first-child,
.pse-search-table th:first-child {
  font-variant-numeric: tabular-nums;
  min-width: 72px;
}

/* 금액 */
.pse-search-table td:nth-child(10) {
  font-variant-numeric: tabular-nums;
}

/* 관리 링크 */
.pse-search-actions {
  white-space: nowrap;
}

.pse-search-actions a {
  display: inline-block;
  padding: 2px 8px;
  font-size: .78rem;
  border-radius: 3px;
  border: 1px solid currentColor;
  text-decoration: none;
  margin-right: 4px;
  color: #1a73e8;
  transition: background .15s, color .15s;
}

.pse-search-actions a:last-child {
  margin-right: 0;
}

.pse-search-actions a:hover {
  background: #1a73e8;
  color: #fff;
}

/* ── 토스트 알림 — .pse-search-form 기준 입력란 바로 위에 표시 ─────────── */
.pse-search-toast {
  position: absolute;
  bottom: calc(100% + 6px); /* 폼(입력란) 위 6px */
  left: 0;
  transform: translateY(8px);
  background: #fff8e1;
  color: #795700;
  border: 1px solid #f6c000;
  border-left: 4px solid #f6c000;
  border-radius: 6px;
  padding: 12px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.14);
  font-size: .875rem;
  line-height: 1.7;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 240px;
  max-width: 420px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.pse-search-toast--show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pse-search-toast--hide {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* ── 반응형 : 테이블 → 카드 (≤1080px) ──────────────────────────────────── */
@media (max-width: 1080px) {

  /* 가로 스크롤 해제 */
  .pse-search-results { overflow-x: visible; }

  /* thead 숨기고 table 구조 해제 */
  .pse-search-table thead { display: none !important; }
  .pse-search-table,
  .pse-search-table tbody,
  .pse-search-table tr   { display: block; width: 100%; }

  /* tr → 카드 + 2열 그리드 */
  .pse-search-table tr {
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    background: #fff;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }

  /* 짝수행 배경 제거 (카드 모드에서 불필요) */
  .pse-search-table tbody tr:nth-child(even) { background: #fff; }

  /* 셀 기본 리셋 */
  .pse-search-table td {
    display: block;
    border: 0;
    padding: 0;
    font-size: .875rem;
    line-height: 1.5;
    white-space: normal;
    text-align: left;
  }

  /* 레이블 공통 — ::before */
  .pse-search-table td::before {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: #888;
    letter-spacing: .04em;
    margin-bottom: 2px;
  }

  /* 항공날짜(8) 레이블 */
  .pse-search-table td:nth-child(8)::before  { content: '항공 날짜'; }

  /* 탑승일시(9) 레이블 */
  .pse-search-table td:nth-child(9)::before  { content: '탑승 일시'; }


  /* ── 숨길 열: 연락처(4), 인원(5), 금액(10), 결제(11) ── */
  .pse-search-table td:nth-child(4),
  .pse-search-table td:nth-child(5),
  .pse-search-table td:nth-child(10),
  .pse-search-table td:nth-child(11) { display: none !important; }

  /* ── 그리드 배치 ── */

  /* 주문번호(1) — 전체 너비 헤더 */
  .pse-search-table td:nth-child(1) {
    grid-column: 1 / -1;
    font-weight: 800;
    font-size: .95rem;
    padding-bottom: 6px;
    border-bottom: 1px dashed #ddd;
    margin-bottom: 4px;
  }

  /* 상태(2) — 왼쪽 */
  .pse-search-table td:nth-child(2) { grid-column: 1 / 2; }

  /* 대표자(3) — 오른쪽 */
  .pse-search-table td:nth-child(3) { grid-column: 2 / 3; }

  /* 공항(6) — 왼쪽 */
  .pse-search-table td:nth-child(6) { grid-column: 1 / 2; }

  /* 편도/왕복(7) — 오른쪽 */
  .pse-search-table td:nth-child(7) { grid-column: 2 / 3; }

  /* 항공날짜(8) — 왼쪽 */
  .pse-search-table td:nth-child(8) { grid-column: 1 / 2; }

  /* 탑승일시(9) — 오른쪽 */
  .pse-search-table td:nth-child(9) { grid-column: 2 / 3; }


  /* 관리(12) — 카드 모드에서 숨김, 카드 전체 클릭으로 대체 */
  .pse-search-table td:nth-child(12) { display: none !important; }

  /* 카드 클릭 가능 표시 */
  .pse-search-table tr[data-print-url] {
    cursor: pointer;
  }
  .pse-search-table tr[data-print-url]:active {
    background: #e8f0fe;
  }
}

/* ── 반응형 : 폼 세로 스택 (≤680px) ────────────────────────────────────── */
@media (max-width: 680px) {
  .pse-search-row {
	display: flex;
	flex-wrap: wrap;
  }

  .pse-search-row input[type="text"],
  .pse-search-row input[name="s_last"],
  .pse-search-row input[name="s_date"],
  .pse-search-row input[name="s_phone"],
  .pse-search-row input[name="s_order"] {
    flex: 0 0 calc(50% - 5px);
    width: calc(50% - 5px);
	height: 40px;
	margin: 0 0 0;
  }

  .pse-search-row input[name="s_order"] {
    border-left: 2px solid #1a73e8;
  }

  .pse-search-row .button.alt {
    width: 100%;
    text-align: center;
  }
}

/* ── 반응형 : 카드 1열 (≤480px) ────────────────────────────────────────── */
@media (max-width: 480px) {
  .pse-search-table tr { grid-template-columns: 1fr; }

  .pse-search-table td:nth-child(2),
  .pse-search-table td:nth-child(3),
  .pse-search-table td:nth-child(6),
  .pse-search-table td:nth-child(7),
  .pse-search-table td:nth-child(8),
  .pse-search-table td:nth-child(9) { grid-column: 1 / -1; }
}
