/* ============================================================
   demo.css — Estimator Simulator (index.php) Styles
   Design: Structured Grid / Trust-forward / Interactive delight
   ============================================================ */

/* ── Grid Layout ─────────────────────────────────────────── */
.l-estimator-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first */
    gap: var(--space-section-s);
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: var(--space-content-m);
}

@media (min-width: 1024px) {
    .l-estimator-grid {
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

/* ── Sidebar & Bottom Area Visibility ────────────────────── */

/* スマホ時：サイドバーを隠し、ボトムエリアを表示 */
.sub {
    display: none;
}
.estimator__bottom-mobile {
    display: block;
    margin-top: var(--space-section-m);
}

/* PC時（1024px〜）：ボトムエリアを隠し、サイドバーを表示 */
@media (min-width: 1024px) {
    .sub {
        display: block;
        position: sticky;
        top: calc(var(--header-height-scrolled) + 20px);
    }
    .estimator__bottom-mobile {
        display: none;
    }
    .estimator__sticky-sidebar {
        background: var(--color-card);
        /* border: 2px solid var(--color-primary); */
        border-radius: 8px;
        /* padding: var(--space-content-m); */
        /* box-shadow: 0 4px 20px rgba(0,0,0,0.05); */
    }
}

/* スマホボトムエリア内の合計金額表示スタイル */
.estimator__summary-total {
    margin-block: var(--space-content-s);
    padding: 12px;
    background: rgba(var(--main-rgb), 0.05);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.estimator__summary-total .label {
    font-size: var(--font-size-note);
    font-weight: 600;
}

.estimator__summary-total .value {
    font-family: "Montserrat", sans-serif;
    font-size: var(--font-size-term);
    font-weight: 800;
    color: rgb(82, 67, 158);
}
/* 選択中のプラン表示エリアのスタイリング */
.estimator__summary-details {
    margin-top: var(--space-content-m);
}

.js_selectedPlanName {
    font-weight: 700;
    color: rgb(82, 67, 158);
    margin-bottom: 8px;
}

/* 追加プラン（オプション）のリストスタイル */
.estimator__selected-options {
    list-style: none;
    padding-left: 1.2rem;
    margin-top: 4px;
    border-left: 2px solid rgb(239, 115, 23);
}

.estimator__selected-options li {
    font-size: 0.9rem;
    color: var(--font-note-color);
    position: relative;
    margin-bottom: 4px;
}

.estimator__selected-options li::before {
    content: "＋";
    position: absolute;
    left: -1.2rem;
    font-size: 0.7rem;
    top: 2px;
    color: rgb(239, 115, 23);
}
/* 数量入力エリアのコンテナ */
.option-item__quantity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto; /* チェックボックスから離して右側に配置 */
    transition: opacity 0.3s ease;
}

/* 数量入力ボックス本体 */
.js_option-quantity {
    width: 60px; /* 幅を固定すると中央寄せが際立ちます */
    padding: 6px 4px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #fff;
    
    /* 【今回のポイント】中央寄せ */
    text-align: center;
    
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--font-color);
}

/* 価格表示 */
.option-price {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    color: rgb(82, 67, 158);
    font-size: var(--font-size-sub);
    white-space: nowrap;
    margin-left: auto;
    transition: color 0.2s;
}

/* 数量インプット（選択時） */
.option-item:has(input[type="checkbox"]:checked) .js_option-quantity {
    border-color: rgba(239, 115, 23, 0.4);
}

/* スピンボタン（上下矢印）を常に表示、または押しやすくする調整（ブラウザ標準） */
.js_option-quantity:focus {
    outline: none;
    border-color: rgb(239, 115, 23);
    background-color: rgba(239, 115, 23, 0.03);
    box-shadow: 0 0 0 3px rgba(239, 115, 23, 0.12);
}

/* 単位（人、GBなど）のスタイル */
.option-item__quantity .unit {
    font-size: 0.85rem;
    color: var(--font-note-color);
    font-weight: 500;
}

/* 非活性時（チェックが入っていない時）のスタイル */
.js_quantity-group.is-disabled {
    opacity: 0.4;
    pointer-events: none; /* クリック不可に */
}

.js_quantity-group.is-disabled .js_option-quantity {
    background-color: #f5f5f5;
}

/* サイドバー内の調整 */
.estimator__sidebar-details {
    margin-top: var(--space-component-s);
    padding-top: var(--space-content-m);
    border-top: 1px solid var(--border-color);
}

.estimator__sidebar-sub-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--font-note-color);
}

