/* ===== PAGE STATE MANAGEMENT ===== */

/* InfoWindow close button hide */
.gm-style-iw button.gm-ui-hover-effect {
  display: none !important;
}

.page {
  display: block;
}

.page.hidden {
  display: none;
}

/* ===== PAGE HEADER（BACK BUTTON） ===== */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.back-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.back-button:hover {
  background: #f0f0f0;
}

.back-arrow {
  font-size: 16px;
  font-weight: 700;
}

.page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ===== STATION LIST PAGE ===== */
.station-results-block {
  margin-bottom: 24px;
}

.station-results-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.station-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.station-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: #d6eeff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  transition: background-color 0.2s;
}

.station-item:hover {
  background: #b8e0ff;
}

.station-name {
  margin: 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.station-detail {
  display: block;
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.station-result-count {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  padding: 0 4px;
}

.station-empty-message {
  padding: 20px 12px;
  font-size: 14px;
  color: var(--sub);
  line-height: 1.8;
}

/* 中央配置の戻るボタン */
.center-back-button-wrapper {
  text-align: center;
  margin: 24px 0;
}

.center-back-button {
  display: inline-block;
  padding: 12px 52px;
  border: none;
  border-radius: var(--radius);
  background: #999999;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s;
}

.center-back-button:hover {
  background: #888888;
}

/* 0件時のアクションボタン */
.station-zero-action {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  margin: 24px 0;
}

.station-zero-action.hidden {
  display: none;
}

.station-zero-action .action-link {
  width: 47%;
}

.station-zero-action .action-link .action-btn {
  width: 100%;
  height: 100%;
}

.station-zero-action .center-back-button {
  width: 47%;
}

/* ===== 既存スタイル ===== */
:root {
  --primary: #008EED;
  --bg: #fafafa;
  --card: #ffffff;
  --line: #e5e5e5;
  --text: #333333;
  --sub: #666666;
  --caution: #dd0000;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", Meiryo, "メイリオ", sans-serif;
  color: var(--text);
  background: var(--bg);
}

#wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#contents {
  flex: 1;
}

.speakAnchor {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#header {
  position: relative;
  min-height: 44px;
  background: #fff;
}

#header.min {
  min-height: 44px;
  background-color: #fff;
}

#header__outer {
  position: relative;
  z-index: 3;
  max-width: none;
  margin: 0;
  padding: 0;
}

#header__inner {
  position: relative;
  min-height: 44px;
}

#header__logo {
  position: absolute;
  width: 100%;
  height: 44px;
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

#header__logo p {
  margin: 0;
}

#header__logo img {
  position: absolute;
  top: 11px;
  left: 14px;
  display: block;
  width: 30px;
  height: 22px;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-image {
  height: 50px;
  width: 167px;
  display: block;
}

.main-container {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* タイトルブロック */
.title-block {
  margin-bottom: 24px;
}

.title-block h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

/* 検索機能ブロック */
.search-block {
  margin-bottom: 24px;
}

.search-form {
  margin: 0;
}

.search-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  height: 48px;
}

.search-input::placeholder {
  color: #aaa;
}

.search-button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-button:hover {
  opacity: 0.9;
}

.search-hint {
  margin: 6px 0 16px;
  font-size: 12px;
  color: var(--sub);
}

.current-location-button {
  width: 44%;
  padding: 11px 10px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto;
}

.current-location-button:hover {
  opacity: 0.9;
}

.arrow-icon {
  width: 18px;
  height: 18px;
  color: #fff;
}

/* 注意事項ブロック */
.caution-block {
  margin-bottom: 24px;
  background: #fff;
  padding: 16px;
  border-radius: 10px;
}

.caution-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.caution-line {
  flex: 1;
  border: none;
  border-top: 1px solid #8a94a6;
  margin: 0;
}

.caution-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.caution-text {
  margin: 12px 0;
  font-size: 14px;
  color: #FF0000;
  line-height: 1.6;
  font-weight: 700;
}

