/* modal.css: モーダルと結果カードのスタイル */

/* results_flex（検索結果コンテナ）の基本がここにある場合は残す） */
.results_flex{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 50px;
    letter-spacing: 0.05em;
}

/* --- 結果カード --- */
.result-card{
    width: min(380px, 100%);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.result-card:focus,
.result-card:hover{
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.18);
    outline: none;
}
.result-card__media{ width:100%; height:200px; overflow:hidden; }
.result-card__media img{ width:100%; height:100%; object-fit:cover; display:block; }
.result-card__body{ padding:12px 14px; }
.result-card .shop{ margin:0 0 6px 0; font-size:18px; font-weight: normal; color: #B03B3B; }
.result-card .course{ margin:0 0 8px 0; font-size: 20px; font-weight: 700; letter-spacing: 0.05em; color: #B03B3B; }
.result-card .price{ margin:0; font-weight:normal; font-size: 20px; color:#B03B3B; }

/* --- モーダル --- */
.modal{ display:none; position:fixed; inset:0; z-index:1200; }
.modal.is-open{ display:block; }
.modal__overlay{ position:absolute; inset:0; background: rgba(0,0,0,0.5); }

/* 1. モーダル本体: 高さ上限とスクロールを設定 */
.modal__card{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    background:#fff;
    color:#333;
    border-radius:12px;
    box-shadow:0 12px 30px rgba(0,0,0,0.2);
    
    /* デザイン調整とスクロール対応 */
    max-width: 1200px;
    width: min(1200px, calc(100% - 40px));
    max-height: 85vh;
    overflow-y: auto; /* カード全体をスクロールさせる */
}

.modal__close{ position:absolute; right:12px; top:8px; border:none; background:transparent; font-size:36px; cursor:pointer; z-index: 10; color:#B03B3B; }

/* 2. コンテンツエリア全体: 上端揃えにし、内側に余白を設ける */
.modal__content{
    display: flex;
    gap: 24px; /* 画像とテキストの間のスペース */
    align-items: flex-start; /* ★ 子要素を上端で揃える */
    padding: 24px; /* 内側の余白 */
}

/* 左側（画像） */
.modal__left{
    flex: 1 1 50%;
    min-width: 180px;
}
.modal__media{
    width:100%;
    height:100%;
    overflow:hidden;
    background-color: #f5f5f5; /* 画像の余白部分の背景色 */
    border-radius: 8px;
}
.modal__media img{
    width:100%;
    height:100%;
    object-fit: contain; /* 画像が見切れないように調整 */
    display:block;
}

/* 3. 右側（テキスト） */
.modal__right{
    flex: 1 1 50%;
    display: flex;
    align-items: flex-start;
}
.modal__right .modal__body{ padding: 0; width: 100%;} /* 幅を100%に */

/* --- テキスト要素のスタイル調整 --- */
#modal-title.modal__shop {
    font-weight: 500;
    font-size: 20px;
    color: #B03B3B;
}
#modal-course.modal__course {
    font-size: 24px;
    font-weight: bold;
    color: #B03B3B;
    margin-top: 8px;
}
#modal-desc.modal__desc {
    font-size: 16px;
    margin-top: 16px;
    margin-bottom: 1.5em;
    color: #4a4a4a;
    line-height: 1.6;
}

/* contentとbenefitの間のスペース */
#modal-content {

}

#modal-benefit.modal__benefit {
    font-size: 16px;
    margin-bottom: 1.5em;
}
#modal-price.modal__price {
    font-size: 24px;
    font-weight: bold;
    margin-top: 24px;
    text-align: left;
    color:#B03B3B;
}

/* --- ボタンエリアのスタイル調整 --- */
.modal__actions {
    text-align: center;
    margin-top: 16px;
    display: flex;
    gap: 16px;
    justify-content: center;
}
.modal__actions .btn {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.1em;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration:none;
    font-size: 20px; /* 文字を大きく */
    /* 新しいスタイルをここに集約 */
    background-color: #B03B3B;
    color: #fff;
    border-radius: 99px; /* 角丸を大きく */
    border: 1px solid #B03B3B;
}

.modal__actions .btn:hover {
    background-color: #fff; /* ホバー時に背景を白に */
    color: #B03B3B; /* ホバー時に文字をテーマカラーに */
    border-color: #B03B3B;
}


/* 4. SP表示時の調整 */
@media screen and (max-width: 720px){
    .modal__card{
        width: calc(100% - 32px);
    }
    .modal__content{
        flex-direction: column;
        overflow-y: auto; /* ★ SPではコンテンツ全体をスクロール */
        -webkit-overflow-scrolling: touch;
        padding: 16px; /* SPでは余白を少し狭く */
        gap: 16px;
        align-items: stretch; /* SPではstretchに戻す */
    }
    .modal__left{
        width: 100%;
        height: 200px; /* 画像の高さを固定 */
        flex-shrink: 0;
    }
    .modal__right{
        width: 100%;
        overflow-y: visible; /* 右側の個別スクロールは無効化 */
        height: auto; /* 高さを自動に */
    }
}

/* --- Tel Button --- */
.modal__tel {
    text-align: center;
    margin-top: 24px;
}

.btn-tel {
    display: flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center icon and text */
    justify-content: center; /* Horizontally center icon and text */
    width: 100%;
    padding: 8px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.1em;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    font-size: 20px;
    background-color: #B03B3B;
    color: #fff;
    border-radius: 99px;
    border: 1px solid #B03B3B;
}

.btn-tel:hover {
    background-color: #fff;
    color: #B03B3B;
    border-color: #B03B3B;
}

.btn-tel i {
    margin-right: 8px;
}
.modal__content_text,.modal__benefit{
    font-size: 14px;
    color: #441A00;
}