/**
 * 料金シミュレーション プロトタイプ - スタイル
 * 更新: 2026-03-02 / 260302_料金シミュレーション機能_機能要件確認書.xlsx 対応
 */

/* ── ベース ─────────────────────────────────────────────────────────────── */
.sim-wrap {
    --sim-main-color: #61619e; /* メインカラー（紫） */
    --sim-main-color-light: #e2e2ed; /* メインカラーの薄い版 */
    --sim-text-color: #343434; /* 本文の文字色 */
    --sim-heading-color: #331d4c; /* 見出しの文字色 */
    --sim-notice-color: #d31717; /* 注意・割引の文字色（赤） */

    max-width: 960px;
    margin: 0 auto;
    padding: 80px 16px 24px; /* 上80px（グローバルナビとの余白）・左右16px・下24px */
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 0.9375rem; /* 15px */
    line-height: 1.6;
    color: #333;
}

.sim-header {
    position: relative;
    margin-bottom: 40px;
}

.sim-header-bg {
    position: absolute;
    top: -80px; /* .sim-wrapの上padding(80px)を打ち消し、画像をページ上端に詰める */
    left: 50%;
    width: 100vw; /* ビューポート全幅に広げ、.sim-wrapの960px制約からはみ出させる */
    height: 372px; /* 画面幅1400px以下の表示サイズ（幅541px時、実寸比率を保った値） */
    transform: translateX(-50%); /* .sim-headerが中央寄せのため、50%地点はページの水平中央と一致する */
    background-image: url("../img/bg_sim-header.png"); /* image-set非対応ブラウザ向けフォールバック */
    background-image: image-set(
        url("../img/bg_sim-header.avif") type("image/avif"),
        url("../img/bg_sim-header.webp") type("image/webp"),
        url("../img/bg_sim-header.png") type("image/png")
    );
    background-repeat: no-repeat;
    background-position: right top; /* 100vw幅の帯の右端 = ブラウザの右端に画像を配置 */
    background-size: 541px 372px; /* 画面幅1400px以下の表示サイズ。実寸1082×744の比率を保っている */
    pointer-events: none;
}
@media (min-width: 1401px) {
    .sim-header-bg {
        height: 500px; /* 画面幅1401px以上の表示サイズ（高さ500px基準） */
        background-size: auto 500px; /* 幅は画像の実寸比率から自動計算される */
    }
}

.sim-page-title,
.sim-intro,
.sim-disclaimer-box {
    position: relative;
}

.sim-page-title {
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
    font-weight: 600; /* Demibold */
    font-size: 1.875rem; /* 30px */
    line-height: 1.4;
    margin: 0 0 3.5rem 0; /* 56px */
}

.sim-intro {
    margin-bottom: 2.625rem; /* 42px */
}

.sim-intro p {
    margin: 0;
    font-size: 1rem; /* 16px */
    color: #4d4d4d;
}

.sim-disclaimer-box {
    padding: 1.25rem; /* 20px */
    background: var(--sim-main-color-light);
    border: 1px solid var(--sim-main-color);
}

.sim-disclaimer-box ul {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sim-disclaimer-box li {
    position: relative;
    padding-left: 1em; /* 「※」分の字下げ。折り返し時もここで本文の頭が揃う */
    font-size: 1rem; /* 16px */
    color: #4d4d4d;
}

.sim-disclaimer-box li::before {
    content: "※";
    position: absolute;
    left: 0;
}

/* ── セクション ────────────────────────────────────────────────────────── */
.sim-section {
    margin-top: 56px; /* 区切り線の上の余白（前のセクションとのmarginは衝突時に大きい方が優先される） */
    padding-top: 56px; /* 区切り線の下の余白 */
    border-top: 2px solid #d9d9d9; /* 区切り線 */
}

.sim-section-title {
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
    font-weight: 500;
    font-size: 1.5rem; /* 24px */
    line-height: 1.4;
    color: var(--sim-heading-color);
    margin: 0 0 40px 0;
}

/* ── 選択カード（共通: ホール選択・割引など、同じ見た目の選択肢で使い回す）──── */
.sim-choice-card {
    display: block;
    position: relative;
    box-sizing: border-box;
    width: 300px;
    flex-shrink: 0;
    padding: 1rem 1.25rem; /* 上下16px 左右20px */
    cursor: pointer;
    background: #fff;
    border: 2px solid var(--sim-main-color-light);
    border-radius: 6px;
    transition: border-color 0.15s, background 0.15s;
}

.sim-choice-card:has(.sim-choice-input:checked) {
    background: var(--sim-main-color-light);
    border-color: var(--sim-main-color);
}

.sim-choice-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ── ホール選択 ─────────────────────────────────────────────────────────── */
.sim-hall-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 25px;
}

