/* 介護施設検索セクション */
.store-search {
  padding: 4rem 0;
  background: #a4c3b2;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.store-search::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* 検索セクション */
.search-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2.5rem;
  margin: 2rem 0;
  border-radius: 20px;
  box-shadow:
    0 8px 32px rgba(107, 144, 128, 0.12),
    0 2px 8px rgba(107, 144, 128, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 1;
}

.search-form {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.search-group {
  position: relative;
}

.search-label {
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #2C3E3A;
  font-size: 0.9rem;
  display: block;
  letter-spacing: 0.3px;
}

.search-input,
.search-select {
  padding: 1rem 1.25rem;
  border: 2px solid rgba(107, 144, 128, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.8);
  color: #2C3E3A;
  width: 100%;
  box-sizing: border-box;
}

.search-input:focus,
.search-select:focus {
  outline: none;
  border-color: #6B9080;
  background: #FFFFFF;
  box-shadow: 
    0 0 0 4px rgba(107, 144, 128, 0.1),
    0 4px 12px rgba(107, 144, 128, 0.15);
  transform: translateY(-2px);
}

.search-button {
  padding: 1rem 2rem;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, #6B9080 0%, #567568 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(107, 144, 128, 0.3);
  position: relative;
  overflow: hidden;
}

.search-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.search-button:hover::before {
  width: 300px;
  height: 300px;
}

.search-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(107, 144, 128, 0.4);
}

.search-button:active {
  transform: translateY(-1px);
}

.search-button.secondary {
  background: rgba(255, 255, 255, 0.9);
  color: #6B9080;
  border: 2px solid #6B9080;
  box-shadow: 0 2px 8px rgba(107, 144, 128, 0.15);
}

.search-button.secondary:hover {
  background: #6B9080;
  color: #FFFFFF;
  border: 2px solid #6B9080;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(107, 144, 128, 0.4);
}

/* 左右分割レイアウト */
.search-map-layout {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  min-height: 600px;
}

/* 左側：地図エリア */
.map-section-left {
  flex: 1;
  min-height: 600px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  box-shadow: 
    0 8px 32px rgba(107, 144, 128, 0.15),
    0 2px 8px rgba(107, 144, 128, 0.1);
  overflow: hidden;
}

/* 実際の地図用スタイル */
.real-map {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
}

/* Google Maps用スタイル */
.gm-style {
  font-family: inherit !important;
}

.gm-style-iw {
  font-family: inherit !important;
}

/* Google Maps コントロールの位置調整 */
.gm-bundled-control {
  margin: 10px !important;
}

/* 地図ポップアップのスタイル */
.map-popup .popup-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #2C3E3A;
  font-weight: 600;
}

.map-popup p {
  margin: 4px 0;
  font-size: 14px;
  color: #5A6B67;
}

.map-popup p img {
  width: 14px;
}

.map-popup strong {
  color: #6B9080;
}

/* 現在位置ポップアップのスタイル */
.current-location-popup .popup-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #6B9080;
  font-weight: 600;
}

.current-location-popup p {
  margin: 4px 0;
  font-size: 14px;
  color: #5A6B67;
}

/* 右側：検索結果エリア */
.store-results-right {
  flex: 1;
  min-height: 600px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 8px 32px rgba(107, 144, 128, 0.15),
    0 2px 8px rgba(107, 144, 128, 0.1);
  overflow: hidden;
}

.results-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(107, 144, 128, 0.1) 0%, rgba(164, 195, 178, 0.1) 100%);
  border-bottom: 1px solid rgba(107, 144, 128, 0.15);
  border-radius: 20px 20px 0 0;
  position: relative;
}

.results-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(107, 144, 128, 0.3), transparent);
}

.results-header .results-title {
  margin: 0;
  font-size: 1.25rem;
  color: #2C3E3A;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.results-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  max-height: calc(600px - 60px);
}

/* スクロールバーのスタイル */
.results-scroll-container::-webkit-scrollbar {
  width: 8px;
}

.results-scroll-container::-webkit-scrollbar-track {
  background: #F6F1E9;
  border-radius: 4px;
}

.results-scroll-container::-webkit-scrollbar-thumb {
  background: #A4C3B2;
  border-radius: 4px;
}

.results-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #6B9080;
}

