/* jin-bar-map.css — crafters-jin */

.jin-bar-map-wrap {
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-rows: auto 1fr;
    height: 80vh;
    min-height: 560px;
    width: calc(100vw - 96px);
    margin-left: calc(50% - 50vw + 48px);
    margin-top: 16px;
    margin-bottom: 32px;
    border: 1px solid #e8e4de;
    border-radius: 12px;
    overflow: hidden;
    font-family: inherit;
}

/* sb-top: ヘッド＋検索エリア（サイドバー上部、デスクトップ） */
.sb-top {
    grid-column: 2;
    grid-row: 1;
    border-left: 1px solid #e8e4de;
    background: #faf9f7;
    flex-shrink: 0;
}

/* モバイルタブバーはデスクトップでは非表示 */
.mobile-tab-bar { display: none; }

#jin-bar-map {
    grid-column: 1;
    grid-row: 1 / 3;
    height: 100%;
    z-index: 1;
}

#jin-bar-sidebar {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e8e4de;
    background: #faf9f7;
    overflow: hidden;
    height: 100%;
}

/* ヘッド */
.sb-head    { padding: 16px 18px 10px; flex-shrink: 0; }
.sb-eyebrow { font-size: 11px; letter-spacing: 0.12em; color: #3B6D11; text-transform: uppercase; margin-bottom: 4px; }
.sb-title   { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.sb-count   { font-size: 12px; color: #1a1a1a; margin-top: 2px; }

/* 検索 */
.sb-search { padding: 10px 15px; border-bottom: 1px solid #e8e4de; flex-shrink: 0; }
.sb-search input {
    width: 100%;
    background: #f0ede8;
    border: 1px solid #d3d1c7;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 13px;
    color: #1a1a1a;
    outline: none;
    box-sizing: border-box;
}
.sb-search input::placeholder { color: #888780; }

/* リセットボタン */
.sb-reset-btn {
    font-size: 13px;
    font-weight: 500;
    color: #3B6D11;
    text-align: center;
    padding: 8px 15px;
    cursor: pointer;
    border-bottom: 1px solid #e8e4de;
    letter-spacing: 0.04em;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.sb-reset-btn:hover  { background: #f0ede8; }
.sb-reset-btn:active { background: #EAF3DE; color: #27500A; }

/* 地域・都道府県 */
.sb-region { padding: 7px 15px; border-bottom: 1px solid #e8e4de; flex-shrink: 0; }
.sb-region select {
    width: 100%;
    background: #faf9f7;
    border: 1px solid #d3d1c7;
    border-radius: 7px;
    padding: 7px 12px;
    font-size: 12px;
    color: #1a1a1a;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888780'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.sb-region select:focus { border-color: #97C459; }

#sb-pref-select {
    width: 100%;
    background: #f0ede8;
    border: 1px solid #d3d1c7;
    border-radius: 7px;
    padding: 7px 32px 7px 12px;
    font-size: 12px;
    color: #1a1a1a;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23888780'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 8px;
}
#sb-pref-select:disabled { opacity: 0.4; cursor: not-allowed; }
#sb-pref-select:focus    { border-color: #97C459; }

/* リスト */
#jin-bar-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.bitem { display: block; padding: 12px 15px; border-bottom: 1px solid #e8e4de; cursor: pointer; }
.bitem:hover  { background: #f5f3ef; }
.bitem.active { background: #f7f9f4; border-left: 2px solid #3B6D11; padding-left: 13px; }

.bname { font-size: 14px; font-weight: 700; color: #1a1a1a; line-height: 1.3; }
.bitem.active .bname { color: #27500A; }
.bpref { font-size: 12px; color: #1a1a1a; margin-top: 2px; }
.bmeta { font-size: 11px; color: #888780; margin-top: 3px; line-height: 1.4; }
.btype-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 7px;
    background: #EAF3DE;
    color: #27500A;
    border: 1px solid #C0DD97;
    margin-top: 5px;
}

/* アコーディオン詳細 */
.bitem-detail {
    padding: 14px 15px;
    background: #f7f9f4;
    border-bottom: 1px solid #e8e4de;
    border-left: 2px solid #3B6D11;
    animation: slideDown 0.15s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.det-region { font-size: 11px; letter-spacing: 0.1em; color: #3B6D11; text-transform: uppercase; margin-bottom: 3px; }
.det-name   { font-size: 16px; font-weight: 700; color: #1a1a1a; margin-bottom: 5px; }
.det-addr   { font-size: 12px; color: #1a1a1a; line-height: 1.6; margin-bottom: 8px; }

/* 詳細情報セクション */
.det-section { margin-bottom: 10px; }
.det-section:last-of-type { margin-bottom: 12px; }
.det-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    color: #888780;
    text-transform: uppercase;
    margin-bottom: 3px;
    font-weight: 600;
}
.det-value {
    font-size: 12px;
    color: #1a1a1a;
    line-height: 1.6;
    white-space: pre-line;
}
.det-value.muted { color: #888780; }

/* タグ群 */
.det-row    { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.det-tag    { font-size: 11px; padding: 3px 9px; border-radius: 9px; background: #EAF3DE; color: #27500A; border: 1px solid #C0DD97; }
.det-tag.gray { background: #f0ede8; color: #1a1a1a; border-color: #d3d1c7; }

/* リンク・ボタン群 */
.det-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8e4de;
}
.det-link {
    font-size: 13px;
    color: #3B6D11;
    text-decoration: none;
    padding: 5px 0;
}
.det-link:hover { text-decoration: underline; }

.det-btn {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 7px;
    background: #faf9f7;
    color: #1a1a1a;
    border: 1px solid #d3d1c7;
    text-decoration: none;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.det-btn:hover { background: #f0ede8; }
.det-btn.primary {
    background: #3B6D11;
    color: #fff;
    border-color: #3B6D11;
}
.det-btn.primary:hover { background: #2d5410; }

/* ピン */
.custom-pin { background: none; border: none; }
.pin-drop {
    width: 16px;
    height: 16px;
    background: #3B6D11;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    position: relative;
    border: 2px solid #faf9f7;
    box-shadow: 0 0 0 1.5px #3B6D11;
}
.pin-drop::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #faf9f7;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

/* ポップアップ */
.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12) !important;
    padding: 0 !important;
    border: 1px solid #e8e4de !important;
}
.custom-popup .leaflet-popup-content { margin: 0 !important; width: auto !important; }
.custom-popup .leaflet-popup-tip     { background: #faf9f7 !important; }

.map-popup          { padding: 12px 14px; background: #faf9f7; border-radius: 8px; min-width: 180px; }
.map-popup-name     { font-size: 13px; font-weight: 700; color: #1a1a1a; margin-bottom: 2px; line-height: 1.3; }
.map-popup-pref     { font-size: 11px; color: #888780; margin-bottom: 4px; }
.map-popup-meta     { font-size: 11px; color: #1a1a1a; margin-top: 4px; line-height: 1.5; }
.map-popup-link     { display: block; font-size: 11px; color: #3B6D11; text-decoration: none; margin-top: 8px; padding-top: 7px; border-top: 0.5px solid #e8e4de; }
.map-popup-link:hover { text-decoration: underline; }

/* Leaflet上書き */
.leaflet-control-attribution { font-size: 9px !important; background: rgba(250,249,247,0.8) !important; }
.leaflet-control-zoom a      { color: #1a1a1a !important; border-color: #e8e4de !important; background: #faf9f7 !important; }
.leaflet-control-zoom a:hover { background: #f0ede8 !important; }

/* ————————————————————————
   現在地ボタン
   ———————————————————————— */
.locate-btn {
    width: 34px;
    height: 34px;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.locate-btn:hover { background: #f4f4f4; color: #1a73e8; }
.locate-btn.loading {
    color: #1a73e8;
    animation: locate-pulse 1s ease-in-out infinite;
}
@keyframes locate-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ————————————————————————
   現在地マーカー
   ———————————————————————— */
.user-location-pin { background: transparent; border: none; }
.user-location-dot {
    width: 16px;
    height: 16px;
    background: #1a73e8;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ————————————————————————
   現在地プロンプト
   ———————————————————————— */
.location-prompt {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translate(-50%, -12px);
    z-index: 1000;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    padding: 14px 16px;
    max-width: calc(100% - 32px);
    width: 380px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.location-prompt.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
.location-prompt-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.location-prompt-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(26, 115, 232, 0.1);
    color: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.location-prompt-text { flex: 1 1 160px; min-width: 0; }
.location-prompt-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}
.location-prompt-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    line-height: 1.4;
}
.location-prompt-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}
.location-prompt-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.location-prompt-btn.primary { background: #1a73e8; color: #fff; }
.location-prompt-btn.primary:hover { background: #1666cc; }
.location-prompt-btn.ghost { background: transparent; color: #666; }
.location-prompt-btn.ghost:hover { background: #f1f3f4; color: #222; }

@media (max-width: 480px) {
    .location-prompt-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }
}

/* ————————————————————————
   モバイルタブバー
   ———————————————————————— */
.mobile-tab-bar {
    background: #faf9f7;
    border-bottom: 1px solid #e8e4de;
    flex-shrink: 0;
}
.mobile-tab {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #888780;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    letter-spacing: 0.04em;
    line-height: 1;
}
.mobile-tab.active { color: #3B6D11; border-bottom-color: #3B6D11; }

/* ————————————————————————
   タブレット (641px – 900px)
   ———————————————————————— */
@media (min-width: 641px) and (max-width: 900px) {
    .jin-bar-map-wrap {
        grid-template-columns: 1fr 260px;
    }
}

/* ————————————————————————
   スマホ (≤640px)
   ———————————————————————— */
@media (max-width: 640px) {
    .jin-bar-map-wrap {
        display: flex;
        flex-direction: column;
        position: static;
        left: auto;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        height: auto;
        border-radius: 0;
        border: none;
    }

    /* sb-top: タイトルと検索を横並び */
    .sb-top {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        border-left: none;
        border-bottom: 1px solid #e8e4de;
        order: -2;
    }
    .sb-top .sb-head {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0;
    }
    .sb-top .sb-eyebrow { font-size: 10px; letter-spacing: 0.1em; margin-bottom: 2px; }
    .sb-top .sb-title {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sb-top .sb-count { font-size: 11px; color: #888780; margin-top: 1px; }
    .sb-top .sb-search {
        flex: 0 0 auto;
        width: 145px;
        padding: 0;
        border-bottom: none;
    }
    .sb-head { padding: 0; }

    /* 検索インプット：ピル型 */
    .sb-top .sb-search input {
        font-size: 13px;
        padding: 8px 10px 8px 30px;
        border-radius: 20px;
        background: #f0ede8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23888780' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 10px center;
        background-size: 13px;
        border: 1px solid #c8c5bc;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    }
    .sb-top .sb-search input:focus {
        border-color: #97C459;
        background-color: #fff;
        box-shadow: 0 0 0 2px rgba(151,196,89,0.18);
    }

    .mobile-tab-bar {
        display: flex;
        order: -1;
    }

    #jin-bar-map {
        height: 55vh;
        min-height: 280px;
    }

    .jin-bar-map-wrap.show-list #jin-bar-map     { display: none; }
    .jin-bar-map-wrap.show-map  #jin-bar-sidebar  { display: none; }

    #jin-bar-sidebar {
        border-left: none;
        border-top: 1px solid #e8e4de;
        height: auto;
        max-height: none;
    }

    #jin-bar-list {
        height: auto;
        max-height: 60vh;
        min-height: 200px;
        overflow-y: auto;
    }

    #jin-bar-sidebar .sb-search input,
    .sb-region select,
    #sb-pref-select { font-size: 16px; }

    .sb-reset-btn { padding: 12px 15px; font-size: 14px; }
    .bitem        { padding: 14px 15px; }
    .bname        { font-size: 15px; }
}