/* GoogleMap */
.top-p {
    margin: 0 1rem 1rem;
}

.custom-marker {
    position: relative;
    width: 40px;
    height: 40px;
    pointer-events: auto;
}

.custom-marker .pin {
    width: 40px;
    height: 40px;
    background: #ff5722;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    /* ★画像をピンの中に収めるため必要！ */
    pointer-events: auto;
}

.custom-marker .pin img {

    /* 右にずれている場合は微調整 */
    width: 93%;
    height: 93%;
    margin: auto;
    object-fit: cover;
    position: absolute;
    /* 画像を引き伸ばさずフィット */
    border-radius: 50%;
    /* ★画像も丸く！ */
    transform: rotate(45deg);
    /* ★ピンの回転分を戻す（見た目まっすぐに） */
    top: 2px;
    left: 1px;
}

#map-container {
    position: relative;
    /* これが基準になる */
    margin-bottom: 70px;
}

/* 地図の表示領域 */
#map {
    height: calc(100vh - 260px);
    /* 相対位置に設定 */
    margin: auto;
    margin-right: 10px;
    margin-left: 10px;
}

.gm-style-mtc-bbw {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    display: none;
}


/* 検索ボックス全体 */
#search-box {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 12px;
    border-radius: 30px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    /* ← 縦に並べる */
    align-items: center;
    z-index: 999;
}

/* 検索入力 */
#search-input {
    width: 200px;
    padding: 6px 8px;
    border: none;
    border-radius: 20px;
}

/* フォーカス時に枠線等を除去 */
input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

/* 候補リスト */
#search-suggestions {
    list-style: none;
    margin: 4px 0 0 0;
    /* input のすぐ下に余白を追加 */
    padding: 0;
    background: white;
    width: 200px;
    max-height: 200px;
    overflow-y: auto;
    display: none;

}

/* 候補アイテム */
#search-suggestions li {
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #ddd;
}

/* 最後のliの下線を消す */
#search-suggestions li:last-child {
    border-bottom: none;
}

#search-suggestions li:hover {
    background-color: #f0f0f0;
}


#search-button {
    padding: 6px 12px;
    background-color: #4285F4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 現在地ボタン（右下に配置） */
#location-button {
    position: absolute;
    bottom: 140px;
    /* 下から10px */
    right: 18px;
    /* 右から10px */
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 10;
    /* 他の要素より前面に表示 */
}

#location-button img {
    width: 43px;
    height: 43px;
    /* 画像のサイズ調整 */
}


/* 情報ボックス全体 */
#info-box {
    position: fixed;
    /* ← absoluteではなく fixed にするのがポイント */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    /* モバイル対応 */
    width: 400px;
    /* 必要に応じて調整 */
    display: none;
    z-index: 999;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    /* ← 縦方向スクロールを有効にする */
}

#info-box p {
    text-align: left;
}



/* ヘッダー部分：画像と閉じるボタン */
.info-header {
    position: relative;
    width: 100%;
    height: 150px;
    /* 画像の高さ */
}

.info-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 画像が領域に収まるように */
    border-radius: 8px 8px 0 0;
}

.close-btn {
    position: absolute;
    top: 0px;
    right: 5px;
    background-color: transparent;
    border: none;
    font-size: 30px;
    color: white;
    cursor: pointer;
    padding-top: 0;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
    margin-top: 0;
    padding-right: 10px;
}

.close-btn:hover {
    background-color: transparent;
}

/* タイトル部分 */
.info-title {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
}

/* サブタイトルやその他の情報 */
.info-subtitle,
.info-description {
    font-size: 14px;
    margin: 5px 0;
}

/* 「Google Mapで開く」のリンク */
.info-link {
    display: block;
    text-align: center;
    background-color: #ff5722;
    color: white;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 10px;
}

.info-link:hover {
    background-color: #e64a19;
}

.icon-scroll-container {
    position: absolute;
    overflow: hidden;
    width: 90%;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
}

.icon-container {
    position: relative;
    /* absolute → relative に変更 */
    margin: 0 auto;
    /* 中央寄せ */
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    border-radius: 16px;
    padding: 0.5rem 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);

    display: flex;
    align-items: center;
    /* スクロールバー非表示用 */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE, Edge */
}

.icon-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}


/* コンテンツ（文字や画像） */
#icon-list {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 16px;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 16px;
    border: 1px solid white;
    margin: auto;
}

/* アイコン＋文字セット */
.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    padding: 5px;
    border-radius: 8px;
}

.icon-item img {
    transition: filter 0.3s;
}

.icon-item.active img {
    filter: brightness(0) saturate(100%) invert(45%) sepia(73%) saturate(3688%) hue-rotate(347deg) brightness(105%) contrast(101%);
}

.icon-item.active {
    box-shadow: 0 0 4px gray;
}

.icon-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    margin-bottom: 4px;
}

.icon-item span {
    font-size: 10px;
    color: #333;
    text-align: center;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* ★オレンジにしたいときはactiveクラスを付ける！ */
.icon-item.active {
    background-color: white;
}

.icon-item.active span {
    color: #ff5722;
    font-weight: 600;
}

.icon-item.active svg {
    fill: #ff5722;
    /* active時はオレンジ */
}


/* スクロールボタン（→） */
.icon-scroll-button,
.icon-scroll-back-button {
    position: fixed;
    top: 35%;
    /* 画面の中央 */
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 999;
    /* 必要に応じて */
    color: black;
    width: 30px;
    height: 30px;
}

.icon-scroll-button {
    right: 0;
}

.icon-scroll-back-button {
    left: 0;
}

.icon-scroll-button::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    border-top: 3px solid #7a0;
    border-right: 3px solid #7a0;
}

.icon-scroll-back-button::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%) rotate(-135deg);
    /* ← ↖（左上向き） */
    width: 12px;
    height: 12px;
    border-top: 3px solid #7a0;
    border-right: 3px solid #7a0;
}

.icon-scroll-button:hover,
.icon-scroll-back-button:hover {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

@media (min-width: 768px) {
    main {
        max-width: 100%;
    }

    #info-box {
        position: absolute;
        max-height: 500px;
    }

    #map-container {
        /* これが基準になる */
        margin-bottom: 50px;
    }

    /* 地図の表示領域 */
    #map {
        height: calc(100vh - 160px);
    }

    /* 検索入力 */
    #search-input {
        width: 300px;
        font-size: 1.3rem;
    }
}

@media (min-width: 1000px) {
    .icon-scroll-button {
        display: none;
    }
}
