/* =========================================
   1. ベース設定 & カラーパレット
   ========================================= */
:root {
    --accent: #007AFF;
    --accent-bg: rgba(0, 122, 255, 0.1);
    --text-main: #1d1d1f;
    --text-sub: #86868b;
    --bg-body: #f5f5f7;
    --bg-card: rgba(255, 255, 255, 0.94);
    --bg-section: #f8fafc;
    --shadow-L: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-S: 0 2px 8px rgba(0,0,0,0.08);
    --radius-pill: 99px;
    --radius-card: 24px;
    --radius-M: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg-body); color: var(--text-main); }
.app { position: relative; width: 100%; height: 100%; }
#map { width: 100%; height: 100%; z-index: 0; outline: none; }

/* =========================================
   2. フローティング・ヘッダー
   ========================================= */
.floating-top-bar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 10;
    padding: 12px 0 20px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 100%);
    display: flex; flex-direction: column; gap: 12px;
    pointer-events: none; align-items: center;
}

.header-row {
    position: relative;
    width: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    pointer-events: auto;
    min-height: 46px;
}

.search-pill {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5; 
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); 
    padding: 12px 24px; 
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); 
    display: flex; align-items: center; gap: 8px;
    color: #ffffff; 
    font-weight: 600; font-size: 15px;
    height: 46px;
    white-space: nowrap; 
}

.icon-btn-circle {
    min-width: 38px; height: 38px;
    padding: 0 10px;
    border-radius: 99px;
    background: rgba(100, 100, 100, 0.85);
    color: #fff;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; 
    transition: transform 0.2s;
    z-index: 10;
}
.icon-btn-circle:active { transform: scale(0.95); }

#floating-count-badge { margin-right: auto; }
#btn-open-about { margin-left: auto; min-width: 34px; height: 34px; width: 34px; padding: 0; }

/* =========================================
   3. ボトム・カードエリア & アクションボタン
   ========================================= */
.bottom-card-container {
    position: absolute; bottom: 0; left: 0; right: 0;
    z-index: 20; display: flex; 
    flex-direction: column; 
    align-items: center;    
    justify-content: flex-end; 
    padding: 0 16px 16px; pointer-events: none;
}

/* --- アクションボタンエリア（左下） --- */
.floating-action-row {
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: flex-start; /* 右要素の独立に伴い左寄せに */
    margin-bottom: 12px;
    padding: 0 4px;
    pointer-events: none; 
    transition: opacity 0.2s, visibility 0.2s;
    opacity: 1;
    visibility: visible;
}

.floating-action-row.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.action-group-left {
    display: flex; gap: 12px; pointer-events: auto; 
}

/* --- 右側のマップ操作エリア（独立・縦並び） --- */
.action-group-right {
    position: absolute;
    right: 16px;
    bottom: 220px; /* 下のカードと重ならないように上に配置 */
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none; /* コンテナ自体は透過 */
    z-index: 50;
    align-items: flex-end;
}

/* フィルターボタン（左下の丸いボタン） */
.f-chip {
    flex: 0 0 auto;
    width: 44px; height: 44px; border-radius: 50%; padding: 0;
    background: #fff; color: var(--text-main);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-S); border: 1px solid rgba(0,0,0,0.05);
    cursor: pointer; transition: all 0.2s;
}
.f-chip i { color: var(--text-sub); font-size: 18px; }

.f-chip.active {
    background: var(--text-main); color: #fff; border-color: var(--text-main);
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.f-chip.active i { color: #fff; }

/* --- マップ操作ボタン専用スタイル（右側の角丸四角） --- */
.zoom-group {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex; flex-direction: column; overflow: hidden;
    pointer-events: auto;
}

.map-control-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    cursor: pointer; color: #444; font-size: 16px;
    transition: background 0.2s;
}
.map-control-btn:active { background: #f0f0f0; }

.zoom-divider {
    height: 1px; width: 100%;
    background: #e0e0e0;
}

.location-btn-square {
    width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 8px; /* ズームグループと揃える */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent); font-size: 18px;
    cursor: pointer; pointer-events: auto;
}
.location-btn-square:active { transform: scale(0.95); }

/* --- 情報カード本体 --- */
.info-card {
    pointer-events: auto; width: 100%; max-width: 500px;
    background: var(--bg-card);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-card); box-shadow: var(--shadow-L);
    padding: 8px 0 0; display: flex; flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255,255,255,0.4); position: relative;
}
@keyframes slideUp { from{ transform: translateY(100%); opacity:0; } to{ transform: translateY(0); opacity:1; } }

.card-content {
    padding: 8px 20px 8px;
    max-height: 50vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.btn-close {
    position: absolute; top: 12px; right: 12px;
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.05); background: #f1f5f9;
    color: var(--text-sub); font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; z-index: 10;
}

