/**
 * 店舗検索機能 CSS
 * Mobile-first responsive design
 */

/* ====================================
   検索セクション全体
   ==================================== */
.store-search-section {
    margin-bottom: 30px;
}

/* ====================================
   検索ボックス
   ==================================== */
.search-box {
    position: relative;
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-input {
    flex: 1;
    padding: 8px 36px 8px 12px;
    font-size: 13px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #00A68C;
}

.search-input::placeholder {
    color: #999;
}

.clear-input-btn {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.clear-input-btn:hover {
    color: #333;
}

.search-btn {
    background: #00A68C;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 60px;
    font-weight: 700;
}

.search-btn:hover {
    background: #008c75;
}

.search-btn:active {
    transform: scale(0.98);
}

/* ====================================
   位置情報検索ボタン
   ==================================== */
.location-btn {
    display: block;
    width: auto;
    max-width: 300px;
    margin: 0 auto 16px auto;
    padding: 8px 20px;
    background: transparent;
    border: 2px solid #00A68C;
    border-radius: 4px;
    color: #00A68C;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.location-btn:hover {
    background: #00A68C;
    color: #fff;
    border-color: #00A68C;
}

.location-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====================================
   カテゴリフィルター
   ==================================== */
.category-filters,
.distance-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    white-space: nowrap;
}

.filter-btn,
.distance-btn {
    padding: 6px 12px;
    background: transparent;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover,
.distance-btn:hover {
    border-color: #00A68C;
    color: #00A68C;
}

.filter-btn.active,
.distance-btn.active {
    background: #00A68C;
    border-color: #00A68C;
    color: #fff;
}

/* ====================================
   検索結果
   ==================================== */
.search-results {
    margin-top: 24px;
    animation: fadeIn 0.3s ease-in;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 16px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
}

.result-info {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

#search-keyword {
    color: #00A68C;
    font-weight: 700;
}

#result-count {
    color: #00A68C;
}

.clear-search-btn {
    padding: 6px 12px;
    background: transparent;
    border: 2px solid #00A68C;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #00A68C;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.clear-search-btn:hover {
    background: #00A68C;
    color: #fff;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    background: transparent;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.result-item:hover {
    border-color: #00A68C;
    background: rgba(0, 166, 140, 0.02);
}

.result-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.result-item-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    flex: 1;
}

.result-item-category {
    padding: 4px 10px;
    background: #00A68C;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.result-item-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.result-item-distance {
    font-size: 13px;
    color: #00A68C;
    font-weight: 600;
}

.result-item-tel {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-results-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #666;
}

.no-results-hint {
    font-size: 14px;
    color: #999;
}

/* ====================================
   観光スポットリンク（ヒーロー内）
   ==================================== */
.tourist-link {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #00A68C;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    border: 2px solid rgba(0, 166, 140, 0.3);
    align-self: flex-start;
}

.tourist-link:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #00A68C;
}

/* ====================================
   レスポンシブ対応（スマホ）
   ==================================== */
@media screen and (max-width: 767px) {
    .location-btn {
        width: 100%;
        max-width: none;
    }

    .tourist-link {
        margin-top: 8px;
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* ====================================
   レスポンシブ対応（タブレット以上）
   ==================================== */
@media screen and (min-width: 768px) {
    .store-search-section {
        padding: 30px;
    }

    .search-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .search-box {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .location-btn {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .category-filters,
    .distance-filters {
        justify-content: center;
    }

    .result-item-name {
        font-size: 18px;
    }

    .result-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ====================================
   レスポンシブ対応（PC）
   ==================================== */
@media screen and (min-width: 1024px) {
    .result-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ====================================
   ローディング状態
   ==================================== */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00A68C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====================================
   エラーメッセージ
   ==================================== */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}
