/* =========================================
   Theme Variables（色だけを集中管理）
========================================= */
:root {
  --bg: #ffffff;
  --text: #222;
  --header-border: #eee;

  --section-bg: #ffffff;
  --section-shadow: rgba(0, 0, 0, .05);

  --input-bg: #ffffff;
  --input-border: #ddd;

  --icon-bg: #f5f5f5;

  --assistant-bg: #ffffff;
  --assistant-border: #2bb7ff;
}

/* ===== Dark Mode ===== */
.dark {
  --bg: #111;
  --text: #eaeaea;
  --header-border: #444;

  --section-bg: #1a1a1a;
  --section-shadow: rgba(0, 0, 0, .4);

  --input-bg: #222;
  --input-border: #555;

  --icon-bg: #2a2a2a;

  --assistant-bg: #111;
  --assistant-border: #67c8ff;
}

/* =========================================
   SHOP PAGE
========================================= */
html, body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: "Helvetica","Arial","YuGothic",sans-serif;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

.center {
  width: 100%;
  max-width:100%;
  margin: 0 auto;
  text-align: center;
}


/* =========================================
   Layout
========================================= */
.main {
  width: 96%;
  max-width: 96%;
  margin: 0 auto;
  padding-top: 16px;
}

/* =========================================
   Title
========================================= */
h2 {
  text-align: center;
  margin-top: 24px;
  font-weight: 600;
  font-size: 20px;
  display: block;
  white-space: pre-line;
}


/* =========================================
   Buttons
========================================= */
.btn {
  margin: 25px auto;
  padding: 18px 38px;
  background: linear-gradient(#ffd85a, #ffb726);
  border-radius: 40px;
  font-weight: bold;
  font-size: 20px;
  box-shadow: 0 6px 0 #d19400;
  transition: .2s;
  position: relative;
  cursor: pointer;
  display: inline-block;
}

.btn::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 30%;
  border-radius: 30px;
  background: rgba(255,255,255,.55);
  filter: blur(2px);
}

.btn:hover { transform: scale(1.06); }
.btn:active {
  transform: scale(.97);
  box-shadow: 0 3px 0 #a87500;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.btn.pulse { animation: pulse 2.4s infinite ease-in-out; }


/* =========================================
   Arrow
========================================= */
.arrow {
  font-size: 26px;
  animation: float 1.6s infinite ease-in-out;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(8px); }
  100% { transform: translateY(0); }
}


/* =========================================
   Sections
========================================= */
.section {
  width: auto;
  background: var(--section-bg);
  margin: 18px auto;
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 0 12px var(--section-shadow);
}

.section-title {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: bold;
}


/* =========================================
   Inputs
========================================= */
input[type=file],
input[type=text] {
  width: 100%;
  max-width: 100%;
  padding: 13px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text);
  font-size: 16px;
}

input:focus {
  border-color: #66c8ff;
}


/* =========================================
   Icon Preview
========================================= */
.icon-box {
  width: 160px;
  height: 160px;
  background: var(--icon-bg);
  border-radius: 22px;
  margin: 12px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}


/* =========================================
   Guide Link
========================================= */
.guide-link {
  color: #2bb7ff;
  font-weight: bold;
  text-decoration: none;
}


/* =========================================
   Assistant Box
========================================= */
#assistantBox {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--assistant-bg);
  border-radius: 20px;
  border: 2px solid var(--assistant-border);
  padding: 12px 18px;
  box-shadow: 0 0 12px rgba(0,0,0,.1);
  font-size: 15px;
  display: none;
}

.shop-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* タイトル */
.shop-title {
  font-size: 26px;
  font-weight: bold;
  margin-bottom: 12px;
}

.shop-desc {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 28px;
  color: var(--text);
}

/* グリッド */
.shop-grid {
  display: grid;
  gap: 24px;
  justify-content: center;
  margin-top: 20px;
}

