/* ================================================
   Reset & Base Styles
   ================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background-color: #e8e8e8;
  color: #111827;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  background-color: #FFFFFF;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ================================================
   Header
   ================================================ */
.header {
  background-color: #FFFFFF;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
}

.header-logo {
  display: block;
}

.header-logo img {
  height: 24px;
  width: auto;
}

/* ================================================
   Hero Section
   ================================================ */
.hero {
  width: 100%;
  overflow: hidden;
  position: relative;
  background-color: #f3f4f6;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* ================================================
   Loading & Error States
   ================================================ */
.loading-container,
.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 32px 16px;
}

.loading-content,
.error-content {
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 4px solid #ff6b6b;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  color: #6B7280;
}

.error-text {
  font-size: 14px;
  color: #DC2626;
  margin-bottom: 12px;
}

.retry-button {
  padding: 8px 16px;
  background-color: #ff6b6b;
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

.retry-button:hover {
  background-color: #e85555;
}

/* ================================================
   Catalog Section
   ================================================ */
.section-catalog {
  padding: 32px 0;
  background-color: #FFFCF4;
}

.container {
  padding: 0 16px;
  margin: 0 auto;
  max-width: 1280px;
}

.section-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 13px;
  color: #4B5563;
  line-height: 1.8;
  text-align: justify;
  margin-bottom: 24px;
}

/* ================================================
   Sticky Filter Wrap（エリア・滞在時間・ジャンルタブをヘッダー直下に固定）
   ================================================ */
.sticky-filter-wrap {
  position: sticky;
  top: 49px; /* .header の高さに合わせる */
  z-index: 90;
  background-color: #FFFCF4;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* ================================================
   Filter Bar（エリア）
   ================================================ */
.filter-bar {
  position: relative;
  margin-bottom: 10px;
}

.filter-scroll {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid #E5E7EB;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
}

.filter-btn:not(.active) {
  background-color: #FFFFFF;
  color: #9CA3AF;
  border-color: #E5E7EB;
}

.filter-btn:not(.active):hover {
  border-color: #F0578F;
}

.filter-btn.active {
  background-color: #F0578F;
  color: #FFFFFF;
  border-color: #F0578F;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-btn::after {
  content: '▾';
  display: inline-block;
  margin-left: 4px;
  font-size: 8px;
  transition: transform 0.2s;
  vertical-align: middle;
}

.filter-btn.open::after {
  transform: rotate(180deg);
}

.filter-btn.no-dropdown::after {
  content: none;
}

/* ================================================
   Prefecture Filter Bar（エリアタブ配下の都道府県）
   ※ 参考LPのネイティブ<select>が開いた時の見た目
     （クリーム色の角丸ボックスに縦積みリスト）を再現
   ================================================ */
.pref-filter-bar {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 120px;
  max-width: calc(100% - 8px);
  padding: 4px;
  background-color: #FFF3F7;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  z-index: 50;
  animation: prefDrop 0.16s ease-out;
}

.pref-filter-bar:empty {
  display: none;
  padding: 0;
  box-shadow: none;
}

@keyframes prefDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pref-filter-scroll {
  display: flex;
  flex-direction: column;
}

.pref-filter-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background-color: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #333333;
  cursor: pointer;
  transition: background-color 0.15s;
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
}

.pref-filter-btn:not(.active):hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.pref-filter-btn.active {
  background-color: #F0578F;
  color: #FFFFFF;
  text-shadow: none;
}

/* ================================================
   Duration Filter Bar（滞在時間：半日〜1日／2〜3時間）
   ================================================ */
.duration-filter-bar {
  margin-bottom: 8px;
}

.duration-filter-scroll {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.duration-filter-scroll::-webkit-scrollbar {
  display: none;
}

.duration-filter-btn {
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid #E5E7EB;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  background-color: #FFFFFF;
  color: #9CA3AF;
}

.duration-filter-btn:not(.active):hover {
  border-color: #F5A83D;
}

.duration-filter-btn.active {
  background-color: #F5A83D;
  color: #FFFFFF;
  border-color: #F5A83D;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ================================================
   Genre Filter Bar（ジャンル）
   ================================================ */
.genre-filter-bar {
  margin-bottom: 0;
}

.genre-filter-scroll {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.genre-filter-scroll::-webkit-scrollbar {
  display: none;
}

.genre-filter-btn {
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid #E5E7EB;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  background-color: #FFFFFF;
  color: #9CA3AF;
}

.genre-filter-btn:not(.active):hover {
  border-color: #1D9A93;
}

.genre-filter-btn.active {
  background-color: #1D9A93;
  color: #FFFFFF;
  border-color: #1D9A93;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ================================================
   Product Grid & Cards
   ================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background-color: #FFFFFF;
  border: 1px solid #EBEBEC;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s;
  cursor: pointer;
  height: 100%;
}

.product-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  /* 画像が未設定・読み込み前でも枠が崩れないよう、下地を敷いておく */
  background-color: #EFEFF1;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loc-chip {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(17, 24, 39, 0.6);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 8px 3px;
  border-radius: 999px;
  z-index: 2;
  line-height: 1.4;
}

.loc-chip svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  position: relative;
  top: 0.5px;
}

.incentive-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #F44336;
  border: 1px solid #F44336;
  line-height: 1.5;
  margin-right: auto;
}

