/*
 * ModulesGuard Page Builder - Public pages
 *
 * Ce fichier n'est chargé que pour une page publique Page Builder valide.
 * Les règles ci-dessous libèrent uniquement les conteneurs WHMCS qui
 * entourent réellement la page. Le header et le footer WHMCS restent intacts.
 */

html.mgpb-public-document,
body.mgpb-public-document {
    overflow-x: clip;
}

.mgpb-client-wrap {
    box-sizing: border-box !important;
    margin: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    width: 100% !important;
}

.mgpb-client-wrap .mgpb-public-page {
    box-sizing: border-box !important;
    margin: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    width: 100% !important;
}

/*
 * Les classes mgpb-public-host-* sont ajoutées uniquement aux ancêtres de la
 * page par templates/client/page.tpl. On n'élargit donc pas les containers du
 * header/footer ou d'autres zones WHMCS.
 */
.mgpb-public-host-container {
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
}

.mgpb-public-host-row {
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none !important;
    width: 100% !important;

    /* Bootstrap 5 */
    --bs-gutter-x: 0rem !important;
}

.mgpb-public-host-content {
    box-sizing: border-box !important;
    flex: 0 0 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
}

.mgpb-public-host-sidebar {
    display: none !important;
}

/*
 * Compatibilité directe avec Twenty-One/Six et thèmes dérivés, même avant
 * l'exécution du petit runtime du template.
 */
body.mgpb-public-document #main-body .container:has(.mgpb-client-wrap),
body.mgpb-public-document #main-body .container-fluid:has(.mgpb-client-wrap),
body.mgpb-public-document #main-body .row:has(.mgpb-client-wrap),
body.mgpb-public-document #main-body .main-content:has(.mgpb-client-wrap),
body.mgpb-public-document #main-body .primary-content:has(.mgpb-client-wrap) {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
}

/*
 * Fallback full-bleed : si un thème propriétaire conserve malgré tout un
 * parent de largeur fixe, la racine peut sortir de ce parent et occuper le
 * viewport. Ce fallback ne touche pas aux blocs internes générés par l'IA.
 */
.mgpb-client-wrap.mgpb-public-runtime-ready {
    left: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    max-width: none !important;
    position: relative !important;
    right: 50% !important;
    width: 100vw !important;
}

.mgpb-public-page {
    color: #172033;
    font-family: Inter, Arial, sans-serif;
}

.mgpb-public-page img,
.mgpb-public-page video,
.mgpb-public-page iframe {
    max-width: 100%;
}

.mgpb-public-page iframe {
    border: 0;
}

.mgpb-notfound {
    box-sizing: border-box;
    margin: 48px auto;
    max-width: 760px;
    padding: 32px;
    text-align: center;
    width: 100%;
}
