/* メンズ商品一覧 */

.product-container {
  display: flex;
}

.sidebar {
  width: 200px;
  background: #fff;
  padding: 20px;
  border-right: 1px solid #ccc;
}

.product-area {
  flex-grow: 1;
  padding: 20px;
}

/* 商品グリッド */
#productGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.product-grid-card-container-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  align-items: stretch;
}

/* 商品カードリンク */
.product-card-link {
  flex: 1 1 calc(25% - 20px);
  display: flex;
  text-decoration: none;
}

/* 商品カード本体 */
.product-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border-color: #999;
}

.product-card.dummy,
.product-card-link.dummy {
  visibility: hidden;
  pointer-events: none;
  cursor: default;
  box-shadow: none;
  transform: none;
}


/* 画像ラップ */
.img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 130%; /* アスペクト比維持 */
  overflow: hidden;
  background: #f8f8f8;
}

.img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* タグ（NEW/SEASON/LINEなど） */
.tag-container {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background-color: #555;
  line-height: 1.4;
}

.tag.new { background-color: #e91e63; }
.tag.season { background-color: #4caf50; }
.tag.line { background-color: #2196f3; }

/* 商品情報 */
.product-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-info .name {
  font-weight: bold;
  font-size: 16px;
}

.product-info .brand,
.product-info .materialspecifications {
  font-size: 12px;
  color: #777;
}

.product-info .price,
.final-price {
  font-weight: bold;
  font-size: 15px;
  color: #e91e63;
}

.price-original {
  font-size: 12px;
  color: #999;
  margin: 5px 0 2px;
}

.price-original s {
  text-decoration: line-through;
}

.discount-rate {
  font-size: 12px;
  color: #e60023;
  font-weight: bold;
  margin-bottom: 2px;
}

/* SOLD OUTラベル */
.sold-out-label {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}

/* 検索結果下 */

.search-result{
  margin-top: 10px;
  text-align: center;
}

.pagination {
  margin-top: 10px !important; 
}

/* --- サイドバー フィルター --- */

/* 共通設定 */
#lineFilter label,
#categoryFilter label {
  display: block;
  margin: 6px 0;
  cursor: pointer;
}

/* ラインフィルター */
.line-toggle label,
.category-toggle label {
  display: inline-block;
  border: 1px solid #ccc;
  padding: 8px 16px;
  margin: 5px;
  border-radius: 20px;
  background-color: white;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  font-size: 14px;
}

/* ラジオボタン非表示 */
.line-toggle input[type="radio"],
.category-toggle input[type="radio"],
.color-toggle input[type="radio"] {
  display: none;
}

/* 選択中スタイル */
.line-toggle input[type="radio"]:checked + label,
.line-toggle label:has(input[type="radio"]:checked),
.category-toggle input[type="radio"]:checked + label,
.category-toggle label:has(input[type="radio"]:checked) {
  background-color: #333;
  color: white;
  border-color: #333;
}

/* カラーフィルター */
.color-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-toggle label.color {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ccc;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* 色別背景 */
.color.white { background-color: white; }
.color.black { background-color: black; }
.color.red   { background-color: red; }

/* 選択中強調 */
.color-toggle input[type="radio"]:checked + label {
  border-color: #333;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* --- 価格フィルター --- */
.price-filter {
  margin-top: 30px;
  font-size: 14px;
}

.price-inputs {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.price-inputs input {
  width: 60px;
  padding: 5px;
}

.price-buttons {
  display: flex;
  margin-top: 10px;
}

.price-buttons button {
  padding: 5px 10px;
  margin-right: 5px;
  cursor: pointer;
}

#applyPrice {
  background-color: #333;
  color: white;
  border: none;
}

#resetPrice {
  background-color: white;
  color: #333;
  border: 1px solid #ccc;
}

/* --- 並び替えセレクト --- */
.sort-container {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin: 20px 0;
}

.sort-bar label {
  font-size: 16px;
  font-weight: bold;
}

.sort-bar select {
  padding: 5px 10px;
  font-size: 16px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

/* --- レスポンシブ対応 --- */

/* タブレット（768px以下） */
@media screen and (max-width: 768px) {
  .product-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ccc;
  }

  .product-area {
    padding: 10px;
  }

  .product-grid-card-container-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .sort-container {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .sold-out-label {
    font-size: 14px;
    padding: 6px 12px;
  }
}

/* スマホ（480px以下） */
@media screen and (max-width: 480px) {
  .product-grid-card-container-4 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    width: 100%;
    padding: 0;
  }

  .img-wrapper {
    padding-top: 140%;
  }

  .product-info .name {
    font-size: 14px;
  }

  .product-info .brand,
  .product-info .materialspecifications {
    font-size: 11px;
  }

  .product-info .price,
  .final-price {
    font-size: 14px;
  }

  .sort-container {
    flex-direction: column;
    align-items: center;
  }

  .price-buttons{
    margin-bottom: 20px;
  }

  .price-inputs input {
    width: 100%;
  }

  .sort-bar{
    width: 100%;
  }

  .sold-out-label {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    padding: 4px 8px;
    border-radius: 2px;
  }
}