@charset "UTF-8";

/* ===== 基本設定 ===== */
:root {
  --primary-orange: #FF6600;
  --primary-yellow: #FFCC00;
  --link-blue: #437FFF;
  --text-main: #333;
  --bg-color: #f9f9f9;
}

body {
  font-family: "MS PGothic", "Hiragino Kaku Gothic ProN", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

a {
  color: var(--link-blue);
  text-decoration: underline;
}

a:hover {
  text-decoration: none;
}

/* レイアウトコンテナ */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* ===== ヘッダー ===== */
header {
  padding: 10px 0;
  border-bottom: 2px solid #ddd;
  margin-bottom: 20px;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.logo img {
  max-height: 80px; /* ロゴ画像のサイズ調整 */
  cursor: pointer;
}

/* 検索バー周り */
.search-area {
  flex-grow: 1;
  max-width: 400px;
  display: flex;
  gap: 5px;
}

#searchInput {
  width: 100%;
  padding: 5px;
  border: 1px solid #ccc;
  /* キーワード入力欄：インナーシャドウ */
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1); 
}

#searchBtn {
  background: var(--primary-orange);
  color: #fff;
  border: none;
  padding: 5px 15px;
  font-weight: bold;
  cursor: pointer;
  /* ボタン：ドロップシャドウ */
  box-shadow: 2px 2px 3px rgba(0,0,0,0.3);
}

/* 右上メニュー */
.header-menu {
  display: flex;
  gap: 15px;
  font-size: 14px;
}
.header-menu a {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}
.icon-img {
  width: 24px;
}

