/* ========================================
   씨젠 클리닉 스타일 - 상용화 버전
   ======================================== */

/* ========================================
   Variables
   ======================================== */
:root {
    --color-primary: #665d51;
    --color-primary-dark: #4a4237;
    --color-secondary: #03216b;
    --color-accent: #ae7d30;
    --color-accent-light: #c49240;
    --color-text: #404040;
    --color-text-light: #777;
    --color-text-muted: #aaa;
    --color-bg: #fff;
    --color-bg-light: #f7f7f5;
    --color-bg-warm: #faf8f5;
    --color-border: #e8e4df;
    --color-border-light: #f0ede8;
    --font-family: 'Noto Sans KR', -apple-system, sans-serif;
    --header-height: 100px;
    --section-padding: 110px 0;
    --container-max: 1240px;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-family); color: var(--color-text); line-height: 1.8; overflow-x: hidden; background: var(--color-bg); font-size: 15px; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }

/* ========================================
   Header
   ======================================== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
}
.header-inner { height: var(--header-height); display: flex; align-items: center; }
.logo { display: flex; align-items: center; }
.logo-img { height: 48px; width: auto; }

.nav-desktop { gap: 2px; }
.nav-desktop .nav-link {
    padding: 10px 18px; font-size: 0.92rem; font-weight: 500;
    color: var(--color-text); border-radius: 0;
    transition: var(--transition); position: relative;
}
.nav-desktop .nav-link::after {
    content: ''; position: absolute; bottom: 2px; left: 50%;
    width: 0; height: 2px; background: var(--color-accent);
    transition: all 0.3s ease; transform: translateX(-50%);
}
.nav-desktop .nav-link:hover { color: var(--color-accent); }
.nav-desktop .nav-link:hover::after { width: 60%; }

.nav-desktop .nav-link-primary {
    background: var(--color-accent); color: #fff !important;
    border-radius: 30px; padding: 9px 24px; margin-left: 8px;
    font-weight: 600;
}
.nav-desktop .nav-link-primary:hover { background: var(--color-accent-light); }
.nav-desktop .nav-link-primary::after { display: none; }

.btn-hamburger { background: none; border: none; font-size: 1.6rem; color: var(--color-text); cursor: pointer; padding: 8px; }

/* Mobile Menu */
.nav-mobile .nav-link {
    display: block; padding: 15px 0; font-size: 1rem; font-weight: 500;
    border-bottom: 1px solid var(--color-border-light); color: var(--color-text);
}
.nav-mobile .nav-link:hover { color: var(--color-accent); }
.nav-mobile .nav-link-primary { color: var(--color-accent); font-weight: 700; }

/* Language Dropdown */
.lang-dropdown { position: relative; }
.lang-toggle {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px; font-size: 0.84rem; font-weight: 500;
    color: var(--color-text); background: #fff;
    border: 1px solid var(--color-border); border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
}
.lang-toggle:hover { border-color: var(--color-accent); }
.lang-toggle i:first-child { font-size: 1rem; color: var(--color-accent); }

.lang-menu {
    display: none; position: absolute; top: calc(100% + 6px); right: 0;
    background: #fff; border: 1px solid var(--color-border);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 160px; z-index: 1100; overflow: hidden;
}
.lang-dropdown.open .lang-menu { display: block; }

.lang-option {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; font-size: 0.88rem; color: var(--color-text);
    text-decoration: none; transition: background 0.15s;
}
.lang-option:hover { background: var(--color-bg-light); color: var(--color-text); }
.lang-option.selected { font-weight: 700; color: var(--color-accent); }
.lang-option .bi-check-lg { margin-left: auto; color: var(--color-accent); }
.lang-code {
    display: inline-block; width: 28px; height: 20px; line-height: 20px;
    text-align: center; font-size: 0.72rem; font-weight: 700;
    color: #fff; background: var(--color-primary); border-radius: 3px;
}

