/**
 * 店舗マップ - フロントエンド用CSS
 * 2カラムレイアウト
 */

/* ========================================
   ページ全体
   ======================================== */
.store-map-page {
    padding: 60px 0 80px !important;
    background-color: #f5f3ef;
}

.store-map-page .content-container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* .site-footer .containerと同じレスポンシブ幅 */
@media (min-width: 576px) {
    .store-map-page .content-container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .store-map-page .content-container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .store-map-page .content-container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .store-map-page .content-container {
        max-width: 1140px;
    }
}

/* Heroセクション後のマージン調整 */
.hero + .store-map-page {
    margin-top: 0px;
}

/* ========================================
   地域フィルター
   ======================================== */
.region-filter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.region-tab {
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #fff;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
}

.region-tab:first-child {
    grid-column: 1 / -1;
}

.region-tab:hover {
    border-color: #2c3035;
}

.region-tab.active {
    background: #2c3035;
    border-color: #2c3035;
    color: #fff;
}

/* Heroタイトルのレスポンシブ対応 */
.hero__h--title {
    display: block;
    text-align: center;
}

@media screen and (max-width: 768px) {
    .hero__h--title {
        font-size: 3rem !important;
    }
}

@media screen and (max-width: 480px) {
    .hero__h--title {
        font-size: 2.5rem !important;
    }
}

/* ========================================
   地図パネル（全幅・上部）
   ======================================== */
.store-map-panel {
    width: 100vw;
    height: 70vh;
    min-height: 500px;
    position: relative;
    background: #f5f5f5;
    padding: 0 54px;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* 地図表示エリア */
.store-map {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ========================================
   店舗リストパネル（下部・コンテナ幅）
   ======================================== */
.store-list-panel {
    width: 100%;
    margin-top: 40px;
    overflow: hidden;
}

/* 店舗リスト */
.store-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
}

.store-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.store-item__icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    display: none;
}

.store-item__info {
    flex: 1;
    min-width: 0;
    margin-bottom: 15px;
}

