/* body-match.css — [avos_body_match] ショートコード用スタイル */

/* ============================================================
   ラッパー
   ============================================================ */
.bm-wrap {
    max-width: 640px;
    margin: 0 auto 40px;
    padding: 0 8px;
    box-sizing: border-box;
}

/* ============================================================
   説明文
   ============================================================ */
.bm-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 16px;
}

/* ============================================================
   プリセットボタン
   ============================================================ */
.bm-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.bm-preset-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bm-preset-btn:hover,
.bm-preset-btn--active {
    background: color-mix(in srgb, var(--color_main, #e0a0a0) 15%, #fff);
    border-color: var(--color_main, #e0a0a0);
    color: var(--color_main, #e0a0a0);
}

.bm-preset-btn--active {
    background: var(--color_main, #e0a0a0);
    color: #fff;
}

/* ============================================================
   入力フォーム
   ============================================================ */
.bm-form {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.bm-field {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.bm-field:last-child {
    margin-bottom: 0;
}

.bm-label {
    width: 64px;
    font-size: 0.82rem;
    color: #555;
    flex-shrink: 0;
}

/* カップ select */
.bm-select {
    padding: 5px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    flex-shrink: 0;
}

/* 〜 セパレーター（カップ用） */
.bm-range-sep {
    font-size: 0.75rem;
    color: #aaa;
    flex-shrink: 0;
}

/* ============================================================
   デュアルハンドル range スライダー
   ============================================================ */
.bm-range-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 24px; /* thumb の高さに合わせる */
}

/* 背景トラック */
.bm-range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    pointer-events: none;
}

/* 選択範囲の着色 fill（JS が left/width を更新） */
.bm-range-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--color_main, #e0a0a0);
    border-radius: 4px;
}

/* 2つの input を重ねて配置 */
.bm-range-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none; /* トラック部分は無効 */
    outline: none;
    cursor: pointer;
}

/* トラック疑似要素を input 全高に広げて thumb を中央に合わせる */
.bm-range-input::-webkit-slider-runnable-track {
    height: 100%;
    background: transparent;
    border: none;
}

.bm-range-input::-moz-range-track {
    height: 100%;
    background: transparent;
    border: none;
}

.bm-range-input::-moz-range-progress {
    background: transparent;
}

/* thumb */
.bm-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color_main, #e0a0a0);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
}

.bm-range-input::-moz-range-thumb {
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color_main, #e0a0a0);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* max input は min の上に重ねる（z-index で制御） */
.bm-range-input:last-of-type {
    z-index: 2;
}

.bm-range-input:first-of-type {
    z-index: 1;
}

/* min が max と同じ位置にきた場合は min を上に */
.bm-range-input.bm-range-input--top {
    z-index: 3;
}

/* ============================================================
   値表示・単位
   ============================================================ */
.bm-value {
    width: 30px;
    text-align: center;
    font-size: 0.82rem;
    color: #333;
    flex-shrink: 0;
}

.bm-unit {
    font-size: 0.8rem;
    color: #888;
    flex-shrink: 0;
}

/* ============================================================
   検索ボタン
   ============================================================ */
.bm-search-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--color_main, #e0a0a0);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.15s;
    margin-bottom: 12px;
}

.bm-search-btn:hover {
    opacity: 0.85;
}

.bm-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   ステータスメッセージ
   ============================================================ */
.bm-status {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    min-height: 1.4em;
    margin-bottom: 16px;
}

/* ============================================================
   結果エリア
   ============================================================ */
.bm-results {
    min-height: 80px;
}

.bm-results .p-actress-card-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 480px) {
    .bm-form {
        padding: 14px 12px;
    }

    .bm-field {
        gap: 4px;
    }

    .bm-label {
        width: 48px;
        font-size: 0.78rem;
    }

    .bm-value {
        width: 26px;
        font-size: 0.78rem;
    }

    .bm-results .p-actress-card-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