/* 浮遊フッター内のボタン（スクロール用） */
.estimator__confirm-scroll-button {
    background: rgb(82, 67, 158);
    color: #fff;
    padding: 10px 20px;
    border-radius: 100vmax;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.2s, box-shadow 0.2s;
}

.estimator__confirm-scroll-button:hover {
    background: rgba(82, 67, 158, 0.85);
    box-shadow: 0 4px 14px rgba(82, 67, 158, 0.28);
}

/* ── Bottom Area & Summary ───────────────────────────────── */
.estimator__bottom {
    margin-top: var(--space-section-m);
    padding-top: var(--space-section-s);
    border-top: 1px solid var(--border-color);
}

.estimator__summary-card {
    padding: var(--space-content-m);
    border-radius: 8px;
}

.estimator__notes {
    font-size: var(--font-size-note);
    color: var(--font-note-color);
    margin-block: var(--space-content-s);
    padding-left: 1.2em;
}

.u-w100 { width: 100%; }

/* ── Floating Footer (Mobile) ────────────────────────────── */
.estimator__floating-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 接触時に隠すためのクラス */
.estimator__floating-footer.is-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 1024px) {
    .estimator__floating-footer {
        display: none;
    }
}




/* ── Estimator Layout ──────────────────────────────────────── */
.estimator {
    min-height: 100dvh;
    padding-bottom: var(--space-section-s); /* フッター分の余白 */
}

.estimator__header {
    padding-block: var(--space-section-s);
}

.estimator__sub-title {
    font-size: var(--font-size-h3);
    color: var(--font-header-color);
    margin-bottom: var(--space-content-m);
    padding-left: 12px;
    border-left: 4px solid rgb(82, 67, 158);
}

/* ── Plan Cards (Radio Select) ─────────────────────────────── */
.l-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-content-s);
}

/* ── Main Plan Cards ───────────────────────────────────────── */
.estimator__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid rgb(233, 227, 215);
    border-radius: 8px;
    padding: var(--space-content-m);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(82, 67, 158, 0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.estimator__card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(233, 227, 215, 0.45) 0%,
        transparent 55%
    );
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.estimator__card:hover {
    border-color: rgba(82, 67, 158, 0.5);
    box-shadow:
        0 6px 24px rgba(82, 67, 158, 0.14),
        0 2px 6px rgba(82, 67, 158, 0.08);
    transform: translateY(-3px);
}

.estimator__card:hover::before {
    opacity: 0;
}

/* Radio 非表示 */
.estimator__input-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 選択済み状態 */
.estimator__card:has(.estimator__input-radio:checked) {
    border-color: rgb(82, 67, 158);
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(82, 67, 158, 0.12),
        0 8px 32px rgba(82, 67, 158, 0.18);
    transform: translateY(-3px);
}

.estimator__card:has(.estimator__input-radio:checked)::before {
    background: linear-gradient(
        160deg,
        rgba(82, 67, 158, 0.07) 0%,
        transparent 60%
    );
    opacity: 1;
}

/* チェックマークバッジ */
.estimator__card:has(.estimator__input-radio:checked)::after {
    content: '\2713';
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgb(82, 67, 158);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(82, 67, 158, 0.35);
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.estimator__card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-component-s);
    flex: 1;
}

