/* =========================
   1. 変数
========================= */
/* ヘッダーの文したに下げている */
:root {
  --header-height: 60px; /* 60 + ナビ分 */
  --main-color: #fc9637;
  --background-color: #FFF4EC;
  --black: #333;
  --page-side-padding-desktop: 24px;
  --page-side-padding-mobile: 12px;
  --page-margin-desktop: 28px 0 64px;
  --page-margin-mobile: 12px 0 56px;
}

/* =========================
   2. リセット / ベース
========================= */
html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--background-color);
  padding-top: var(--header-height);
  padding-left: var(--page-side-padding-desktop) !important;
  padding-right: var(--page-side-padding-desktop) !important;
  padding-bottom: 0;
  margin: 0;
  box-sizing: border-box;
}

@media (hover: none) {
  body {
    padding-top: var(--header-height);
    padding-left: var(--page-side-padding-mobile) !important;
    padding-right: var(--page-side-padding-mobile) !important;
    padding-bottom: 0;
  }
}

h2 {
  margin-bottom: 10px;
}

/* =========================
   管理画面プレースホルダー共通
========================= */
.page-shell {
  width: 100%;
  margin: var(--page-margin-desktop);
  box-sizing: border-box;
}

.page-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  padding: 28px;
  box-sizing: border-box;
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.page-title-row h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  color: #111827;
}

.page-eyebrow {
  margin: 0 0 6px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-content {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.8;
}

@media (max-width: 640px) {
  .page-shell {
    margin: var(--page-margin-mobile);
  }

  .page-card {
    border-radius: 16px;
    padding: 16px;
  }

  .page-title-row h1 {
    font-size: 22px;
  }
}

/* =========================
   共通コンポーネント
========================= */

.app-back-link,
.app-back-link.page-link,
.app-back-link.back-link,
.app-back-link.dashboard-back-link,
.app-back-link.contact-back-link,
.app-back-link.information-back-link {
  display: inline !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #2563eb !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.app-back-link:hover,
.app-back-link.page-link:hover,
.app-back-link.back-link:hover,
.app-back-link.dashboard-back-link:hover,
.app-back-link.contact-back-link:hover,
.app-back-link.information-back-link:hover {
  background: transparent !important;
  box-shadow: none !important;
  color: #1d4ed8 !important;
  text-decoration: underline !important;
}

.app-back-link:active {
  transform: none !important;
}

/* ダッシュボードへ戻るは共通で青リンク表示に統一 */
.dashboard-back-link.app-back-link {
  display: inline !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #2563eb !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.dashboard-back-link.app-back-link:hover {
  background: transparent !important;
  box-shadow: none !important;
  color: #1d4ed8 !important;
  text-decoration: underline !important;
}

.dashboard-back-link.app-back-link:active {
  transform: none !important;
}

/* 戻るリンクはヘッダー右上に統一し、左側の見出し先頭(管理画面ラベル行)と高さを合わせる */
.page-title-row,
.store-list-header,
.review-page-header,
.information-header,
.contact-page-header {
  align-items: flex-start !important;
}

.page-title-row > .app-back-link,
.store-list-header > .app-back-link,
.review-page-header > .app-back-link,
.information-header > .app-back-link,
.contact-page-header > .app-back-link,
.page-actions > .app-back-link {
  margin-left: auto !important;
  align-self: flex-start !important;
  white-space: nowrap;
}

.app-primary-button,
.app-primary-button.button,
.app-primary-button.action-button,
.app-primary-button.modal-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 50px !important;
  padding: 0 18px !important;
  border: none !important;
  border-radius: 12px !important;
  background: #fb923c !important;
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: none !important;
}

.app-secondary-button,
.app-secondary-button.action-button,
.app-secondary-button.modal-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 50px !important;
  padding: 0 18px !important;
  border: none !important;
  border-radius: 12px !important;
  background: #e5e7eb !important;
  color: #111827 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

.app-danger-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 50px !important;
  padding: 0 18px !important;
  border: none !important;
  border-radius: 12px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: none !important;
}

.app-primary-button:hover,
.app-secondary-button:hover,
.app-danger-button:hover {
  opacity: 0.92;
}

.app-primary-button:active,
.app-secondary-button:active,
.app-danger-button:active {
  transform: scale(0.98);
}

