/* ==========================================================================
   Global Dark Chic Design Reset
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Language Selector (Top Right Floating) */
.lang-selector-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 999;
    display: flex;
    gap: 6px;
}

.lang-btn {
    background: rgba(30, 30, 30, 0.75);
    color: #bbb;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.lang-btn:hover, .lang-btn.active {
    background: #ffffff;
    color: #111111;
    border-color: #ffffff;
}

/* ==========================================================================
   Desktop Premium Header Configuration
   ========================================================================== */
/* ヘッダーの背景画像設定 */
.main-header {
    position: relative;
    width: 100%;
    height: 400px;
    /* 修正前: rgba(0, 0, 0, 0.6) -> 修正後: rgba(0, 0, 0, 0.3) に変更して明るくします */
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('../images/back.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}

/* オーバーレイ（必要に応じて、さらに明るくする場合はbackgroundの数値を小さくします） */
.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* ここも 0.2 程度に下げるとより明るくなります */
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2; /* 文字を画像の上に表示 */
    width: 100%;
    padding: 0 20px;
}

#main-title {
    font-size: 2.4rem;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

#main-subtitle {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 30px;
}

/* Search and Near Me UI Combo Layout */
.search-container {
    display: flex;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto 25px auto;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

#search-bar {
    width: 100%;
    padding: 14px 15px 14px 45px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#search-bar:focus {
    border-color: #a07855;
    outline: none;
    box-shadow: 0 0 8px rgba(160, 120, 85, 0.3);
}

#near-me-btn {
    background: #1e1e1e;
    color: #fff;
    border: 1px solid #444;
    padding: 0 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

#near-me-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.status-message {
    font-size: 0.9rem;
    margin-top: -15px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Filter Badges and Checkbox UI Group */
.header-filter-sidebar .filter-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(25, 25, 25, 0.6);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #282828;
}

.area-filter-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.area-badge {
    background: #252525;
    color: #ccc;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.area-badge:hover {
    background: #333;
    color: #fff;
}

.area-badge.active {
    background: #a07855; /* Warm Coffee/Industrial Brown Accent */
    color: #fff;
}

.checkbox-filter-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px 25px;
}

/* Custom Styled Modern Checkboxes */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #bbb;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    background-color: #333;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #a07855;
    border-color: #a07855;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.share-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.share-btn {
    background: #333;
    color: #eee;
    border: none;
    padding: 6px 12px;
    border-radius: 20px; /* 丸みのあるボタン型 */
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.share-btn:hover {
    background: #555;
}

/* ==========================================================================
   Main Content Layout (Cards Grid)
   ========================================================================== */
/* Price Filter Group Styling */
.price-filter-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.price-badge {
    background: #252525;
    color: #aaa;
    border: 1px solid #333;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.price-badge:hover {
    background: #333;
    color: #fff;
    border-color: #555;
}

.price-badge.active {
    background: #a07855; /* コーヒーブラウンのアクセント */
    color: #fff;
    border-color: #a07855;
    box-shadow: 0 0 8px rgba(160, 120, 85, 0.4);
}

.content-wrapper-full {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.results-header-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}

#results-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffcc00;
}

.cards-grid-layout {
    display: grid;
/* デスクトップで3列に固定。最小幅300pxを確保し、画面幅に応じて自動調整 */
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* モバイル（スマホ）では1列に戻すためのレスポンシブ設定 */
@media (max-width: 992px) {
    .cards-grid-layout {
        grid-template-columns: repeat(2, 1fr); /* タブレットは2列 */
    }
}

@media (max-width: 600px) {
    .cards-grid-layout {
        grid-template-columns: 1fr; /* スマホは1列 */
    }
}
/* Item Card Aesthetics */
.item-card {
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border-color: #444;
}

.card-body-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-main-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.item-name {
    font-size: 1.25rem;
    color: #fff;
    font-weight: 700;
}

.area-tag-label {
    background: #2a2a2a;
    color: #aaa;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.distance-badge-ui {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.25);
    color: #ffcc00;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.item-description-text {
    font-size: 0.95rem;
    color: #bbb;
    margin-bottom: 20px;
    flex: 1;
}

.card-features-grid-box {
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.card-features-grid-box strong {
    color: #888;
    display: block;
    margin-bottom: 6px;
}

.feature-tags-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feature-tags-flex span {
    background: #222;
    border: 1px solid #333;
    color: #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.walkable-alert-row {
    color: #4cd137;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-action-btn {
    display: block;
    width: 100%;
    background: #a07855;
    color: #fff;
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.2s ease;
    margin-top: auto;
}

.map-action-btn:hover {
    background: #b88d67;
}

/* ==========================================================================
   Stunning Responsive Optimization & Mobile Header Golden Ratio Fix
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Mobile Header Compact Form Factors */
    header, .main-header {
        padding: 25px 15px 30px 15px !important;
        background-position: center center !important;
    }

    #main-title {
        font-size: 1.4rem !important;
        margin-top: 45px !important;
        margin-bottom: 4px !important;
    }

    #main-subtitle {
        font-size: 0.8rem !important;
        margin-bottom: 15px !important;
        line-height: 1.3 !important;
    }

    /* 2. Interactive Controls Adjustments */
    .search-container {
        flex-direction: column;
        gap: 6px !important;
        margin-bottom: 15px !important;
    }

    #near-me-btn {
        padding: 12px !important;
        justify-content: center;
    }

    /* 3. Filter Padding Density Compression */
    .header-filter-sidebar .filter-box {
        gap: 12px !important;
        padding: 12px;
    }

    .area-filter-group, .checkbox-filter-group {
        gap: 8px 10px !important;
    }

    .custom-checkbox {
        font-size: 0.85rem;
    }

    /* 4. Complete Removal of Dead Spaces to prevent full-screen image overflow */
    .content-wrapper-full {
        margin: 15px auto !important;
        padding: 0 10px !important;
    }

    .results-header-container {
        margin-bottom: 10px !important;
        justify-content: center !important;
    }

    .cards-grid-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
/* style.css の末尾に追加 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper-full {
    flex: 1; /* コンテンツエリアを伸縮させてフッターを押し下げる */
}
@media (max-width: 768px) {
    .main-header {
        height: 250px !important; /* 高さを400pxから250pxに圧縮 */
    }

    /* 検索バーやエリアフィルターなどの要素をモバイル向けにコンパクト化 */
    .header-content {
        padding: 0 10px !important;
    }

    .filter-box {
        gap: 5px !important;
        padding: 8px !important;
    }
@media (max-width: 768px) {
    /* 1. ヘッダーのコンテンツ表示調整 */
    .main-header {
        position: relative;
        height: 677px !important; /* 少し高さを戻してタイトルを表示 */
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* 上寄せに変更 */
        padding-top: 60px !important; /* タイトルのためのスペース確保 */
    }

    /* 2. タイトルとサブタイトルの可読性向上 */
    .header-content {
        z-index: 2;
    }

    #main-title {
        font-size: 1.5rem !important;
        margin-top: 0 !important;
        color: #ffffff;
        text-shadow: 0 2px 4px rgba(0,0,0,0.8); /* 文字の視認性アップ */
    }

    #main-subtitle {
        font-size: 0.85rem !important;
        color: #ddd;
        margin-bottom: 10px !important;
    }

    /* 3. カードエリアが被らないように余白（マージン）を強制的に空ける */
    .content-wrapper-full {
        margin-top: 20px !important;
    }
    
    /* 必要であればカードエリア自体を少し下げます */
    #cards-grid {
        margin-top: 10px;
    }
}