.estimator__plan-name {
    font-size: var(--font-size-h3);
    color: rgb(82, 67, 158);
    line-height: var(--lh-medium);
    font-weight: 700;
    letter-spacing: 0.01em;
}
.estimator__card:has(.estimator__input-radio:checked) .estimator__plan-name {
    color: rgb(82, 67, 158);
}

.estimator__plan-desc {
    font-size: var(--font-size-card-body);
    color: var(--font-note-color);
    line-height: 1.6;
}

/* 箇条書きのスタイル */
.estimator__plan-features {
    list-style: none;    /* 標準の黒丸を消してカスタムしやすくする */
    padding: 0;
    margin: 0 0 15px 0;  /* 下の金額との間隔 */
    font-size: 13px;     /* 説明文(14px)より一回り小さくして情報の優先度を下げる */
    color: #666;         /* 少し薄めの色にして、説明文と差別化 */
}

.estimator__plan-features li {
    position: relative;
    padding-left: 1.2em; /* 文頭アイコンのスペース */
    line-height: 1.5;
    margin-bottom: 6px;  /* 項目間の余白 */
}

/* 文頭の記号（・やチェックマーク）を擬似要素で作成 */
.estimator__plan-features li::before {
    content: "・";       /* シンプルな中黒、または「✓」など */
    position: absolute;
    left: 0;
    color: #888;         /* 記号の色を少し薄く */
    font-weight: bold;
}

.estimator__plan-price {
    font-size: var(--font-size-price);
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    color: rgb(82, 67, 158);
    letter-spacing: -0.03em;
    margin-top: auto;
    padding-top: var(--space-component-s);
    border-top: 1px solid rgb(233, 227, 215);
}

.estimator__plan-price.is-text {
    font-size: var(--font-size-term);
    font-weight: 500;
    color: rgb(82, 67, 158);
    letter-spacing: 0;
    margin-top: auto;
    padding-top: var(--space-component-s);
    line-height: 1.5;
    border-top: 1px solid rgb(233, 227, 215);
    font-family: "Noto Sans JP", sans-serif;
}

.estimator__card:has(.estimator__input-radio:checked) .estimator__plan-price {
    color: rgb(82, 67, 158);
    border-top-color: rgba(82, 67, 158, 0.2);
}

/* ── Option Section ─────────────────────────────────────────── */
#optionSection {
    animation: slideDown 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.estimator__option-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-component-m);
}

/* option-item は JS が付与する想定（demo.js の .option-item） */
.option-item {
    display: flex;
    align-items: center; /* 縦方向中央 */
    gap: var(--space-component-m);
    padding: 16px var(--space-content-m);
    background: #fdfdfd;
    border: 1.5px solid rgb(233, 227, 215);
    border-radius: 6px;

    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
    cursor: pointer;
}
.option-item__text-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1; /* 余白を埋めて価格を右に寄せる */
}
.option-item:hover:not(.is-disabled) {
    border-color: rgba(239, 115, 23, 0.5);
    background: #fff;
    box-shadow: 0 2px 12px rgba(239, 115, 23, 0.1);
}

/* チェック済みオプション */
.option-item:has(input[type="checkbox"]:checked) {
    border-color: rgb(239, 115, 23);
    background: #fff;
    box-shadow:
        0 0 0 3px rgba(239, 115, 23, 0.12),
        0 2px 12px rgba(239, 115, 23, 0.12);
}

.option-item.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgb(245, 243, 240);
}

.option-item__main {
    display: flex;
    align-items: center;
    gap: 0.5em; 
}

/* カスタムチェックボックス */
.option-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgb(233, 227, 215);
    border-radius: 4px;
    background: #fff;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.option-item input[type="checkbox"]:checked {
    background: rgb(239, 115, 23);
    border-color: rgb(239, 115, 23);
    box-shadow: 0 0 0 3px rgba(239, 115, 23, 0.15);
}

