@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
*/

/* CSS読み込み確認 */
body::before {
  content: "工事中";
  display: block;
  color: red;
  font-weight: bold;
  background: yellow;
}

/* ギフトサイト全ページで日付・タグ・著者情報を非表示にする */
.home.page .date-tags,
.home.page .author-info,
.date-tags,
.author-info {
  display: none !important;
}

/************************************
** 基本設定
************************************/
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

/************************************
** 商品グリッド共通
************************************/
.product-grid,
#rakuten-products-container {
  width: 100%;
  max-width: 100%;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 767px) {
  .product-grid,
  #rakuten-products-container {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 8px;
    justify-content: center;
    transform: scale(1); /* 拡大・縮小せず */
    transform-origin: top center;
  }

  .product-grid .product,
  #rakuten-products-container .product {
    width: 100%;
    max-width: none;
    margin: 0 auto;
  }
}

@media (max-width: 375px) {
  .product-grid,
  #rakuten-products-container {
    grid-template-columns: 1fr;
  }
}

/************************************
** 商品カード
************************************/
.product {
  width: 100%;
  max-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;
}

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

.product img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  display: block;
  image-rendering: auto;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

/************************************
** タイトル・説明（行制限・省略）
************************************/
.product .title {
  font-size: 1rem;
  font-weight: bold;
  margin: 0;
  padding: 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;
  text-decoration: none;
  word-break: break-word;
}

.product .description {
  font-size: 0.9rem;
  margin: 0;
  padding: 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;
  text-decoration: none;
}

/************************************
** 商品情報（価格・評価・レビュー）
************************************/
.product .info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3em 0.8em;
  font-size: 0.9rem;
  margin-top: 0.6em;
}

.product .info-grid .price > span:first-child,
.product .info-grid .rating-number > span:first-child,
.product .info-grid .review-count > span:first-child {
  display: none !important;
}

.product .info-grid .price,
.product .info-grid .rating-number,
.product .info-grid .review-count {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-left: 0;
}

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

/************************************
** ランキング・星・レビュー数
************************************/
.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;
}

.product .rating-number {
  font-weight: bold;
  margin-left: 0.3em;
  color: #222;
  font-size: 14px;
}

.product.popular {
  border: 2px solid gold;
  background-color: #fffbea;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

/************************************
** スマホ用 調整
************************************/
@media (max-width: 767px) {
  .product {
    margin: 0.5rem;
    padding: 10px;
  }

  .product img {
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .product .title {
    font-size: 0.9rem;
  }

  .product .description {
    font-size: 0.85rem;
  }

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

  .rank {
    font-size: 20px;
  }

  .product .rating-number {
    font-size: 12px;
  }
}

/************************************
** 下線・リンク装飾除去
************************************/
a,
a *,
u {
  text-decoration: none !important;
  border: none !important;
}

/************************************
** 不要要素の非表示
************************************/
.author-box,
.author-follow,
.sns-follow,
.footer .copyright::before,
.footer .copyright a {
  display: none !important;
}

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

/* 情報表示を縦1列・左寄せに変更 */
.product .info-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3em;
  font-size: 0.9rem;
  margin-top: 0.6em;
}

/* ボタンも左寄せに */
.product .rakuten-button {
  align-self: flex-start;
}

/* レビュー件数のラベルを削除済み + スマホ含めて全デバイス対応 */
.product .info-grid .price > span:first-child,
.product .info-grid .rating-number > span:first-child,
.product .info-grid .review-count > span:first-child {
  display: none !important;
}