.product-card-content {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pc-desc {
  font-size: 11px;
  line-height: 1.4;
  font-weight: 500;
  color: #333333;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-hash-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 8px;
}

.tag-hash {
  font-size: 10px;
  font-weight: 700;
  color: #6FBE44;
  line-height: 1.4;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  font-size: 13px;
  color: #6B7280;
}

/* ================================================
   Footer
   ================================================ */
.footer {
  background-color: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  padding: 24px 16px;
}

.footer-content {
  text-align: center;
}

.footer-content p {
  font-size: 12px;
  color: #6B7280;
}

/* ================================================
   Responsive Adjustments
   ================================================ */


/* 画面には出さないが、検索エンジン・スクリーンリーダーには読ませる見出し。
   KVの画像に書かれている文言と同じものを h1 として置くために使う。 */
.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;
}

/* 絞り込みセクションの見出し。「全国どこでも使える」と同じ大きさに揃える */
.section-title {
  font-size: 18px; font-weight: 800; color: #111827; margin: 0 0 2px;
}

/* ===== 全国どこでも使える（カルーセル） =====
   挙動は温泉LPの .rail に合わせる（CSSのscroll-snapだけ、JSは使わない）。
   カードは既存の .product-card をそのまま入れるので見た目は一覧と揃う。
   PCでも横並びに畳まず、カルーセルのままにする。 */
.section-nationwide {
  padding: 32px 0 8px;
  background-color: #FFFCF4;   /* .section-catalog と同じ */
}
.nationwide-title {
  font-size: 18px; font-weight: 800; color: #111827; margin: 0 0 2px;
}
.nationwide-desc {
  font-size: 12px; color: #6b7280; margin: 0 0 12px; line-height: 1.6;
}

/* 左は本文と同じ位置から始め、右は画面端まで流して「次がある」ことを見せる。
   コンテナの横余白ぶんだけ右へ食い込ませ、左は食い込ませない。 */
.nationwide-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 86%;
  gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  margin-right: -16px; padding-right: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nationwide-rail::-webkit-scrollbar { display: none; }
.nationwide-rail > * { scroll-snap-align: start; }
.nationwide-rail .product-card { height: 100%; }

/* 全国枠の画像バッジ。位置チップ（📍東京・銀座）の代わりに出す */
.badge-nationwide {
  position: absolute; left: 6px; bottom: 6px;
  display: inline-flex; align-items: center;
  background: rgba(17, 24, 39, .72); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1.5;
  padding: 3px 9px; border-radius: 999px; letter-spacing: .04em;
}



/* ===== TOPへ戻る =====
   最初は出さず、1画面ぶんスクロールしたら現れる。
   LPは #app-wrapper で最大480pxに収まるので、その右端に合わせて置く。 */
.to-top {
  position: fixed;
  right: calc(50% - 240px + 16px);   /* app-wrapper(480px)の右端から16px内側 */
  bottom: 20px;
  z-index: 50;
  width: 48px; height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  border: 0; border-radius: 50%;
  background: rgba(17, 24, 39, .82);
  color: #fff; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  /* 出入りはふわっと。出ていないときはクリックも拾わない */
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  -webkit-tap-highlight-color: transparent;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: rgba(17, 24, 39, .92); }
.to-top-arrow { font-size: 14px; line-height: 1; margin-top: -4px; }
.to-top-text { font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: 0; }

/* 画面が480pxより狭いときは、単純に右端から16px */
@media (max-width: 480px) {
  .to-top { right: 16px; }
}

/* ===== カードの価格欄 =====
   元値と価格は必ず右寄せで横並びにする（1行に3つ並べて折り返すと、価格の桁数で価格だけが下に落ちていた）。
   PC: 割引率・元値・価格を横一列。入りきらないときは割引率だけが上の段に左寄せで回る
   SP: 割引率はいつも上の段に左寄せ（スキー特集のカードと同じ配置）
   全国枠の映画カードは幅が広いので、PC・SPとも横一列 */
.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: auto;
}
.price-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-left: auto;
  white-space: nowrap;
}
.price-main.is-text { white-space: normal; }

@media (max-width: 480px) {
  .product-grid .price-badge { flex-basis: 100%; }
}