.option-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* 親要素：チェックボックス、テキスト、価格を横に並べる */
.option-item {
    display: flex;
    align-items: center; /* 縦方向中央 */
    gap: var(--space-component-m);
    padding: 16px var(--space-content-m);
    /* ...既存のスタイル... */
}

/* テキストグループ：名前と説明を縦に並べる */
.option-item__text-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1; /* 余白を埋めて価格を右に寄せる */
}

.option-name {
    font-weight: 600;
    color: var(--font-card-color);
    line-height: 1.4;
}

.option-item__desc {
    font-size: 0.85rem; /* 少し小さめに */
    color: #666; /* 控えめな色 */
    line-height: 1.5;
    margin: 0;
}

/* 価格表示：右側に固定 */
.option-item__price-box {
    text-align: right;
    min-width: 120px;
}

.option-price {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    color: var(--color-primary);
    font-size: var(--font-size-sub);
    white-space: nowrap;
}

/* 数値入力がある場合の微調整 */
.option-item__quantity {
    margin-left: 10px;
}

/* モバイル対応：画面が狭いときは価格や数値を下に回す設定（必要に応じて） */
@media (max-width: 600px) {
    .option-item {
        flex-wrap: wrap;
    }
    .option-item__text-group {
        width: calc(100% - 40px); /* チェックボックスの分を引く */
    }
    .option-item__price-box {
        width: 100%;
        text-align: left;
        padding-left: 36px; /* チェックボックスの位置に合わせる */
        margin-top: 4px;
    }
}

/* オプション名（選択時にオレンジ） */
.option-item:has(input[type="checkbox"]:checked) .option-name {
    color: rgb(239, 115, 23);
    font-weight: 600;
}


/* ── Footer (Fixed Total & Submit) ─────────────────────────── */
.estimator__footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.07);
    z-index: 100;
    gap: var(--space-content-m);
}

.estimator__total {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.estimator__total-label {
    font-size: var(--font-size-note);
    color: var(--font-note-color);
    letter-spacing: 0.05em;
}

.estimator__total-value {
    font-family: "Montserrat", sans-serif;
    font-size: var(--font-size-term);
    font-weight: 800;
    color: rgb(82, 67, 158);
    line-height: 1;
    transition: color 0.3s ease;
}

.estimator__submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    padding: 14px 28px;
    border: none;
    border-radius: 100vmax;
    background: rgb(239, 115, 23);
    color: #fff;
    font-family: "Noto Sans JP", sans-serif;
    font-size: var(--font-size-button);
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.06em;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.estimator__submit-button::after {
    content: ' →';
}

.estimator__submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(239, 115, 23, 0.38);
}

.estimator__submit-button:active {
    transform: scale(0.97);
    box-shadow: none;
}

.estimator__submit-button:disabled {
    background: rgb(233, 227, 215);
    color: rgba(0, 0, 0, 0.35);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 1;
}

/* 無効時はホバー演出や矢印も控えめにする設定 */
.estimator__submit-button:disabled::after {
    opacity: 0.4;
}

.estimator__submit-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ── Utility ────────────────────────────────────────────────── */
.u-hidden,
.is-hidden {
    display: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .l-grid {
        grid-template-columns: 1fr;
    }

    .estimator__footer {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 10px;
    }

    .estimator__submit-button {
        width: 100%;
        min-width: unset;
    }

    .estimator__total {
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
    }
}


/* リセットボタンのスタイル　20260405　ここから　修正後削除 */
.estimator__reset-button {
    display: none; /* 初期状態は非表示（プラン選択時にJSで表示） */
    width: 100%;
    background: none;
    border: none;
    color: #888;
    font-size: 12px;
    text-decoration: underline;
    margin-bottom: 16px; /* お問い合わせボタンとの隙間 */
    cursor: pointer;
}

.estimator__reset-button:hover {
    color: #cc0000;
}

/* プラン選択中のみリセットボタンを表示するためのクラス（JSで制御） */
.has-selection .estimator__reset-button {
    display: block;
}