/* --- コンパクトカード用 --- */
.compact-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.btn-compact {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 4px; height: 64px;
    background: #fff; border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px; cursor: pointer; transition: all 0.2s;
    box-shadow: var(--shadow-S); touch-action: manipulation;
}
.btn-compact i {
    font-size: 28px;        /* 24px -> 28px にサイズアップ */
    color: var(--text-sub); /* 明示的にグレー(#86868b)を指定 */
    transition: color 0.2s;
}
.btn-compact.active {
    background: var(--text-main); border-color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.btn-compact.active i, .btn-compact.active span { color: #fff; }

.btn-compact span { font-size: 12px; font-weight: 600; color: #4a4a4a; white-space: nowrap; }

/* --- 店舗詳細スタイル --- */
.store-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.store-brand { font-size: 11px; font-weight: 800; color: var(--text-sub); text-transform: uppercase; margin-bottom: 4px; }
.store-title { font-size: 20px; font-weight: 800; line-height: 1.3; }
.store-title-link { color: var(--text-main); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.store-title-link i { color: var(--accent); font-size: 0.8em; }
.store-tags { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.tag { font-size: 11px; padding: 4px 10px; border-radius: 6px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.tag.ok { background: #E8F5E9; color: #2E7D32; }
.tag.ng { background: #F5F5F7; color: #86868b; }
.store-section { 
    background: var(--bg-section); border-radius: var(--radius-M); 
    padding: 8px 12px; margin-bottom: 12px; 
}
.section-title { font-size: 11px; font-weight: bold; color: var(--text-sub); margin-bottom: 8px; }
.hours-row { 
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; color: var(--text-main); margin-bottom: 2px;
}
.hours-label { 
    background: #e2e8f0; color: #475569; font-size: 12px; padding: 3px 8px; border-radius: 4px; 
}
.store-info-row {
    margin-top: 12px; padding-top: 0; border-top: none;
    display: flex; align-items: baseline; gap: 12px;
    font-size: 13px; color: var(--text-main); line-height: 1.5;
}
.store-info-row .label {
    font-size: 10px; font-weight: 700; color: var(--text-sub);
    letter-spacing: 0.05em; flex-shrink: 0;
}

/* =========================================
   4. モーダル
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-content {
    width: 90%; max-width: 400px; background: #fff; border-radius: 24px;
    box-shadow: var(--shadow-L); padding: 24px;
    transform: translateY(20px); transition: transform 0.3s;
    display: flex; flex-direction: column; gap: 20px;
}
.modal-overlay.show .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.btn-icon-close { background: transparent; border: none; font-size: 20px; color: var(--text-sub); cursor: pointer; padding: 4px; }

/* 日時設定UI */
.day-selector { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 12px; }
.day-btn {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); background: #f1f5f9;
    color: var(--text-sub); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0;
}
.day-btn.is-selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.digital-clock-row {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    background: #f1f5f9; padding: 16px; border-radius: var(--radius-M);
}
.clock-select {
    appearance: none; background: transparent; border: none;
    color: var(--text-main); font-size: 32px; font-family: monospace; font-weight: 700;
    padding: 0; margin: 0; width: 56px; text-align: center;
}
.btn-now-pill {
    margin-left: 12px; padding: 6px 14px; font-size: 11px; font-weight: bold;
    color: var(--accent); background: rgba(0, 122, 255, 0.1); border-radius: 99px;
    border: none; cursor: pointer;
}
.btn-primary-full {
    width: 100%; padding: 14px; background: var(--text-main); color: #fff;
    border: none; border-radius: 16px; font-weight: 700; font-size: 15px; cursor: pointer;
}

/* チェーン選択 */
.chain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 0; }
.chain-item-btn {
    display: flex; align-items: center; gap: 8px; padding: 12px;
    border-radius: 12px; background: #f1f5f9; color: var(--text-main); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chain-item-btn.is-active { background: #fff; border: 1px solid var(--accent); color: var(--accent); box-shadow: 0 4px 12px rgba(0,122,255,0.15); }
.modal-note {
    font-size: 12px; color: var(--text-sub); text-align: center; margin: 8px 0 0;
}

/* トースト */
.toast {
    position: absolute; top: 100px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px; border-radius: 99px;
    font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 100;
}
.toast.show { opacity: 1; }

/* アプリフッター */
.app-footer {
    margin-top: 8px; padding-top: 8px; 
    border-top: 1px solid rgba(0,0,0,0.05);
}
.footer-toggle {
    display: flex; justify-content: center; align-items: center;
    font-size: 13px; font-weight: 700;
    color: var(--text-sub); cursor: pointer; padding: 0; 
    transition: opacity 0.2s;
}
.footer-toggle:active { opacity: 0.6; }

/* =========================================
   5. JS/HTMLから追い出した追加スタイル
   ========================================= */

/* クラスターマーカー */
.cluster-marker {
    background: #29b6f6;
    color: #ffffff;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: bold;
    border: 1.5px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ステータス表示テキスト */
.status-text { font-weight: bold; font-size: 14px; }
.status-warn { color: #F57F17; } /* もうすぐ閉店（オレンジ） */
.status-ok   { color: #2E7D32; } /* 営業中（緑） */
.status-out  { color: #d32f2f; } /* 時間外（赤） */

/* HTMLから移設したスタイル */
.count-text-style { font-weight: 700; font-size: 12px; }
.modal-content-scrollable { max-height: 80vh; display: flex; flex-direction: column; }
.modal-body-scroll { overflow-y: auto; flex: 1; }
.modal-content-compact { padding: 16px 20px 20px; }
.modal-about-content { text-align: left; padding: 0 4px 0; }

.info-box-note {
    background: var(--bg-section);
    padding: 12px;
    border-radius: 12px;
    margin-top: -4px;
}

/* --- 縦分割ボタン用スタイル（デザイン調整版） --- */
.split-column {
    display: flex;
    flex-direction: column;
    gap: 6px;       /* 上下のボタンの間隔 */
    height: 64px;   /* 左側のボタンと高さを揃える */
}

.btn-half {
    flex: 1;        /* 上下均等に分割 */
    display: flex;
    align-items: center;
    justify-content: center;

    /* 左側のボタン(.btn-compact)と同じデザイン定義を適用 */
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;  /* 高さが低い分、少しだけ角丸を小さくしてバランス調整 */
    box-shadow: var(--shadow-S);
    
    /* テキスト設定 */
    color: #4a4a4a;
    font-size: 11px;
    font-weight: 700; /* 太字にして視認性を確保 */
    
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

/* クリック時の沈み込みエフェクト */
.btn-half:active {
    transform: scale(0.96);
}

/* 選択中（アクティブ）のデザインも左側と統一 */
.btn-half.active {
    background: var(--text-main);
    border-color: var(--text-main);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* --- 2. 「OPEN」の吊り下げ札（透明度で薄くする） --- */
.icon-open-fuda {
    /* 札の本体 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    /* 色は濃いグレーのまま、透明度で薄さを調整します */
    color: #555 !important; 
    opacity: 0.8;  /* ★ここを下げると薄くなります（0.0〜1.0） */
    
    /* 枠線とサイズ */
    border: 2px solid currentColor; 
    border-radius: 3px;
    padding: 0 6px;
    height: 26px;
    margin-top: 6px; 
    
    /* 中の文字 */
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    font-family: sans-serif;
    letter-spacing: 0.5px;
    position: relative;
    transition: all 0.2s;
}

/* 札の上の「紐（ひも）」：三角形（サイズアップ） */
.icon-open-fuda::before {
    content: "";
    position: absolute;
    
    /* 位置調整：大きくなった分、少し上にずらします */
    top: -6px; 
    left: 50%;
    
    /* 正方形を大きくします (8px -> 10px) */
    width: 10px;
    height: 10px;
    
    /* 上と左だけに線を引く */
    border: 2px solid currentColor;
    border-bottom: none;
    border-right: none;
    border-radius: 0;
    
    /* 45度回転させて山型（三角形）にする */
    transform: translateX(-50%) rotate(45deg);
}

/* 選択中は白く・くっきりさせる */
.btn-compact.active .icon-open-fuda {
    color: #ffffff !important;
    opacity: 1; /* 選択時は透明度をなくす */
}

/* --- 指定解除ボタンのスタイル --- */
.btn-text-reset {
    background: transparent;
    border: none;
    color: var(--text-sub); /* 薄いグレー(#86868b) */
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.btn-text-reset:active {
    background: rgba(0,0,0,0.05);
    color: var(--text-main);
}

/* --- ステータス横の注釈テキスト --- */
.status-note {
    font-size: 11px;
    margin-left: 6px;
    font-weight: normal; /* 親が太字なので、ここは標準の太さに */
    opacity: 0.9;        /* 色は同じだが、少しだけ薄くして階層をつける */
}

/* --- ズームアウト時のピン縮小表示（追加） --- */
.zoom-out-view .custom-marker-wrapper > div {
    /* 回転(-45deg)を維持しつつ、0.6倍に縮小 */
    transform: rotate(-45deg) scale(0.6) !important;
    
    /* 滑らかに変化させる */
    transition: transform 0.2s ease;
}