/* 태블릿 */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 0.9375rem;
    }

    section {
        padding: 3.75rem 0;
    }

    section h2 {
        font-size: 2rem;
        line-height: 1.25;
        margin-bottom: 2rem;
    }

    .main-visual {
        height: auto;
        min-height: 18rem;
    }

    .community-grid {
        grid-template-columns: 1fr;
    }

    /* 태블릿 텍스트 최적화 */
    .slide-content h2 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .slide-content p {
        font-size: 1.1rem;
        line-height: 1.4;
    }

    .main-card {
        padding: 2rem 1.5rem;
    }

    .main-card h3 {
        font-size: 1.15rem;
        line-height: 1.3;
    }

    .main-card p {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    /* 통계 섹션 태블릿 최적화 */
    .main-stats .stat-number {
        font-size: 3rem;
        line-height: 1.1;
    }

    .main-stats .stat-label {
        font-size: 1.1rem;
    }

    .main-stats .stat-description {
        font-size: 0.9rem;
        line-height: 1.3;
    }
}

/* 모바일 */
@media screen and (max-width: 768px) {
    .header-top {
        padding: 0.9375rem 0;
    }

    .logo img {
        height: 2.5rem;
    }

    /* 데스크톱 네비게이션 숨기기 */
    .main-nav {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex !important;
        position: relative !important;
        z-index: 1001 !important;
        order: 1;
        visibility: visible !important;
        opacity: 1 !important;
        width: 2.75rem !important;
        height: 2.75rem !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* 헤더 레이아웃 조정 */
    .header-top .container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 1rem !important;
        position: relative;
    }
    
    .logo {
        order: 2;
        flex: 1 1 auto;
        text-align: center;
    }
    
    .mobile-menu-btn {
        order: 1;
        flex: 0 0 auto;
    }
    
    /* 햄버거 아이콘 강제 표시 */
    .hamburger {
        display: flex !important;
        flex-direction: column !important;
        width: 1.5rem !important;
        height: 1.125rem !important;
        justify-content: space-between !important;
    }
    
    .hamburger span {
        display: block !important;
        height: 0.1875rem !important;
        width: 100% !important;
        background-color: #000 !important;
        border-radius: 0.09375rem !important;
        transition: all 0.3s ease !important;
    }
    
    /* 햄버거 아이콘 활성화 애니메이션 */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(0.35rem, 0.35rem) !important;
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0 !important;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(0.35rem, -0.35rem) !important;
    }

    .main-visual {
        height: auto;
        min-height: 10rem;
        margin-top: 4.375rem;
    }

    section {
        padding: 2.5rem 0;
    }

    section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.875rem;
        line-height: 1.3;
    }

    /* 텍스트 크기 최적화 */
    .slide-content h2 {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .slide-content p {
        font-size: 1rem !important;
        line-height: 1.4;
        margin-bottom: 1.5rem;
    }

    .main-card {
        padding: 1.5rem 1rem !important;
        text-align: center;
    }

    .main-card i {
        font-size: 2rem !important;
        margin-bottom: 0.75rem !important;
    }

    .main-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.3;
    }

    .main-card p {
        font-size: 0.9rem !important;
        line-height: 1.4;
    }

    /* 통계 섹션 모바일 최적화 */
    .main-stats .stat-number {
        font-size: 2.5rem !important;
        line-height: 1.1;
    }

    .main-stats .stat-label {
        font-size: 1rem !important;
        margin-top: 0.5rem;
    }

    .main-stats .stat-description {
        font-size: 0.85rem !important;
        line-height: 1.3;
        margin-top: 0.25rem;
    }

    .doctors-grid,
    .specialty-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.875rem;
    }

    /* 스트레스성 질환 섹션 모바일 반응형 */
    .stress-section .grid-2-cols {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .stress-section .disease-cards {
        grid-template-columns: 1fr;
        gap: 0.9375rem;
    }
    
    .stress-section .treatment-step {
        flex-direction: column;
        text-align: center;
        gap: 0.9375rem;
    }
    
    .stress-section .step-number {
        width: 3.125rem;
        height: 3.125rem;
        font-size: 1.2rem;
    }

    /* 질환별 표 모바일 반응형 */
    .disease-table {
        grid-template-columns: 1fr !important;
    }
    
    .disease-table > div {
        text-align: center !important;
        padding: 0.9375rem !important;
    }
    
    /* 특징 섹션 모바일 반응형 */
    .feature-item {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1.25rem !important;
    }
    
    .feature-number {
        width: 3.75rem !important;
        height: 3.75rem !important;
        font-size: 1.5rem !important;
    }
}