/* PC：4列 */
@media (min-width: 900px) {
  .shop-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* タブレット：3列 */
@media (min-width: 600px) and (max-width: 899px) {
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* スマホ：3列 */
@media (max-width: 599px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* =========================================
   商品カード
========================================= */

.item-card {
  background: var(--section-bg);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 14px var(--section-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity .35s ease;
  opacity: 0;
  transform: translateY(12px);
}

.item-card.show {
  opacity: 1;
  transform: translateY(0);
}

/* タップ/ホバー */
.item-card:hover,
.item-card:active {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* サムネ */
.item-thumb-box {
  position: relative;
  width: 100%;
}

.item-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
}

/* 商品名 */
.item-title {
  font-weight: 600;
  margin: 12px 0 2px;
}

/* 価格 */
.item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 8px;
}

/* 作者名 */
.item-author {
  font-size: 13px;
  color: #777;
  margin-bottom: 14px;
}

/* 購入ボタン */
.item-buy-btn {
  background: #0f9cf5;
  color: #fff;
  padding: 10px 0;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  display: block;
  font-weight: bold;
}
.fav-zone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fav-btn {
  cursor: pointer;
  font-size: 18px;
  color: #aaa;
  transition: transform 0.2s, color 0.2s;
}

.fav-btn.active {
  color: #ff4b7d;
  transform: scale(1.15);
}

.fav-count {
  font-size: 14px;
  color: #666;
}

/* =========================================
   作者アイコン（丸アイコン）
========================================= */

.author-icon {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--section-bg); /* ← フチを細めに調整 */
  object-fit: cover;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  padding: 2px;
  background: #fff;
  transition: transform .15s ease;
}

.author-icon:hover {
  transform: scale(1.1);
}

/* ダークモード用フチ */
.dark .author-icon {
  border-color: #222;
}

/* スマホ版サイズ */
@media (max-width: 599px) {
  .author-icon {
    width: 32px;
    height: 32px;
    bottom: 8px;
    right: 8px;
  }
}

/* =========================================
   タブ式ソート UI
========================================= */

.shop-tabs {
  display: flex;
  gap: 16px;
  margin: 10px 0 24px;
}

.shop-tab {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--section-bg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  transition: .15s;
}

.shop-tab:hover {
  transform: translateY(-2px);
}

.shop-tab.active {
  background: #0f9cf5;
  color: #fff;
  box-shadow: 0 3px 10px rgba(15,156,245,0.4);
}

.dark .shop-tab {
  background: #222;
}

/* =========================================
   カテゴリータブ
========================================= */
.filter-row {
  display: flex;
  gap: 12px;
  margin: 12px 0 5px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 20px;
  background: #fff;
  border-radius: 30px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: 0.2s;
}

.filter-tab:hover {
  transform: translateY(-2px);
}

.filter-tab.active {
  background: #3baeff;
  color: #fff;
  box-shadow: 0 6px 14px rgba(59,174,255,0.4);
}

/* =========================================
   モーダル
========================================= */

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.modal-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  animation: fadeIn .25s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  width: 90%;
  max-width: 420px;
  padding: 20px;
  border-radius: 20px;
  background: var(--section-bg);
  color: var(--text);
  animation: popIn .25s ease forwards;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

@keyframes popIn {
  to { transform: translate(-50%, -50%) scale(1); }
}

.modal-thumb {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 12px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text);
}

.modal-buy {
  display: block;
  margin-top: 16px;
  padding: 12px;
  background: #2bb7ff;
  color: #fff;
  font-weight: bold;
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
}

/* =========================================
   今日のおすすめ（常時2列固定）
========================================= */
.recommend-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* ← 常に2列固定 */
  gap: 16px;
  margin: 0 auto 28px;
  width: 100%;
  max-width: 600px;
  padding: 12px;
  border-radius: 18px;
  background: var(--section-bg);
  box-shadow: 0 4px 12px var(--section-shadow);
  box-sizing: border-box;
}

.recommend-item {
  background: var(--section-bg);
  border-radius: 16px;
  box-shadow: 0 3px 8px var(--section-shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  padding: 10px;
}

.recommend-item:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.recommend-thumb {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 6px;
}

.recommend-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  text-align: center;
}

.recommend-author {
  font-size: 12px;
  opacity: 0.85;
  text-align: center;
}

/* =========================================
   価格＋作者 横並び配置
========================================= */
.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 10px;
}

.item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  opacity: 0.85;
}

.item-author {
  font-size: 13px;
  color: #777;
}

.item-author .author-link {
  color: inherit;
  text-decoration: none;
}

.item-author .author-link:hover {
  text-decoration: underline;
}
/* プルダウン全体の行（横並び） */
.shop-filters {
  display: flex;
  gap: 12px;
  margin: 16px 0 28px 0;
}

/* 各セレクトを “ふわっとタブ化” */
.shop-filters select {
  appearance: none;            /* デフォルト矢印消す */
  padding: 8px 24px 8px 14px;  
  font-size: 15px;
  border-radius: 999px;        /* pill 形 */
  border: 1px solid #e5e5e5;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: 0.25s cubic-bezier(.25,.8,.25,1);
  position: relative;
}

/* 矢印の代替アイコンを疑似要素で入れる */
.shop-filters select::after {
  content: "▼";
  font-size: 10px;
  color: #666;
  position: absolute;
  right: 12px;
  pointer-events: none;
}

/* hover ふわっと */
.shop-filters select:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

/* active（選択中）っぽく青背景にしたい場合 */
.shop-filters select:focus {
  border-color: #3fa7ff;
  background: #e9f4ff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(63,167,255,0.2);
}

/* タイトル（例：他にもこんな商品があります！） */
.more-title {
  margin: 20px 0 10px;
  font-size: 18px;
  font-weight: 700;
}

/* 横スクロール本体 */
.recommend-more-scroll {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 10px 2px 20px;
  scroll-snap-type: x mandatory;
}

/* スクロールバーを消す（iPhone/AndroidでもOK） */
.recommend-more-scroll::-webkit-scrollbar {
  display: none;
}
.recommend-more-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 商品カード（小型） */
.recommend-more-item {
  flex: 0 0 140px;
  scroll-snap-align: start;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  transition: transform .15s ease;
}

.recommend-more-item:hover {
  transform: translateY(-3px);
}

/* サムネ */
.recommend-more-thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

/* タイトル */
.recommend-more-title {
  font-size: 13px;
  padding: 6px 8px 0;
  font-weight: 600;
  height: 32px;
  overflow: hidden;
}

/* 作者名 */
.recommend-more-author {
  font-size: 12px;
  padding: 0 8px 8px;
  color: #777;
}

.scroll-section {
  margin: 28px 0;
}

.scroll-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 4px;
}

.scroll-wrap {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 4px;
  scroll-snap-type: x mandatory;
}

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

.scroll-item {
  min-width: 140px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: transform 0.15s;
}

.scroll-item:active {
  transform: scale(0.95);
}

.scroll-thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.scroll-title-text {
  padding: 8px;
  font-size: 14px;
  font-weight: 600;
}
.author-icon,
.recommend-author-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