.sim-hall-name {
    display: block;
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: var(--sim-text-color);
}

.sim-hall-seats {
    display: block;
    margin-top: 16px;
    color: var(--sim-text-color);
}

/* ── 割引選択 ───────────────────────────────────────────────────────────── */
.sim-discount-desc-text {
    margin: 0;
    font-size: 1rem; /* 16px */
    line-height: 1.6;
    color: #4d4d4d;
}

.sim-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 260px;
    height: 48px;
    margin-top: 24px;
    margin-bottom: 40px;
    padding: 0 20px;
    border: 1px solid var(--sim-main-color);
    border-radius: 6px;
    background: #fff;
    color: var(--sim-main-color);
    font-size: 1rem; /* 16px */
    text-decoration: none;
}

.sim-link-button-arrow {
    font-size: 1.25rem; /* 20px */
}

.sim-discount-list {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.sim-discount-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* 8px */
}

.sim-discount-title {
    display: block;
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: var(--sim-text-color);
}

.sim-discount-desc {
    display: block;
    color: var(--sim-text-color);
}

/* ── 小見出し（共通パーツ: このページ内で繰り返し使う） ─────────────────── */
.sim-subheading {
    margin: 48px 0 24px 0;
    padding-bottom: 0.5rem; /* 8px */
    border-bottom: 2px solid var(--sim-main-color-light);
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: var(--sim-main-color);
}

.sim-plan-includes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sim-plan-includes-grid li {
    width: 120px;
    height: 120px;
}

.sim-plan-includes-grid img {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
}

/* ── 小さい注意書き（共通パーツ: このページ内で繰り返し使う） ───────────── */
.sim-note-small {
    margin-top: 1.25rem; /* 20px */
    font-size: 0.875rem; /* 14px */
    color: #808080;
}

/* プラン選択の説明文（祭壇はイメージ画像となります）。
   注釈（.sim-note-small）ではなく、割引の説明文（.sim-discount-desc-text）と同じ見た目にする（2026-10-19） */
.sim-plan-note {
    margin: 0 0 1.5rem 0; /* 下24px: プランカードとの間隔 */
    font-size: 1rem; /* 16px */
    line-height: 1.6;
    color: #4d4d4d;
}

/* ── 選択肢カードの案内文（共通パーツ: カード群の直前に使う） ───────────── */
.sim-choice-hint {
    margin: 1.5rem 0 2rem 0; /* 上24px 下32px */
}

/* ── 連動する数量選択オプションの案内文 ──────────────────────────────── */
.sim-link-qty-note {
    margin: 1.5rem 0 1rem 0; /* 上24px 下16px */
}

/* ── 「このオプションは選択したプランに含まれます。」（表示/非表示は JS が style.display で切り替える） ── */
.sim-plan-included-msg {
    padding: 16px 12px;
    background-color: var(--sim-main-color-light);
    color: var(--sim-notice-color);
    font-weight: bold;
}

/* 2行目の補足（※ どれを選択しても…）は14px・通常の太さ・本文の文字色 */
.sim-plan-included-msg-note {
    display: block;
    font-size: 0.875rem; /* 14px */
    font-weight: normal;
    color: var(--sim-text-color);
}

/* ── オプション種別の注釈（カード上。Figma仕様） ─────────────────────── */
.sim-opt-note-top {
    margin: 1rem 0 2rem 0; /* 上16px 下32px */
    font-size: 1rem; /* 16px */
    line-height: 1.6;
    color: #4d4d4d;
}

/* ── プラン一覧（動的描画）──────────────────────────────────────────────── */
.sim-plan-list {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 12px;
}

.sim-plan-card {
    display: block;
    position: relative;
    box-sizing: border-box;
    width: 300px;
    cursor: pointer;
    background: #fff;
    border: 2px solid var(--sim-main-color-light);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}

.sim-plan-card:has(.sim-choice-input:checked) {
    background: var(--sim-main-color-light);
    border-color: var(--sim-main-color);
}

/* 会館使用料はホール選択に連動して決まるため、お客様が選び直せないようにしている（2026-10-20） */
.sim-plan-card:has(.sim-opt-single:disabled) {
    cursor: default;
}

/* そのうち選ばれていない品目はグレー表示にする */
.sim-plan-card.is-fixed-unselected {
    opacity: 0.45;
}

.sim-plan-card-image {
    position: relative;
    display: block;
    width: 100%;
    height: 161px;
    background: #b3b3b3;
}

.sim-plan-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sim-plan-card-zoom {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 0 6px;
    background: rgba(255, 255, 255, 0.9);
}

.sim-plan-card-zoom img {
    display: block;
    width: 36px;
    height: 36px;
}

.sim-plan-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* 8px */
    padding: 1rem 1.25rem 0.75rem; /* 上16px 左右20px 下12px */
}

