/* Responsive Design */

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .search-container {
        order: 3;
        flex-basis: 100%;
        margin: 0;
        max-width: none;
    }
    
    .search-container.active {
        display: block;
        margin-top: 1rem;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
    
    .nav-menu a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.5rem;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .filter-controls {
        width: 100%;
    }
    
    .filter-controls select {
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .promo-banner {
        font-size: 0.9rem;
        padding: 0.8rem 0;
    }
}

/* Mobile Landscape */
@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .add-btn, .view-btn {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .header {
        padding: 0.8rem 0;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions button {
        font-size: 1rem;
        padding: 0.4rem;
    }
    
    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
    
    .navigation {
        padding: 0.8rem 0;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-menu a {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .main-content {
        padding: 1.5rem 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-info {
        padding: 0.8rem;
    }
    
    .product-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
    }
    
    .view-all-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .footer {
        padding: 1.5rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .promo-banner {
        font-size: 0.8rem;
        padding: 0.6rem 0;
    }
    
    .promo-banner h2 {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-info {
        padding: 0.6rem;
    }
    
    .product-title {
        font-size: 0.8rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .add-btn, .view-btn {
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .nav-menu a {
        font-size: 0.7rem;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-image {
        image-rendering: -webkit-optimize-contrast;
    }
    
    .product-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print Styles */
@media print {
    .header,
    .navigation,
    .promo-banner,
    .footer,
    .cart-sidebar,
    .modal-overlay {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .product-actions {
        display: none;
    }
    
    * {
        color-adjust: exact;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* This would be implemented if dark mode is desired */
    /* Currently keeping light theme for consistency */
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #000;
    }
    
    .add-btn, .view-btn {
        border: 2px solid #000;
    }
    
    .nav-menu a:hover,
    .nav-menu a.active {
        background-color: #000;
        color: #fff;
    }
}