/* ===== ナビゲーションタブ ===== */
.main-nav {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  background: linear-gradient(to bottom, #fff, #f0f0f0);
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  /* タブの文字：ドロップシャドウ */
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  border-right: 1px solid rgba(255,255,255,0.3);
}

.nav-orange { background: var(--primary-orange); }
.nav-yellow { background: var(--primary-yellow); color: #555; text-shadow: none; } /* 黄色は文字色調整 */

/* ===== メインコンテンツレイアウト (2カラム) ===== */
.main-content {
  display: flex;
  gap: 20px;
}

/* サイドバー */
.sidebar {
  width: 200px;
  flex-shrink: 0;
}

.category-box {
  border: 2px solid var(--primary-orange);
  margin-bottom: 20px;
  background: #fff;
}

.cat-header {
  background: var(--primary-orange);
  color: #fff;
  padding: 5px;
  font-weight: bold;
  text-align: center;
}

.cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cat-list li a {
  display: block;
  padding: 8px;
  border-bottom: 1px dotted #ccc;
  color: var(--primary-orange);
  text-decoration: none;
  font-weight: bold;
}
.cat-list li a:hover {
  background: #ffeadd;
}

.sidebar-banner {
  margin-bottom: 10px;
}
.sidebar-banner img {
  width: 100%;
  border: 1px solid #ccc;
}

/* メインエリア */
.content-area {
  flex-grow: 1;
}

/* セクション共通 */
.section-box {
  border: 2px solid var(--primary-orange);
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 20px;
}
.section-header {
  background: var(--primary-orange);
  color: #fff;
  padding: 5px 10px;
  font-weight: bold;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 10px;
  box-shadow: 2px 2px 2px rgba(0,0,0,0.2);
}

/* 商品グリッド */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.item-card {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
  background: #fff;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.item-card:hover {
  transform: translateY(-2px);
}
.item-img-placeholder {
  width: 100%;
  aspect-ratio: 1/1;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
}
.item-img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-name {
  font-weight: bold;
  color: var(--link-blue);
  text-decoration: underline;
  display: block;
}

/* フッター */
.footer-back {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  border-top: 1px solid #ccc;
}
.footer-note {
  font-size: 10px;
  color: #999;
  text-align: center;
  margin-bottom: 20px;
}

/* ===== 商品詳細ページ用 ===== */
.product-detail {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.product-images {
  flex: 1;
  min-width: 300px;
}
.main-image {
  width: 100%;
  border: 1px solid #ccc;
  margin-bottom: 10px;
}
.thumb-list {
  display: flex;
  gap: 5px;
}
.thumb-list img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid #ddd;
  cursor: pointer;
}
.thumb-list img:hover { border-color: var(--primary-orange); }

.product-info {
  flex: 1;
  min-width: 300px;
}
.product-title {
  font-size: 24px;
  border-bottom: 2px solid #ddd;
  margin-bottom: 10px;
}
.product-price {
  color: #d00;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}
.spec-table th, .spec-table td {
  border: 1px solid #999;
  padding: 5px;
}
.spec-table th { background: #eee; width: 30%; text-align: left; }

.voice-section {
  border: 2px solid var(--primary-orange);
  padding: 15px;
  margin-top: 30px;
  border-radius: 8px;
}
.voice-user { font-weight: bold; margin-bottom: 5px; }
.voice-img { max-width: 150px; margin: 10px 0; border: 1px solid #ccc; }

/* ===== フォーム関連 (Login/Signup) ===== */
.form-box {
  background: #f0f0f0;
  padding: 30px;
  max-width: 500px;
  margin: 20px auto;
  border-radius: 5px;
}
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; }
.form-group input {
  width: 100%;
  padding: 8px;
  border: 1px solid #999;
  box-sizing: border-box;
}
.btn-primary {
  background: var(--primary-orange); /* オレンジ */
  color: #fff;
  border: none;
  padding: 10px 0;
  width: 100%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 #cc5200; /* 立体的なボタン */
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #cc5200;
}
.btn-secondary {
  background: #437FFF; /* 青 */
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
}
.error-msg {
  color: red;
  font-weight: bold;
  display: none;
  margin-top: 10px;
}

/* ===== マイページ ===== */
.mypage-dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.mypage-dt { font-weight: bold; }

/* アコーディオン (FAQ) */
.accordion-item {
  border: 1px solid #ccc;
  margin-bottom: 5px;
  background: #ddd;
}
.accordion-header {
  padding: 10px;
  cursor: pointer;
  font-weight: bold;
}
.accordion-content {
  display: none;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #ccc;
}
.accordion-item.active .accordion-content {
  display: block;
}

/* === 12) 検索結果オーバーレイ ==================== */
/* 画面全体を覆う黒半透明のレイヤー（最初は非表示） */
#searchOverlay{
  display: none;              /* JSで block に切り替え */
  position: fixed;
  inset: 0;                   /* top/right/bottom/left を一括指定 */
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  overflow-y: auto;           /* 結果が長い場合はスクロール */
}

/* オーバーレイ中央の白いカード */
#searchResults{
  background: #fff;
  color: #111;
  margin: 5% auto;
  padding: 20px;
  width: 80%;
  max-width: 600px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* 閉じるボタン（右上） */
#closeBtn{
  float: right;
  cursor: pointer;
  background: #f44336;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
}
#closeBtn:hover{ filter: brightness(1.05); }

/* ダークモードで結果カードの文字色を読みやすく */
@media (prefers-color-scheme: dark){
  #searchResults{
    background: #111827;
    color: #e5e7eb;
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .main-content { flex-direction: column; }
  .sidebar { width: 100%; }
  .product-detail { flex-direction: column; }
  .header-inner { flex-direction: column; align-items: center; }
  .search-area { width: 100%; }
}

/* ===== style.css の一番下の @media 内に追記 ===== */

@media (max-width: 768px) {
  /* ...既存のレスポンシブ記述... */

  /* カテゴリボックス全体のマージン調整 */
  .category-box {
    margin-bottom: 15px;
  }

  /* ヘッダーをボタンっぽくする */
  .cat-header {
    cursor: pointer;
    position: relative;
    user-select: none; /* テキスト選択防止 */
  }

  /* 開閉の目印（▼）を追加 */
  .cat-header::after {
    content: "▼";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s;
  }

  /* 開いている時は目印を回転（▲にする） */
  .category-box.active .cat-header::after {
    transform: translateY(-50%) rotate(180deg);
  }

  /* リストはデフォルトで非表示 */
  .cat-list {
    display: none;
    padding: 10px; /* 開いた時の余白 */
  }

  /* アクティブクラスがついたら表示 */
  .category-box.active .cat-list {
    display: block;
    border-top: 1px solid #ccc; /* ヘッダーとの境界線 */
  }

  /* ...先ほどのカテゴリ設定の下に追記... */

  /* ▼ サイドバーの中身をバラバラに配置するための設定 */

  /* 1. 親要素をFlexのカラムレイアウトにする */
  .main-content {
    display: flex;
    flex-direction: column;
  }

  /* 2. サイドバーという「枠」を無視する（display: contents） */
  /* これにより、カテゴリやバナーがメインエリアと同列に扱えるようになります */
  .sidebar {
    display: contents;
  }

  /* 3. 表示順序の指定 (数字が小さい順に上から並びます) */
  
  /* カテゴリ：一番上 */
  .category-box {
    order: 1;
  }

  /* メインエリア：真ん中 */
  .content-area {
    order: 2;
  }

  /* バナー：一番下 */
  .sidebar-banner {
    order: 3;
    margin-top: 20px; /* メインエリアとの間隔 */
  }
}