/* GiversMall 共通CSS */

/* ===== 基本設定 ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  margin: 0;
  padding: 0;
}

/* ===== ハンバーガーメニューボタン ===== */
.hamburger-menu {
  display: none;
  position: absolute;
  top: 18px;
  left: 16px;
  transform: none;
  z-index: 1000;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 24px;
  color: #333;
  transition: color 0.3s;
}

.hamburger-menu:hover {
  color: #d7372f;
}

/* ===== サイドメニュー ===== */
.side-menu {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transition: left 0.3s ease-in-out;
  overflow-y: auto;
}

.side-menu.active {
  left: 0;
}

.side-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.side-menu-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #333;
  padding: 8px;
  transition: color 0.3s;
}

.side-menu-close:hover {
  color: #d7372f;
}

.side-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-menu-list li {
  border-bottom: 1px solid #f0f0f0;
}

.side-menu-list li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  text-decoration: none;
  color: #333;
  font-size: 15px;
  transition: background-color 0.3s;
}

.side-menu-list li a:hover {
  background-color: #f8f9fa;
}

.side-menu-list li a i {
  font-size: 18px;
  width: 20px;
  text-align: center;
  color: #d7372f;
}

/* HOMEへ戻るのスタイル */
.side-menu-list .menu-home {
  background-color: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
}

.side-menu-list .menu-home a {
  font-weight: 600;
  color: #d7372f;
}

.side-menu-list .menu-home a:hover {
  background-color: #e9ecef;
}

/* ログアウトボタンのスタイル */
.side-menu-list .menu-logout {
  background-color: #fff5f5;
  border-top: 2px solid #e0e0e0;
  margin-top: 10px;
}

.side-menu-list .menu-logout a {
  font-weight: 600;
  color: #dc3545;
}

.side-menu-list .menu-logout a:hover {
  background-color: #ffe5e5;
}

.side-menu-list .menu-logout a i {
  color: #dc3545;
}

/* ===== メニューオーバーレイ ===== */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* ===== ヘッダー・フッター ===== */
header, footer {
  background-color: #ffffff;
}

/* ===== スティッキーフッターメニュー ===== */
.sticky-footer-menu {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 8px 0;
}

.footer-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 8px 4px;
  text-decoration: none;
  color: #666;
  font-size: 10px;
  transition: all 0.3s;
}

.footer-menu-item i {
  font-size: 20px;
}

.footer-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}

.footer-menu-item:active {
  background: #f5f5f5;
}

.footer-menu-item span {
  line-height: 1;
}

/* フッター未読バッジ */
.footer-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* モバイルでのみ表示 */
@media (max-width: 768px) {
  .sticky-footer-menu {
    display: flex;
  }

  .site-footer {
    display: none;
  }
}

.header-top {
  display: flex;
  align-items: center;
  padding: 10px 40px;
  border-bottom: 1px solid #ccc;
  background-color: #fff;
  gap: 20px;
}

/* ===== GiversMallヘッダー詳細 ===== */
.gm-header-detail {
  background: #fff;
  border-bottom: 1px solid #ccc;
  position: relative;
}

.gm-header-inner { 
  width: 100%; 
  margin: 0; 
  position: relative; 
}

.gm-header-topline {
  font-size: 12px;
  padding: 6px 250px 0 10px; /* 右側にユーザー行分の余白を確保 */
}

.gm-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 12px 10px;
}

.gm-left { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  min-width: 320px; 
}

.gm-logo { 
  height: 44px; 
}

.gm-logo-mobile {
  display: none;
}

.gm-logo-link { 
  display: inline-block; 
  cursor: pointer; 
}

.gm-stats { 
  font-size: 13px; 
  line-height: 1.4; 
}

.gm-highlight { 
  color: orange; 
}

.gm-search {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  max-width: 640px;
  margin: 0 8px;
  border: 2px solid #d7372f;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.gm-search input[type="text"] {
  flex: 1 1 auto;
  border: none;
  font-size: 16px;
  padding: 10px 12px;
}

