/* ===================================
   TRÈS PETITS ÉCRANS (MOBILES ≤480px)
   =================================== */

@media screen and (max-width: 480px) {
    html {
        font-size: 14px;
    }

    nav {
        padding: 0.75rem 1rem;
    }

    nav.nav-scrolled {
        margin: 0.5rem 1rem;
        padding: 0.5rem 1rem;
        border-radius: 50px;
    }

    .nav-logo {
        height: 30px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .tagline {
        font-size: 1.5rem;
        padding: 0 1rem;
    }

    .metier-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    /* SEGMENTS PRODUITS - Photos en colonne sur mobile */
    .segment-slider-container {
        flex-direction: column !important;
        gap: 1rem;
    }

    .segment-slide {
        min-width: 100% !important;
        width: 100%;
        aspect-ratio: 16/9;
    }

    /* Masquer les dots de navigation */
    .segment-slider-dots {
        display: none;
    }

    /* Ajuster le contenu des slides */
    .segment-slide-content {
        padding: 1rem;
    }

    .segment-slide-title {
        font-size: 1rem;
    }

    .segment-slide-description {
        font-size: 0.85rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .map-container {
        height: 300px;
    }

    /* Section bols - très petits écrans */
    #bols-vibrants .moyens-content-item .moyens-text .moyens-video {
        border-radius: 12px;
    }

    #bols-vibrants .moyens-description {
        padding: 1rem;
    }
}

/* ===================================
   MOBILES LANDSCAPE ET PETITES TABLETTES
   =================================== */
@media screen and (min-width: 481px) and (max-width: 768px) {
    html {
        font-size: 15px;
    }

    nav {
        padding: 0.875rem 1.5rem;
    }

    nav.nav-scrolled {
        margin: 0.75rem 1.5rem;
    }

    .nav-logo {
        height: 35px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 2rem;
    }

    .metier-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    /* SEGMENTS PRODUITS - Photos en colonne */
    .segment-slider-container {
        flex-direction: column !important;
        gap: 1.5rem;
    }

    .segment-slide {
        min-width: 100% !important;
        width: 100%;
        aspect-ratio: 3/2;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .equipes-container {
        flex-direction: column;
        gap: 2rem;
    }

    .moyens-content-item {
        flex-direction: column !important;
        gap: 2rem;
    }

    .moyens-image,
    .moyens-text {
        max-width: 100%;
    }
}

/* ===================================
   TOUS LES MOBILES (≤768px)
   =================================== */
@media screen and (max-width: 768px) {

    /* Navigation mobile - Menu hamburger */
    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        background: rgba(11, 22, 44, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 0;
        padding: 2rem;
        list-style: none;
        margin: 0;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        border-left: 1px solid var(--border-light);
        z-index: 999;
    }

    nav ul.open {
        right: 0;
    }

    nav li {
        width: 100%;
        opacity: 0;
        transform: translateX(30px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    nav ul.open li {
        opacity: 1;
        transform: translateX(0);
    }

    nav ul.open li:nth-child(1) {
        transition-delay: 0.1s;
    }

    nav ul.open li:nth-child(2) {
        transition-delay: 0.15s;
    }

    nav ul.open li:nth-child(3) {
        transition-delay: 0.2s;
    }

    nav ul.open li:nth-child(4) {
        transition-delay: 0.25s;
    }

    nav ul.open li:nth-child(5) {
        transition-delay: 0.3s;
    }

    nav a {
        display: block;
        width: 100%;
        padding: 1.25rem 1.5rem;
        font-size: 1.25rem;
        border-radius: 12px;
        margin: 0.25rem 0;
    }

    nav a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 0;
        background: var(--primary-green);
        border-radius: 0 2px 2px 0;
        transition: height 0.3s ease;
    }

    nav a:hover,
    nav a.active {
        background: rgba(149, 193, 31, 0.1);
        color: var(--primary-green);
        padding-left: 2rem;
    }

    nav a:hover::before,
    nav a.active::before {
        height: 100%;
    }

    nav a.active {
        background: rgba(149, 193, 31, 0.15);
    }

    nav a::after {
        display: none;
    }

    /* Hamburger button */
    .hamburger-btn {
        display: flex;
    }

    /* Utilitaires responsive */
    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: block;
    }

    /* SEGMENTS PRODUITS - Photos en colonne */
    .segment-slider-container {
        flex-direction: column !important;
        gap: 1.5rem;
    }

    .segment-slide {
        min-width: 100% !important;
        width: 100%;
        aspect-ratio: 4/3;
    }

    /* Masquer les dots de navigation */
    .segment-slider-dots {
        display: none;
    }

    /* Section bols vibrants - MASQUER L'IMAGE */
    #bols-vibrants .moyens-content-item .moyens-text img {
        display: none !important;
    }

    #bols-vibrants .moyens-content-item .moyens-text .moyens-video {
        display: block;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }

    #bols-vibrants+.moyens-text h4 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
}

/* ===================================
   ORIENTATION PORTRAIT MOBILE
   =================================== */
@media screen and (orientation: portrait) and (max-width: 768px) {
    .hero-video-container {
        width: 100%;
        aspect-ratio: 9 / 16;
    }

    /* Ajustement pour les segments en portrait */
    .segment-slider {
        padding: 1rem 0;
    }

    .segment-slide {
        border-radius: 12px;
    }
}

