/* =============================================
   ENHANCED MOBILE RESPONSIVENESS
   Additional CSS for better mobile experience
   ============================================= */

/* Extra small devices (320px and up) */
@media (max-width: 375px) {
    /* Typography adjustments */
    :root {
        --font-size-base: 0.875rem;
    }
    
    .hero__title {
        font-size: 1.5rem !important;
        line-height: 1.2;
    }
    
    .hero__subtitle {
        font-size: 0.875rem;
    }
    
    .section__title {
        font-size: 1.5rem;
    }
    
    /* Button sizing */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn--large {
        padding: 0.875rem 1.5rem;
    }
    
    /* Product cards */
    .product-card {
        min-width: 260px;
    }
    
    /* Stats grid */
    .stats__grid {
        gap: 1rem;
    }
    
    .stats__item {
        padding: 1.5rem;
    }
}

/* Small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    /* Container padding */
    .container {
        padding: 0 1rem;
    }
    
    /* Section spacing */
    .section {
        padding: 3rem 0;
    }
    
    /* Header adjustments */
    .header__logo-text {
        font-size: 1.25rem;
    }
    
    /* Hero section */
    .hero {
        min-height: 500px;
        height: 80vh;
    }
    
    .hero__cta {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .hero__cta .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Stats - single column */
    .stats__grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* About preview */
    .about-preview__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-preview__image {
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* Product carousel */
    .carousel__btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .product-card {
        min-width: 280px;
    }
    
    .product-card__image {
        height: 200px;
    }
    
    /* Testimonials */
    .testimonial {
        padding: 1.5rem;
    }
    
    .testimonial__avatar img {
        width: 50px;
        height: 50px;
    }
    
    .testimonial__text {
        font-size: 0.9rem;
    }
    
    /* CTA section */
    .cta__title {
        font-size: 1.75rem;
    }
    
    .cta__buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .cta__buttons .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer__col {
        text-align: center;
    }
    
    .footer__certifications {
        justify-content: center;
    }
}

/* Medium devices (tablets, 576px to 768px) */
@media (min-width: 576px) and (max-width: 767px) {
    /* Stats - 2 columns */
    .stats__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Product cards - 2 per row */
    .product-card {
        min-width: calc(50% - 1rem);
    }
    
    /* Footer - 2 columns */
    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large phones and small tablets (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Navigation */
    .nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--color-white);
        box-shadow: var(--shadow-md);
        z-index: 200;
    }
    
    .nav.active {
        display: block;
    }
    
    .nav__list {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    .nav__item {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .nav__link {
        display: block;
        padding: 1rem;
    }
    
    /* Hero */
    .hero__title {
        font-size: 2.5rem;
    }
    
    /* Stats - 2 columns */
    .stats__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* About preview */
    .about-preview__grid {
        gap: 3rem;
    }
    
    /* Product carousel */
    .product-card {
        min-width: 280px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav__link {
        padding: 1rem;
    }
    
    .header__hamburger {
        padding: 0.5rem;
    }
    
    /* Remove hover effects on touch devices */
    .product-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    /* Tap highlight */
    * {
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.1);
    }
}

/* Landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 400px;
        padding: 2rem 0;
    }
    
    .hero__title {
        font-size: 2rem;
    }
    
    .hero__scroll {
        display: none;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper images on retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed in future */
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero {
        background-attachment: scroll !important;
    }
    
    .cta {
        background-attachment: scroll !important;
    }
}

/* Print styles */
@media print {
    .header,
    .hero__scroll,
    .carousel__btn,
    .testimonials__controls,
    .cta,
    .scroll-top,
    .cookie-consent,
    .loading-screen {
        display: none !important;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .hero {
        background-attachment: scroll;
    }
    
    .cta {
        background-attachment: scroll;
    }
    
    /* Fix iOS input zoom */
    input, select, textarea {
        font-size: 16px;
    }
}

/* Android Chrome specific */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select, textarea, input {
        font-size: 16px;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .footer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* Loading performance optimizations */
img {
    loading: lazy;
}

/* Smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