/* 작은 모바일 */
@media screen and (max-width: 480px) {
    .main-visual {
        height: auto;
        min-height: 8rem;
    }

    section {
        padding: 2rem 0;
    }

    section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        line-height: 1.25;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        min-height: 2.75rem;
        border-radius: 0.375rem;
    }

    /* 작은 모바일 텍스트 최적화 */
    .slide-content h2 {
        font-size: 1.75rem !important;
        line-height: 1.15;
        margin-bottom: 0.75rem;
    }

    .slide-content p {
        font-size: 0.9rem !important;
        line-height: 1.4;
        margin-bottom: 1.25rem;
    }

    .main-card {
        padding: 1.25rem 0.75rem !important;
    }

    .main-card i {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
    }

    .main-card h3 {
        font-size: 1rem !important;
        margin-bottom: 0.375rem !important;
    }

    .main-card p {
        font-size: 0.85rem !important;
        line-height: 1.35;
    }

    /* 통계 섹션 작은 모바일 최적화 */
    .main-stats .stat-number {
        font-size: 2rem !important;
        line-height: 1;
    }

    .main-stats .stat-label {
        font-size: 0.9rem !important;
    }

    .main-stats .stat-description {
        font-size: 0.8rem !important;
        line-height: 1.25;
    }

    /* 이미지 반응형 처리 */
    .slider-control {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
    }

    .slider-dot {
        width: 0.5rem;
        height: 0.5rem;
    }

    .logo img {
        height: 2rem;
    }

    /* 컨테이너 패딩 조정 */
    .container {
        padding: 0 1rem;
    }

    /* 폰트 크기 전반적 최적화 */
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    h3 {
        font-size: 1.125rem;
        line-height: 1.3;
    }

    h4 {
        font-size: 1rem;
        line-height: 1.4;
    }

    p, li {
        font-size: 0.875rem;
        line-height: 1.4;
    }
}

/* 모바일 메뉴 스타일 */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(20rem, 80vw);
    height: 100vh;
    background: var(--white);
    padding: 1.25rem;
    transition: left 0.3s ease;
    z-index: 1001;
    box-shadow: 0.125rem 0 1rem rgba(0,0,0,0.15);
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 0.0625rem solid var(--light-gray);
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li {
    margin: 0;
    border-bottom: 0.0625rem solid var(--light-gray);
}

.mobile-menu li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    display: block;
    padding: 1rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}

.mobile-menu a:hover,
.mobile-menu a:focus {
    background-color: var(--light-gray);
    color: var(--primary-color);
    transform: translateX(0.25rem);
}

.mobile-menu a:active {
    transform: translateX(0.25rem) scale(0.98);
}

/* 서브메뉴 모바일 처리 */
.mobile-menu .sub-menu {
    display: none;
    background-color: var(--light-gray);
    margin: 0;
    padding: 0;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
    margin-left: 1rem;
}

.mobile-menu .sub-menu.active {
    display: block;
}

.mobile-menu .sub-menu li {
    border-bottom: none;
}

.mobile-menu .sub-menu a {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    margin-left: 0;
}

.mobile-menu .sub-menu a:hover {
    background-color: var(--white);
}

