/**
 * ViserKid Style - Responsive Design
 * 반응형 디자인 스타일
 */

/* ==================== Extra Large Screens (1400px+) ==================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-banner h1 {
        font-size: 3.5rem;
    }
    
    .section-title h2 {
        font-size: 3rem;
    }
}

/* ==================== Large Screens (1200px - 1399px) ==================== */
@media (max-width: 1399px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }
    
    .hero-banner h1 {
        font-size: 2.75rem;
    }
}

/* ==================== Medium Screens (992px - 1199px) ==================== */
@media (max-width: 1199px) {
    .header-btm {
        padding: var(--spacing-sm) 0;
    }
    
    .gnb-nav {
        gap: var(--spacing-md);
    }
    
    .gnb-nav > li > a {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.9rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .hero-banner h1 {
        font-size: 2.5rem;
    }
    
    .section-title h2 {
        font-size: 2.25rem;
    }
}

/* ==================== Tablets (768px - 991px) ==================== */
@media (max-width: 991px) {
    /* 헤더 */
    .header-top {
        padding: var(--spacing-xs) 0;
        font-size: 0.8rem;
    }
    
    .header-top-left ul {
        gap: var(--spacing-md);
    }
    
    .header-top-menu {
        display: none;
    }
    
    .header-logo img {
        max-height: 50px;
    }
    
    /* 네비게이션 - 모바일 메뉴로 전환 */
    .gnb-wrap {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100vh;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        transition: left 0.3s;
        z-index: 1100;
    }
    
    .gnb-wrap.active {
        left: 0;
    }
    
    .gnb-nav {
        flex-direction: column;
        gap: 0;
        padding: var(--spacing-lg);
    }
    
    .gnb-nav > li > a {
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
    }
    
    /* 메인 콘텐츠 */
    .hero-banner {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .hero-banner h1 {
        font-size: 2rem;
    }
    
    .hero-banner p {
        font-size: 1rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    /* 카테고리 */
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: var(--spacing-md);
    }
    
    .category-card {
        padding: var(--spacing-md);
    }
    
    .category-card img {
        width: 60px;
        height: 60px;
    }
    
    .category-card h4 {
        font-size: 0.875rem;
    }
    
    /* 제품 그리드 */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: var(--spacing-md);
    }
    
    .product-card {
        border-radius: var(--radius-md);
    }
    
    .product-info {
        padding: var(--spacing-sm);
    }
    
    .product-title {
        font-size: 0.875rem;
    }
    
    .product-price .current-price {
        font-size: 1rem;
    }
    
    /* 브랜드 */
    .brand-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: var(--spacing-md);
    }
    
    /* 고객 리뷰 */
    .testimonial-slider {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .testimonial-card {
        padding: var(--spacing-lg);
    }
    
    /* 푸터 */
    .footer-top {
        padding: var(--spacing-xl) 0;
    }
    
    .footer-widget {
        margin-bottom: var(--spacing-lg);
    }
}

/* ==================== Mobile Large (576px - 767px) ==================== */
@media (max-width: 767px) {
    /* 헤더 */
    .header-top-left {
        display: none;
    }
    
    .header-logo {
        text-align: center;
        margin: 0 auto;
    }
    
    .header-logo img {
        max-height: 40px;
    }
    
    .header-btm {
        padding: var(--spacing-xs) 0;
    }
    
    /* 탑바 */
    .top-bar-list {
        gap: var(--spacing-sm);
    }
    
    .top-bar-list li a {
        width: 36px;
        height: 36px;
    }
    
    .top-bar-list li a img {
        width: 18px;
        height: 18px;
    }
    
    /* 메인 콘텐츠 */
    .hero-banner {
        padding: var(--spacing-lg) var(--spacing-sm);
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-banner h1 {
        font-size: 1.75rem;
    }
    
    .hero-banner p {
        font-size: 0.875rem;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-banner .btn-primary {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.875rem;
    }
    
    /* 섹션 간격 조정 */
    .section {
        padding: var(--spacing-lg) 0;
    }
    
    .section-m-tb {
        margin: var(--spacing-lg) 0;
    }
    
    .section-p-tb {
        padding: var(--spacing-lg) 0;
    }
    
    .section-title {
        margin-bottom: var(--spacing-lg);
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .section-title h2::after {
        width: 50px;
        height: 3px;
    }
    
    .section-title p {
        font-size: 0.875rem;
    }
    
    /* 카테고리 */
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .category-card {
        padding: var(--spacing-sm);
    }
    
    .category-card div {
        font-size: 2.5rem !important;
    }
    
    .category-card h4 {
        font-size: 0.75rem;
    }
    
    /* 제품 그리드 */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .product-card-badge {
        top: var(--spacing-sm);
        left: var(--spacing-sm);
        padding: 2px var(--spacing-sm);
        font-size: 0.65rem;
    }
    
    .product-actions {
        gap: var(--spacing-xs);
    }
    
    .product-action-btn {
        width: 36px;
        height: 36px;
    }
    
    .product-info {
        padding: var(--spacing-sm);
    }
    
    .product-category {
        font-size: 0.75rem;
    }
    
    .product-title {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
    
    .product-rating {
        font-size: 0.75rem;
    }
    
    .product-price .current-price {
        font-size: 1rem;
    }
    
    .product-price .original-price {
        font-size: 0.8rem;
    }
    
    .btn-add-to-cart {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    /* 브랜드 */
    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
    }
    
    .brand-item {
        padding: var(--spacing-md);
    }
    
    /* 고객 리뷰 */
    .testimonial-slider {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .testimonial-card {
        padding: var(--spacing-md);
    }
    
    .testimonial-card::before {
        font-size: 3rem;
    }
    
    .testimonial-text {
        font-size: 0.875rem;
    }
    
    /* 뉴스레터 */
    .newsletter-section {
        padding: var(--spacing-lg);
    }
    
    .newsletter-section h2 {
        font-size: 1.5rem;
    }
    
    .newsletter-section p {
        font-size: 0.875rem;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        padding: var(--spacing-sm);
    }
    
    /* 푸터 */
    .footer-top {
        padding: var(--spacing-lg) 0;
    }
    
    .footer-menu-title {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
    }
    
    .footer-menu-links {
        font-size: 0.875rem;
    }
    
    .footer-company-info address {
        font-size: 0.75rem;
        line-height: 1.6;
    }
    
    .footer-btm {
        padding: var(--spacing-md) 0;
    }
    
    .footer-btm .row > div {
        text-align: center !important;
        margin-bottom: var(--spacing-sm);
    }
    
    .footer-payment-icons {
        text-align: center !important;
    }
}

/* ==================== Mobile Small (400px - 575px) ==================== */
@media (max-width: 575px) {
    .hero-banner h1 {
        font-size: 1.5rem;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .brand-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== Mobile Extra Small (< 400px) ==================== */
@media (max-width: 399px) {
    .hero-banner h1 {
        font-size: 1.25rem;
    }
    
    .hero-banner p {
        font-size: 0.75rem;
    }
    
    .section-title h2 {
        font-size: 1.25rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-card div {
        font-size: 2rem !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    .product-card {
        border-radius: var(--radius-sm);
    }
    
    .product-info {
        padding: var(--spacing-xs);
    }
    
    .product-title {
        font-size: 0.75rem;
    }
    
    .btn-add-to-cart {
        font-size: 0.75rem;
    }
}

/* ==================== 터치 디바이스 최적화 ==================== */
@media (hover: none) and (pointer: coarse) {
    /* 터치 영역 확대 */
    .product-action-btn,
    .btn-add-to-cart,
    .category-card {
        min-height: 44px;
    }
    
    /* 호버 효과 제거 */
    .product-card:hover .product-image img {
        transform: none;
    }
    
    .product-card:hover .product-actions {
        opacity: 1;
    }
    
    /* 터치 피드백 */
    .category-card:active,
    .product-card:active,
    .brand-item:active {
        transform: scale(0.98);
    }
}

/* ==================== 프린트 스타일 ==================== */
@media print {
    .header,
    .footer,
    .top-bar,
    .gnb-nav,
    .newsletter-section,
    .btn-add-to-cart,
    .product-actions {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        color: #000;
    }
}

/* ==================== 다크모드 대응 (선택사항) ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #E2E8F0;
        --text-secondary: #CBD5E0;
        --text-light: #A0AEC0;
        --bg-primary: #1A202C;
        --bg-secondary: #2D3748;
        --white: #2D3748;
        --light-gray: #1A202C;
        --border-color: #4A5568;
    }
    
    .product-card,
    .category-card,
    .brand-item,
    .testimonial-card,
    .blog-card {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
}

/* ==================== 접근성 개선 ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== 가로 모드 (Landscape) ==================== */
@media (max-width: 991px) and (orientation: landscape) {
    .hero-banner {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .hero-banner h1 {
        font-size: 2rem;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .offcanvas {
        width: 320px !important;
    }
}

/* ==================== 고해상도 디스플레이 ==================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image img,
    .category-card img,
    .brand-item img {
        image-rendering: -webkit-optimize-contrast;
    }
}