.info-list {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.info-list li {
  margin-bottom: 10px;
}

.info-list ul {
  margin: 6px 0 0;
  padding-left: 20px;
  list-style-type: disc;
}

.info-list ul li::marker {
  color: #333;
}

.info-list ul li {
  margin-bottom: 4px;
  font-size: 12px;
}

/* アクションボタンブロック */
.action-buttons-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.action-link {
  text-decoration: none;
}

.action-btn {
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  width: 94%;
  margin: 0 auto;
}

.btn-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
}

.action-btn:hover {
  opacity: 0.9;
}

.btn-label {
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 3px;
  opacity: 0.95;
  text-align: left;
  width: max-content;
}

.btn-main {
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.action-link[target="_blank"] .btn-main::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border: 1px solid #fff;
  background: var(--primary);
  box-shadow: 3px -3px 0 -1px var(--primary), 3px -3px 0 0 #fff;
  vertical-align: 1px;
}

/* 検索結果エリア */
.search-results {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
}

.search-results.hidden {
   display: none;
 }

 /* ページ上部にマージンを追加（TOP PAGE以外） */
 .page-header + * {
   margin-top: 12px;
 }

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.results-header h2 {
  margin: 0;
  font-size: 16px;
}

#result-count {
  font-size: 13px;
  color: var(--sub);
}

.store-list {
  max-height: 600px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #7f7f7f #e5e5e5;
}

.store-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
}

.store-item:hover {
  background: #f9f9f9;
}

.store-name {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
}

.store-address,
.store-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--sub);
}

/* ===== STORE LIST PAGE v2 ===== */
.store-station-info {
  display: flex;
  align-items: stretch;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  margin-bottom: 16px;
}

.store-station-info.hidden {
  display: none;
}

.store-station-name {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.store-location-info {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--sub);
}

.store-location-info.hidden {
  display: none;
}

.store-location-info p {
  margin: 0;
}

.store-map {
  width: 100%;
  height: 450px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  z-index: 0;
}

.store-count-message {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 16px;
}

.store-list-v2 {
  border-top: 1px solid var(--line);
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #7f7f7f #e5e5e5;
}

.store-scroll-hint {
  margin: 0 0 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 8px rgba(0, 142, 237, 0.35);
  transition: opacity 0.2s ease;
}

.store-scroll-hint.hidden {
  opacity: 0;
}

.store-list-v2.ios-scrollable {
  position: relative;
  padding-bottom: 20px;
  background-image: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0, rgba(255, 255, 255, 0) 28px);
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: 100% 28px;
}

.store-list-v2::-webkit-scrollbar,
.store-list::-webkit-scrollbar {
  width: 10px;
}

.store-list-v2::-webkit-scrollbar-track,
.store-list::-webkit-scrollbar-track {
  background: #e5e5e5;
  border-radius: 999px;
}

.store-list-v2::-webkit-scrollbar-thumb,
.store-list::-webkit-scrollbar-thumb {
  background: #7f7f7f;
  border-radius: 999px;
  border: 2px solid #e5e5e5;
}

.store-list-v2::-webkit-scrollbar-thumb:hover,
.store-list::-webkit-scrollbar-thumb:hover {
  background: #666666;
}

.store-item-v2 {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s;
}

.store-item-v2.highlighted {
  background-color: #fff3cd;
}

.store-name-link {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.store-name-link:hover {
  opacity: 0.8;
}

.store-address-v2 {
  margin: 4px 0 6px;
  font-size: 13px;
  color: var(--text);
}

.store-icons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.store-icon {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: var(--sub);
  background: #f5f5f5;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 8px;
}

.store-icon-card {
  color: #0066cc;
}

.store-icon-mobile {
  color: #009944;
}

.store-empty-message {
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
  color: var(--sub);
}

.store-bottom-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
}

.store-nav-btn {
  display: block;
  width: 45%;
  padding: 14px 10px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.store-nav-btn:hover {
  background: #f2f9ff;
}

.store-fallback-notice {
  background: #d9534f;
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.store-fallback-notice.hidden {
  display: none;
}


/* フッター */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--sub);
}

#footer {
  margin-top: auto;
  background: #fff;
  border-top: 1px solid #d9d9d9;
  color: #333;
}

