/* ===== Responsive Design ===== */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (992px to 1199px) */
@media (max-width: 1199px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet (768px to 991px) */
@media (max-width: 991px) {
    /* Navigation */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: var(--spacing-md);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .search-box input {
        width: 200px;
    }
    
    /* Hero */
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-features {
        gap: var(--spacing-lg);
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Products */
    .products-header {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-xl);
    }
    
    .stats {
        justify-content: center;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    /* Modal */
    .modal-content {
        margin: 10% auto;
        max-width: 90%;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .product-preview {
        min-height: 250px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Large (576px to 767px) */
@media (max-width: 767px) {
    /* Container */
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Navigation */
    .navbar .container {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }
    
    .nav-actions {
        order: 3;
        width: 100%;
        justify-content: space-between;
        margin-top: var(--spacing-md);
    }
    
    .search-box {
        flex: 1;
    }
    
    .search-box input {
        width: 100%;
    }
    
    /* Hero */
    .hero {
        padding: 80px 0 40px;
        margin-top: 120px;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-features {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-md);
    }
    
    /* Section titles */
    .section-title {
        font-size: 2rem;
    }
    
    /* Categories */
    .categories {
        padding: var(--spacing-xl) 0;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .category-card {
        padding: var(--spacing-xl);
    }
    
    /* Products */
    .products {
        padding: var(--spacing-xl) 0;
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .filter-btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* About */
    .about {
        padding: var(--spacing-xl) 0;
    }
    
    .about-text h2 {
        font-size: 1.75rem;
    }
    
    .stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .about-features {
        gap: var(--spacing-md);
    }
    
    .feature-item {
        padding: var(--spacing-md);
    }
    
    /* Contact */
    .contact {
        padding: var(--spacing-xl) 0;
    }
    
    .contact-form {
        padding: var(--spacing-xl);
    }
    
    /* Modal */
    .modal-content {
        margin: 5% var(--spacing-sm);
        max-width: none;
        max-height: 95vh;
    }
    
    .product-details {
        padding: var(--spacing-xl);
    }
    
    .close {
        top: var(--spacing-sm);
        left: var(--spacing-sm);
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-md);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-xl);
    }
    
    .social-links {
        justify-content: center;
    }
    
    .newsletter {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* Mobile Small (up to 575px) */
@media (max-width: 575px) {
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    /* Navigation */
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .navbar {
        padding: var(--spacing-sm) 0;
    }
    
    /* Hero */
    .hero {
        margin-top: 100px;
        padding: 60px 0 30px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-features .feature {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .cta-button {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 1rem;
    }
    
    /* Section spacing */
    .categories,
    .products,
    .about,
    .contact {
        padding: var(--spacing-lg) 0;
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-xl);
    }
    
    /* Categories */
    .category-card {
        padding: var(--spacing-lg);
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        margin-bottom: var(--spacing-md);
    }
    
    .category-icon i {
        font-size: 1.5rem;
    }
    
    /* Products */
    .filter-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .product-info {
        padding: var(--spacing-md);
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-actions {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    /* About */
    .about-text h2 {
        font-size: 1.5rem;
    }
    
    .about-text p {
        font-size: 1rem;
    }
    
    .stat h3 {
        font-size: 1.75rem;
    }
    
    /* Contact */
    .contact-form {
        padding: var(--spacing-lg);
    }
    
    .form-group input,
    .form-group textarea {
        padding: var(--spacing-sm);
    }
    
    /* Modal */
    .modal-content {
        margin: 2% var(--spacing-xs);
    }
    
    .product-details {
        padding: var(--spacing-lg);
    }
    
    .product-actions {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    /* Footer */
    .footer-section h3 {
        font-size: 1.25rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
    }
}

/* Extra Small Mobile (up to 380px) */
@media (max-width: 380px) {
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .category-card,
    .product-info,
    .contact-form {
        padding: var(--spacing-sm);
    }
    
    .hero-features .feature {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .filter-controls {
        gap: var(--spacing-xs);
    }
    
    .filter-btn {
        padding: var(--spacing-xs);
        font-size: 0.75rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero,
    .category-card,
    .product-card {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Landscape Orientation on Mobile */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .hero {
        padding: 40px 0 20px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-features {
        flex-direction: row;
        justify-content: center;
        margin-bottom: var(--spacing-lg);
    }
    
    .modal-content {
        max-height: 95vh;
        margin: 2% auto;
    }
}

/* Print Styles */
@media print {
    .header,
    .hero,
    .footer,
    .modal,
    .loading-spinner {
        display: none !important;
    }
    
    .products,
    .categories,
    .about {
        page-break-inside: avoid;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero::before {
        animation: none;
    }
    
    .spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --background: #111827;
        --background-light: #1f2937;
        --background-dark: #374151;
        --border-color: #4b5563;
    }
    
    .header {
        background: var(--background);
        border-bottom: 1px solid var(--border-color);
    }
    
    .modal-content {
        background: var(--background);
    }
    
    .close {
        background: var(--background-dark);
        color: var(--text-light);
    }
    
    .close:hover {
        background: var(--background-light);
        color: var(--text-primary);
    }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .product-card,
    .category-card {
        border: 2px solid var(--border-color);
    }
}