@media (hover: none) {
  .app-back-link,
  .app-back-link.page-link,
  .app-back-link.back-link,
  .app-back-link.dashboard-back-link,
  .app-back-link.contact-back-link,
  .app-back-link.information-back-link {
    min-height: 42px;
    padding: 0 14px;
    font-size: 13px;
  }

  .app-primary-button,
  .app-secondary-button,
  .app-danger-button,
  .app-primary-button.button,
  .app-primary-button.action-button,
  .app-primary-button.modal-button,
  .app-secondary-button.action-button,
  .app-secondary-button.modal-button {
    min-height: 48px;
    font-size: 15px;
  }
}

/* =========================
   3. レイアウト
========================= */
.search-page.container {
  width: 1200px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.form-group {
  margin-bottom: 15px;
  clear: both;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* 入力系すべて統一 */
.form-group input,
.form-group select {
  height: 36px;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box; /* ←重要 */
}

@media (hover: none) {
  .form-group input,
  .form-group select {
    height: 36px;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* ←重要 */
  }
}

/* 幅を揃える（基本） */
.form-group input[type="text"],
.form-group select {
  width: 200px;
}

/* 数値入力は小さく */
#minPrice,
#maxPrice {
  width: clamp(90px, 10vw, 15vh);
}

#radius {
  width: clamp(50px, 5vw, 8vh);
}

@media (hover: none) {
  #minPrice,
  #maxPrice {
    width: clamp(90px, 15vw, 180px);
  }

  #radius {
    width: clamp(50px, 5vw, 8vh);
  }
}

/* ボタン高さも合わせる */
.form-group button {
  height: 36px;
  padding: 0 12px;
}

/* 右寄せ */
#minPrice,
#maxPrice,
#radius {
  text-align: right;
}

/* ~の位置 */
.price-separator {
  display: flex;
  align-items: center;
  justify-content: center; /* 横も中央 */
  height: 36px;
  padding: 0 4px;          /* 少し余白 */
  font-size: 18px;
}

/* =========================
   ページラベル
========================= */

.page-label {
  margin:
    48px 24px 18px;
  font-size: 24px;
  color: #3b3b3b;
}

@media (hover: none) {

  .page-label {
    margin:
      82px 16px 14px;
  }

}

/* =========================
   4. ヘッダー
========================= */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(0);
  transition: transform 0.35s ease-in-out;
  will-change: transform; /* パフォーマンス改善 */
  background-color: var(--background-color);
  z-index: 9999;
}

.app-header.hide {
  transform: translateY(-100%);
}

.header-top {
  height: clamp(60px, 15vh, 60px);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;              /* ★これ追加 */
  align-items: center;        /* 縦中央 */
  justify-content: flex-start;
  width: 100%;
  max-width: 1200px;
  padding-left: 2%;
}

/* ロゴ画像 */
.header-inner img {
  height: 100%;
  max-height: 55px; /* header-topと合わせる */
  object-fit: contain;
  z-index: 1;
}

@media (hover: none) {
  .header-inner img {
    height: 100%;
    max-height: 35px; /* header-topと合わせる */
    object-fit: contain;
  }
}

.logo {
  font-size: 20px;
  font-weight: bold;
}

/* header下のバー */
.header-nav {
  display: flex;
  justify-content: left;
  background-color: var(--main-color);
}

.header-nav a {
  padding: 10px 20px;
  color: white;
  text-decoration: none;
}

.header-nav a:hover {
  background-color: var(--main-color);
}

@media (hover: none) {
  .app-header {
    box-shadow: 0 3px 5px var(--main-color)
  }
}

/* =========================
    5. 検索UI
========================= */
.search-bar {
  display: flex;
  align-items: center;
  width: 100vw;
  height: 42px;
  border: 1px solid #ddd;
  border-radius: 999px;
  overflow: visible;
  background: white;
  margin-left: 3%; /* 右寄せ */
}

@media (hover: none) {

  .header-inner {
    position: relative;
  }

  .search-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    height: 34px;
    width: 60vw;
    z-index: 2000;
  }

  /* ボタンは縮ませない */
  #searchCondition,
  #searchBtn {
    flex-shrink: 0;
    width: 10vw;
    height: 100%;
    padding: 0 10px;
    font-size: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  /* inputだけ可変 */
  .search-bar #freeword {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
    font-size: 12px;
  }
}

