/* ===================================
   STYLES RESPONSIVE ADDITIONNELS
   Chargé inline pour optimisation
   =================================== */

/* Viewport height mobile fix */
:root {
    --vh: 1vh;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Touch optimizations */
.is-touch a,
.is-touch button {
    -webkit-tap-highlight-color: rgba(46, 204, 113, 0.3);
    tap-highlight-color: rgba(46, 204, 113, 0.3);
}

.is-touch button.touch-active,
.is-touch .button.touch-active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* Mobile menu overlay */
body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile header improvements */
@media (max-width: 768px) {
    .site-header {
        position: relative;
    }
    
    .header-content {
        padding: 10px 0;
    }
    
    .site-branding {
        margin-bottom: 10px;
    }
}

/* Landscape mobile adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .top-bar {
        padding: 5px 0;
    }
    
    .contact-info {
        font-size: 11px;
        gap: 8px;
    }
    
    .hero-section {
        padding: 20px 0;
        min-height: 250px;
    }
    
    .site-header {
        position: relative;
    }
    
    .header-main {
        padding: 10px 0;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-section h1 {
        font-size: 20px;
    }
    
    .btn-hero {
        padding: 8px 20px;
        font-size: 13px;
    }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 992px) and (orientation: landscape) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimisations pour écrans Retina */
    .site-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Désactivé par défaut, peut être activé plus tard */
    /* body {
        background-color: #1a1a1a;
        color: #ffffff;
    } */
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .nav-menu,
    .menu-toggle,
    .back-to-top,
    .add-to-cart,
    .search-form {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .main-content {
        width: 100%;
        padding: 0;
        box-shadow: none;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS viewport height */
    .hero-section {
        min-height: calc(var(--vh, 1vh) * 50);
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .site-header {
        padding-top: max(0px, env(safe-area-inset-top));
    }
}

/* Accessibility improvements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100000;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improve form controls on mobile */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Prevent zoom on iOS */
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Larger checkboxes and radios on mobile */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}
