/* stylecoupon.css */
/*body {
    font-family: 'Arial', sans-serif;
    background-color: #ffffff;
    /* ページのコンテンツを中央に寄せたい場合、body自体を中央寄せの親として機能させるか、
       直接の子要素にmargin: 0 auto; を設定する。
       ここでは直接の子要素（.coupon-container）に設定します。
       既存のサイトのCSSによってこれらの設定が上書きされている可能性があるため、
       ここでは.coupon-containerに直接中央寄せの指定をします。 */
    /*min-height: 100vh;*/
    margin: 0;
    padding: 0px;
}
*/
.coupon-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 800px; /* PCでの最大幅を調整 */
    width: 90%; /* レスポンシブ対応のため相対的な幅を設定 */
    margin: 0 auto; /* ★★★この行を追加★★★ これが水平方向の中央揃えを担当します */
}

h1 {
    color: #e44d26; /* サンエーのブランドカラーを意識した色 */
    margin-bottom: 20px;
}

p {
    color: #ffffff; /* 本文テキストを黒に変更 */
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: center; /* デフォルトを左揃えに */
}


/* クーポンコード表示ボックス */
.coupon-code-box {
    background-color: #f9f9f9;
    border: 1px solid #dddddd;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    display: flex; /* Flexboxを適用 */
    flex-wrap: wrap; /* 必要に応じて要素を折り返す */
    align-items: center; /* 垂直方向中央揃え */
    gap: 10px; /* 要素間の隙間 */
}

/* クーポンコードのテキスト部分 */
#couponCode1,
#couponCode2 {
    font-size: 1.1em; /* フォントサイズを少し大きく */
    font-weight: bold;
    color: #007bff; /* 強調色 */
    flex-grow: 1; /* 残りのスペースを埋めるように伸長 */
    min-width: 0; /* flexアイテムの最小幅を設定（重要：長い文字列の折り返しに影響） */
    word-break: break-all; /* 長い文字列でも強制的に折り返す */
    text-align: left; /* 左寄せに見やすく */
}

/* コピーボタン */
#copyButton1,
#copyButton2 {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    flex-shrink: 0; /* ボタンは縮まない */
}

#copyButton1:hover,
#copyButton2:hover {
    background-color: #0056b3;
}

/* 注意書き */
.note {
    font-size: 0.9em;
    color: #000;
    margin-bottom: 10px;
    text-align: left;
}

.coupon-notes {
    margin-top: 30px;
    text-align: left;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.coupon-notes h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.coupon-notes ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.coupon-notes li {
    color: #000;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 5px;
}

/* 各商品クーポンブロック */
.product-coupon {
    display: flex;
    align-items: center; /* 縦方向中央揃え */
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #f9f9f9;
    text-align: left;
}

.product-image {
    width: 120px;
    height: auto;
    margin-right: 15px;
    border-radius: 5px;
    flex-shrink: 0; /* 画像は縮まない */
}

.product-coupon > div {
    flex-grow: 1; /* テキスト部分が残りのスペースを埋める */
}

.product-name {
    color: #000;
    font-size: 1em;
    margin-bottom: 5px;
}

.discount-info {
    color: #008000; /* 緑色などで強調 */
    font-size: 0.9em;
    margin-bottom: 8px;
}

/* ショップへのリンクボタン */
.back-to-shop {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #e44d26;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    font-weight: bold;
    margin-top: 10px;
}

.back-to-shop:hover {
    background-color: #c83d1a;
}

.arrow-icon {
    margin-left: 5px;
    font-size: 1em;
}

/* 小さいリンクボタン（会員登録、お問い合わせ） */
.note a.back-to-shop.small {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    margin-left: 5px;
}

.note a.back-to-shop.small:hover {
    background-color: #0056b3;
}

.note.small {
    font-size: 0.8em;
    color: #888;
    margin-top: 10px;
}

/* ====================================
    メディアクエリ（レスポンシブ対応）
    ==================================== */

/* タブレット・スマートフォン向け */
@media (max-width: 767px) {
    .coupon-container {
        padding: 20px; /* パディングを少し減らす */
        width: 95%; /* 画面幅いっぱいに近づける */
    }

    h1 {
        font-size: 1.5em; /* タイトルを小さく */
    }

    /* クーポンコードボックスの縦並び */
    .coupon-code-box {
        flex-direction: column; /* 要素を縦並びにする */
        align-items: flex-start; /* 左揃えにする */
    }

    .coupon-code-box span {
        width: 100%; /* 全幅に広げる */
        margin-bottom: 5px; /* ボタンとの間に少し余白 */
        font-size: 1em; /* スマートフォンでは少し小さめに */
    }

    .coupon-code-box button {
        width: 100%; /* ボタンも全幅に広げる */
        margin-top: 5px; /* クーポンコードとの間に余白 */
    }

    /* 商品ごとのクーポンブロックの調整 */
    .product-coupon {
        flex-direction: column; /* 画像とテキストを縦並びにする */
        text-align: center; /* 中央揃えに */
    }

    .product-image {
        margin-right: 0;
        margin-bottom: 10px; /* 画像の下に余白 */
        width: 100px; /* 画像サイズを調整 */
    }

    .product-coupon > div {
        width: 100%; /* テキスト部分を全幅に */
    }

    .product-name,
    .discount-info,
    .coupon-code-box {
        text-align: center; /* 商品名や割引情報も中央揃えに */
    }

    .note,
    .coupon-notes {
        text-align: left; /* 注意書きは左揃えを維持 */
    }
}

/* さらに小さいスマートフォン向け */
@media (max-width: 480px) {
    .coupon-container {
        padding: 15px;
    }

    h1 {
        font-size: 1.3em;
    }

    .product-image {
        width: 80px; /* さらに小さく */
    }

    .back-to-shop,
    .note a.back-to-shop.small {
        padding: 8px 15px;
        font-size: 0.8em;
    }
}