/* 条件ボタン */
#searchCondition {
  height: 100%;
  padding: 0 16px;
  border: none;
  background: #585858;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 999px 0 0 999px;
}
/* 条件タブ */
.condition-area {
  position: relative;
}

.condition-tab {
  display: none;
  position: absolute;
  top: 60px;
  width: 70%;
  height: clamp(60vh, 80vh, 80vh);
  overflow-y: auto;
  padding: 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overscroll-behavior: contain;
  z-index: 3000;
}

@media (hover: none) {

  .condition-tab {
    display: none;
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-53%);
    height: clamp(60vh, 70vh, 80vh);
    width: 85vw;
    padding: 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow-y: auto;
    z-index: 3000;
  }
}

.condition-tab.show {
  display: block;
}

/* 価格文字列表示 */
.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-label {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
  top: 4px;
}

/* 価格入力 */
.price-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

/* フリーワード */
.search-bar #freeword {
  flex: 1;
  height: 100%;
  padding: 0 14px;
  border: none;
  outline: none;
  font-size: 14px;
}

/* 検索ボタン */
.search-bar #searchBtn {
  height: 100%;
  padding: 0 20px;
  border: none;
  background: var(--main-color);
  color: white;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0 999px 999px 0;
}

/* =========================
   5. フッター
========================= */
.app-footer {
  width: 100%;
  height: 20px;
  background-color: var(--main-color);
  color: white;
  display: flex;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 9999;
}

.footer-inner {
  width: 100%;
  text-align: center;
}

.copyright {
  margin: 0;
  font-size: 14px;
}

@media (hover: none) {
  .app-footer {
    height: 40px;
  }
}

/* =========================
   スマホフッターナビ
========================= */

.footer-inner.sp-nav {
  display: none;
}

.footer-inner.sp-nav a {
  flex: 1;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* アイコン画像 */
.footer-inner.sp-nav img {
  width: 0px;
  height: 0px;
  object-fit: contain;
  display: none;
}

@media (hover: none) {
  .footer-inner.sp-nav {
    display: flex;
  }
  /* アイコン画像 */
  .footer-inner.sp-nav img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
  }
}

/* =========================
   6. 検索UI
========================= */
.search-box {
  margin-bottom: 20px;
}

input {
  margin-right: 10px;
  padding: 5px;
}

button {
  padding: 6px 12px;
  cursor: pointer;
  background-color: #ff9900;
  border: none;
  color: white;
  border-radius: 4px;
}

/* =========================
   7. カードUI
========================= */
.card {
  background: white;
  border-radius: 8px;
  padding: 10px;
  transition: transform 0.2s;
}

.card-erea {
  margin-bottom: 100px;
}

.card:hover {
  transform: scale(1.03);
}

.card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  border-radius: 6px;
  background: #f5f5f5;
}

.card-body {
  padding: 5px;
}

.item-name {
  font-size: 14px;
  margin: 5px 0;
}

.price {
  color: #b12704;
  font-weight: bold;
}

.review {
  font-size: 12px;
  color: #555;
}

.stock {
  font-size: 12px;
  color: green;
}

.address {
  font-size: 11px;
  color: #777;
}

/* =========================
   8. レスポンシブ
========================= */
@media (hover: none) {
  .container {
    width: 100%;
  }
}

/* =========================
   ナビ共通
========================= */
.pc-nav a,
.sp-nav a {
  color: white;
  text-decoration: none;
  font-size: 14px;
}

/* =========================
   PCナビ
========================= */
.pc-nav {
  margin-left: auto;
}

.pc-nav a {
  margin-left: 20px;
}

/* =========================
   スマホナビ
========================= */
.sp-nav {
  display: none;
}

/* =========================
   スマホ時の切り替え
========================= */
@media (hover: none) {

  /* ヘッダー高さ調整 */
  :root {
    --header-height: 80px;
  }

  /* PCナビ非表示 */
  .pc-nav {
    display: none;
  }

  /* ヘッダー下ナビ非表示 */
  .header-nav {
    display: none;
  }

  /* スマホナビ表示 */
  .sp-nav {
    display: flex;
    justify-content: space-around;
    width: 100%;
  }

  .sp-nav a {
    flex: 1;
    text-align: center;
    padding: 10px 0;
  }
}

