/* ==========================================================================
   Search List Page Stylesheet (Refactored from search/list.php)
   ========================================================================== */

/* ギャラリー全体を囲むコンテナ */
.image-box {
    box-sizing: border-box;
    background-color: #ffffff;
    padding: 1rem;
    width: 100%;
    max-width: 448px;
}

/* メイン画像表示エリア (スマホ用デフォルト) */
.image-box .main-image-wrapper {
    position: relative;
    background-color: #f9fafb;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    height: 260px;
    cursor: pointer;
}

.image-box .main-image {
    object-fit: contain;
    width: 100%;
    height: 100%;
    transition: opacity 0.2s ease-in-out;
}

/* サムネイル表示エリア */
.image-box .thumbnails-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.image-box .thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
    cursor: pointer;
    background-color: #e5e7eb;
    transition: opacity 0.2s ease-in-out, transform 0.1s;
}

.image-box .thumbnail:hover {
    opacity: 0.8;
}

.image-box .thumbnail:active {
    transform: scale(0.95);
}

.image-box .active-thumb {
    outline: 2px solid #21b7e0;
    outline-offset: 2px;
    box-shadow: 0 4px 10px rgba(33, 183, 224, 0.25);
    opacity: 1 !important;
}

/* 補足テキスト (スマホのみ表示) */
.image-box .help-text {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    margin-top: 0.75rem;
}

/* ライトボックスのスタイル (ページ共通) */
.lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 19999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-overlay.show {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* PC (画面幅768px以上) 向けのレスポンシブスタイル */
@media (min-width: 768px) {
    .image-box .main-image-wrapper {
        width: 356px;
        height: 475px;
        cursor: default; /* PCではライトボックスを開かないためカーソルをデフォルトに */
    }
    .image-box .help-text {
        display: none; /* PCではタップ補足テキストを隠す */
    }
}

.lightbox-overlay.floor {
    flex-direction: column; /* 子要素を上から下へ縦並びにする */
    gap: 20px;              /* 画像とテーブルの間の余白（必要に応じて調整） */
    background-color: #666c;
}

/* 画像のスタイル調整（必要に応じて） */
.lightbox-overlay .top-image {
    width: 100%;            /* 横幅いっぱいに広げる場合 */
    height: auto;           /* アスペクト比を維持 */
    max-height: 500px;      /* 画像が大きくなりすぎるのを防ぐ場合 */
    object-fit: cover;      /* トリミングして綺麗に収める場合 */
    text-align: center;
}

/* テーブルのスタイル調整（必要に応じて） */
.lightbox-overlay .middle-table {
    width: 90%;            /* 横幅いっぱいに広げる場合 */
    border-collapse: collapse;
    margin: 0 auto;
}

.lightbox-overlay .bottom-box {
    width: 90%;            /* 横幅いっぱいに広げる場合 */
    border-collapse: collapse;
    margin: 0 auto;
}

/* お気に入りボタンのトグル */
.table_06_new_sp .favorite_wrap .favorite.checked, 
.table_06_new_sp .favorite_wrap .favorite.checked2, 
.table_06_new_sp .favorite_wrap .favorite.is-checked {
    background: url(/img/search/ico_favorite2_on.svg) no-repeat;
    background-size: 100% 100%; /* 縦横の枠ぴったりに縮小・変形 */
}
.table_06_new_sp .favorite_wrap .favorite {
    background: url(/img/search/ico_favorite.svg) no-repeat;
    background-size: 100% 100%; /* 縦横の枠ぴったりに縮小・変形 */
}

/* テーブル行ホバー効果 */
tr.hover-pink:hover {
    background-color: #fce7f3 !important;
}

/* モーダル表示 */
.mm-modal--search2 .mm-checked_list {
    flex-direction: row;
}
.mm-modal--search2 .mm-checked_list li {
    width: 25%;
}

/* レスポンシブ調整 */
@media screen and (max-width: 1025px) {
    .tab-tsubo-range .tab-tsubo-range--title {
        font-size: 14px;
    }

    .table_06_new_sp .head {
        padding: 2px 10px;
    }

    .table_06_new_sp .content .thumb {
        height: 60px;
    }
}