.gm-search button {
  background: #d7372f;
  border: none;
  padding: 0 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gm-search button i { 
  color: #fff; 
  font-size: 18px; 
}

.gm-right { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-end; 
  gap: 6px; 
  font-size: 12px; 
  text-align: right; 
}

.gm-user-row { 
  color: #333; 
  position: absolute; 
  top: 6px; 
  right: 10px; 
}

.gm-user { 
  display: inline-flex; 
  align-items: center; 
  gap: 6px; 
  font-weight: 600; 
}

.gm-user-link { 
  color: #d7372f; 
  text-decoration: none; 
}

.gm-sep { 
  color: #aaa; 
  margin: 0 4px; 
}

.gm-links-row { 
  display: flex; 
  align-items: flex-end; 
  justify-content: space-between; 
  gap: 10px; 
  width: 100%; 
}

.gm-links-row::before { 
  content: ""; 
  flex: 1 1 auto; 
}

.gm-links-row a { 
  color: #555; 
  text-decoration: none; 
  display: inline-flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 2px; 
}

.gm-links-row a i { 
  font-size: 20px; 
  line-height: 1; 
}

.gm-links-row a span { 
  font-size: 11px; 
  line-height: 1; 
  padding-top: 5px; 
}

.gm-login { 
  color: #d7372f; 
  text-decoration: none; 
}

/* ===== メインレイアウト ===== */
.main-3col {
  display: flex;
  gap: 20px;
  padding: 10px;
}

.sidebar {
  width: 20%;
}

.content {
  width: 50%;
}

.recommend {
  width: 30%;
}

/* ===== 商品リストヘッダー ===== */
.product-list-header {
  margin-bottom: 16px;
}

.product-list-header h3 {
  font-size: 20px;
  color: #333;
  margin: 0;
  padding: 0;
}

/* ===== 商品表示 ===== */
.product {
  display: inline-block;
  width: 150px;
  margin: 10px;
  vertical-align: top;
}

.product a {
  display: block;
  width: 100%;
}

.product-image-wrapper {
  width: 150px;
  height: 150px;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f0f0;
  position: relative;
}

.product img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
}

.product-link { 
  display: block; 
  color: inherit; 
  text-decoration: none; 
}

.product-link:hover { 
  opacity: 0.96; 
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  color: #333;
}

.product-price {
  font-size: 13px;
  color: #d7372f;
  margin-top: 2px;
}

.yen {
  font-size: 12px;
}

/* ===== アイコングループ ===== */
.icon-group {
  display: flex;
  gap: 10px;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
}

.favorite-count, .comment-count {
  display: flex;
  align-items: center;
  gap: 3px;
}

.favorite-count i {
  color: #e74c3c;
}

.comment-count i {
  color: #3498db;
}

/* ===== ページネーション ===== */
.pagination {
  text-align: center;
  margin: 30px 0;
}

.pagination a, .pagination span {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 4px;
  text-decoration: none;
  border: 1px solid #ddd;
  color: #333;
  border-radius: 4px;
}

.pagination a:hover {
  background-color: #f5f5f5;
}

.pagination .current {
  background-color: #d7372f;
  color: white;
  border-color: #d7372f;
}

.pagination .disabled {
  color: #ccc;
  cursor: not-allowed;
}

/* ===== アラート ===== */
.alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* ===== ボタン ===== */
.btn-primary { 
  background: #007bff; 
  color: white; 
  padding: 8px 16px; 
  border-radius: 4px; 
  text-decoration: none; 
  display: inline-block;
  border: none;
  cursor: pointer;
}

.btn-primary:hover { 
  background: #0056b3; 
  color: white; 
}

