/* ============================================
   バス検索システム - フロント CSS
   ============================================ */

/* ---------- 検索フォーム ---------- */
.bs-search-wrap {
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
    background-color: #004AAD;
    border-radius: 0;
    overflow: hidden;
}
.bs-search-inner {
    padding: 32px 24px 40px;
}

/* タイトル行 */
.bs-search-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: nowrap;
}
.bs-search-title-text {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
}
.bs-search-title-jp {
    font-size: clamp(1.2em, 4%, 2em);
    font-weight: 900;
    color: #fff;
    font-style: normal;
    letter-spacing: .02em;
    white-space: nowrap;
}
.bs-search-title-en {
    font-size: clamp(.7em, 1.5%, .9em);
    font-weight: 700;
    color: #fff;
    letter-spacing: .01em;
    font-style: normal;
    white-space: nowrap;
}

/* バスアイコン */
.bs-search-bus-icon {
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;
    line-height: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}
.bs-search-bus-icon svg {
    width: clamp(40px, 6vw, 74px);
    height: auto;
    display: block;
}

/* 区切り線：アイコン下端にぴったり */
.bs-search-divider {
    border: none;
    border-top: 2px solid #fff;
    margin: 0 0 22px 0;
}

/* フォームフィールド */
.bs-search-field {
    margin-bottom: 14px;
}
.bs-search-label {
    display: block;
    color: #fff;
    font-size: .95em;
    font-weight: 700;
    margin-bottom: 5px;
    white-space: nowrap;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* セレクト共通 */
.bs-search-select-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}
.bs-select-custom {
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
    font-feature-settings: "palt";
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 8px 19px 8px 12px;
    font-size: 1em;
    color: #222;
    cursor: pointer;
    outline: none;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* ▼アイコン：全セレクトで統一シアン */
.bs-select-arrow {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: .65em;
    color: #2cc2d5;
}

/* 日時行：横並び固定・折り返し禁止 */
.bs-datetime-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.bs-date-wrap {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}
.bs-time-wrap {
    flex: 0 0 auto;
    min-width: 78px;
    width: auto;
}
.bs-select-date,
.bs-select-time {
    padding-right: 20px;
}
.bs-time-unit {
    display: none;
}

/* エラー */
.bs-search-error {
    background: #ffe0e0;
    color: #c00;
    border-radius: 0;
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: .9em;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* 検索ボタン */
.bs-search-btn {
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #e5305a;
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 12px 20px;
    font-size: 1.05em;
    font-weight: 900;
    cursor: pointer;
    letter-spacing: .06em;
    margin-top: 18px;
    transition: background .15s;
    white-space: nowrap;
    box-sizing: border-box;
}
.bs-search-btn:hover { background: #c0204a; }
.bs-search-btn-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.bs-search-btn-icon svg {
    width: 20px;
    height: 20px;
    filter: brightness(10);
}

/* コンパクト版（結果下部・max-width 660px） */
.bs-result-reserach-wrap {
    margin-top: 48px;
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
}
.bs-search-compact .bs-search-inner {
    padding: 20px 20px 24px;
}
.bs-search-compact .bs-search-title-jp { font-size: clamp(1em, 3%, 1.5em); }
.bs-search-compact .bs-search-bus-icon svg { width: clamp(36px, 5vw, 60px); }

/* ============================================
   検索結果
   ============================================ */
.bs-result-wrap {
    margin-top: 16px;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* ページタイトル */
.bs-result-page-title {
    font-size: 1.6em;
    font-weight: 900;
    color: #0042ab;
    text-align: center;
    margin: 0 0 24px 0;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* 検索条件サマリ */
.bs-result-summary {
    border: 2px solid #0042ab;
    padding: 18px 24px;
    margin-bottom: 10px;
}
.bs-result-summary-date {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    letter-spacing: .04em;
}
.bs-result-summary-route {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    gap: 10px;
    flex-wrap: nowrap;
}
.bs-result-summary-stop {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bs-result-summary-name {
    font-size: 1em;
    font-weight: 700;
    color: #222;
}
.bs-result-summary-arrow {
    font-size: 1.2em;
    color: #2cc2d5;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    margin-top: -8px;
    font-weight: bold;
}

/* 発・着バッジ（サマリ内） */
.bs-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2em;
    font-size: 1em;
    font-weight: 900;
    flex-shrink: 0;
    border-radius: 0;
    line-height: 1;
}
.bs-badge-dep { background: #0042ab; color: #fff; }
.bs-badge-arr { background: #e5305a; color: #fff; }

/* 発・着行内バッジ（stop-row内専用） */
.bs-stop-row-icon {
    height: 100%;
    width: auto;
    aspect-ratio: 1;
    font-size: 1.3em;
    padding: 0.5em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 900;
    line-height: 1;
}

/* 注釈（サマリ下） */
.bs-result-note-global {
    font-size: 0.9em;
    color: #444;
    margin: 0 0 20px 0;
}

/* 区切り線 */
.bs-result-divider {
    border: none;
    border-top: 2px solid #2cc2d5;
    margin: 20px 0;
}

/* 結果なし */
.bs-no-result {
    text-align: center;
    color: #666;
    padding: 32px 16px;
    line-height: 1.8;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* 各便カード */
.bs-result-card {
    margin-bottom: 0;
}

/* 便タイトル（1便目・2便目） */
.bs-result-trip-title {
    font-size: 1.35em;
    font-weight: 900;
    color: #222;
    margin: 0 0 8px 0;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* 運賃行 */
.bs-result-fare-row {
    font-size: 1em;
    color: #333;
    margin-bottom: 14px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}
.bs-fare-price {
    font-size: 2em;
    font-weight: 900;
    color: #0042ab;
    line-height: 1;
}
.bs-fare-unknown {
    font-size: .95em;
    color: #888;
}

/* 出発・到着行 */
.bs-stop-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f2f4f8;
    color: #111;
    height: fit-content;
}
.bs-stop-row-time {
    font-size: 1em;
    font-weight: 700;
    color: #333;
    min-width: 40px;
    white-space: nowrap;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}
.bs-stop-row-name {
    font-size: 1em;
    font-weight: 700;
    color: #222;
    padding: 4px;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* PC：display:contents でラッパーを透過、子要素を直接flex子として扱う */
.bs-stop-row-info {
    display: contents;
}

/* 中間エリア（矢印＋バス画像＋路線名） */
.bs-result-middle {
    display: flex;
    align-items: center;
    padding: 8px 0 8px 14px;
    gap: 0;
    min-height: 60px;
}
.bs-result-middle-arrow {
    font-size: 1.6em;
    color: #2cc2d5;
    flex-shrink: 0;
    margin-right: 16px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    transform: rotate(90deg);
    font-weight: bold;
}
.bs-result-middle-content {
    display: flex;
    align-items: center;
    gap: 16px;
}
.bs-result-bus-img {
    width: 120px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}
.bs-result-route-name {
    font-size: .95em;
    font-weight: 700;
    color: #0042ab;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* 便注釈 */
.bs-result-trip-note {
    font-size: .85em;
    color: #444;
    margin-top: 8px;
    padding-left: 4px;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* コンパクト版（結果下部） */
.bs-result-reserach-wrap {
    margin-top: 48px;
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
}
.bs-search-compact .bs-search-inner { padding: 20px 20px 24px; }
.bs-search-compact .bs-search-title-jp { font-size: clamp(1em, 3%, 1.5em); }
.bs-search-compact .bs-search-bus-icon svg { width: clamp(36px, 5vw, 60px); }

/* エラー（結果ページ内） */
.bs-search-error {
    background: #ffe0e0;
    color: #c00;
    border-radius: 0;
    padding: 10px 16px;
    font-size: .9em;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

/* モバイル */
@media (max-width: 767px) {
    .bs-result-summary { padding: 14px 16px; }
    .bs-result-summary-date { font-size: 1.1em; }
    .bs-result-summary-route { font-size: 1.2em; flex-direction: column; gap: 6px; }
    .bs-result-summary-arrow { display: none; }
    .bs-result-summary-stop { justify-content: center; }
    .bs-result-trip-title { font-size: 1.15em; }
    .bs-fare-price { font-size: 1.6em; }

    /* stop-row */
    .bs-stop-row { gap: 12px; }
    .bs-stop-row-icon { font-size: 1.4em; padding: 0.7em; }
    .bs-stop-row-info { display: block; padding: 0 0 4px; }
    .bs-stop-row-name { display: block; padding: 0; line-height: 1.25; }

    /* middle */
    .bs-result-middle { min-height: 52px; }
    .bs-result-middle-arrow { margin-right: 3px; }
    .bs-result-middle-content { gap: 14px; }
    .bs-result-bus-img { width: 66px; }
}
