/* 画像ホバーで裏表表示のスタイル*/

/* 1. PCでは絶対に隠す */
.sp-only {
  display: none !important;
}

/* 2. スマホ（幅767px以下）の時だけ表示 */
@media screen and (max-width: 767px) {
  .sp-only {
    display: block !important;
    text-align: center; /* ここで真ん中寄せにする */
    width: 100%;
    margin: 10px 0;
  }
}

/* --- ベースのコンテナ設定 --- */
.custom-hover-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f9f9f9;
}

/* チェックボックス本体は隠す */
.toggle-checkbox {
    display: none;
}

/* 切り替えボタンのスタイル（右上配置） */
.toggle-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 20px;
    transition: transform 0.3s ease;
}

/* 画像の基本スタイル */
.custom-hover-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease-in-out;
}

.custom-hover-container img.front-image {
    z-index: 2;
}

.custom-hover-container img.back-image {
    z-index: 1;
}

/* --- 切り替えロジック --- */

/* 1. PCでのホバー挙動 */
@media (hover: hover) {
    .custom-hover-container:hover img.front-image {
        opacity: 0;
    }
    /* PCでは切り替えボタンを隠す（お好みで） */
    .toggle-button {
        display: none;
    }
}

/* 2. スマホ等でのタップ（チェックボックス連動）挙動 */
.toggle-checkbox:checked ~ img.front-image {
    opacity: 0;
}

/* ボタンをタップした時に少し回転させる演出 */
.toggle-checkbox:checked ~ .toggle-button {
    transform: rotate(180deg);
    background-color: #fff;
}

/* 画像ホバーで裏表表示のスタイルここまで*/
/* 画像ホバーで裏表表示のスタイルここまで*/


/* モデル着用アイテムはこちらボタン表示CSS*/
/* モデル着用アイテムはこちらボタン表示CSS*/

/* --- 商品コンテナ（画面幅70%のレスポンシブ設定） --- */
  .custom-item-container {
    display: flex;
    flex-direction: column; /* 常に1列（縦並び） */
    gap: 15px;              /* カード同士の間隔 */
    width: 90%;             /* デフォルトで画面幅の70% */
    max-width: 1300px;       /* 広がりすぎないように最大幅を設定 */
    margin: 0 auto 20px auto; /* 中央寄せ、下に余白 */
  }

  /* 個々の商品カード基本スタイル */
  .custom-item-container .item {
    display: flex;          /* 内部（画像とテキスト）を横並びにする */
    align-items: stretch;   /* 高さを揃える */
    background-color: #f7f7f7; 
    border: 1px solid #e0e0e0;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    position: relative;     /* PC用の右下ボタン配置の基準 */
  }

  .custom-item-container .item:hover {
    background-color: #eeeeee;
  }

  .custom-item-container .item a {
    display: flex; 
    width: 100%;
    text-decoration: none;
    color: inherit;
  }

  /* --- 左側：画像の設定 --- */
  .custom-item-container .item img {
    width: 120px;           /* 画像の横幅を固定 */
    height: 120px;          /* 高さを固定（正方形） */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin-right: 15px;     /* 右側テキストとの余白 */
    flex-shrink: 0;         /* 画像が潰れないように固定 */
  }

  /* --- 右側：テキスト情報配置エリア --- */
  .custom-item-container .item-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-right: 110px;   /* PC時は右下のボタンと重ならないように余白を確保 */
    flex-grow: 1;
  }

  .custom-item-container .item p {
    margin: 0;
    text-align: left;
    word-break: break-all;  /* 枠の右端で英数字でも強制改行させる設定 */
  }

  /* 商品名 */
  .custom-item-container .item p.product-name {
    font-size: 14px;
    font-weight: bold;
    color: #333333;
    line-height: 1.4;
    margin-bottom: 8px;
  }

  /* 価格 */
  .custom-item-container .item p.product-price {
    font-size: 14px;
    color: #000000;
   margin-top: 0;       /* &#128161;auto から 0 に変更（上に詰めさせる） */
  margin-bottom: 8px;
    padding-bottom: 5px;
  }

  /* --- 「アイテムを見る」ボタン（PC用基本設定） --- */
  .custom-item-container .detail-btn {
    position: absolute;
    right: 15px;
    bottom: 15px;
    border: 1px solid #007e98; 
    background-color: #ffffff;
    color: #007e98;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;   
  }

  /* --- &#128241;スマートフォン環境（画面幅が狭いとき）のレスポンシブ調整 --- */
  @media (max-width: 768px) {
    .custom-item-container {
      width: 100%;          /* タブレット・スマホでは画面いっぱいに広げる */
      padding: 0 10px;      /* 左右に最低限の余白を確保 */
      box-sizing: border-box;
    }
    
    .custom-item-container .item img {
      width: 90px;          /* スマホに合わせて画像を少し縮小 */
      height: 90px;
      margin-right: 12px;
    }

    /* &#128161;スマホ時はテキストエリア自体を調整 */
    .custom-item-container .item-info {
      padding-right: 0;     /* PC用の絶対配置用の余白をリセット */
      justify-content: center; /* 上下中央寄せにしてバランスを取る */
    }

    /* &#128161;スマホ時は枠の右端で自動改行 */
    .custom-item-container .item p.product-name {
      font-size: 13px;      
      white-space: normal;  /* 自動改行を許可 */
      margin-bottom: 4px;   /* 価格との間隔を狭める */
    }

    /* &#128161;価格をアイテム名のすぐ下に配置 */
    .custom-item-container .item p.product-price {
      font-size: 13px;
      white-space: normal;  /* 自動改行を許可 */
      margin-top: 0;        /* PC用の「一番下に引き離す」設定をリセット */
      padding-bottom: 0;
      margin-bottom: 10px;  /* 下のボタンとの間に少し隙間を作る */
    }

    /* &#128161;重要：スマホ時はボタンを右下に固定せず、文字の下に流す（絶対に被らない） */
    .custom-item-container .detail-btn {
      position: static;     /* 絶対配置を解除 */
      align-self: flex-end; /* ボタン自体を右側に寄せる */
      padding: 4px 10px;
      font-size: 11px;
    }
  }