.sim-plan-card-name {
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: var(--sim-text-color);
}

.sim-plan-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--sim-main-color);
    font-weight: 700;
    white-space: nowrap;
}

.sim-plan-card-price {
    font-size: 1.25rem; /* 20px */
}

.sim-plan-card-price-unit {
    font-size: 0.875rem; /* 14px */
}

.sim-plan-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 0 1.25rem 1.25rem; /* 左右20px 下20px */
}

.sim-plan-card-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 5px 5px;
    border-radius: 3px;
    background: var(--sim-main-color);
    color: #fff;
    font-size: 0.9375rem; /* 15px */
    line-height: 15px;
    white-space: nowrap;
}

/* プラン・オプションカードの説明文バリエーション（画像の高さが異なる） */
.sim-plan-card--desc .sim-plan-card-image {
    height: 200px;
}

.sim-plan-card-desc {
    display: block;
    padding: 0.25rem 1.25rem 1rem; /* 上4px 左右20px 下16px */
    font-size: 0.9375rem; /* 15px */
    line-height: 1.6;
    color: var(--sim-text-color);
}

.sim-radio-label,
.sim-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.sim-radio-label input,
.sim-check-label input {
    margin: 0;
}

.sim-input-number {
    padding: 6px 10px;
    font-size: 1rem;
    border: 1px solid #999;
    border-radius: 4px;
    width: 90px;
}

.sim-input-number.small {
    width: 95px;
    height: 32px;
    padding: 4px 6px;
    font-size: 0.9rem;
    border-color: #d9d9d9;
    border-radius: 6px;
    box-sizing: border-box;
}

/* ── 品目画像 ─────────────────────────────────────────────────────────────── */
.sim-item-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    display: block;
}

/* ── 数量選択カード（礼状・生花など。画像は縦横混在想定）──────────────────
   CSS Gridを使用: 同じ行のカード同士は自動で高さが揃う（align-items初期値のstretch）。
   画像はトリミングせず実寸比率のまま表示するため、揃うのは「行の中だけ」になる。
   カード内の余白は .sim-qty-card-body 側（flex:1 + 数量欄のmargin-top:auto）で吸収する。 */
.sim-qty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 210px);
    gap: 30px;
}

.sim-qty-card {
    display: flex;
    flex-direction: column;
    width: 210px;
}

.sim-qty-card-image {
    position: relative;
    box-sizing: border-box;
    width: 210px;
    min-height: 140px; /* 画像が無い場合でもグレーのプレースホルダー枠を表示する（推奨比率 横3:縦2 の高さ） */
    background: #d9d9d9;
    border: 1px solid #d9d9d9;
}

/* 画像がある場合は画像の高さに合わせ、下に背景色がはみ出さないようにする */
.sim-qty-card-image:has(> img) {
    min-height: 0;
}

.sim-qty-card-image img {
    display: block;
    width: 100%;
    height: auto; /* 実寸比率のまま。トリミングしない */
}

.sim-qty-card-body {
    display: flex;
    flex: 1; /* Gridで伸びたカードの余白をここで吸収する */
    flex-direction: column;
    margin-top: 1.5rem; /* 24px */
}

.sim-qty-card-name {
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: #000;
}

.sim-qty-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 1.25rem; /* 20px */
    color: var(--sim-main-color);
    font-weight: 700;
}

.sim-qty-card-price {
    font-size: 1.25rem; /* 20px */
}

.sim-qty-card-price-unit {
    font-size: 0.875rem; /* 14px */
}

/* 品目の説明（例：精進鉢盛の「1鉢5〜6名目安」。管理画面の「説明」欄） */
.sim-qty-card-desc {
    margin-top: 1rem; /* 16px */
    font-size: 0.9375rem; /* 15px */
    color: var(--sim-text-color);
}

.sim-qty-card-input-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto; /* カード内の余った高さをここで吸収し、入力欄を下端に揃える */
    padding-top: 1.5rem; /* 24px */
}

.sim-qty-card-input-label {
    font-size: 0.8125rem; /* 13px */
    color: #000;
}

/* ── シミュレーション結果（内訳・合計）─────────────────────────────────── */
.sim-result-section {
    position: relative;
    isolation: isolate; /* 背景用の::before(z-index:-1)をこのセクション内に閉じ込める */
    margin-top: 56px;
    padding: 80px 0;
}

.sim-result-section::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: -1;
    width: 100vw; /* .sim-wrapの960px制約からはみ出させ、背景をビューポート全幅に広げる */
    transform: translateX(-50%);
    background: var(--sim-main-color-light);
}

.sim-result-title {
    text-align: center;
    margin-bottom: 56px;
}

