/* 약국 사이트 전용 컴포넌트 스타일 (병원 theme CSS 위에 얹음) */

/* 메인 — 병원 사이트와 동일 단순 컨테이너 (사이드 컬럼 없음, full-width) */
.main-col,
.main-col-fullwidth { min-width: 0; width: 100%; }

/* 추천/최근 위젯 — 사이드에서 본문 아래로 옮긴 후 가로 2열 */
.side-widget {
    display: inline-block;
    vertical-align: top;
    width: calc(50% - 10px);
    box-sizing: border-box;
    margin-right: 16px;
}
.side-widget:nth-of-type(2) { margin-right: 0; }
@media (max-width: 720px) {
    .side-widget { display: block; width: 100%; margin-right: 0; }
}

/* 카테고리 칩 바 */
.category-chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 8px;
}
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    color: var(--text-primary, #2c3e50);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}
.category-chip:hover {
    background: var(--accent-color, #3498db);
    color: #fff;
    border-color: var(--accent-color, #3498db);
}
.category-chip.active {
    background: var(--accent-color, #3498db);
    color: #fff;
    border-color: var(--accent-color, #3498db);
}
.category-chip .chip-icon { font-size: 16px; }
.category-chip .chip-count {
    font-size: 12px;
    background: rgba(0,0,0,0.08);
    padding: 2px 8px;
    border-radius: 999px;
}
.category-chip.active .chip-count { background: rgba(255,255,255,0.25); }
.category-chip.chip-back {
    background: transparent;
    border-style: dashed;
}

/* 지역 그리드 */
.region-grid-section { margin: 24px 0; }
.region-grid-section h2 {
    font-size: 18px;
    margin-bottom: 12px;
}
.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.region-tile {
    display: block;
    padding: 12px 14px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary, #2c3e50);
    font-weight: 500;
    transition: all 0.15s ease;
}
.region-tile:hover {
    background: var(--accent-color, #3498db);
    color: #fff;
    border-color: var(--accent-color, #3498db);
}
.region-tile small { opacity: 0.7; font-weight: normal; }

/* 약국 카드 리스트 */
.pharmacy-list-section { margin: 24px 0; }
.pharmacy-list-section h2 { font-size: 18px; margin-bottom: 12px; }
.pharmacy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.pharmacy-card {
    padding: 16px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 8px;
}
.pharm-name {
    display: block;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    text-decoration: none;
    margin-bottom: 6px;
}
.pharm-name:hover { color: var(--accent, var(--accent-color, #3498db)); }
.pharm-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary, #5a6c7d);
    margin-bottom: 8px;
}
.pharm-phone { color: var(--accent-color, #3498db); text-decoration: none; }
.pharm-hours {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary, #5a6c7d);
    margin-bottom: 6px;
}
.hours-item {
    padding: 2px 8px;
    background: rgba(0,0,0,0.04);
    border-radius: 4px;
}
.pharm-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    background: rgba(52, 152, 219, 0.12);
    color: var(--accent-color, #3498db);
}

/* 사이드 위젯 */
.side-widget {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.widget-title { font-size: 16px; margin: 0 0 12px; }

/* 추천 약국 — 카드 전체가 링크 (모바일 탭 영역 확장) */
.recommended-card {
    display: block;
    padding: 8px;
    margin: 0 -8px;  /* 위젯 padding 만큼 빼서 탭 영역을 위젯 가장자리까지 확장 */
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}
.recommended-card:hover,
.recommended-card:active {
    background: var(--card-bg-hover, rgba(0,0,0,0.04));
}
.recommended-name {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 6px;
}
.recommended-region { font-size: 14px; color: var(--text-secondary, #5a6c7d); margin-bottom: 4px; }
.recommended-address { font-size: 13px; color: var(--text-secondary, #5a6c7d); }

/* 최근 개설 — 행 전체가 링크 */
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li { border-bottom: 1px solid rgba(0,0,0,0.06); }
.recent-list li:last-child { border-bottom: none; }
.recent-item {
    display: block;
    padding: 10px 8px;
    margin: 0 -8px;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}
.recent-item:hover,
.recent-item:active {
    background: var(--card-bg-hover, rgba(0,0,0,0.04));
}
.recent-name {
    display: block;
    font-weight: 500;
    color: var(--text-primary, #2c3e50);
}
.recent-meta { display: block; font-size: 12px; color: var(--text-secondary, #5a6c7d); margin-top: 2px; }

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    align-items: center;
}
.pagination a {
    padding: 8px 16px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-primary, #2c3e50);
}
.pagination a:hover { background: var(--accent-color, #3498db); color: #fff; }
.current-page { font-weight: 600; }

/* 상세 페이지 */
.detail-page { padding: 16px 0; }
.detail-name { font-size: 28px; margin: 12px 0 4px; }
.detail-region { color: var(--text-secondary, #5a6c7d); margin-bottom: 20px; }
.detail-info, .detail-hours, .detail-map, .detail-nearby {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.detail-info dl {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px 16px;
    margin: 0;
}
.detail-info dt { font-weight: 600; color: var(--text-secondary, #5a6c7d); }
.detail-info dd { margin: 0; }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th { text-align: left; width: 80px; padding: 8px; color: var(--text-secondary, #5a6c7d); }
.hours-table td { padding: 8px; }
.hours-table tr { border-bottom: 1px solid rgba(0,0,0,0.06); }
.hours-table tr:last-child { border-bottom: none; }
.hours-table .closed { color: #999; }
.detail-flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#detailMap { height: 360px; border-radius: 8px; }

/* Leaflet 텍스트 라벨 마커 (divIcon) */
.pharm-label {
    background: transparent !important;
    border: none !important;
}
.pharm-label .pharm-label-inner {
    display: inline-block;
    background: #fff;
    color: #2c3e50;
    border: 1px solid #4299e1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    transform: translate(-50%, -100%);
    transition: all 0.15s ease;
}
.pharm-label .pharm-label-inner:hover {
    background: #ebf5ff;
    border-color: #2c5282;
    z-index: 2000;
}
.pharm-label.current .pharm-label-inner {
    background: #38a169;
    color: #fff;
    border-color: #38a169;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.4);
}
.pharm-label.current .pharm-label-inner .pin { margin-right: 4px; }

/* 스트리트뷰 */
.detail-streetview {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.detail-streetview h2 { margin: 0 0 12px; font-size: 18px; }
.streetview-container { width: 100%; height: 360px; border-radius: 8px; overflow: hidden; }
.detail-map-nearby { display: none; }

/* 네이버 블로그 위젯 */
.naver-widget {
    margin: 32px 0;
    padding: 24px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 10px;
}
.naver-widget-title {
    font-size: 18px;
    margin: 0 0 16px;
    color: var(--text-primary, #2c3e50);
}
.naver-block { margin-bottom: 20px; }
.naver-block:last-child { margin-bottom: 0; }
.naver-block-query {
    font-size: 13px;
    color: var(--text-secondary, #5a6c7d);
    margin-bottom: 8px;
    font-weight: 600;
}
.naver-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.naver-item a {
    display: block;
    padding: 12px 14px;
    background: var(--card-bg-hover, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary, #2c3e50);
    transition: all 0.15s ease;
}
.naver-item a:hover {
    background: var(--accent-soft, #ebf5ff);
    border-color: var(--accent, #4299e1);
}
.naver-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary, #2c3e50);
}
.naver-desc {
    display: block;
    font-size: 13px;
    color: var(--text-secondary, #5a6c7d);
    line-height: 1.5;
}
.naver-blogger {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary, #888);
    margin-top: 4px;
}
.naver-credit {
    font-size: 11px;
    color: var(--text-tertiary, #999);
    text-align: right;
    margin: 12px 0 0;
}

/* FAQ 섹션 */
.faq-section {
    margin: 32px 0;
    padding: 24px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 10px;
}
.faq-section-title {
    font-size: 20px;
    margin: 0 0 16px;
    color: var(--text-primary, #2c3e50);
}
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.15s ease;
}
.faq-item[open] {
    border-color: var(--accent-color, #4299e1);
    background: #f8fbff;
}
.faq-question {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    list-style: none;
    position: relative;
    padding-right: 40px;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
    content: '▾';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color, #4299e1);
    transition: transform 0.15s ease;
}
.faq-item[open] .faq-question::after { transform: translateY(-50%) rotate(180deg); }
.faq-question:hover { background: rgba(66, 153, 225, 0.05); }
.faq-answer {
    padding: 0 18px 16px;
    color: var(--text-secondary, #5a6c7d);
    line-height: 1.7;
    font-size: 14px;
}

/* SEO 본문 소개 */
.seo-intro {
    background: var(--card-bg, #fff);
    border-left: 3px solid var(--accent-color, #3498db);
    border-radius: 6px;
    padding: 14px 18px;
    margin: 14px 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary, #2c3e50);
}
.seo-intro p { margin: 0; }

/* 빈 카테고리 안내 */
.empty-category {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    margin: 24px 0;
}
.empty-msg { font-size: 16px; margin: 0 0 8px; color: var(--text-primary, #2c3e50); }
.empty-hint { color: var(--text-secondary, #5a6c7d); margin-bottom: 20px; }
.empty-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty-actions a {
    display: inline-block;
    padding: 8px 18px;
    background: var(--accent-color, #3498db);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
}
.empty-actions a:hover { background: #2c5282; }

/* 지도 */
.map-section { margin-bottom: 8px; }
.map-wrapper { position: relative; }
#map { height: 320px; border-radius: 8px; }
.map-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.4); color: #fff;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    z-index: 1000;
}

/* 에러 페이지 */
.error-page { text-align: center; padding: 60px 20px; }
.error-page h1 { font-size: 48px; margin-bottom: 16px; }

/* 푸터 */
.site-footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color, #e0e6ed);
    text-align: center;
    color: var(--text-secondary, #5a6c7d);
    font-size: 13px;
}
.site-footer p { margin: 4px 0; }

/* 헤더 검색 */
.header-search {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.header-search input[type=search] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 6px;
    font-size: 15px;
}
.header-search button {
    padding: 10px 18px;
    background: var(--accent-color, #3498db);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

/* ================================================================
 * 인덱스 풍부도 보강 — 통계/가이드/인기지역/차트/뉴스
 * ================================================================ */

/* 영업중 배지 (intro 안) */
.open-now-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
}
.open-now-badge strong { font-weight: 700; }
.open-now-dot {
    width: 8px; height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* 카테고리 통계 카드 (1번) */
.stat-cards-section { margin: 24px 0; }
.stat-section-title { font-size: 20px; margin: 0 0 16px; color: var(--text-primary, #2c3e50); }
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.stat-card {
    display: block;
    padding: 22px 20px;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 22px rgba(0,0,0,0.14); }
.stat-card-holiday { background: linear-gradient(135deg, #e53e3e 0%, #f56565 100%); }
.stat-card-night   { background: linear-gradient(135deg, #553c9a 0%, #7c3aed 100%); }
.stat-card-sun     { background: linear-gradient(135deg, #d69e2e 0%, #ecc94b 100%); }
.stat-card-sat     { background: linear-gradient(135deg, #2c5282 0%, #4299e1 100%); }
.stat-card-icon    { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.stat-card-label   { font-size: 14px; opacity: 0.9; margin-bottom: 4px; }
.stat-card-number  { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.stat-card-unit    { font-size: 14px; opacity: 0.85; margin-top: 2px; }
.stat-card-desc    { font-size: 12px; opacity: 0.8; margin-top: 8px; }

/* 약국 이용 가이드 (2번) */
.usage-guide-section { margin: 32px 0; }
.guide-section-title { font-size: 20px; margin: 0 0 16px; }
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.guide-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 10px;
    padding: 18px;
}
.guide-icon { font-size: 28px; margin-bottom: 8px; }
.guide-title { font-size: 16px; margin: 0 0 8px; color: var(--text-primary, #2c3e50); }
.guide-body { font-size: 14px; line-height: 1.7; color: var(--text-secondary, #5a6c7d); margin: 0; }

/* 인기 지역 (4번) */
.popular-regions-section { margin: 28px 0; }
.popular-section-title { font-size: 20px; margin: 0 0 14px; }
.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.popular-card {
    display: block;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary, #2c3e50);
    transition: all 0.15s ease;
}
.popular-card:hover {
    border-color: #4299e1;
    background: #ebf5ff;
    transform: translateY(-2px);
}
.popular-dong { display: block; font-weight: 600; font-size: 15px; color: #2c5282; }
.popular-detail { display: block; font-size: 12px; color: var(--text-secondary, #5a6c7d); margin-top: 4px; }

/* 시도 그리드 강화 (5번) */
.region-tile-strong {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 8px;
}
.region-tile-name { font-size: 15px; font-weight: 600; }
.region-tile-count { font-size: 12px; color: var(--text-secondary, #5a6c7d); font-weight: 500; }
.region-tile-strong:hover .region-tile-count { color: rgba(255,255,255,0.85); }

/* 시도별 차트 (7번) */
.sido-chart-section { margin: 32px 0; }
.chart-section-title { font-size: 20px; margin: 0 0 14px; }
.sido-chart {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e6ed);
    border-radius: 10px;
    padding: 16px 20px;
}
.sido-bar-row {
    display: grid;
    grid-template-columns: 60px 1fr 70px;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text-primary, #2c3e50);
    border-bottom: 1px solid #f0f4f8;
}
.sido-bar-row:last-child { border-bottom: none; }
.sido-bar-row:hover .sido-bar-label { color: #2c5282; }
.sido-bar-label { font-size: 14px; font-weight: 600; }
.sido-bar-track {
    background: #f0f4f8;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
    position: relative;
}
.sido-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #4299e1, #2c5282);
    border-radius: 999px;
    transition: width 0.6s ease;
}
.sido-bar-value {
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #5a6c7d);
}

/* 뉴스 위젯 (9번) */
.news-widget {
    margin: 28px 0;
    padding: 22px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e0e6ed);
    border-radius: 10px;
}
.news-widget-title { font-size: 18px; margin: 0 0 14px; color: var(--text-primary, #2c3e50); }
.news-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.news-item a {
    display: block;
    padding: 12px 14px;
    background: var(--card-bg-hover, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary, #2c3e50);
    transition: all 0.15s ease;
}
.news-item a:hover {
    background: var(--accent-soft, #ebf5ff);
    border-color: var(--accent, #4299e1);
}
.news-title { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--text-primary, #2c3e50); }
.news-desc { display: block; font-size: 13px; color: var(--text-secondary, #5a6c7d); line-height: 1.5; }
.news-date { display: block; font-size: 11px; color: var(--text-tertiary, #888); margin-top: 4px; }
.news-credit { font-size: 11px; color: var(--text-tertiary, #999); text-align: right; margin: 12px 0 0; }

/* 모바일 */
@media (max-width: 640px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .stat-card-number { font-size: 28px; }
    .sido-bar-row { grid-template-columns: 50px 1fr 60px; }
}

/* 약국 자동 소개 (detail 페이지) */
.pharmacy-intro {
    margin: 0 0 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ebf5ff 0%, #f0f9ff 100%);
    border-left: 4px solid #4299e1;
    border-radius: 8px;
}
.pharmacy-intro p {
    margin: 0;
    font-size: 15px;
    line-height: 1.75;
    color: #2c3e50;
}