.no-results {
  text-align: center;
  color: #5A6B67;
  font-style: italic;
  padding: 2rem;
}

/* store-card */
.store-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: 
    0 4px 20px rgba(107, 144, 128, 0.12),
    0 1px 4px rgba(107, 144, 128, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin-bottom: 1.25rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.store-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6B9080, #A4C3B2, #6B9080);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.store-card:hover::before {
  transform: scaleX(1);
}

.store-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 
    0 12px 40px rgba(107, 144, 128, 0.2),
    0 4px 12px rgba(107, 144, 128, 0.15);
  border-color: rgba(107, 144, 128, 0.3);
}

.store-card-main {
  padding: 1.75rem;
  position: relative;
  z-index: 1;
}

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.store-title-section {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.store-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2C3E3A;
  margin: 0;
  line-height: 1.4;
  letter-spacing: -0.3px;
}

.store-carrier {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #6B9080 0%, #567568 100%);
  color: #FFFFFF;
  border-radius: 25px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(107, 144, 128, 0.25);
  transition: all 0.3s ease;
}

.store-card:hover .store-carrier {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(107, 144, 128, 0.35);
}

/* 施設種別別カラー */
.carrier-特別養護老人ホーム {
  background-color: #6B9080 !important;
  color: #FFFFFF !important;
}

.carrier-デイサービス {
  background-color: #A4C3B2 !important;
  color: #FFFFFF !important;
}

.carrier-介護老人保健施設 {
  background-color: #567568 !important;
  color: #FFFFFF !important;
}

.store-distance-badge {
  text-align: center;
  background: #6B9080;
  color: #FFFFFF;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  min-width: 60px;
  margin-left: 5px;
}

.distance-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.distance-unit {
  display: block;
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 2px;
}

.store-details {
  margin-bottom: 1.25rem;
}