/* 内訳リスト */
.sim-breakdown {
    max-width: 760px;
    margin: 0 auto;
}

.sim-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sim-breakdown-row {
    display: flex;
    align-items: baseline;
    padding: 1px 8px 10px 0; /* 下線までの余白10px・金額の右余白8px */
    border-bottom: 1px solid var(--sim-main-color);
    font-size: 1.125rem; /* 18px */
    line-height: 1.5;
    color: #000;
}

.sim-breakdown-category {
    flex: 0 0 240px; /* 品目名の開始位置を揃える */
}

.sim-breakdown-item {
    flex: 1 1 auto;
}

.sim-breakdown-amount {
    margin-left: auto;
    padding-left: 16px;
    white-space: nowrap;
    text-align: right;
}

/* 品目列のない行（会館使用料・プラン・割引）は区分名を全幅で表示 */
.sim-breakdown-row--no-item .sim-breakdown-category {
    flex: 1 1 auto;
}

.sim-breakdown-row--discount {
    color: var(--sim-notice-color);
}

.sim-breakdown-row--included .sim-breakdown-amount {
    font-size: 0.875rem; /* 14px */
    color: var(--sim-main-color);
}

/* 合計ボックス */
.sim-result-box {
    box-sizing: border-box;
    width: 960px; /* .sim-wrapのコンテンツ幅(928px)より広いため左右にはみ出させる */
    margin: 56px 0 0 calc(50% - 480px);
    padding: 54px 96px 48px;
    background: #fff;
    border: 2px solid var(--sim-main-color);
}

.sim-result-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.sim-result-total-label {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    color: #000;
}

.sim-result-total-price {
    font-size: 1.875rem; /* 30px */
    font-weight: 700;
    line-height: 1.4;
    color: var(--sim-main-color);
}

.sim-result-total-price-unit {
    margin-left: 4px;
    font-size: 0.875rem; /* 14px */
    font-weight: 700;
    color: var(--sim-main-color);
}

.sim-result-note {
    margin: 12px 0 0;
    font-size: 0.6875rem; /* 11px */
    color: #808080;
    text-align: right;
}

.sim-result-pdf-btn {
    display: block;
    margin: 20px auto 0;
    padding: 12px 32px;
    font-family: inherit;
    font-size: 1rem; /* 16px */
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    background: var(--sim-main-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.sim-result-pdf-btn:hover {
    opacity: 0.85;
}

/* ── 関連ページへのリンク（お急ぎの方・斎場のご案内・ご利用の流れ）──────── */
/* 既存サイトの .cont_link_box（/themes/PC/css/cont.css）と同じ並び。cont.css は読み込まず専用クラスで再現する */
.sim-page-links {
    width: 960px; /* 300px×3枚＋間隔30px×2。.sim-wrapのコンテンツ幅(928px)より広いため左右にはみ出させる */
    margin: 56px 0 0 calc(50% - 480px);
}

.sim-page-links-list {
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sim-page-links-list a {
    display: block;
}

.sim-page-links-list img {
    display: block;
}

.sim-disclaimer {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 16px;
}

/* ── 画像ライトボックス ───────────────────────────────────────────────────── */
.sim-plan-card-zoom {
    cursor: pointer;
    border: none;
    padding: 0;
}

.sim-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
}

.sim-lightbox[hidden] {
    display: none;
}

.sim-lightbox-body {
    max-width: 960px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sim-lightbox-img {
    max-width: 100%;
    max-height: 70vh; /* 縦長画像でもキャプション分の余白が画面内に残るようにする */
    width: auto;
    height: auto;
    display: block;
}

.sim-lightbox-caption {
    margin: 12px 0 0 0;
    color: #fff;
    font-size: 1rem; /* 16px */
    text-align: center;
}

.sim-lightbox-caption[hidden] {
    display: none;
}

.sim-lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 1.5rem; /* 24px */
    line-height: 1;
    cursor: pointer;
}
@media (max-width: 600px) {
    .sim-wrap {
        padding: 16px 12px;
    }
}

/* ── キーボード操作時のフォーカス表示 ───────────────────────────────────── */
/* カード内の radio / checkbox は opacity:0 で隠しているため、
   フォーカスが当たったことをカード側の枠線で示す */
.sim-choice-card:has(.sim-choice-input:focus-visible),
.sim-plan-card:has(.sim-choice-input:focus-visible) {
    outline: 3px solid #5b5ea6;
    outline-offset: 2px;
}

/* 数量入力・拡大ボタン・PDFボタンは要素自身に枠線を出す */
.sim-opt-qty:focus-visible,
.sim-plan-card-zoom:focus-visible,
.sim-result-pdf-btn:focus-visible,
.sim-lightbox-close:focus-visible {
    outline: 3px solid #5b5ea6;
    outline-offset: 2px;
}
