/**
 * Responsive Design Enhancements
 * Wallpaper Elegance Theme
 */

/* Mobile-First Approach - Base styles for mobile devices */

/* Mobile Navigation Enhancement */
@media (max-width: 768px) {
    .site-header {
        padding: 0.5rem 0;
    }
    
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .site-logo {
        font-size: 1.5rem;
    }
    
    .main-navigation {
        position: relative;
        width: 100%;
    }
    
    .main-navigation ul {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 1rem 0;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .main-navigation ul.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .main-navigation li {
        padding: 0;
    }
    
    .main-navigation a {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid #f0f0f0;
        font-size: 1.1rem;
    }
    
    .main-navigation a:hover {
        background: #f8f9fa;
    }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        position: relative;
        width: 30px;
        height: 30px;
    }
    
    .hamburger-line {
        display: block;
        width: 25px;
        height: 2px;
        background: #333;
        margin: 5px 0;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    
    .menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Desktop Navigation (hide menu toggle) */
@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
    
    .main-navigation ul {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        position: static !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }
}

/* Hero Section Responsive */
@media (max-width: 768px) {
    .hero-section {
        height: 70vh;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-cta {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* Product Grid Responsive */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .product-card {
        margin: 0 0.5rem;
    }
    
    .product-info {
        padding: 1.5rem;
    }
    
    .product-title {
        font-size: 1.2rem;
    }
    
    .product-actions-bottom {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .request-sample,
    .view-details {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-card {
        margin: 0;
    }
}

/* Filters Responsive */
@media (max-width: 768px) {
    .filters-container {
        padding: 2rem 0;
    }
    
    .filters-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }
    
    .filters-toggle {
        display: block;
        background: #333;
        color: #fff;
        border: none;
        padding: 0.8rem 1.5rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.9rem;
        transition: all 0.3s ease;
    }
    
    .filters-toggle:hover {
        background: #555;
    }
    
    .filters-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .filters-content.show {
        max-height: 1000px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .filter-options {
        gap: 0.3rem;
    }
    
    .filter-option {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (min-width: 769px) {
    .filters-toggle {
        display: none;
    }
    
    .filters-content {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Section Responsive */
@media (max-width: 768px) {
    .section {
        padding: 3rem 0;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .section-title p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 2rem 0;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
}

/* Grid System Responsive */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Single Product Page Responsive */
@media (max-width: 768px) {
    .product-single-container {
        display: block;
    }
    
    .product-gallery {
        margin-bottom: 2rem;
    }
    
    .gallery-thumbnails {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding: 1rem 0;
    }
    
    .thumbnail {
        min-width: 80px;
        height: 80px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 2rem;
    }
    
    .color-swatches-large {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .request-sample,
    .add-to-wishlist {
        width: 100%;
        justify-content: center;
    }
    
    .share-buttons {
        justify-content: center;
    }
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section ul {
        list-style: none;
    }
    
    .footer-section ul li {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Collections & Projects Responsive */
@media (max-width: 768px) {
    .collections-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .collection-card,
    .project-card {
        margin: 0;
    }
    
    .collection-header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .collection-title {
        font-size: 2.5rem;
    }
    
    .collection-stats {
        justify-content: center;
    }
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-width: none;
        margin: 2rem auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .sample-request-form .form-group {
        margin-bottom: 1rem;
    }
    
    .sample-request-form input,
    .sample-request-form textarea {
        width: 100%;
        padding: 0.8rem;
        font-size: 1rem;
    }
}

/* Utility Classes for Mobile */
@media (max-width: 768px) {
    .mobile-center {
        text-align: center;
    }
    
    .mobile-full-width {
        width: 100%;
    }
    
    .mobile-stack {
        flex-direction: column;
    }
    
    .mobile-hide {
        display: none;
    }
}

@media (min-width: 769px) {
    .desktop-hide {
        display: none;
    }
}

/* Touch-Friendly Elements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .filter-option,
    .color-swatch,
    .product-card,
    .collection-card,
    .project-card {
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    /* Increase touch target sizes */
    .filter-option {
        min-height: 44px;
        padding: 0.8rem 1rem;
    }
    
    .color-swatch {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .product-card:hover,
    .collection-card:hover,
    .project-card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    }
    
    .product-overlay {
        opacity: 1;
        background: rgba(0,0,0,0.3);
    }
    
    .product-actions {
        position: static;
        background: transparent;
    }
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image img,
    .collection-image img,
    .project-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .filters-container,
    .product-overlay,
    .modal {
        display: none !important;
    }
    
    .product-card,
    .collection-card,
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
}