@charset "UTF-8";
/*!
Theme Name: Cocoon Child
Description: Cocoon専用の子テーマ
Theme URI: https://wp-cocoon.com/
Author: わいひら
Author URI: https://nelog.jp/
Template: cocoon-master
Version: 1.1.3
*/

/* テスト表示（削除可） */
body::before {
content: "工事中";
display: block;
color: red;
font-weight: bold;
background: yellow;
}

/*--------------------------------------
  全体レイアウト調整
--------------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

a,
a *,
u {
  text-decoration: none !important;
  border: none !important;
}

/*--------------------------------------
  非表示要素（グローバル）
--------------------------------------*/
.date-tags,
.author-info,
.author-box,
.author-follow,
.sns-follow,
.footer .copyright::before,
.footer .copyright a {
  display: none !important;
}

/* 商品グリッド全体 */
.product-grid,
#rakuten-products-container,
.entry-cards.column-4.column-sm-2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

/* スマホ2列（幅均等） */
@media (max-width: 767px) {
  .product-grid,
  #rakuten-products-container,
  .entry-cards.column-4.column-sm-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0;
    margin: 0;
  }

  .product,
  .rakuten-card,
  .entry-card {
    width: auto !important;
    margin: 0 !important;
    box-sizing: border-box;
  }
}

/* 極小画面対応（スマホ以下、1列） */
@media (max-width: 375px) {
  .product-grid,
  #rakuten-products-container,
  .entry-cards.column-4.column-sm-2 {
    grid-template-columns: 1fr;
  }
}

/*--------------------------------------
  商品カードスタイル
--------------------------------------*/
.product,
.entry-card,
.rakuten-card {
  width: 100%;
  border: 2px solid #ccc;
  border-radius: 12px;
  padding: 15px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
  margin: 0;
  box-sizing: border-box;
}

.product:hover,
.entry-card:hover,
.rakuten-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* 画像 */
.product img,
.entry-card img,
.rakuten-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  display: block;
  image-rendering: auto;
  aspect-ratio: 1 / 1;
  max-width: 100% !important;
  margin: 0 auto;
}

/* タイトル・説明 */
.product .title,
.entry-card .title,
.rakuten-card .title {
  font-size: 1rem;
  font-weight: bold;
  margin: 0;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.product .description,
.entry-card .description,
.rakuten-card .description {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
  color: #555;
  max-height: 4.2em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* 情報表示 */
.product .info-grid,
.entry-card .info-grid,
.rakuten-card .info-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3em;
  font-size: 0.9rem;
  margin-top: 0.6em;
}

.product .rating-number,
.entry-card .rating-number,
.rakuten-card .rating-number,
.product .review-count,
.entry-card .review-count,
.rakuten-card .review-count {
  font-weight: bold;
  color: #222;
  font-size: 14px;
}

/* 楽天ボタン */
.product .rakuten-button,
.entry-card .rakuten-button,
.rakuten-card .rakuten-button {
  display: inline-block;
  background-color: #f00;
  color: #fff !important;
  font-weight: bold;
  padding: 0.4em 0.8em;
  margin-top: 0.8em;
  border-radius: 4px;
  font-size: 0.95rem;
  text-align: center;
  white-space: nowrap;
  align-self: flex-start;
  cursor: pointer;
  border: none;
}

/* ランキング・星・レビュー */
.rank {
  font-size: 28px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 10px;
  text-align: center;
}

.rating-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0;
  margin: 5px 0;
}

.rating-stars svg.star {
  width: 16px;
  height: 16px;
  fill: #FFD700;
}

/*--------------------------------------
  スマホ最適化
--------------------------------------*/
@media (max-width: 767px) {
  .product,
  .entry-card,
  .rakuten-card {
    padding: 10px;
  }

  .product img,
  .entry-card img,
  .rakuten-card img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .product .title,
  .entry-card .title,
  .rakuten-card .title {
    font-size: 0.9rem;
  }

  .product .description,
  .entry-card .description,
  .rakuten-card .description {
    font-size: 0.85rem;
  }

  .product .rakuten-button,
  .entry-card .rakuten-button,
  .rakuten-card .rakuten-button {
    font-size: 0.85rem;
    padding: 0.3em 0.6em;
  }

  .rank {
    font-size: 20px;
  }

  .product .rating-number,
  .entry-card .rating-number,
  .rakuten-card .rating-number {
    font-size: 12px;
  }

  /* スマホ用のgapとpaddingの最適化 */
  .product-grid,
  #rakuten-products-container,
  .entry-cards.column-sm-2 {
    padding: 0;
    gap: 16px;
  }
}

/*--------------------------------------
  Cocoon 標準構造：entry-cards修正（スマホ2列等幅対応）
--------------------------------------*/
.entry-cards.column-sm-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 0;
  box-sizing: border-box;
}

@media screen and (min-width: 768px) {
  .entry-cards.column-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .entry-cards.column-sm-2 {
    display: grid;
  }
}

/*--------------------------------------
  slicknav スマホメニュー対応
--------------------------------------*/
.slicknav_nav ul.sub-menu {
  display: none;
}

.slicknav_nav li.slicknav_open > ul.sub-menu {
  display: block;
}

.rakuten-card *,
.rakuten-card *::before,
.rakuten-card *::after {
  min-width: 0;
  box-sizing: border-box;
}

.rakuten-rating,
.rakuten-button,
.product-title,
.product-price {
  white-space: normal !important;
  overflow-wrap: break-word;
}

.product,
.entry-card,
.rakuten-card {
  margin: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.product > *,
.entry-card > *,
.rakuten-card > * {
  border: none !important;
}