/* 既存のヘッダーアニメーション（変更なし） */
.navbar.fixed-top {
    transition: transform 0.3s ease-in-out;
}
.navbar.fixed-top.hidden {
    transform: translateY(-100%);
}

/* フルスクリーンモーダルのスタイル */
#imageModal.modal-fullscreen {
    top: 0 !important;
    z-index: 1060 !important;
}
#imageModal .modal-dialog {
    margin: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
}
#imageModal .modal-content {
    height: 100vh !important;
    border-radius: 0 !important;
    background-color: #333333 !important;
}
#imageModal .modal-body {
    padding: 0 !important;
    height: 100vh !important;
}
#imageModal .swiper {
    width: 100% !important;
    height: 100vh !important;
    padding-bottom: 50px !important;
}
#imageModal .swiper-slide {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh !important;
}
#imageModal .swiper-slide img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
}
#imageModal .modal-backdrop {
    top: 0 !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    z-index: 1048 !important;
}

/* body.modal-open のパディング無効化 */
body.modal-open {
    padding-top: 0 !important;
}

/* その他のモーダル（#imageModal 以外）のスタイル */
.modal:not(#imageModal) {
    top: 0;
}
.modal:not(#imageModal) .modal-dialog {
    margin-top: 0;
    width: 100%; /* デスクトップでも幅を最大化 */
}
.modal:not(#imageModal) .modal-content {
    height: auto;
    max-height: calc(100vh - 20px);
}
.modal:not(#imageModal) .modal-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}
.modal:not(#imageModal) .modal-footer {
    position: sticky;
    bottom: 0;
    background: inherit;
    z-index: 1;
}

/* 小画面向けの調整 */
@media (max-width: 575.98px) {
    .modal:not(#imageModal).modal-fullscreen-sm-down .modal-dialog {
        margin: 0 !important;
        width: 100vw !important;
        min-height: 100vh;
    }
    .modal:not(#imageModal).modal-fullscreen-sm-down .modal-content {
        border-radius: 0 !important;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    .modal:not(#imageModal).modal-fullscreen-sm-down .modal-body {
        flex: 1 1 auto;
        max-height: none;
        overflow-y: auto;
        padding: 1rem;
    }
    .modal:not(#imageModal).modal-fullscreen-sm-down .modal-footer {
        padding: 0.5rem;
        border-top: 1px solid #dee2e6;
    }
}

/* 検索オートコンプリートドロップダウンスタイル */
.autocomplete-dropdown {
    position: absolute;
    z-index: 1070 !important; /* モーダル(1060)やbackdrop(1048)より高く */
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.2rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* 検索モーダル内のオートコンプリート */
.modal#searchModal .autocomplete-dropdown {
    top: calc(100% + 0.5rem); /* 入力フォームの下 */
    left: 0;
    width: 100%;
    z-index: 1070 !important; /* モーダル内でも最前面 */
}

/* ドロップダウンのアイテム */
.autocomplete-dropdown .dropdown-item {
    cursor: pointer;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
.autocomplete-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

/* ヘッダーの影響を軽減 */
.navbar.fixed-top ~ .autocomplete-dropdown {
    z-index: 1070 !important; /* ナビバーより前面 */
}

/* 検索モーダルのモーダルボディ調整 */
.modal#searchModal .modal-body {
    max-height: none; /* 縦幅制限を解除 */
    overflow-y: visible; /* クリップ防止 */
}