@charset "utf-8";
/* 最安eSIM購入ページ（PC・モバイル共通レスポンシブ）
   配色はサイトのテーマ色（--main-color / --main-bg）に合わせる。
   テーマを変更しても自動で追従するよう、色は極力 CSS 変数を使う。 */

#easybuy {
    --eb-main: var(--main-color, #bf0000);   /* テーマ基本色（赤） */
    --eb-line: var(--bs-gray-300, #dee2e6);
    --eb-soft: var(--bs-gray-100, #f8f9fa);
    --eb-text: var(--bs-gray-700, #495057);

    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 12px;
}

/* 見出し */
#easybuy .eb_head { text-align: center; margin: 24px 0 20px; }
#easybuy .eb_head h1 { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
#easybuy .eb_head p { margin: 0; color: var(--eb-text); font-size: 14px; }

/* ステップ表示 */
.eb_steps {
    display: flex;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    overflow-x: auto;
    gap: 4px;
}
.eb_steps li {
    flex: 1 1 0;
    min-width: 64px;
    text-align: center;
    font-size: 11px;
    color: #adb5bd;
    padding: 8px 2px;
    border-top: 3px solid var(--eb-line);
    white-space: nowrap;
}
.eb_steps li span {
    display: block;
    width: 22px; height: 22px; line-height: 22px;
    margin: 0 auto 4px;
    border-radius: 50%;
    background: var(--eb-line);
    color: #fff;
    font-weight: 700;
}
/* 現在のステップ＝テーマ色、通過済み＝薄いテーマ色 */
.eb_steps li.on { color: var(--eb-main); border-top-color: var(--eb-main); font-weight: 700; }
.eb_steps li.on span { background: var(--eb-main); }
.eb_steps li.done { color: var(--eb-main); border-top-color: var(--eb-main); opacity: .55; }
.eb_steps li.done span { background: var(--eb-main); }

/* 選択済み条件 */
.eb_chosen { margin: 0 0 16px; text-align: center; }
.eb_chosen .eb_tag {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 4px 12px;
    background: var(--eb-soft);
    border: 1px solid var(--eb-line);
    color: var(--eb-main);
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
}

/* パネル（1画面につき1ステップだけ表示する）
   ※ hidden 属性はテーマ側の CSS に負けて効かない場合があるため、
     クラスで表示を制御し、[hidden] も !important で確実に隠す。 */
.eb_panel { display: none; }
.eb_panel.eb_on { display: block; }
#easybuy [hidden] { display: none !important; }

.eb_panel h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.eb_panel .eb_note { margin: -6px 0 12px; font-size: 12px; color: #868e96; }

/* 絞り込み入力 */
.eb_search { margin-bottom: 12px; }
.eb_search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--eb-line);
    border-radius: 2em;
    font-size: 15px;
    /* input も button と同様、文字色と書体が端末既定にならないよう揃える */
    color: var(--eb-text);
    font-family: inherit;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}
.eb_search input:focus { outline: none; border-color: var(--eb-main); }

/* 選択肢グリッド */
.eb_grid { display: grid; gap: 8px; }
/* 1ステップ1画面なので内部スクロールは付けず、ページごと自然に流す */
.eb_country { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.eb_opts    { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.eb_item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 10px;
    background: #fff;
    border: 1px solid var(--eb-line);
    /* 選択肢は角丸の四角に統一（国・日数・容量・低速すべて同じ形にする）
       ※ テーマ側の button スタイルに上書きされないよう !important を付ける */
    border-radius: 0.5em !important;
    font-size: 14px;
    /* iOS の WebView では button の文字色が既定でシステム色（青）になるため、
       明示的に指定する。-webkit-appearance: none だけでは色は戻らない。
       font-family も button は継承しないので、本文と揃える。 */
    color: var(--eb-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.eb_item:hover { border-color: var(--eb-main); color: var(--eb-main); }
.eb_item img { width: 24px; height: auto; flex: none; }
.eb_c_body { display: flex; flex-direction: column; min-width: 0; }
/* 絞り込みで「含まれる国」に当たった時だけ出る補足行 */
.eb_c_hit {
    display: none;
    font-size: 11px;
    color: var(--eb-main);
    line-height: 1.4;
    word-break: break-word;
}

/* 日数・容量など（縦並び） */
.eb_opts .eb_item { flex-direction: column; align-items: flex-start; gap: 2px; }
.eb_o_label { font-weight: 700; }
.eb_o_price { font-size: 12px; color: var(--eb-main); }

/* ── 結果カード ───────────────────────────────────────────── */
.eb_card {
    border: 2px solid var(--eb-main);
    border-radius: 12px;
    padding: 18px;
    background: #fff;
}

/* 商品画像 */
.eb_thumb { text-align: center; margin: 0 0 14px; }
.eb_thumb img {
    width: 100%;
    height: auto;
    border-radius: 1em;
    border: 1px solid var(--eb-line);
}

.eb_card .eb_name { font-size: 17px; font-weight: 700; margin: 0 0 12px; line-height: 1.4; }

/* 価格（商品ページと同じくテーマ色） */
.eb_price { text-align: right; margin-bottom: 14px; }
.eb_price strong { font-size: 30px; font-weight: 700; color: var(--eb-main); }
.eb_price span { font-size: 14px; margin-left: 4px; color: var(--eb-text); }

/* 詳細情報（商品ページの仕様表と同じ見た目：枠線＋左列グレー） */
.eb_more { margin: 0 0 16px; }
.eb_detail {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--eb-line);
    border-radius: 8px;
    overflow: hidden;
}
.eb_detail li {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--eb-line);
    font-size: 13px;
    line-height: 1.7;
}
.eb_detail li:last-child { border-bottom: 0; }
.eb_detail .k {
    flex: 0 0 34%;
    padding: 10px 12px;
    background: var(--eb-soft);
    border-right: 1px solid var(--eb-line);
    font-weight: 700;
}
.eb_detail .v { flex: 1 1 auto; padding: 10px 12px; word-break: break-word; }
/* 商品ページと同じく、重要な2項目は赤字 */
.eb_detail li.red .k,
.eb_detail li.red .v { color: var(--eb-main); }
.eb_detail small { display: block; color: #868e96; font-size: 12px; }
.eb_detail li.red small { color: var(--eb-main); }

/* 購入ボタン（商品ページと同じ配色: 主要ボタン＝塗り、副＝白地に枠） */
.eb_buy { display: flex; gap: 8px; flex-wrap: wrap; }
.eb_btn_buy {
    flex: 1 1 220px;
    padding: 15px;
    background: var(--eb-main);
    color: #fff;
    border: 2px solid var(--eb-main);
    border-radius: 2em;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.eb_btn_buy:hover { opacity: .88; }
.eb_btn_detail {
    flex: 1 1 160px;
    padding: 15px;
    background: #fff;
    color: var(--eb-main);
    border: 2px solid var(--eb-main);
    border-radius: 2em;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.eb_btn_detail:hover { background: var(--eb-soft); }

/* 状態表示 */
.eb_loading { text-align: center; padding: 20px; color: #868e96; }
.eb_error {
    margin: 12px 0;
    padding: 12px 14px;
    background: var(--eb-soft);
    border: 1px solid var(--eb-main);
    border-radius: 8px;
    color: var(--eb-main);
    font-size: 14px;
}

/* 操作ボタン（見落とさないよう、はっきりしたコントラストにする） */
.eb_actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--eb-line);
}
.eb_actions button {
    flex: 1 1 0;
    padding: 14px 16px;
    background: var(--eb-soft);
    border: 2px solid var(--eb-main);
    border-radius: 2em;
    font-size: 15px;
    font-weight: 700;
    color: var(--eb-main);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.eb_actions button:hover { background: var(--eb-main); color: #fff; }

/* 「前へ戻る」は進行方向が分かるよう矢印を付ける */
.eb_actions .eb_back::before { content: "\2039"; margin-right: 6px; font-size: 20px; line-height: 1; }
.eb_actions .eb_reset::before { content: "\21BA"; margin-right: 6px; font-size: 16px; line-height: 1; }

/* やり直しは補助操作なので控えめに */
.eb_actions .eb_reset {
    flex: 0 1 auto;
    background: #fff;
    border-color: var(--eb-line);
    color: #868e96;
    font-weight: 400;
}
.eb_actions .eb_reset:hover { background: var(--eb-soft); border-color: #adb5bd; color: var(--eb-text); }

/* スマホ */
@media (max-width: 640px) {
    #easybuy .eb_head h1 { font-size: 20px; }
    .eb_country { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .eb_opts    { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .eb_item { padding: 10px 8px; font-size: 13px; }
    .eb_price strong { font-size: 26px; }
    .eb_steps li { font-size: 10px; min-width: 56px; }
    .eb_detail li { font-size: 12px; }
    .eb_detail .k { flex: 0 0 38%; padding: 9px 10px; }
    .eb_detail .v { padding: 9px 10px; }
    /* スマホでも押しやすいサイズを保つ */
    .eb_actions button { padding: 13px 10px; font-size: 14px; }
}

/* ダークモード（テーマが dark の場合） */
body.dark #easybuy .eb_item,
body.dark #easybuy .eb_card { background: #2b2b2b; border-color: #444; color: #eee; }
body.dark #easybuy .eb_search input { background: #2b2b2b; border-color: #444; color: #eee; }
body.dark .eb_detail { border-color: #444; }
body.dark .eb_detail li { border-bottom-color: #444; }
body.dark .eb_detail .k { background: #333; border-right-color: #444; }