/* =========================
   トグルスイッチ
========================= */
/* スイッチ全体 */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

/* チェックボックスを隠す */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* 背景 */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 34px;
}

/* 丸 */
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

/* ON時 */
.switch input:checked + .slider {
  background-color: #4CAF50;
}

/* 丸が右へ */
.switch input:checked + .slider:before {
  transform: translateX(24px);
}

/* スマホ */
@media (hover: none) {
  #areaGroup {
    flex-direction: column;   /* ★縦並び */
    align-items: stretch;     /* ★横幅いっぱい */
  }

  #areaGroup input {
    width: 100%;              /* ★横幅100% */
  }

  #areaGroup button {
    width: 60%;              /* ★横幅100% */
    align-self: center;   /* ← 中央配置（重要） */
  }
}

/* =========================
   サブカテゴリー
========================= */
#subCategoryContainer {
  display: flex;
  flex-direction: column;
  gap: 0px; /* ★完全に隙間なし */
  margin-bottom: 20px;
  overflow: hidden;
  max-height: 0;           /* 初期は閉じる */
  opacity: 0;
  transform: translateY(-10px);
  transition: 
    max-height 0.4s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

#subCategoryContainer .form-group {
  margin: 0;           /* ★余白リセット */
  padding: 4px;       /* 内側だけ余白にする */
  background: #ffffff; /* 見やすく */
}

/* 表示状態 */
#subCategoryContainer.open {
  max-height: 1000px; /* ★十分大きい値 */
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   価格スライダー
========================= */
/* ラッパー */ 
.slider-wrapper {
  position: relative; 
  width: clamp(240px, 20vw, 290px);
  height: 30px; 
  left: 2%;
} 

@media (hover: none) {
  .slider-wrapper {
    position: relative; 
    width: clamp(150px, 70vw, 90%);
    height: 30px; 
    left: 2%;
  } 
} 

/* range本体 */ 
.slider-wrapper input[type="range"] {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110%;
  height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

/* トラック削除（1回でOK） */ 
.slider-wrapper input[type="range"]::-webkit-slider-runnable-track { 
  background: transparent; border: none; 
} 

.slider-wrapper input[type="range"]::-moz-range-track {
  background: transparent; border: none; 
} 

/* つまみ */
.slider-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff9900;
  border: 3px solid #ffd089;
  margin-top: -4px;
}

#minRange::-webkit-slider-thumb { margin-left: -4px; } 
#maxRange::-webkit-slider-thumb { margin-left: 4px; } 

.slider-wrapper input[type="range"]::-moz-range-thumb { 
  pointer-events: auto;
  cursor: pointer; 
  width: 24px;
  height: 24px; 
  border-radius: 50%;
  background: #ff9900; 
} 

/* フォーカス削除 */ 
.slider-wrapper input[type="range"]:focus { 
  outline: none; 
} 
.slider-wrapper input[type="range"]::-moz-focus-outer {
  border: 0; 
} 

/* ========================= 自作ライン ========================= */ 
/* ベース線 */ 
.slider-track { 
  position: absolute;
  top: 50%; 
  left: 0;
  width: 100%;
  height: 4px; 
  background: #ddd; 
  transform: translateY(-50%);
  border-radius: 2px; 
} 

/* 範囲 */ 
.slider-range { 
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px; 
  background: #ff9900; 
  transform: translateY(-50%);
  border-radius: 2px; 
}

.price-inputs input {
  width: 140px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.price-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px; /* 要素間の間隔 */
}

/* 結果表示エリア */
#resultGrid {
  /* margin-top: 120px; */
  margin-bottom: 60px;
}

/* 半径入力 */
@media (hover: none) {

  #radiusGroup {
    flex-direction: column;
    align-items: flex-start;
  }

  #radiusGroup .input-unit {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #radiusGroup input {
    width: 80px;
  }

}

/* =========================
   レビュー数★表示 
========================= */
.star-rating {
  position: relative;
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

.star-rating-base {
  color: #dcdcdc;
}

.star-rating-fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #ffb400;
}

/* 全画面共通: 装飾のシャドウを使用しない */
html body *,
html body *::before,
html body *::after {
  box-shadow: none !important;
  text-shadow: none !important;
}