.favorite-btn {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.favorite-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.favorite-btn.favorited {
  background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

.favorite-btn.favorited:hover:not(:disabled) {
  background: linear-gradient(135deg, #545b62 0%, #3d4449 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.favorite-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

.purchase-btn {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.purchase-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.purchase-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

/* ===== レビュー ===== */
.review {
  clear: both;
  border-bottom: 1px solid #ccc;
  padding: 10px 0;
  margin-top: 10px;
}

/* ===== 検索結果ページ専用 ===== */
.search-results-header {
  margin: 20px 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.search-results-header h1 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 24px;
}

.search-keyword {
  color: #d7372f;
  font-weight: bold;
}

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

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.no-results i {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 20px;
}

/* ===== 商品詳細ページ専用 ===== */
.item-detail-wrap { 
  display: flex; 
  justify-content: center; 
  width: 100%; 
}

.item-detail-inner { 
  max-width: 980px; 
  width: 100%; 
  margin: 0 auto; 
  padding: 16px; 
  box-sizing: border-box; 
  display: block; 
}

.item-detail-row { 
  display: flex; 
  gap: 24px; 
  align-items: flex-start; 
}

.item-media { 
  width: 420px; 
}

.item-media img { 
  width: 100%; 
  height: auto; 
  border: 1px solid #ddd; 
}

.image-view { 
  width: 100%; 
  aspect-ratio: 1 / 1; 
  display: block; 
  overflow: hidden; 
  background: #fff; 
}

.image-view img { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
  border: none; 
}

.thumbs { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 8px; 
  margin-top: 8px; 
}

.thumbs button { 
  border: 1px solid #ddd; 
  background: #fff; 
  padding: 0; 
  cursor: pointer; 
}

.thumbs img { 
  display: block; 
  width: 100%; 
  height: 100px; 
  object-fit: cover; 
}

.thumbs button.active { 
  outline: 2px solid #d7372f; 
}

.item-media .item-media-caption { 
  margin-top: 8px; 
  color: #333; 
  font-weight: bold; 
}

.item-body { 
  flex: 1; 
}

.item-title { 
  margin: 0 0 8px 0; 
  font-size: 28px; 
}

.item-subtitle { 
  margin: 0 0 12px 0; 
  color: #666; 
  white-space: pre-wrap; 
  word-wrap: break-word; 
}

.item-price { 
  font-size: 24px; 
  color: #d7372f; 
  font-weight: bold; 
  margin-bottom: 12px; 
}

.item-price .free-ship { 
  font-size: 14px; 
  color: #333; 
  font-weight: normal; 
}

.shop-logos { 
  display: flex; 
  gap: 20px; 
  align-items: center; 
  margin-bottom: 16px; 
}

.shop-logo { 
  height: 50px; 
}

.shop-logos a { 
  text-decoration: none; 
}

.shop-logos a:hover { 
  opacity: 0.8; 
}

.spec-list { 
  line-height: 1.9; 
}

.note-section { 
  margin-top: 24px; 
  font-size: 14px; 
  color: #333; 
  white-space: pre-wrap; 
  word-wrap: break-word; 
}

/* ===== レスポンシブデザイン ===== */

/* タブレット対応 */
@media (max-width: 960px) {
  .gm-stats { 
    display: none; 
  }
  
  .gm-right span { 
    display: none; 
  }
  
  .gm-left {
    min-width: auto;
  }
}

/* スマートフォン対応（横向き） */
@media (max-width: 768px) {
  /* ハンバーガーメニューボタンを表示 */
  .hamburger-menu {
    display: block;
    position: fixed;
    top: 18px;
    background: transparent;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2001;
  }

  .hamburger-menu:hover {
    color: #fff;
  }

  /* ヘッダーレイアウト調整 */
  .gm-header-detail {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.75);
    border-bottom: none;
  }

  .gm-header-topline {
    display: none;
  }

  .gm-header-bar {
    flex-direction: column;
    padding: 12px 16px;
    gap: 0;
  }

  .gm-left {
    width: 100%;
    justify-content: center;
    padding: 8px 0;
  }

  .gm-logo {
    height: 36px;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.9));
  }

  .gm-logo-desktop {
    display: none;
  }

  .gm-logo-mobile {
    display: block;
  }

  .gm-logo-link {
    display: inline-block;
  }

  .gm-stats {
    display: none;
  }

  /* デスクトップ用検索バーを非表示 */
  .gm-search {
    display: none !important;
  }

  .gm-right {
    display: none;
  }

  .gm-user-row,
  .gm-links-row {
    display: none;
  }

  /* 3カラムレイアウトを1カラムに */
  .main-3col {
    padding: 0;
  }

  .sidebar {
    display: none;
  }
  
  .content {
    width: 100%;
  }

  .recommend {
    display: none;
  }
  
  /* ヘッダーの調整 */
  .header-top {
    padding: 10px;
  }
  
  /* 商品詳細ページ */
  .item-detail-row {
    flex-direction: column;
  }
  
  .item-media {
    width: 100%;
  }
}

/* スマートフォン対応（縦向き） */
@media (max-width: 480px) {
  /* ハンバーガーメニューボタンの位置調整 */
  .hamburger-menu {
    position: fixed;
    left: 12px;
    top: 16px;
    font-size: 22px;
    z-index: 2001;
  }

  /* ヘッダーのモバイル最適化 */
  .gm-header-bar {
    padding: 10px 12px;
  }
  
  .gm-left {
    padding: 6px 0;
  }
  
  .gm-logo {
    height: 32px;
  }
  
  /* 3カラムレイアウト */
  .main-3col {
    padding: 0;
  }
  
  /* サイドバー（カテゴリー） */
  .sidebar h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .sidebar ul {
    padding-left: 0;
  }
  
  .sidebar li {
    padding: 6px 8px;
    font-size: 13px;
  }
  
  /* 商品リストヘッダー */
  .product-list-header {
    margin: 16px 12px 12px 12px;
  }

  .product-list-header h3 {
    font-size: 18px;
  }

  /* 商品リスト */
  .product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 8px;
  }
  
  .product {
    display: block;
    width: 100%;
    margin: 0;
  }
  
  .product-image-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  
  .product h4 {
    font-size: 13px;
    margin: 6px 0 4px 0;
  }
  
  .product .price {
    font-size: 15px;
    font-weight: bold;
  }
  
  .product .stats {
    font-size: 11px;
  }
  
  /* レビューセクション */
  .recommend h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .review {
    padding: 8px 0;
    font-size: 13px;
  }
  
  /* フッター */
  footer {
    padding: 16px 8px;
    font-size: 12px;
  }
  
  /* 商品詳細ページ */
  .item-detail-container {
    padding: 10px;
  }
  
  .item-title {
    font-size: 20px;
  }
  
  .item-price {
    font-size: 20px;
  }
  
  .item-description {
    font-size: 14px;
  }
  
  /* ボタン */
  .favorite-btn,
  .purchase-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    height: 48px;
    justify-content: center;
  }

  .item-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .item-actions form {
    width: 100%;
  }
  
  /* 検索結果ページ */
  .search-results {
    padding: 10px;
  }
  
  .search-results .product-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