.store-item__name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.store-item__address {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

.store-item__button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: #2c3035;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.store-item__button:hover {
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.store-item__link {
    display: inline-block;
    font-size: 13px;
    color: #2c3035;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.store-item__link:hover {
    color: #6d5f42;
}

.no-stores {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    grid-column: 1 / -1;
}

/* ========================================
   InfoWindow内のスタイル
   ======================================== */
/* Google Maps InfoWindowのデフォルト余白を削除 */
.gm-style-iw-ch {
    padding: 0 !important;
}

.gm-style .gm-style-iw-c {
    padding: 0 !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    padding: 0 !important;
}

.gm-style-iw.gm-style-iw-c {
    padding: 0 !important;
    max-width: 320px !important;
}

/* InfoWindowの閉じるボタン（×）を非表示 */
.gm-style-iw-t::after,
.gm-ui-hover-effect {
    display: none !important;
}

.gm-style .gm-style-iw-tc::after {
    display: none !important;
}

button[title="閉じる"],
button.gm-ui-hover-effect {
    display: none !important;
}

.info-window {
    padding: 15px;
    max-width: 320px;
    font-family: 'Noto Sans JP', sans-serif;
    background: #fff;
}

.info-window__thumbnail {
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.info-window__thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.info-window__title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.info-window__address {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.info-window__link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2c3035;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.info-window__link:hover {
    opacity: 0.8;
    background-color: #2c3035;
    color: #fff;
}

/* ========================================
   フルスクリーンボタン
   ======================================== */
.fullscreen-btn {
    position: absolute;
    top: 70px;
    right: 10px;
    z-index: 100;
    background: #fff;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-btn:hover {
    background: #f8f8f8;
}

/* ========================================
   レスポンシブ対応
   ======================================== */
/* タブレット（768px以下） */
@media screen and (max-width: 768px) {
    /* ページ全体のパディング調整 */
    .store-map-page {
        padding: 40px 0 60px !important;
    }
    
    /* 地域フィルター */
    .region-filter {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .region-tab {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    /* 地図パネル */
    .store-map-panel {
        height: 60vh;
        min-height: 400px;
        padding: 0;
    }
    
    /* 店舗リストパネル */
    .store-list-panel {
        margin-top: 30px;
    }
    
    /* 店舗リスト：1列表示 */
    .store-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* 店舗アイテム */
    .store-item {
        padding: 15px;
    }
    
    .store-item__name {
        font-size: 15px;
    }
    
    .store-item__address {
        font-size: 12px;
    }
    
    .store-item__button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* InfoWindowのスタイル調整（タブレット） */
    .gm-style-iw.gm-style-iw-c {
        max-width: 280px !important;
    }
    
    .info-window {
        padding: 13px;
        max-width: 280px;
    }
    
    .info-window__title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .info-window__address {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .info-window__link {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* スマホ（480px以下） */
@media screen and (max-width: 480px) {
    /* ページ全体のパディング調整 */
    .store-map-page {
        padding: 20px 0 40px !important;
    }
    
    .store-map-page .content-container {
        padding-right: 10px;
        padding-left: 10px;
    }
    
    /* 地域フィルター */
    .region-filter {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .region-tab {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* 地図パネル */
    .store-map-panel {
        height: 50vh;
        min-height: 300px;
    }
    
    /* 店舗リストパネル */
    .store-list-panel {
        margin-top: 20px;
    }
    
    /* 店舗リスト */
    .store-list {
        gap: 10px;
    }
    
    /* 店舗アイテム */
    .store-item {
        padding: 12px;
    }
    
    .store-item__info {
        margin-bottom: 12px;
    }
    
    .store-item__name {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .store-item__address {
        font-size: 11px;
    }
    
    .store-item__button {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    /* InfoWindowのスタイル調整（スマホ） */
    .gm-style-iw.gm-style-iw-c {
        max-width: 240px !important;
    }
    
    .info-window {
        padding: 10px;
        max-width: 240px;
    }
    
    .info-window__thumbnail {
        margin-bottom: 8px;
        border-radius: 4px;
    }
    
    .info-window__title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .info-window__address {
        font-size: 12px;
        margin-bottom: 10px;
        line-height: 1.5;
    }
    
    .info-window__link {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 極小スマホ（360px以下） */
@media screen and (max-width: 360px) {
    .region-filter {
        grid-template-columns: 1fr;
    }
    
    .store-list {
        grid-template-columns: 1fr;
    }
    
    .store-item__name {
        font-size: 13px;
    }
    
    .store-item__address {
        font-size: 10px;
    }
}

/* ========================================
   スクロールバーのスタイル
   ======================================== */
.store-list::-webkit-scrollbar {
    width: 8px;
}

.store-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.store-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.store-list::-webkit-scrollbar-thumb:hover {
    background: #2c3035;
}

/* ========================================
   アニメーション
   ======================================== */
.store-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   印刷対応
   ======================================== */
@media print {
    .store-map-container {
        display: block;
        height: auto;
    }
    
    .store-list-panel {
        width: 100%;
        max-height: none;
        border: 1px solid #000;
        page-break-after: always;
    }
    
    .store-map-panel {
        width: 100%;
        height: 800px;
    }
}

/* ========================================
   地図凡例（マーカー色の説明）
   ======================================== */
.map-legend {
    position: absolute;
    bottom: 22px;
    right: 60px;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
    min-width: 150px;
    z-index: 1;
}

.map-legend__title {
    font-size: 13px;
    font-weight: bold;
    color: #2c3035;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.map-legend__item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.map-legend__item:last-child {
    margin-bottom: 0;
}

.map-legend__marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.map-legend__label {
    font-size: 12px;
    color: #333;
}

/* レスポンシブ対応 */
@media screen and (max-width: 480px) {
    .map-legend {
        bottom: 14px;
        padding: 12px;
        margin: 8px;
        min-width: 130px;
    }
    
    .map-legend__title {
        font-size: 12px;
    }
    
    .map-legend__marker {
        width: 14px;
        height: 14px;
    }
    
    .map-legend__label {
        font-size: 11px;
    }
}
