/* Responsive Design */

/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) and (max-width: 2559px) {
    .container {
        max-width: 1440px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Large Devices (1200px and up) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
}

/* Medium Devices (992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero-content {
        gap: var(--spacing-2xl);
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Devices (768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
        padding: 0 var(--spacing-lg);
    }
    
    .hero {
        padding: 100px 0 var(--spacing-2xl);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
        text-align: center;
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .category-image {
        height: 180px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .video-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .creating-joy .container {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
}

/* Extra Small Devices (576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 var(--spacing-md);
    }
    
    .hero {
        padding: 80px 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .category-image {
        height: 160px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .filter-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Extra Extra Small Devices (less than 576px) */
@media (max-width: 575px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero {
        padding: 60px 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
        line-height: 1.3;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .section-description {
        font-size: var(--font-size-base);
    }
    
    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-md);
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .category-image {
        height: 150px;
    }
    
    .category-content {
        padding: var(--spacing-md);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .product-card {
        padding: var(--spacing-lg);
    }
    
    .filter-tabs {
        flex-direction: column;
        gap: var(--spacing-sm);
        width: 100%;
    }
    
    .filter-tab {
        width: 100%;
        text-align: center;
    }
    
    .video-container iframe {
        min-height: 200px;
    }
    
    .video-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .playlist-item {
        flex-direction: column;
        text-align: center;
    }
    
    .playlist-thumbnail {
        width: 100%;
        height: 120px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .contact-cards {
        gap: var(--spacing-md);
    }
    
    .contact-card {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .social-links {
        flex-wrap: wrap;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    /* Navigation adjustments for mobile */
    .nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--background-primary);
        transition: left var(--transition-base);
        z-index: var(--z-modal);
        padding: var(--spacing-xl);
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: var(--spacing-lg);
        height: 100%;
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    .nav-link {
        font-size: var(--font-size-lg);
        padding: var(--spacing-md) 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 40px 0 var(--spacing-lg);
    }
    
    .hero-title {
        font-size: var(--font-size-xl);
    }
    
    .section-title {
        font-size: var(--font-size-xl);
    }
    
    .video-container iframe {
        min-height: 180px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mascot-image,
    .logo img,
    .footer-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .video-showcase,
    .floating-card,
    .btn,
    .social-links {
        display: none !important;
    }
    
    .hero,
    .popular-categories,
    .featured-products,
    .creating-joy,
    .contact-us {
        padding: var(--spacing-lg) 0 !important;
        page-break-inside: avoid;
    }
    
    .section-title {
        color: #000 !important;
        font-size: var(--font-size-xl) !important;
    }
    
    .section-description,
    .hero-description {
        color: #333 !important;
    }
    
    .product-card,
    .category-card,
    .contact-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .floating-card,
    .mascot-image {
        animation: none !important;
    }
    
    .btn::before {
        display: none;
    }
    
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #fff !important;
    }
    
    .btn-secondary {
        background: #fff !important;
        color: #000 !important;
        border: 2px solid #000 !important;
    }
    
    .card,
    .product-card,
    .category-card {
        border: 2px solid #000 !important;
    }
}

/* Focus management for keyboard navigation */
@media (any-hover: none) {
    .card:hover,
    .product-card:hover,
    .category-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .btn,
    .filter-tab,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .social-link,
    .search-btn {
        min-height: 50px;
        min-width: 50px;
    }
}

/* Back to Top Button - Mobile Responsive */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .back-to-top img {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .back-to-top img {
        width: 18px;
        height: 18px;
    }
}

/* Video section responsive styles */
@media (max-width: 768px) {
    .video-main-content {
        height: 300px;
    }
    
    .video-mascot {
        max-width: 200px;
    }
    
    .playlist {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .playlist-thumbnail {
        height: 120px;
    }
}

@media (max-width: 576px) {
    .video-main-content {
        height: 250px;
    }
    
    .video-mascot {
        max-width: 150px;
    }
    
    .playlist {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .playlist-thumbnail {
        height: 180px;
    }
    
    .video-section .section-title {
        font-size: var(--font-size-4xl);
    }
    
    .video-section .section-description {
        font-size: var(--font-size-sm);
    }
}

/* Container queries for modern browsers */
@supports (container-type: inline-size) {
    .products-grid {
        container-type: inline-size;
    }
    
    @container (max-width: 600px) {
        .product-card {
            padding: var(--spacing-md);
        }
        
        .product-title {
            font-size: var(--font-size-base);
        }
    }
}



/* Default styles - 8K UHD and above (7680x4320+) */
.dynamic-title {
    font-size: 72px !important;
    line-height: 80px !important;
}

.dynamic-subtitle {
    font-size: 48px !important;
    line-height: 56px !important;
}

.dynamic-button-text {
    font-size: 48px !important;
    line-height: 96px !important;
}

/* 5K resolution (5120x2880) - iMac 27" Retina 5K */
@media screen and (max-width: 5120px) {
    .dynamic-title {
        font-size: 64px !important;
        line-height: 72px !important;
    }
    
    .dynamic-subtitle {
        font-size: 42px !important;
        line-height: 48px !important;
    }

    
    .dynamic-button-text {
        font-size: 42px !important;
        line-height: 84px !important;
    }
}

/* 4K UHD (3840x2160) */
@media screen and (max-width: 3840px) {
    .dynamic-title {
        font-size: 56px !important;
        line-height: 64px !important;
    }
    
    .dynamic-subtitle {
        font-size: 36px !important;
        line-height: 42px !important;
    }
    
    
    .dynamic-button-text {
        font-size: 36px !important;
        line-height: 72px !important;
    }
}

/* Ultra-wide screen (3440x1440) - 21:9 ultrawide */
@media screen and (max-width: 3440px) {
    .dynamic-title {
        font-size: 52px !important;
        line-height: 60px !important;
    }
    
    .dynamic-subtitle {
        font-size: 34px !important;
        line-height: 40px !important;
    }

    
    .dynamic-button-text {
        font-size: 34px !important;
        line-height: 68px !important;
    }
}

/* MacBook Pro 16" (3072x1920) */
@media screen and (max-width: 3072px) {
    .dynamic-title {
        font-size: 48px !important;
        line-height: 56px !important;
    }
    
    .dynamic-subtitle {
        font-size: 32px !important;
        line-height: 38px !important;
    }

    
    .dynamic-button-text {
        font-size: 32px !important;
        line-height: 64px !important;
    }
}

/* QHD/WQHD (2560x1440/1600) - MacBook Pro 13" */
@media screen and (max-width: 2560px) {
    .dynamic-title {
        font-size: 44px !important;
        line-height: 52px !important;
    }
    
    .dynamic-subtitle {
        font-size: 30px !important;
        line-height: 36px !important;
    }
    
    
    .dynamic-button-text {
        font-size: 26px !important;
        line-height:60px !important;
    }
}

/* FHD (1920x1080/1200) - iMac 21.5", Full HD */
@media screen and (max-width: 1920px) {
    .dynamic-title {
        font-size: 52px !important;
        line-height: 52px !important;
    }
    
    .dynamic-subtitle {
        font-size: 28px !important;
        line-height: 34px !important;
    }

    
    .dynamic-button-text {
        font-size: 20px !important;
        line-height: 56px !important;
    }
}

/* Other common resolutions (1600x900) */
@media screen and (max-width: 1600px) {
    .dynamic-title {
        font-size: 36px !important;
        line-height: 44px !important;
    }
    
    .dynamic-subtitle {
        font-size: 26px !important;
        line-height: 32px !important;
    }
    
    
    .dynamic-button-text {
        font-size: 18px !important;
        line-height: 52px !important;
    }
}

/* Common laptop resolution (1366x768) */
@media screen and (max-width: 1366px) {
    .dynamic-title {
        font-size: 32px !important;
        line-height: 40px !important;
    }
    
    .dynamic-subtitle {
        font-size: 24px !important;
        line-height: 30px !important;
    }
    
    .dynamic-button-text {
        font-size: 16px !important;
        line-height:48px !important;
    }
}

/* HD 720p (1280x720/1024) - SXGA */
@media screen and (max-width: 1280px) {
    .dynamic-title {
        font-size: 28px !important;
        line-height: 36px !important;
    }
    
    .dynamic-subtitle {
        font-size: 22px !important;
        line-height: 28px !important;
    }

    
    .dynamic-button-text {
        font-size: 14px !important;
        line-height: 44px !important;
    }
}

/* XGA (1024x768) */
@media screen and (max-width: 1024px) {
    .dynamic-title {
        font-size: 24px !important;
        line-height: 32px !important;
    }
    
    .dynamic-subtitle {
        font-size: 20px !important;
        line-height: 26px !important;
    }
    
    
    .dynamic-button-text {
        font-size: 12px !important;
        line-height: 40px !important;
    }
}

/* SVGA (800x600) */
@media screen and (max-width: 800px) {
    .dynamic-title {
        font-size: 20px !important;
        line-height: 28px !important;
    }
    
    .dynamic-subtitle {
        font-size: 18px !important;
        line-height: 24px !important;
    }
    
    
    .dynamic-button-text {
        font-size: 18px !important;
        line-height: 36px !important;
    }
}

/* VGA (640x480) - minimum resolution */
@media screen and (max-width: 640px) {
    .dynamic-title {
        font-size: 16px !important;
        line-height: 24px !important;
    }
    
    .dynamic-subtitle {
        font-size: 14px !important;
        line-height: 20px !important;
    }

    
    .dynamic-button-text {
        font-size: 14px !important;
        line-height: 28px !important;
    }
}