/* 
 * 商品カードのレイアウト修正用CSS (Version 19)
 * HTMLのフラットな構造（pタグの羅列）をCSS Gridで完全に制御し、
 * 画面サイズを変えても重なり・はみ出し・跳ね上がりが起きないようにしました。
 */

/* 1. 商品カード全体の並び */
.plan-type01 {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

/* 2. カード本体のデザイン（plan.css 289行目準拠） */
.plan-type01 > li {
    width: 30% !important;
    min-width: 310px !important;
    margin: 1% !important;
    margin-bottom: 25px !important;
    border: double 3px #DDD !important;
    padding: 25px !important;
    border-radius: 20px !important;
    background: #FFF !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* 3. 価格エリア（.type01-week）のGridによる構造化 */
.type01-week {
    display: grid !important;
    /* 左：項目名（可変）、右：金額（内容に合わせる） */
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px 10px !important; /* 行間8px, 列間10px */
    border-bottom: dotted 1px #AAA !important;
    padding: 10px 0 !important;
    margin-top: auto !important;
    width: 100% !important;
    align-items: start !important; /* 上揃えにしてズレを防止 */
}

.type01-week p {
    color: #000 !important;
    font-family: "メイリオ", sans-serif !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* 項目名（奇数番目のp：左側） */
.type01-week p:nth-child(odd) {
    grid-column: 1 !important;
    text-align: left !important;
    font-size: 16px !important;
    word-break: break-all !important; /* 長い項目名でも強制改行してはみ出し防止 */
}

/* 金額（偶数番目のp：右側） */
.type01-week p:nth-child(even) {
    grid-column: 2 !important;
    text-align: right !important;
    font-size: 26px !important;
    font-weight: normal !important;
    white-space: nowrap !important; /* 金額と税込は一行を維持 */
}

/* 金額内の単位 */
.type01-week p:nth-child(even) span:not(.small) {
    font-size: 14px !important;
}

/* 補足説明（span.small）の制御 */
.type01-week span.small {
    font-size: 11px !important;
    color: #666 !important;
    display: block !important; /* 金額の上または下に改行して配置 */
    line-height: 1.1 !important;
    margin-bottom: 2px !important;
}

/* 4. レスポンシブ対応 */
@media screen and (max-width: 1200px) {
    .plan-type01 > li {
        width: 46% !important;
    }
}

@media screen and (max-width: 800px) {
    /* 画面が狭くなったら金額の文字サイズを下げてはみ出しを未然に防ぐ */
    .type01-week p:nth-child(even) {
        font-size: 22px !important;
    }
}

@media screen and (max-width: 640px) {
    .plan-type01 > li {
        width: 96% !important;
        margin: 10px auto !important;
        min-width: 0 !important;
    }
    
    /* スマホ等の極小画面では1列（上下並び）に切り替えて重なりを100%回避 */
    .type01-week {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .type01-week p:nth-child(odd) {
        text-align: left !important;
        font-size: 14px !important;
    }
    .type01-week p:nth-child(even) {
        text-align: right !important;
        font-size: 20px !important;
        margin-top: -5px !important;
        margin-bottom: 10px !important;
    }
}
