/* ==========================================================================
   Responsive Design Enhancements for EineCosmetics
   ========================================================================== */

/* 모바일 우선 기본 스타일 개선 */
.container {
    padding: 0 var(--space-4);
}

/* 초소형 디바이스 (480px 이하) */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    /* Hero 섹션 모바일 최적화 */
    .hero-title {
        font-size: var(--text-3xl);
        line-height: var(--leading-tight);
    }
    
    .hero-subtitle {
        font-size: var(--text-sm);
        padding: var(--space-2) var(--space-3);
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--space-3);
        margin: var(--space-6) 0;
    }
    
    .stat-item {
        text-align: center;
        padding: var(--space-3);
        background: rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
    }
    
    .stat-number {
        font-size: var(--text-2xl);
    }
    
    /* 버튼 스타일 모바일 최적화 */
    .hero-cta {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: var(--space-4) var(--space-6);
        font-size: var(--text-base);
    }
    
    /* 기능 카드 모바일 레이아웃 */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .feature-card {
        padding: var(--space-4);
    }
    
    /* 제품 카테고리 모바일 */
    .product-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    /* 프로세스 타임라인 모바일 */
    .process-timeline {
        padding: 0;
    }
    
    .timeline-item {
        margin-bottom: var(--space-4);
    }
    
    .timeline-content {
        padding: var(--space-3);
    }
    
    .timeline-content h3 {
        font-size: var(--text-base);
    }
    
    .timeline-content p {
        font-size: var(--text-sm);
    }
}

/* 소형 디바이스 (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .hero-cta {
        flex-direction: row;
        gap: var(--space-4);
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        max-width: 200px;
    }
}

/* 중간 디바이스 (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 900px;
    }
    
    .hero-title {
        font-size: var(--text-5xl);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    /* 가로 타임라인 적용 */
    .process-timeline {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        position: relative;
    }
    
    .process-timeline::before {
        content: '';
        position: absolute;
        top: 30px;
        left: 10%;
        right: 10%;
        height: 2px;
        background: var(--border-color);
    }
    
    .timeline-item {
        flex: 1;
        text-align: center;
        margin-bottom: 0;
    }
}

/* 대형 디바이스 (1025px 이상) */
@media (min-width: 1025px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .case-studies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 터치 디바이스 최적화 */
@media (hover: none) and (pointer: coarse) {
    /* 터치 타겟 크기 증가 */
    .btn,
    .feature-detail,
    .tab-btn,
    .news-link {
        min-height: 44px;
        min-width: 44px;
        padding: var(--space-3) var(--space-4);
    }
    
    /* 호버 효과 비활성화 */
    .feature-card:hover,
    .case-study-card:hover,
    .product-category-card:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    /* 터치 피드백 추가 */
    .btn:active,
    .feature-card:active,
    .case-study-card:active {
        transform: scale(0.98);
        transition: transform var(--duration-fast);
    }
    
    /* 스크롤 최적화 */
    .hero-stats,
    .features-grid,
    .product-grid {
        scroll-snap-type: x mandatory;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .stat-item,
    .feature-card,
    .product-category-card {
        scroll-snap-align: start;
    }
}

/* 마우스/트랙패드 디바이스 최적화 */
@media (hover: hover) and (pointer: fine) {
    .feature-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: var(--shadow-2xl);
    }
    
    .case-study-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }
    
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }
}

/* 세로 모드 최적화 */
@media (orientation: portrait) {
    .hero-content {
        text-align: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    @media (min-width: 768px) {
        .features-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
}

/* 가로 모드 최적화 */
@media (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: 100vh;
        padding: var(--space-8) 0;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-sm);
    }
    
    .hero-stats {
        margin: var(--space-4) 0;
    }
}

/* 고해상도 디스플레이 최적화 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-title {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 다크 모드 지원 준비 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F7FAFC;
        --text-secondary: #E2E8F0;
        --bg-white: #1A202C;
        --bg-gray: #2D3748;
        --border-color: #4A5568;
    }
    
    .hero::before {
        background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%);
    }
}