/* 모바일 메뉴 화살표 */
.mobile-menu .has-sub::after {
    content: '▼';
    float: right;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.mobile-menu .has-sub.active::after {
    transform: rotate(180deg);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
}

/* About 페이지 모바일 최적화 */
@media screen and (max-width: 768px) {
    .about-greeting-section {
        padding: 2.5rem 0 !important;
    }

    .about-greeting-section h2,
    .about-greeting-section div[style*="font-size:2.1rem"] {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }

    .about-greeting-section p[style*="font-size:1.2rem"] {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }

    .about-greeting-section p[style*="font-size:1.1rem"] {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
    }

    .about-autonomic-bg {
        padding: 2.5rem 0 !important;
    }

    .about-autonomic-bg h2 {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }

    .about-autonomic-btns {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .about-autonomic-btns .btn {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.95rem !important;
        border-radius: 2rem !important;
    }
}

/* Autonomic 페이지 모바일 최적화 */
@media screen and (max-width: 768px) {
    .autonomic-visual {
        padding: 2rem 0 1.5rem 0 !important;
    }

    .autonomic-visual .container {
        flex-direction: column !important;
        gap: 1.5rem !important;
        text-align: center !important;
    }

    .autonomic-visual img {
        max-width: 45% !important;
        margin: 0 0.25rem !important;
    }

    .autonomic-visual div[style*="font-size:1.1rem"] {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        max-width: 100% !important;
        margin-top: 1rem !important;
    }
}

@media screen and (max-width: 480px) {
    .about-greeting-section div[style*="font-size:2.1rem"] {
        font-size: 1.5rem !important;
    }

    .about-greeting-section p[style*="font-size:1.2rem"] {
        font-size: 0.9rem !important;
    }

    .about-greeting-section p[style*="font-size:1.1rem"] {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    .about-autonomic-bg h2 {
        font-size: 1.4rem !important;
        line-height: 1.25 !important;
    }

    .autonomic-visual img {
        max-width: 80% !important;
        display: block !important;
        margin: 0.5rem auto !important;
    }

    .autonomic-visual div[style*="font-size:1.1rem"] {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
}

/* 클리닉 페이지들 공통 모바일 최적화 (digestive, immune, neuro, women) */
@media screen and (max-width: 768px) {
    /* 주요 비주얼 섹션 */
    section[style*="padding:2.5rem"] {
        padding: 1.5rem 1rem !important;
    }

    section[style*="padding:60px"] {
        padding: 2.5rem 0 !important;
    }

    section[style*="padding:60px 40px"] {
        padding: 2rem 1rem !important;
    }

    /* 4만건 처방 사례 섹션 */
    div[style*="padding:60px 40px"] {
        padding: 2rem 1rem !important;
    }

    /* 카드 레이아웃 */
    div[style*="flex:1 1 180px"] {
        flex: 1 1 100% !important;
        min-width: 100% !important;
        margin-bottom: 1rem !important;
    }

    /* 제목 크기 조정 */
    div[style*="font-size:2.5rem"] {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
    }

    div[style*="font-size:1.5rem"] {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
    }

    /* 목록 들여쓰기 조정 */
    li[style*="margin-left:20px"] {
        margin-left: 1rem !important;
    }

    /* 플렉스 컨테이너 모바일 스택 */
    div[style*="display:flex"][style*="gap:"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }
}

/* 진료철학 페이지 (philosophy.html) 모바일 최적화 */
@media screen and (max-width: 768px) {
    section[style*="min-height:420px"] {
        min-height: 300px !important;
        padding: 2.5rem 0 !important;
    }

    div[style*="font-size:2.8rem"] {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    div[style*="font-size:2.2rem"] {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
    }
}

/* 치료프로그램 페이지 (treatmentprogram.html) 모바일 최적화 */
@media screen and (max-width: 768px) {
    .treatment-program img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 0.5rem !important;
    }

    .treatment-program-section {
        padding: 2rem 0 !important;
    }

    .treatment-program-title {
        font-size: 1.8rem !important;
        margin-bottom: 1rem !important;
    }
}

@media screen and (max-width: 480px) {
    /* 작은 모바일 추가 최적화 */
    section[style*="padding:2.5rem"] {
        padding: 1rem 0.5rem !important;
    }

    div[style*="font-size:2.5rem"] {
        font-size: 1.5rem !important;
    }

    div[style*="font-size:1.5rem"] {
        font-size: 1.1rem !important;
    }

    section[style*="min-height:420px"] {
        min-height: 250px !important;
        padding: 2rem 0 !important;
    }

    div[style*="font-size:2.8rem"] {
        font-size: 1.75rem !important;
    }

    div[style*="font-size:2.2rem"] {
        font-size: 1.4rem !important;
    }

    /* 컨테이너 최적화 */
    div[style*="max-width:800px"] {
        max-width: 100% !important;
        padding: 0 1rem !important;
    }

    div[style*="max-width:1100px"] {
        max-width: 100% !important;
        padding: 0 1rem !important;
    }

    /* 상담신청 배너 모바일 최적화 */
    .quick-consult-banner {
        padding: 0.75rem 1rem !important;
        gap: 0.75rem !important;
    }

    .quick-consult-banner .qc-form {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .quick-consult-banner .qc-form input {
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
        font-size: 0.875rem !important;
        padding: 0.5rem !important;
    }

    .quick-consult-banner .qc-submit {
        width: 100% !important;
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
    }
} 