/* ===================================
   ORIENTATION PAYSAGE MOBILE
   =================================== */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    section {
        padding: 4rem 2rem;
    }

    .section-metier {
        padding: 4rem 2rem;
    }
}

@media screen and (max-width: 768px) and (orientation: landscape) {
    #bols-vibrants .moyens-content-item .moyens-text .moyens-video {
        max-width: 60%;
    }
}

/* ===================================
   TABLETTES
   =================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .metier-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .segment-slide {
        min-width: calc(50% - 1rem);
    }

    .moyens-content-item {
        gap: 2rem;
    }

    .moyens-image,
    .moyens-text {
        flex: 1;
    }

    .contact-container {
        grid-template-columns: 1fr 1.5fr;
    }

    .equipes-container {
        gap: 3rem;
    }

    nav ul {
        gap: 1.5rem;
    }

    nav a {
        padding: 0.4rem 0.8rem;
    }

    /* Section bols vibrants - Tablette */
    #bols-vibrants .moyens-content-item .moyens-text {
        flex-direction: column;
        gap: 2rem;
    }

    #bols-vibrants .moyens-content-item .moyens-text img {
        max-height: 400px;
        width: auto;
        margin: 0 auto;
    }

    #bols-vibrants .moyens-content-item .moyens-text .moyens-video {
        max-width: 500px;
    }
}

/* ===================================
   DESKTOP - Cacher le hamburger
   =================================== */
@media screen and (min-width: 769px) {
    .hamburger-btn {
        display: none;
    }

    nav ul {
        position: static;
        flex-direction: row;
        width: auto;
        height: auto;
        background: none;
        backdrop-filter: none;
        box-shadow: none;
    }

    /* Utilitaires responsive */
    .hide-mobile {
        display: block;
    }

    .show-mobile {
        display: none;
    }
}

/* ===================================
   ÉCRANS MOYENS (laptops)
   =================================== */
@media screen and (min-width: 1025px) and (max-width: 1399px) {
    .container {
        max-width: 1200px;
    }

    .metier-grid {
        max-width: 1200px;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .tagline {
        font-size: 3rem;
    }

    /* Section bols vibrants - Desktop */
    #bols-vibrants .moyens-content-item .moyens-text {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
    }

    #bols-vibrants .moyens-content-item .moyens-text img {
        height: 500px;
        width: auto;
    }

    #bols-vibrants .moyens-content-item .moyens-text .moyens-video {
        max-width: 400px;
    }
}

/* ===================================
   GRANDS ÉCRANS
   =================================== */
@media screen and (min-width: 1400px) {
    html {
        font-size: 18px;
    }

    .container {
        max-width: 1600px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .tagline {
        font-size: 4rem;
    }

    .section-title {
        font-size: 4rem;
    }

    .metier-grid {
        max-width: 1600px;
        gap: 4rem;
    }

    .segment-slide {
        min-width: calc(33.333% - 1.334rem);
    }

    /* Section bols vibrants - Grands écrans */
    #bols-vibrants .moyens-content-item .moyens-text {
        gap: 4rem;
    }

    #bols-vibrants .moyens-content-item .moyens-text img {
        height: 600px;
    }
}

/* ===================================
   TRÈS GRANDS ÉCRANS (4K)
   =================================== */
@media screen and (min-width: 1920px) {
    html {
        font-size: 20px;
    }

    .container {
        max-width: 1800px;
    }

    nav.nav-scrolled {
        margin: 1.5rem 4rem;
    }
}

/* ===================================
   SECTION BOLS VIBRANTS - BASE
   (styles communs à tous les écrans)
   =================================== */
#bols-vibrants .moyens-content-item .moyens-text {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    text-align: center;
}

#bols-vibrants .moyens-content-item .moyens-text img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 15px;
}

#bols-vibrants .moyens-content-item .moyens-text .moyens-video {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* ===================================
   TOUCH DEVICES
   =================================== */
@media (hover: none) and (pointer: coarse) {

    nav a,
    button,
    .button,
    .social-link,
    .segment-slide,
    .metier-card {
        min-height: 44px;
        min-width: 44px;
    }

    nav a {
        padding: 1rem;
    }
}

/* ===================================
   HOVER DEVICES
   =================================== */
@media (hover: hover) and (pointer: fine) {

    .card:hover,
    .slide:hover,
    .segment-slide:hover,
    .metier-card:hover {
        transform: translateY(-5px);
    }
}

/* ===================================
   PRÉFÉRENCES UTILISATEUR
   =================================== */

/* Mouvement réduit */
@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;
    }
}

/* Contraste élevé */
@media (prefers-contrast: high) {
    :root {
        --border-light: rgba(255, 255, 255, 0.3);
        --card-bg: rgba(255, 255, 255, 0.1);
    }

    .button,
    .nav-links a,
    .social-link {
        border: 2px solid currentColor;
    }
}

/* Mode sombre forcé */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* ===================================
   IMPRESSION
   =================================== */
@media print {

    *,
    *::before,
    *::after {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    nav,
    .nav-links,
    .social-links,
    .form-container,
    video,
    .glow,
    footer {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
        color: black !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    .hero-content h1 {
        color: black;
        -webkit-text-fill-color: black;
        background: none;
    }

    section {
        page-break-inside: avoid;
    }

    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    @page {
        margin: 2cm;
    }
}