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

/* 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;
}

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


/* --- メインの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;
}



