/* ================================================
   RESPONSIVE CSS - Ma Création de Société
   Rend tout le site responsive sur mobile/tablette
   ================================================ */

/* === RESET IMAGES - Toutes les images responsive === */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Images dans les conteneurs */
.mxd-container img,
.container img,
.container-fluid img {
    max-width: 100%;
    height: auto;
}

/* === CONTENEURS FLEXIBLES === */
.mxd-container,
.container,
.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* === RESPONSIVE BREAKPOINTS === */

/* Tablettes et petits écrans (max 1024px) */
@media (max-width: 1024px) {
    /* Réduire les paddings */
    .mxd-section {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    /* Grilles responsive */
    .row > [class*="col-"] {
        width: 100% !important;
        margin-bottom: 2rem;
    }

    /* Images hero */
    .mxd-hero__image,
    .hero-image {
        max-height: 400px;
        object-fit: cover;
    }

    /* Titres plus petits */
    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
    /* Paddings réduits sur mobile */
    .mxd-section,
    .mxd-container,
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Toutes les colonnes en pleine largeur */
    .col-12,
    .col-md-6,
    .col-lg-4,
    .col-xl-3,
    [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Images générées par IA - responsive */
    img[src*="uploads/"],
    img[src*="blog/"],
    .blog-card img,
    .article-featured-image img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        object-fit: cover !important;
    }

    /* Hero section */
    .mxd-hero {
        min-height: auto !important;
        padding: 3rem 1rem !important;
    }

    /* Titres mobile */
    h1,
    .inner-headline__title {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Textes plus lisibles */
    p,
    .t-large {
        font-size: 1rem !important;
    }

    /* Boutons pleine largeur sur mobile */
    .btn,
    .btn-large,
    .btn-anim {
        width: 100%;
        text-align: center;
        justify-content: center;
        margin-bottom: 1rem;
    }

    /* Navigation mobile */
    .mxd-nav__wrap {
        position: fixed;
        width: 100%;
        z-index: 9999;
    }

    /* Slider/Carousel responsive */
    .swiper-slide {
        width: 100% !important;
    }

    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }

    /* Cards/Cartes responsive */
    .mxd-testimonials-card,
    .blog-card,
    .service-card {
        margin-bottom: 2rem;
        width: 100% !important;
    }

    /* Formulaires responsive */
    .form-control,
    .form-select,
    input,
    textarea,
    select {
        width: 100% !important;
        font-size: 16px !important; /* Évite le zoom sur iOS */
    }

    /* Footer responsive */
    .footer .col-md-3,
    .footer .col-lg-3 {
        width: 100% !important;
        margin-bottom: 2rem;
    }

    /* Tableaux responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 100%;
    }

    /* Espacement mobile */
    .padding-default {
        padding: 3rem 1rem !important;
    }

    .margin-default {
        margin: 2rem 1rem !important;
    }

    /* Blog responsive */
    .article-body {
        font-size: 1.2rem !important;
        padding: 0 1rem;
    }

    .article-excerpt p {
        font-size: 1.3rem !important;
    }

    /* Images dans le contenu */
    .article-body img,
    .mxd-block__content img {
        width: 100% !important;
        height: auto !important;
        margin: 1.5rem 0 !important;
    }

    /* Grid layout mobile */
    .mxd-grid,
    .row,
    .d-flex {
        flex-direction: column !important;
    }

    /* Pricing cards mobile */
    .pricing-card {
        width: 100% !important;
        max-width: 400px;
        margin: 0 auto 2rem;
    }
}

/* Très petits mobiles (max 480px) */
@media (max-width: 480px) {
    /* Paddings ultra-réduits */
    .mxd-section,
    .mxd-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Titres encore plus petits */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    /* Boutons plus petits */
    .btn {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }

    /* Images carousel */
    .swiper-slide img {
        max-height: 250px !important;
        object-fit: cover;
    }
}

/* === IMAGES SPÉCIFIQUES === */

/* Images blog */
.blog-preview__image img,
.mxd-blog-preview__image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* Images fermeture */
img[src*="fermeture"] {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Images générées par IA - forcer le responsive */
img[alt*="AI"],
img[alt*="IA"],
img[class*="ai-generated"],
.ai-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

/* === UTILITAIRES RESPONSIVE === */

/* Cacher sur mobile */
.hide-mobile {
    display: none !important;
}

/* Afficher uniquement sur mobile */
.show-mobile {
    display: block !important;
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }

    .show-mobile {
        display: none !important;
    }

    .hide-mobile {
        display: block !important;
    }
}

/* === FIX OVERFLOW === */
body {
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* Empêcher les débordements */
* {
    max-width: 100%;
}

/* === IFRAME RESPONSIVE (vidéos YouTube, etc.) === */
iframe {
    max-width: 100%;
    height: auto;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