/* モデル着用アイテムはこちらボタン表示CSSここまで*/
/* モデル着用アイテムはこちらボタン表示CSSここまで*/


/* --- メインのeギフトボタン（共通） --- */
div[data-anygift] button {
  border-radius: 2px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- スマホ用（768px未満）--- */
@media (max-width: 767px) {
  div[data-anygift] button {
    width: 350px !important;       /* 固定幅を解除 */
    max-width: 362px !important;  /* 必要なら上限を設定 */
  }

  .anygift-about-button {
    display: block !important;
    margin-left: auto !important;
    margin-right: 0 !important;   /* まず右端に揃える */
    transform: translateX(90px);  /* さらに右にずらしたい場合 */
  }
}

/* --- PC用（768px以上）--- */
@media (min-width: 768px) {
  div[data-anygift] button {
    width: 305px !important;
  }

  .anygift-about-button {
    margin-left: auto !important;
    margin-right: -30px !important;
  }
}

/* --- 親要素（ヘッダー）を位置指定の基準にする --- */
.anygift-step-modal__header {
  position: relative;
}

/* --- タイトル要素を強制的に中央配置する --- */
.ag-font-bold.anygift-step-modal__header__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  text-align: center;
}

/* --- タイトルの下に注意書きを追加する --- */
.ag-font-bold.anygift-step-modal__header__title::after {
  content: "他の商品を追加する場合はこの画面を閉じ、商品ページからカートに追加してください"; 
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  font-weight: normal;
  line-height: 1.5;
}

/* --- eギフトのご利用方法の下に注意書きを追加する --- */
.anygift-explain-modal__title::after {
  content: "クーポン、セール価格、ポイント付与、送料無料規定は対象外です";
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #666;
  text-align: center; 
  line-height: 1.5;
}


.reviewWebsiteRedirect {
  margin-left: auto;
  margin-right: 0;
}