/* Mobile lang buttons */
.lang-mobile-btn {
    padding: 8px 16px; font-size: 0.88rem; border: 1px solid var(--color-border);
    border-radius: 6px; text-decoration: none; color: var(--color-text); transition: all 0.2s;
}
.lang-mobile-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ========================================
   Hero Slider
   ======================================== */
.hero-slider { margin-top: var(--header-height); position: relative; overflow: hidden; }
.hero-slider .swiper-slide { position: relative; overflow: hidden; }
.hero-slide-img { width: 100%; height: auto; display: block; }
.hero-content {
    position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; color: #fff;
}
.hero-content h2 {
    font-size: 2.6rem; font-weight: 800; margin-bottom: 12px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.25); letter-spacing: -1px;
}
.hero-content p { font-size: 1.15rem; opacity: 0.9; font-weight: 300; }
.hero-slider .swiper-pagination-bullet { background: #fff; opacity: 0.4; width: 10px; height: 10px; }
.hero-slider .swiper-pagination-bullet-active { opacity: 1; background: var(--color-accent); width: 28px; border-radius: 5px; }
.hero-slider .swiper-button-next, .hero-slider .swiper-button-prev { color: rgba(255,255,255,0.7); }
.hero-slider .swiper-button-next:hover, .hero-slider .swiper-button-prev:hover { color: #fff; }

/* ========================================
   Sections
   ======================================== */
main { overflow-x: hidden; }
.section { padding: var(--section-padding); }
.section-light { background: var(--color-bg-light); }

.section-title { text-align: center; margin-bottom: 64px; }
.section-title h2 {
    font-size: 2rem; font-weight: 800; color: var(--color-primary);
    margin-bottom: 0; letter-spacing: -0.5px; display: inline-block; position: relative;
}
.section-title h2::after {
    content: ''; display: block; width: 40px; height: 2px;
    background: var(--color-accent); margin: 18px auto 0;
}
.section-title p {
    font-size: 1rem; color: var(--color-text-light);
    max-width: 480px; margin: 16px auto 0; font-weight: 300;
}

/* ========================================
   Greeting Section
   ======================================== */
.greeting-content {
    max-width: 700px; font-size: 1.02rem; line-height: 2.1;
    color: var(--color-text-light); word-break: keep-all;
}
.greeting-image {
    height: 100%;
}
.greeting-image img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 0;
}

/* ========================================
   Intro Section
   ======================================== */
.intro-card {
    background: #fff; border-radius: 2px; padding: 40px 28px; text-align: center;
    transition: var(--transition); border: 1px solid var(--color-border-light);
    height: 100%;
}
.intro-card:hover { box-shadow: 0 8px 30px rgba(102,93,81,0.08); border-color: var(--color-border); }

.intro-card .icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--color-bg-warm); border: 2px solid var(--color-border-light);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 22px; font-size: 1.6rem; color: var(--color-accent);
    transition: var(--transition);
}
.intro-card:hover .icon { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

.intro-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--color-primary); margin-bottom: 10px; }
.intro-card p { color: var(--color-text-light); font-size: 0.88rem; line-height: 1.7; }

/* ========================================
   Test Icon Cards
   ======================================== */
.tests-grid {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 20px; max-width: var(--container-max); margin: 0 auto;
}
.test-icon-card {
    background: #fff; padding: 36px 16px 28px; text-align: center;
    border: 1px solid var(--color-border-light); transition: var(--transition);
    cursor: pointer; position: relative;
}
.test-icon-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 20px rgba(174,125,48,0.1);
}