.store-info-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.store-info-row:last-child {
  margin-bottom: 0;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.info-icon {
  font-size: 1.125rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* グリーン系のアイコン（住所、電話、営業時間） */
.info-icon img {
  filter: brightness(0) saturate(100%) invert(45%) sepia(15%) saturate(1200%) hue-rotate(120deg) brightness(95%) contrast(85%);
  /* #6B9080に近いグリーン系の色に変換 */
}

.info-text {
  color: #5A6B67;
  font-size: 0.9375rem;
  line-height: 1.4;
  word-break: break-word;
}

.store-actions {
  background: linear-gradient(135deg, rgba(246, 241, 233, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.25rem 1.75rem;
  display: flex;
  gap: 0.75rem;
  border-top: 1px solid rgba(107, 144, 128, 0.15);
  position: relative;
}

.store-actions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(107, 144, 128, 0.2), transparent);
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-map {
  background: linear-gradient(135deg, #6B9080 0%, #567568 100%);
  color: #FFFFFF;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(107, 144, 128, 0.25);
}

.btn-map::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.btn-map:hover::before {
  width: 200px;
  height: 200px;
}

.btn-map:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(107, 144, 128, 0.35);
}

.btn-route {
  background: rgba(255, 255, 255, 0.9);
  color: #6B9080;
  border: 2px solid #6B9080;
  box-shadow: 0 2px 8px rgba(107, 144, 128, 0.15);
}

.btn-route:hover {
  background: linear-gradient(135deg, #6B9080 0%, #567568 100%);
  color: #FFFFFF;
  border: 2px solid transparent;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(107, 144, 128, 0.35);
}

.btn-icon {
  font-size: 1.125rem;
  width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ボタンアイコンは文字色に合わせる */
.btn-icon img {
  filter: brightness(0) saturate(100%);
  /* 文字色に合わせるため、currentColorを使用 */
  opacity: 1;
}

/* ボタンの文字色に合わせてアイコンを変更 */
.btn-map .btn-icon img {
  filter: brightness(0) invert(1);
  /* 白文字に合わせる */
}

.btn-route .btn-icon img {
  filter: brightness(0) saturate(100%) invert(45%) sepia(15%) saturate(1200%) hue-rotate(120deg) brightness(95%) contrast(85%);
  /* グリーン系の文字色に合わせる */
}

.btn-route:hover .btn-icon img {
  filter: brightness(0) invert(1);
  /* ホバー時は白文字に合わせる */
}

.btn-text {
  font-weight: 600;
}

/* ローディングアニメーション */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(107, 144, 128, 0.2);
  border-top: 4px solid #6B9080;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* スクリーンリーダー専用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 共通要素 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}


/* レスポンシブ対応 */
@media (min-width: 481px) {
  .search-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  .search-label {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0;
    color: #2C3E3A;
    min-width: 90px;
  }
  .search-input,
  .search-select {
    font-size: 1.05rem;
    height: 44px;
    padding: 0.5rem 1rem;
    width: auto;
    min-width: 160px;
  }
  .search-button {
    font-size: 1.1rem;
    height: 44px;
    padding: 0 2rem;
    margin-top: 0;
    white-space: nowrap;
  }
}

@media (max-width: 1023px) {
  .map-section-left {
    min-height: 400px;
    border-radius: 10px;
    padding: 0.5rem;
  }
  .store-results-right {
    border-radius: 10px;
    padding: 0.5rem;
  }
  .store-card {
    border-radius: 12px;
    margin-bottom: 0.75rem;
    padding: 1rem;
  }
  .store-name {
    font-size: 1.1rem;
  }
  .store-carrier {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
  }
  .search-select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.5rem 1.5rem 0.5rem 0.7rem;
    font-size: 1rem;
    appearance: none;
    background-position: right 0.7rem center;
    background-repeat: no-repeat;
    background-size: 1.2em;
  }
  /* 検索フォームを縦並び・スマホと同じデザインに */
  .search-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  .search-label {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    font-weight: bold;
    color: #2C3E3A;
  }
  .search-input,
  .search-select {
    width: 100%;
    font-size: 1rem;
    padding: 0.7rem;
    min-width: 0;
    box-sizing: border-box;
  }
  .search-button {
    width: 100%;
    font-size: 1.05rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
  }
  /* 検索結果カードデザイン調整 */
  .store-list-sp .store-card,
  .store-list-tab .store-card {
    border-radius: 10px;
    margin-bottom: 0.75rem;
    padding: 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  .store-list-sp .store-header,
  .store-list-tab .store-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .store-list-sp .store-title-section,
  .store-list-tab .store-title-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .store-list-sp .store-distance-badge,
  .store-list-tab .store-distance-badge {
    align-self: flex-end;
    margin-top: 0.5rem;
    margin-bottom: 0;
    min-width: 60px;
    position: static;
  }
  .store-list-sp .store-name,
  .store-list-tab .store-name {
    font-size: 1.05rem;
  }
  .store-list-sp .store-carrier,
  .store-list-tab .store-carrier {
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
  }
  .store-list-sp .store-actions,
  .store-list-tab .store-actions {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
  }
  .store-list-sp .btn-action,
  .store-list-tab .btn-action {
    font-size: 0.95rem;
    padding: 0.5rem 0.5rem;
    border-radius: 8px;
  }
  .store-list-sp .store-info-row,
  .store-list-tab .store-info-row {
    flex-direction: column;
    gap: 0.2rem;
  }
  .store-list-sp .info-item,
  .store-list-tab .info-item {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .search-map-layout {
    flex-direction: column;
    gap: 1.5rem;
  }
  .map-section-left,
  .store-results-right {
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  .map-section-left {
    margin-bottom: 1.5rem;
  }
  .map-section-left, #realMap {
    min-height: 400px !important;
    height: 400px !important;
    display: block !important;
  }
  .search-section {
    padding: 1rem 0.5rem;
  }
  .search-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .search-label {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    font-weight: bold;
    color: #2C3E3A;
  }
  .search-input,
  .search-select {
    width: 100%;
    font-size: 1rem;
    padding: 0.7rem;
    min-width: 0;
    box-sizing: border-box;
  }
  .search-button {
    width: 100%;
    font-size: 1.05rem;
    padding: 0.9rem 0;
    margin-top: 0.5rem;
  }
  .map-section-left {
    min-height: 400px;
    border-radius: 8px;
    padding: 0.25rem;
  }
  .store-results-right {
    border-radius: 8px;
    padding: 0.25rem;
  }
  .store-card {
    border-radius: 8px;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
  }
  .store-name {
    font-size: 1rem;
  }
  .store-carrier {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
  .store-actions {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
  }
  .btn-action {
    font-size: 0.85rem;
    padding: 0.5rem 0.5rem;
    border-radius: 8px;
  }
}

