@charset "UTF-8";

/* =========================================
   1. コンテナ & 共通設定
   ========================================= */
.mp-container {
    margin-bottom: 3em;
    font-family: inherit;
    box-sizing: border-box;
}

.mp-container * {
    box-sizing: border-box;
}

/* =========================================
   2. 選択エリア
   ========================================= */
.mp-selector-area {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
}

.mp-selector-title {
    text-align: center !important;
    font-weight: bold;
    margin: 0 0 20px 0;
    position: relative;
    padding-bottom: 10px;
}

.mp-brand-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.mp-brand-group {
    border-radius: 6px;
    padding: 12px 16px;
    border: 1px solid #eee;
}

.mp-brand-name {
    margin: 0 0 10px 0 !important;
    font-size: 0.95em;
    font-weight: bold;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 6px;
}

.mp-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mp-label {
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 2px 0;
}

/* =========================================
   3. 比較表 ([price_table])
   ========================================= */
.wp-block-table {
    margin: 0 0 2em 0;
    border: 1px solid #ddd;
}

.mp-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate; 
    border-spacing: 0;
}

.mp-table th, 
.mp-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #ddd; 
    border-right: 1px solid #ddd;
    vertical-align: middle !important;
    text-align: center !important;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
    background-color: #fff; /* スクロール時の透過防止 */
}

/* ヘッダー：WPテンプレートの色を尊重（固定列以外） */
.mp-table thead th {
    font-weight: bold;
}

/* 左端「項目」列：ここだけは固定時の視認性と透過防止のため色を付けます */
.mp-table th.mp-row-header {
    width: 160px;
    background-color: #f9f9f9; /* 薄いグレーを復活 */
    font-weight: bold;
}

.mp-align-left {
    text-align: left !important;
}

.mp-note {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    opacity: 0.8;
}

/* =========================================
   4. 簡易リスト表 ([simple_table])
   ========================================= */
.mp-simple-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    border: 1px solid #ddd;
}

.mp-simple-table th, 
.mp-simple-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle !important;
    text-align: center !important;
}

.mp-simple-table th {
    border-bottom: 2px solid #ddd;
    font-weight: bold;
}

.mp-col-brand { text-align: left !important; }
.mp-col-price { font-weight: bold; }

/* =========================================
   5. 差額表示ボックス
   ========================================= */
.mp-diff-box {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0 30px 0;
}

/* =========================================
   6. モバイル設定（スマホ時のみ横スクロール＆固定発動）
   ========================================= */
@media (max-width: 768px) {
    .wp-block-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* スクロールを促す演出 */
        background: linear-gradient(to right, white 30%, rgba(255,255,255,0)),
                    linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
                    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.1), rgba(0,0,0,0)),
                    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.1), rgba(0,0,0,0)) 0 100%;
        background-repeat: no-repeat;
        background-color: white;
        background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }

    .mp-table {
        min-width: 650px; 
        font-size: 0.8em;
    }

    /* スマホで左端を固定 */
    .mp-table th.mp-row-header {
        position: -webkit-sticky;
        position: sticky;
        left: 0;
        z-index: 10;
        width: 100px;
        min-width: 100px;
        border-right: 2px solid #ccc;
        background-color: #f5f5f5; /* スマホ固定時の視認性と重なり防止 */
    }

    .mp-table thead th.mp-row-header {
        z-index: 20;
    }

    .mp-table td, .mp-table th {
        padding: 8px 4px;
    }
}