#footer__companySet {
  max-width: 600px;
  margin: 0 auto;
  padding-left: 2px;
}

.footer__inner {
  padding: 29px 16px 0;
}

#footer__movePageTop {
  margin-bottom: 11px;
  display: flex;
  justify-content: flex-end;
}

#footer__movePageTop a {
  color: #333;
  text-decoration: none;
  font-size: 12px;
  line-height: 24px;
}

#footer__movePageTop a:hover {
  text-decoration: underline;
}

#footer__movePageTop span {
  display: inline-block;
}

#footer__companySet__company {
  margin-bottom: 11px;
}

#footer__companySet__company ul {
  margin: 0;
  padding: 0;
  font-size: 0;
  list-style: none;
}

#footer__companySet__company li {
  display: inline-block;
  margin-bottom: 8px;
}

#footer__companySet__company li::after {
  display: inline-block;
  width: 19px;
  height: 12px;
  content: "";
  vertical-align: top;
  background-image: radial-gradient(circle, #8f8f8f 1px, transparent 1.5px);
  background-repeat: no-repeat;
  background-position: center 6px;
}

#footer__companySet__company li.footer__companySetItem--noDisc::after {
  width: 0;
  height: 0;
  content: none;
  background: none;
}

#footer__companySet__company a {
  color: #333;
  text-decoration: none;
  font-size: 11px;
  line-height: 12px;
}

#footer__companySet__company a:hover {
  text-decoration: underline;
}

#footer__companySet__company li.footer__companySetItem--externalLink a {
  position: relative;
  padding-right: 14px;
}

#footer__companySet__company li.footer__companySetItem--externalLink a::before,
#footer__companySet__company li.footer__companySetItem--externalLink a::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid #8b8b8b;
  background: #fff;
}

#footer__companySet__company li.footer__companySetItem--externalLink a::before {
  right: 0;
  top: 50%;
  transform: translateY(-60%);
}

#footer__companySet__company li.footer__companySetItem--externalLink a::after {
  right: 3px;
  top: 50%;
  transform: translateY(-30%);
}

#footer__companySet__companyInfo {
  min-height: 55px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

#footer__companySet__companyInfo__logo {
  margin: 0;
  flex: 0 0 auto;
}

#footer__companySet__companyInfo__logo img {
  display: block;
  width: 42px;
  height: 12px;
}

#footer__companySet__companyInfo__copyright {
  margin: 8px 0 0;
  padding-bottom: 22px;
  font-size: 11px;
  color: #666;
}

@media (max-width: 480px) {
  .main-container {
    padding: 12px;
  }

  .title-block h1 {
    font-size: 24px;
  }

  .action-buttons-block {
    gap: 8px;
  }
}

/* ===== RESPONSIVE: PC (768px以上) ===== */
@media (min-width: 768px) {
  .main-container {
    max-width: 800px;
    padding: 24px 32px;
  }

  .store-map {
    height: 500px;
  }

  .store-list-v2 {
    max-height: 700px;
  }

  .store-item-v2 {
    padding: 16px 8px;
  }

  .store-name-link {
    font-size: 16px;
  }

  .store-address-v2 {
    font-size: 14px;
  }

  .station-item {
    padding: 12px 20px;
    font-size: 16px;
  }

  .current-location-button {
    width: auto;
    padding: 12px 32px;
  }

  .action-buttons-block {
    gap: 16px;
  }
}

/* ===== RESPONSIVE: スマホ (767px以下) テキスト省略 ===== */
@media (max-width: 767px) {
  .action-buttons-block {
    grid-template-columns: 1fr;
  }

  .action-btn {
    width: 100%;
  }

  .store-name-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .store-address-v2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ===== AUTOCOMPLETE DROPDOWN ===== */
.search-form {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  transition: background 0.15s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: #f0f7ff;
}

.autocomplete-item .station-name {
  font-weight: 600;
  color: #333;
}

.autocomplete-item .station-detail {
  font-size: 12px;
  color: #888;
  margin-top: 1px;
}

.autocomplete-loading {
  padding: 8px 10px;
  color: #888;
  font-size: 13px;
}
