/* ===== RESPONSIVE STYLES ===== */
/* Large Desktop: 1200px and up */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Desktop: 992px - 1199px */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-content,
    .contact-content {
        gap: 2rem;
    }
}

/* Tablet: 768px - 991px */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Navigation */
    .nav-menu {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    /* Products Grid */
    .products-grid,
    .all-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* About Page */
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .mission-vision {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Contact Page */
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Services Page */
    .categories-filter {
        justify-content: center;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 576px - 767px */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 1rem;
    }
    
    /* Typography */
    .hero-title {
        font-size: 2.2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    /* Products */
    .products-grid,
    .all-products-grid,
    .testimonials-grid,
    .services-grid,
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hero Buttons */
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Stats */
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Search Section */
    .search-form {
        flex-direction: column;
    }
    
    .search-btn {
        justify-content: center;
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links,
    .social-icons {
        justify-content: center;
    }
    
    /* Contact Page */
    .contact-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    /* CTA Section */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Product Actions */
    .product-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-cart,
    .btn-details {
        width: 100%;
    }
}

/* Small Mobile: 0 - 575px */
@media (max-width: 575px) {
    .container {
        padding: 0 0.75rem;
    }
    
    /* Typography */
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero-description,
    .page-subtitle {
        font-size: 1rem;
    }
    
    /* Navigation */
    .nav-actions {
        gap: 0.5rem;
    }
    
    .cart-link,
    .user-link {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* Mobile Menu */
    .mobile-menu {
        width: 100%;
        right: -100%;
    }
    
    .mobile-menu.active {
        right: 0;
    }
    
    /* Products */
    .product-card {
        padding: 1rem;
    }
    
    /* Categories Filter */
    .categories-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .category-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Footer */
    .footer-bottom-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Forms */
    .contact-form-container {
        padding: 1.5rem;
    }
    
    /* Newsletter Form */
    .newsletter-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .mobile-toggle,
    .nav-actions,
    .back-to-top,
    .loading-screen,
    .notification,
    .search-section,
    .cta-section,
    .categories-filter,
    .product-actions {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
    }
    
    .hero-section,
    .page-hero {
        background: white !important;
        color: black !important;
        padding: 1rem 0 !important;
    }
    
    .hero-title,
    .page-title,
    .section-title {
        color: black !important;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .btn {
        display: none;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none !important;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    .no-print {
        display: none !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #f8f9fa;
        --light: #212529;
        --bg-light: #121212;
        --white: #1e1e1e;
        --gray-light: #495057;
        --gray-dark: #adb5bd;
    }
    
    body {
        background-color: #121212;
        color: #e9ecef;
    }
    
    /* Cards */
    .product-card,
    .testimonial-card,
    .service-card,
    .contact-form-container,
    .search-box,
    .contact-item,
    .social-contact,
    .faq-item,
    .stat-card,
    .mission,
    .vision,
    .team-member {
        background-color: #1e1e1e;
        border-color: #333;
    }
    
    /* Inputs */
    .form-group input,
    .form-group select,
    .form-group textarea,
    .search-input,
    .newsletter-form input {
        background-color: #2d2d2d;
        border-color: #444;
        color: #f8f9fa;
    }
    
    .form-group input::placeholder,
    .form-group textarea::placeholder,
    .search-input::placeholder {
        color: #6c757d;
    }
    
    /* Headers & Footers */
    .header {
        background-color: #1a1a1a;
        border-bottom: 1px solid #333;
    }
    
    .footer {
        background-color: #1a1a1a;
    }
    
    /* Links */
    .nav-link {
        color: #adb5bd;
    }
    
    .nav-link:hover,
    .nav-link.active {
        color: #4361ee;
        background-color: rgba(67, 97, 238, 0.1);
    }
    
    /* Product Badges */
    .product-badge {
        color: white;
    }
    
    /* Text Colors */
    .product-title,
    .service-title,
    .footer-title,
    .contact-text h3,
    .faq-question h3 {
        color: #e9ecef;
    }
    
    .product-description,
    .service-description,
    .footer-description,
    .contact-text p,
    .faq-answer p {
        color: #adb5bd;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000ff;
        --secondary: #800080;
        --success: #008000;
        --danger: #ff0000;
    }
    
    .btn-primary,
    .btn-cart,
    .search-btn {
        border: 2px solid black;
    }
    
    .product-card,
    .testimonial-card,
    .service-card {
        border: 2px solid black;
    }
    
    .nav-link.active {
        border: 2px solid var(--primary);
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .typing-text,
    .loading-spinner,
    .float,
    .pulse,
    .bounce,
    .rotate {
        animation: none !important;
    }
    
    .hover-lift:hover,
    .hover-grow:hover {
        transform: none !important;
    }
    
    .notification {
        transition: none !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ===== ORIENTATION SPECIFIC ===== */
/* Portrait */
@media (orientation: portrait) {
    .hero-container,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .hero-image,
    .about-image {
        order: -1;
    }
}

/* Landscape */
@media (orientation: landscape) and (max-height: 600px) {
    .header {
        position: static;
    }
    
    .hero-section,
    .page-hero {
        padding: 4rem 0 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
}

/* ===== SPECIFIC DEVICE FIXES ===== */
/* iPhone Safari fix for 100vh */
@supports (-webkit-touch-callout: none) {
    .hero-section,
    .page-hero {
        min-height: -webkit-fill-available;
    }
}

/* Fix for Firefox scrollbar */
@-moz-document url-prefix() {
    .container {
        scrollbar-width: thin;
    }
}

/* ===== ZOOM SUPPORT ===== */
@media (max-width: 360px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .product-card {
        padding: 0.75rem;
    }
}

@media (min-width: 361px) and (max-width: 400px) {
    html {
        font-size: 15px;
    }
}

/* ===== FONT SIZE ADJUSTMENTS ===== */
@media (max-width: 767px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .nav-link,
    .btn,
    .product-card,
    .service-card {
        min-height: 44px;
    }
    
    .btn-cart,
    .btn-details {
        padding: 12px;
    }
    
    .mobile-nav-list a {
        padding: 16px;
    }
    
    /* Increase touch targets */
    .social-link,
    .social-icon {
        width: 44px;
        height: 44px;
    }
    
    .cart-link,
    .user-link {
        width: 44px;
        height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .hover-lift:hover,
    .hover-grow:hover {
        transform: none;
    }
}

/* ===== FOLDABLE DEVICES ===== */
@media (max-width: 359px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-buttons .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .product-features span {
        font-size: 0.8rem;
    }
}

/* ===== 4K AND HIGH RESOLUTION SCREENS ===== */
@media (min-width: 2000px) {
    .container {
        max-width: 1600px;
    }
    
    html {
        font-size: 18px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .products-grid,
    .all-products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* ===== TRANSITIONAL BREAKPOINTS ===== */
@media (min-width: 1400px) and (max-width: 1599px) {
    .container {
        max-width: 1320px;
    }
}

/* ===== CUSTOM BREAKPOINT FOR SPECIFIC COMPONENTS ===== */
@media (max-width: 850px) {
    .mission-vision {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        justify-content: space-around;
    }
}

@media (max-width: 680px) {
    .products-grid,
    .all-products-grid {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== HEIGHT-BASED MEDIA QUERIES ===== */
@media (max-height: 700px) {
    .hero-section {
        padding: 6rem 0 3rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* ===== ASPECT RATIO SPECIFIC ===== */
@media (min-aspect-ratio: 16/9) {
    .hero-section {
        min-height: 70vh;
    }
}

@media (max-aspect-ratio: 3/4) {
    .hero-image .image-placeholder {
        height: 250px;
    }
}