/*--------------------------------------------------------------
# Mobile Optimization CSS for PEULGO
# 모바일 최적화 스타일시트
--------------------------------------------------------------*/

/* ===== 기본 모바일 최적화 ===== */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, select {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

/* 스크롤 부드럽게 처리 */
html {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 모바일 폰트 크기 자동 조절 방지 */
body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ===== 모바일 헤더 개선 ===== */
@media (max-width: 768px) {
    .header {
        padding: 15px 0;
        background-color: var(--white) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    }
    
    .header.scrolled {
        padding: 10px 0;
        background-color: var(--white) !important;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* 모바일 메뉴 개선 */
    .mobile-menu {
        width: 85%;
        max-width: none;
    }
    
    .mobile-menu-container {
        padding: 20px;
    }
    
    .mobile-menu .nav-item {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding: 5px 0;
    }
    
    .mobile-menu .nav-link {
        font-size: 17px;
        padding: 12px 0;
        color: var(--gray-800);
    }
    
    .mobile-menu .nav-link:active {
        background-color: rgba(67, 97, 238, 0.1);
        border-radius: 8px;
    }
    
    /* 로고 크기 조정 */
    .navbar-brand img {
        height: 32px !important;
        width: auto;
    }
    
    /* 햄버거 메뉴 크기 증가 */
    .hamburger {
        padding: 10px;
        margin-right: -10px;
    }
    
    .hamburger .line {
        width: 28px;
        height: 3px;
        margin: 7px 0;
    }
    
    /* 인증 버튼 모바일 최적화 */
    .mobile-menu .auth-buttons {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .mobile-menu .login-btn, 
    .mobile-menu .signup-btn {
        padding: 12px 24px;
        font-size: 16px;
        border-radius: 25px;
    }
}

/* ===== Hero 섹션 모바일 최적화 ===== */
@media (max-width: 768px) {
    .hero-section {
        height: 70vh;
        min-height: 500px;
    }
    
    .hero-content {
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .hero-text {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 25px;
    }
    
    .hero-buttons {
        gap: 12px;
    }
    
    .hero-buttons .primary-btn,
    .hero-buttons .outline-btn {
        padding: 12px 24px;
        font-size: 15px;
        min-width: 140px;
    }
    
    /* Hero 네비게이션 숨김 */
    .hero-navigation {
        display: none;
    }
    
    .hero-scroll-down {
        right: 20px;
        bottom: 20px;
    }
}

/* ===== 섹션 패딩 조정 ===== */
@media (max-width: 768px) {
    section {
        padding: 50px 0;
    }
    
    .section-header {
        margin-bottom: 35px;
    }
    
    .section-title {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .section-subtitle {
        font-size: 12px;
        padding: 4px 12px;
    }
    
    .section-desc {
        font-size: 15px;
        line-height: 1.6;
    }
}

/* ===== 카테고리 모바일 최적화 ===== */
@media (max-width: 576px) {
    .categories-grid {
        gap: 16px;
    }
    
    .category-item {
        border-radius: 12px;
    }
    
    .category-item a {
        padding: 20px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .category-item h3 {
        font-size: 18px;
    }
    
    .category-item p {
        font-size: 14px;
        line-height: 1.5;
    }
}

/* ===== 제품/기업 카드 모바일 최적화 ===== */
@media (max-width: 768px) {
    .product-card,
    .company-card {
        margin: 0 8px;
    }
    
    .product-image,
    .company-image {
        height: 180px;
    }
    
    .product-info,
    .company-info {
        padding: 15px;
    }
    
    .product-title,
    .company-name {
        font-size: 16px;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    /* Swiper 버튼 위치 조정 */
    .swiper-buttons {
        margin-bottom: 15px;
    }
    
    .products-button-prev, 
    .products-button-next,
    .companies-button-prev, 
    .companies-button-next {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* ===== 서비스 섹션 모바일 최적화 ===== */
@media (max-width: 768px) {
    .service-section {
        padding: 60px 0;
    }
    
    .service-feature {
        margin-bottom: 20px;
    }
    
    .feature-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
        margin-right: 15px;
    }
    
    .feature-content h4 {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .feature-content p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .image-wrapper {
        border-radius: 15px;
        margin-top: 30px;
    }
    
    .image-wrapper img {
        height: 250px;
    }
}

/* ===== 통계 섹션 모바일 최적화 ===== */
@media (max-width: 576px) {
    .stats-section {
        padding: 40px 0;
    }
    
    .stats-grid {
        gap: 25px;
    }
    
    .stat-count {
        font-size: 2.2rem;
    }
    
    .stat-item p {
        font-size: 1rem;
    }
}

/* ===== CTA 섹션 모바일 최적화 ===== */
@media (max-width: 768px) {
    .cta-section {
        padding: 60px 0;
    }
    
    .cta-container {
        padding: 35px 20px;
        border-radius: 15px;
    }
    
    .cta-content h2 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .cta-content p {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }
    
    .cta-buttons {
        gap: 10px;
    }
    
    .cta-container .primary-btn,
    .cta-container .secondary-btn {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
        max-width: 200px;
    }
}

/* ===== 푸터 모바일 최적화 ===== */
@media (max-width: 768px) {
    .footer {
        padding-top: 50px;
    }
    
    .footer-top {
        gap: 35px;
    }
    
    .footer-about {
        text-align: center;
    }
    
    .footer-logo {
        margin-bottom: 15px;
    }
    
    .footer-about p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 20px;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .footer-links h5,
    .footer-contact h5 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .footer-links li {
        margin-bottom: 8px;
    }
    
    .footer-links a,
    .contact-info p {
        font-size: 14px;
    }
    
    .footer-bottom {
        padding: 20px 0;
    }
    
    .copyright,
    .business-info {
        font-size: 12px;
    }
}

/* ===== 모바일 버튼 최적화 ===== */
@media (max-width: 576px) {
    .primary-btn,
    .secondary-btn,
    .outline-btn {
        padding: 12px 24px;
        font-size: 15px;
        border-radius: 25px;
    }
    
    .login-btn,
    .signup-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ===== Back to Top 버튼 모바일 ===== */
@media (max-width: 768px) {
    .back-to-top {
        right: 20px;
        bottom: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* ===== 터치 친화적 요소 ===== */
@media (max-width: 768px) {
    /* 모든 클릭 가능한 요소 최소 크기 보장 */
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 인라인 링크는 제외 */
    p a, li a {
        min-height: auto;
        min-width: auto;
    }
    
    /* 폼 요소 개선 */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px; /* iOS 줌 방지 */
        padding: 12px;
        border-radius: 8px;
    }
    
    /* 체크박스와 라디오 버튼 크기 증가 */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}

/* ===== 가로 스크롤 방지 ===== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .container,
    .row,
    .hero-content,
    .section-header {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* ===== 이미지 최적화 ===== */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 레이지 로딩 플레이스홀더 */
    img[loading="lazy"] {
        background-color: var(--gray-200);
    }
}

/* ===== 모바일 성능 최적화 ===== */
@media (max-width: 768px) {
    /* 복잡한 애니메이션 제거 */
    *, *::before, *::after {
        animation-duration: 0.3s !important;
    }
    
    /* 호버 효과 비활성화 */
    .category-item:hover,
    .product-card:hover,
    .company-card:hover {
        transform: none;
    }
    
    /* 그림자 단순화 */
    .product-card,
    .company-card,
    .category-item {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }
}

/* ===== 접근성 개선 ===== */
@media (max-width: 768px) {
    /* 포커스 스타일 강화 */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    /* 스킵 네비게이션 */
    .skip-navigation {
        position: absolute;
        top: -40px;
        left: 0;
        background: var(--primary-color);
        color: white;
        padding: 8px;
        text-decoration: none;
        z-index: 100;
    }
    
    .skip-navigation:focus {
        top: 0;
    }
}

/* ===== 다크모드 지원 (선택사항) ===== */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    /* 다크모드 스타일을 여기에 추가 */
}

/* ===== 가로 모드 최적화 ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        height: 100vh;
        min-height: 400px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    section {
        padding: 40px 0;
    }
}