/* 기본 초기화 */
body, h1, p, ul { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Pretendard', sans-serif; line-height: 1.6; color: #333; background-color: #f8f9fa; }

/* 헤더 스타일 */
header { background: #00a862; color: white; padding: 1rem 0; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
header .site-logo a { color: white; text-decoration: none; font-size: 1.5rem; font-weight: bold; }

/* 메인 컨테이너 */
.container { max-width: 800px; margin: 2rem auto; padding: 0 1rem; min-height: 70vh; }

/* 검색 섹션 */
.search-box { background: white; padding: 2rem; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin-bottom: 2rem; }
.search-box h2 { font-size: 1.2rem; margin-bottom: 1rem; color: #00a862; }

/* 리스트 스타일 */
.region-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; list-style: none; }
.region-list li a { 
    display: block; background: #fff; padding: 0.8rem; text-align: center; 
    border: 1px solid #ddd; border-radius: 8px; text-decoration: none; color: #555; 
    transition: all 0.2s;
}
.region-list li a:hover { background: #00a862; color: white; border-color: #00a862; }

/* 푸터 */
footer { background: #f1f3f5; color: #868e96; padding: 2rem 0; font-size: 0.9rem; }
footer a { color: #495057; text-decoration: none; margin-bottom: 10px; display: inline-block; }

/* 기존 스타일 아래에 추가하세요 */

/* 약국 목록 타이틀 및 정보 */
.container h1 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    word-break: keep-all;
}

.count-info {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #00a862;
    padding-bottom: 10px;
}

.count-info strong {
    color: #00a862;
}

/* 약국 카드 그리드 레이아웃 */
.pharmacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* 개별 약국 카드 스타일 */
.pharmacy-card {
    background: #fff;
    padding: 25px 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pharmacy-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 영업 상태 배지 */
.status-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: -0.5px;
}

/* 약국 텍스트 정보 */
.pharmacy-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #212529;
    padding-right: 60px; /* 배지 공간 확보 */
}

.addr {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 12px;
    display: block;
    min-height: 2.7em; /* 주소 두 줄 높이 고정 */
}

.tel {
    display: inline-block;
    color: #00a862;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    border: 1px solid #00a862;
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.tel:hover {
    background: #00a862;
    color: #fff;
}

/* 시간 정보 영역 */
.time-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #dee2e6;
    font-size: 0.85rem;
    color: #495057;
}

/* 모바일 대응 (화면이 작아질 때) */
@media (max-width: 600px) {
    .pharmacy-grid {
        grid-template-columns: 1fr;
    }
    
    .container h1 {
        font-size: 1.3rem;
    }
}

/* 시도 툴바 스타일 */
.city-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.city-toolbar li { flex: 0 0 auto; }

.city-btn {
    display: block;
    padding: 8px 15px;
    background: #f1f3f5;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.city-btn:hover, .city-btn.active {
    background: #00a862;
    color: white;
}

/* 하위 구 리스트 툴바 */
.sub-toolbar {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #00a862;
    animation: fadeIn 0.3s ease;
}

.sub-toolbar h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #00a862;
}

.region-list.small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.region-list.small li a {
    padding: 6px;
    font-size: 0.85rem;
    background: #fff;
    border: 1px solid #dee2e6;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 시도 선택 툴바 */
.city-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 20px 0;
    justify-content: center;
}

.city-btn {
    border: none;
    cursor: pointer;
    padding: 10px 18px;
    background: #fff;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.city-btn:hover {
    border-color: #00a862;
    color: #00a862;
    background: #f0fdf4;
}

.city-btn.active {
    background: #00a862;
    color: #fff;
    border-color: #00a862;
    box-shadow: 0 4px 10px rgba(0, 168, 98, 0.2);
}

/* 하위 구 리스트 (펼쳐지는 영역) */
.sub-toolbar {
    margin-top: 20px;
    padding: 25px;
    background: #fdfdfd;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.sub-toolbar h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: center;
    color: #212529;
}

.region-list-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    list-style: none;
}

.region-list-small li a {
    display: block;
    padding: 10px;
    text-align: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-size: 0.85rem;
    transition: 0.2s;
}

.region-list-small li a:hover {
    background: #00a862;
    color: #fff;
    border-color: #00a862;
}

/* 추가 및 수정할 스타일 */

.gu-btn {
    border: 1px solid #eee;
    background: #fff;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    width: 100%;
    font-size: 0.85rem;
    transition: 0.2s;
}

.gu-btn:hover, .gu-btn.active {
    border-color: #00a862;
    color: #00a862;
    background: #f0fdf4;
}

/* 동네 툴바 영역 (포인트 컬러 변경) */
.sub-toolbar.color-dong {
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.sub-toolbar.color-dong h3 {
    color: #495057;
}

.sub-toolbar.color-dong .region-list-small li a:hover {
    background: #339af0; /* 동네 선택은 파란색 계열로 포인트 */
    border-color: #339af0;
}

/* 버튼 컨테이너 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* 공통 버튼 스타일 */
.btn-tel, .btn-map {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s;
}

/* 전화하기 버튼 (기존 스타일 계승) */
.btn-tel {
    background: #fff;
    color: #00a862;
    border: 1px solid #00a862;
}

.btn-tel:hover {
    background: #00a862;
    color: #fff;
}

/* 지도보기 버튼 (카카오 테마) */
.btn-map {
    background: #ffeb00; /* 카카오 노란색 */
    color: #3c1e1e;      /* 카카오 갈색 */
    border: 1px solid #ffeb00;
}

.btn-map:hover {
    background: #f7e317;
    border-color: #f7e317;
}

/* 카드 하단 정보 정렬 */
.card-footer {
    margin-top: 15px;
}

