/* Responsive Design Enhancements */

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

/* Large Devices (992px and up) */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    
    .navbar-nav .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 250px;
    }
}

/* Medium Devices (768px and up) */
@media (min-width: 768px) {
    .about-preview .row {
        align-items: center;
    }
    
    .service-card {
        min-height: 350px;
    }
    
    .product-card {
        min-height: 400px;
    }
}

/* Small Devices (576px and up) */
@media (min-width: 576px) {
    .hero-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* Mobile Devices (575px and down) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .hero {
        height: 80vh;
        padding: 0 10px;
    }
    
    .hero-content {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .service-card,
    .product-card {
        margin-bottom: 20px;
    }
    
    .service-card {
        padding: 30px 20px;
        min-height: auto;
    }
    
    .product-card {
        min-height: auto;
    }
    
    .product-content {
        padding: 20px;
    }
    
    .about-content {
        margin-bottom: 30px;
    }
    
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-widget {
        margin-bottom: 30px;
    }
    
    .contact-cta {
        text-align: center;
    }
    
    .contact-cta .btn-lg {
        margin-top: 20px;
        width: 100%;
        max-width: 300px;
    }
}

/* Handheld-first improvements */
@media (max-width: 991.98px) {
    /* Prevent horizontal scrolling on small screens */
    body, html {
        overflow-x: hidden;
    }

    /* Header and navbar spacing */
    .header .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .navbar-toggler {
        padding: 8px 10px;
        border: 1px solid rgba(0,0,0,0.1);
    }

    .navbar-collapse {
        background-color: #fff;
        border-radius: 10px;
        padding: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

    .navbar-collapse .nav-link {
        display: block;
        padding: 12px 10px;
        margin: 2px 0;
    }

    /* Dropdown inside collapsed navbar should be static */
    .navbar-collapse .dropdown-menu {
        position: static;
        float: none;
        box-shadow: none;
        border: 1px solid #e9ecef;
        margin: 6px 0 10px;
    }

    /* Section spacing */
    .section {
        padding: 56px 0;
    }

    /* Page header spacing */
    .page-header {
        padding-top: 96px;
        padding-bottom: 36px;
    }

    /* Buttons: comfortable touch targets */
    .btn, .btn-lg {
        min-height: 44px;
    }

    /* Make images/media fully responsive */
    img, video, canvas, svg {
        max-width: 100%;
        height: auto;
    }

    iframe {
        max-width: 100%;
    }

    /* Footer alignment */
    .footer .text-end {
        text-align: left !important;
    }
}

@media (max-width: 767.98px) {
    /* Stack columns tighter and add gaps */
    .row {
        row-gap: 20px;
    }

    .contact-cta .btn-lg,
    .cta-btn {
        width: 100%;
        max-width: 320px;
    }

    /* Cards padding */
    .service-card,
    .product-card {
        padding: 24px 18px;
    }

    /* Forms spacing */
    .contact-form .mb-3 {
        margin-bottom: 0.9rem !important;
    }
}

/* Extra Small Devices (480px and down) */
@media (max-width: 479.98px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .service-card h3,
    .product-content h3 {
        font-size: 1.1rem;
    }
    
    .navbar-brand .logo {
        height: 40px;
    }
    
    .header .navbar {
        padding: 10px 0;
    }
}

/* Landscape Mobile Devices */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero {
        height: 100vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .service-card:hover,
    .product-card:hover {
        transform: none;
    }
    
    .navbar-nav .nav-link::after {
        display: none;
    }
    
    .dropdown-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: 1px solid #dee2e6;
        margin-top: 0;
    }
    
    .dropdown-item {
        padding: 15px 20px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-background::before {
        background-size: cover;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .hero-actions,
    .contact-cta,
    .btn {
        display: none !important;
    }
    
    .hero {
        height: auto;
        padding: 20px 0;
        background: none !important;
        color: #000 !important;
    }
    
    .hero-title,
    .hero-subtitle {
        color: #000 !important;
    }
    
    .section {
        padding: 20px 0;
    }
    
    .service-card,
    .product-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-content {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --light-gray: #2d2d2d;
        --text-dark: #ffffff;
        --text-light: #cccccc;
    }
    
    .header {
        background-color: rgba(26, 26, 26, 0.95);
    }
    
    .service-card,
    .product-card {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .dropdown-menu {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .dropdown-item {
        color: #ffffff;
    }
    
    .dropdown-item:hover {
        background-color: rgba(255, 107, 53, 0.2);
    }
}