.test-icon-wrapper {
    width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 50%;
    background: var(--color-bg-warm); display: flex; align-items: center;
    justify-content: center; transition: var(--transition); padding: 18px;
}
.test-icon-card:hover .test-icon-wrapper { background: #f5efe6; }

.test-icon-wrapper img { width: 72px; height: 72px; object-fit: contain; transition: transform 0.4s ease; }
.test-icon-card:hover .test-icon-wrapper img { transform: translateY(-3px); }

.test-icon-info h3 {
    font-size: 0.88rem; font-weight: 600; color: var(--color-text);
    margin-bottom: 8px; line-height: 1.4;
}
.test-icon-price { margin: 0; }
.test-icon-price .original { display: block; font-size: 0.78rem; color: var(--color-text-muted); text-decoration: line-through; }
.test-icon-price .current { font-size: 1.05rem; font-weight: 800; color: var(--color-accent); }

@media (max-width: 1200px) { .tests-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 991px) { .tests-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (max-width: 575px) {
    .tests-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .test-icon-card { padding: 24px 10px 18px; }
    .test-icon-wrapper { width: 88px; height: 88px; padding: 14px; }
    .test-icon-wrapper img { width: 52px; height: 52px; }
    .test-icon-info h3 { font-size: 0.8rem; }
    .test-icon-price .current { font-size: 0.92rem; }
}

/* ========================================
   Price Table (Tabs)
   ======================================== */
.price-tabs { overflow: hidden; }
.price-tabs .nav-tabs { border-bottom: none; gap: 0; margin-bottom: 0; }
.price-tabs .nav-link {
    border: none; border-radius: 0; padding: 12px 32px; font-weight: 600; font-size: 0.9rem;
    color: var(--color-text-light); background: #ece8e2; transition: var(--transition);
    position: relative; white-space: nowrap;
}
.price-tabs .nav-link::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px; background: transparent; transition: var(--transition);
}
.price-tabs .nav-link.active { color: #fff; background: var(--color-primary); }
.price-tabs .nav-link.active::after { background: var(--color-accent); }
.price-tabs .nav-link:hover:not(.active) { background: #e2ddd5; color: var(--color-primary); }

.price-table { width: 100%; border-collapse: collapse; }
.price-table thead { background: var(--color-primary); }
.price-table th { font-weight: 600; color: #fff; font-size: 0.9rem; padding: 14px 20px; text-align: left; }
.price-table td {
    padding: 15px 20px; text-align: left; font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border-light);
}
.price-table tbody tr:hover { background: var(--color-bg-warm); }
.price-table .price-cell { font-weight: 700; color: var(--color-primary-dark); }
.price-table .note-cell { color: var(--color-accent); font-size: 0.82rem; }

/* ========================================
   Gallery
   ======================================== */
.gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.gallery-item {
    overflow: hidden; position: relative; aspect-ratio: 4/3; border: 1px solid var(--color-border-light);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .caption {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    color: #fff; font-size: 0.85rem; font-weight: 500;
}

/* ========================================
   Clinic Info / Map
   ======================================== */
.clinic-info-card {
    background: #fff; padding: 36px; border: 1px solid var(--color-border-light);
}
.clinic-info-card h3 { font-size: 1.2rem; font-weight: 700; color: var(--color-primary); margin-bottom: 24px; }

.clinic-info-list { list-style: none; padding: 0; }
.clinic-info-list li {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--color-border-light);
}
.clinic-info-list li:last-child { border-bottom: none; }
.clinic-info-list .icon { color: var(--color-accent); font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.clinic-info-list .label { font-weight: 600; min-width: 70px; color: var(--color-primary); font-size: 0.9rem; }

.map-container { overflow: hidden; border: 1px solid var(--color-border-light); }
.map-container iframe, .map-container #map { width: 100%; height: 400px; border: none; }

/* ========================================
   Floating Quick Menu
   ======================================== */
.floating-menu {
    position: fixed; right: 24px; bottom: 32px; z-index: 999;
    display: flex; flex-direction: column; gap: 10px;
    opacity: 0; transform: translateY(20px); transition: var(--transition);
}
.floating-menu.visible { opacity: 1; transform: translateY(0); }

.floating-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 74px; height: 74px; border-radius: 50%;
    background: var(--color-primary); color: #fff; border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18); cursor: pointer;
    transition: var(--transition); font-size: 0.68rem; text-decoration: none;
    letter-spacing: -0.2px; font-weight: 500;
}
.floating-btn i { font-size: 1.4rem; margin-bottom: 3px; }
.floating-btn:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 6px 22px rgba(0,0,0,0.28); }

/* 예약 - 골드 */
.floating-btn:nth-child(1) { background: var(--color-accent); }
.floating-btn:nth-child(1):hover { background: #c49240; }

/* 결과조회 - 네이비 */
.floating-btn:nth-child(2) { background: #213991; }
.floating-btn:nth-child(2):hover { background: #1a2e75; }

/* 오시는길 - 그린 */
.floating-btn:nth-child(3) { background: #2d8e6e; }
.floating-btn:nth-child(3):hover { background: #257a5e; }

/* 1:1문의 - 퍼플 */
.floating-btn.btn-inquiry { background: #7c3aed; }
.floating-btn.btn-inquiry:hover { background: #6d28d9; }

/* TOP - 연한 그레이 */
.floating-btn.btn-top { background: #888; }
.floating-btn.btn-top:hover { background: #666; }

/* 관리자 - 인디고 */
.floating-btn.btn-admin { background: #6366f1; }
.floating-btn.btn-admin:hover { background: #4f46e5; }

/* ========================================
   Footer
   ======================================== */
.site-footer { background: #2c2c2c; color: #bbb; padding: 56px 0 28px; }
.footer-title { color: #f0f0f0; font-size: 1.02rem; font-weight: 700; margin-bottom: 18px; }
.footer-desc { font-size: 0.87rem; line-height: 1.9; color: #999; }
.footer-info { list-style: none; padding: 0; }
.footer-info li { padding: 3px 0; font-size: 0.87rem; display: flex; gap: 8px; color: #999; }
.footer-info li span { font-weight: 600; min-width: 76px; color: #ccc; }
.footer-info li i { color: var(--color-accent); margin-top: 4px; }
.footer-divider { border-color: rgba(255,255,255,0.06); margin: 32px 0 18px; }
.footer-copyright { font-size: 0.82rem; margin: 0; color: #777; }
.footer-links a { color: #888; font-size: 0.82rem; margin-left: 20px; }
.footer-links a:hover { color: #ddd; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 991px) {
    :root { --header-height: 64px; --section-padding: 70px 0; }
    .hero-slide-img { min-height: 280px; object-fit: cover; }
    .hero-content h2 { font-size: 1.7rem; }
    .section-title h2 { font-size: 1.6rem; }
    .section-title { margin-bottom: 44px; }
    .greeting-image img { height: 350px; }
    .hero-slider .swiper-button-next, .hero-slider .swiper-button-prev { display: none; }
}
@media (max-width: 575px) {
    :root { --section-padding: 56px 0; }
    .hero-slide-img { min-height: 200px; }
    .hero-content h2 { font-size: 1.3rem; }
    .section-title h2 { font-size: 1.35rem; }
    .section-title { margin-bottom: 36px; }
    .greeting-image img { height: 260px; }
    .price-tabs .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .price-tab-content > div { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .price-table { min-width: 500px; }
    .price-table td, .price-table th { white-space: nowrap; }
    .floating-menu { right: 10px; bottom: 16px; gap: 6px; }
    .floating-btn { width: 42px; height: 42px; font-size: 0.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
    .floating-btn i { font-size: 1rem; margin-bottom: 0; }
    .floating-btn span { display: none; }
    .price-tabs .nav-link { padding: 10px 16px; font-size: 0.82rem; }
}

/* ========================================
   Utilities
   ======================================== */
.text-primary-custom { color: var(--color-primary) !important; }
.text-accent { color: var(--color-accent) !important; }
.bg-primary-custom { background: var(--color-primary) !important; }

.btn-primary-custom {
    background: var(--color-primary); color: #fff; border: none;
    padding: 13px 36px; border-radius: 2px; font-weight: 600;
    transition: var(--transition); font-size: 0.92rem; letter-spacing: 0.3px;
}
.btn-primary-custom:hover { background: var(--color-primary-dark); color: #fff; }

.btn-accent {
    background: var(--color-accent); color: #fff; border: none;
    padding: 13px 36px; border-radius: 2px; font-weight: 600;
    transition: var(--transition); font-size: 0.92rem;
}
.btn-accent:hover { background: var(--color-accent-light); color: #fff; }

/* ========================================
   Animations & Polish
   ======================================== */

/* 섹션 타이틀 밑줄 애니메이션 */
.section-title h2::after {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}
[data-aos].aos-animate .section-title h2::after,
.section-title h2.aos-animate::after,
.aos-animate .section-title h2::after {
    width: 40px;
}

/* 히어로 텍스트 등장 */
.hero-content h2 {
    animation: heroFadeUp 1s ease 0.3s both;
}
.hero-content p {
    animation: heroFadeUp 1s ease 0.6s both;
}
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}


/* 카드 호버 - 부드러운 떠오르기 */
.intro-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.intro-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(102,93,81,0.12);
}

/* 검사 카드 호버 */
.test-icon-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.test-icon-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(174,125,48,0.12);
}
.test-icon-card:hover .test-icon-wrapper img {
    transform: translateY(-4px) scale(1.05);
}

/* 갤러리 - 캡션 항상 표시, 호버 시 강조 */
.gallery-item .caption {
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 14px;
    font-size: 0.84rem;
}
.gallery-item:hover .caption {
    padding-bottom: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
}
.gallery-item img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-item:hover img {
    transform: scale(1.08);
}

/* 버튼 호버 - 미세 확대 + 그림자 */
.btn-primary-custom,
.btn-accent {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.btn-primary-custom:hover,
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.btn-primary-custom:active,
.btn-accent:active {
    transform: translateY(0);
}

/* 버튼 클릭 리플 효과 */
.btn-primary-custom::after,
.btn-accent::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}
.btn-primary-custom:active::after,
.btn-accent:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

/* 플로팅 메뉴 순차 등장 */
.floating-menu.visible .floating-btn:nth-child(1) { animation: fabIn 0.4s ease 0.0s both; }
.floating-menu.visible .floating-btn:nth-child(2) { animation: fabIn 0.4s ease 0.08s both; }
.floating-menu.visible .floating-btn:nth-child(3) { animation: fabIn 0.4s ease 0.16s both; }
.floating-menu.visible .floating-btn:nth-child(4) { animation: fabIn 0.4s ease 0.24s both; }
.floating-menu.visible .floating-btn:nth-child(5) { animation: fabIn 0.4s ease 0.32s both; }
.floating-menu.visible .floating-btn:nth-child(6) { animation: fabIn 0.4s ease 0.40s both; }
@keyframes fabIn {
    from { opacity: 0; transform: scale(0.5) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 플로팅 버튼 펄스 (예약 버튼) */
.floating-btn:nth-child(1) {
    animation: pulse 2s ease-in-out infinite;
}
.floating-menu.visible .floating-btn:nth-child(1) {
    animation: fabIn 0.4s ease 0.0s both, pulse 2s ease-in-out 1s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
    50% { box-shadow: 0 4px 24px rgba(174,125,48,0.4); }
}

/* 클리닉 안내 카드 호버 */
.clinic-info-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.clinic-info-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* 가격표 행 호버 */
.price-table tbody tr {
    transition: all 0.2s ease;
}
.price-table tbody tr:hover {
    background: var(--color-bg-warm);
    transform: scale(1.005);
}

/* 스크롤바 커스텀 */
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-track { background: #f5f5f5; }
html::-webkit-scrollbar-thumb { background: #c0b8ad; border-radius: 4px; }
html::-webkit-scrollbar-thumb:hover { background: #a09688; }

/* 텍스트 선택 색상 */
::selection { background: var(--color-accent); color: #fff; }

/* 포커스 스타일 */
*:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* 부드러운 이미지 로딩 */
img {
    opacity: 1;
    transition: opacity 0.4s ease;
}
img[loading="lazy"] {
    opacity: 0;
}
img[loading="lazy"].loaded,
img[loading="lazy"][complete] {
    opacity: 1;
}
