/* ========================================
   COMMERCIFY MODAL DESKTOP SIZES
   Desktop uniquement (min-width: 1280px).
   Positionnement type dashboard (centré, 20px en haut) et dimensions
   adaptées par modale. Les modales en plein écran sur desktop
   réutilisent le même rendu que fullscreen_touch.
   ======================================== */

@media (min-width: 1280px) {

/* ----- Modales en PLEIN ÉCRAN sur desktop (Mes murs et vignettes, Carte du monde, 2 jeux) ----- */
body.modal-search-advanced-open #modalSearchAdvanced.modal.show,
body.modal-games-open #gameKoinkoinsModal.modal.show,
body.modal-games-open #gameShootYourScammersModal.modal.show,
#modalSearchAdvanced.modal.show,
#gameKoinkoinsModal.modal.show,
#gameShootYourScammersModal.modal.show {
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 0 !important;
}

body.modal-search-advanced-open #modalSearchAdvanced .modal-dialog,
#modalSearchAdvanced .modal-dialog,
body.modal-games-open #gameKoinkoinsModal .modal-dialog,
#gameKoinkoinsModal .modal-dialog,
body.modal-games-open #gameShootYourScammersModal .modal-dialog,
#gameShootYourScammersModal .modal-dialog {
    width: 100vw !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    flex: 1 1 auto !important;
    align-self: stretch !important;
}

#modalSearchAdvanced .modal-content,
#modalSearchAdvanced .search-modal-content.dashboard-modal-content,
#gameKoinkoinsModal .modal-content,
#gameShootYourScammersModal .modal-content {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0;
    flex: 1 1 auto !important;
}

#modalSearchAdvanced .modal-body,
#modalSearchAdvanced .search-modal-body,
#gameKoinkoinsModal .modal-body,
#gameShootYourScammersModal .modal-body {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* ----- Modales avec dimensions adaptées : uniquement Export, Langues, Liste jeux, Changement d'éditeur ----- */
#modalExportAds.show,
body:has(#modalExportAds.show) #modalExportAds.modal.show,
#modalPrivateCodes.show,
#modalBanners.show,
#modalInstallHomescreen.show,
#languageModal.show,
#languageModal.fade.show,
body.modal-language-open #languageModal.show,
#gamesCommercifyModal.show,
#gamesCommercifyModal.fade.show,
body.modal-games-open #gamesCommercifyModal.show,
#modalPublisherSwitch.show,
body.modal-publisher-switch-open #modalPublisherSwitch.show {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 20px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
}

/* ----- Export : largeur doublée, plus haute, margin réduit (remontée) ----- */
#modalExportAds .modal-dialog,
#modalExportAds.show .modal-dialog,
#modalPrivateCodes .modal-dialog,
#modalBanners .modal-dialog,
#modalPrivateCodes.show .modal-dialog,
#modalBanners.show .modal-dialog,
#modalInstallHomescreen .modal-dialog,
#modalInstallHomescreen.show .modal-dialog {
    margin: 12px 20px 20px !important;
    width: 90% !important;
    max-width: 1040px !important;
    height: fit-content !important;
    max-height: calc(100vh - 24px) !important;
    min-height: 0 !important;
}

#modalExportAds.show,
body:has(#modalExportAds.show) #modalExportAds.modal.show,
#modalPrivateCodes.show,
#modalBanners.show,
#modalInstallHomescreen.show {
    padding-top: 12px !important;
}

#modalExportAds .modal-content,
#modalPrivateCodes .modal-content,
#modalBanners .modal-content,
#modalInstallHomescreen .modal-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 24px) !important;
    flex: 0 1 auto !important;
}

#modalExportAds .modal-body,
#modalPrivateCodes .modal-body,
#modalBanners .modal-body,
#modalInstallHomescreen .modal-body {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* ----- Langues / IHM : 60 % max hauteur, largeur +30 % (95vw / 1248px) ----- */
#languageModal .modal-dialog,
#languageModal.show .modal-dialog,
body.modal-language-open #languageModal .modal-dialog {
    margin: 20px !important;
    width: 95vw !important;
    max-width: 1248px !important;
    max-height: 60vh !important;
    height: auto !important;
    min-height: 0 !important;
}

#languageModal .modal-content,
body.modal-language-open #languageModal .modal-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: 60vh !important;
    flex: 0 1 auto !important;
}

#languageModal .language-modal-body,
#languageModal .modal-body {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* ----- Sélecteur de jeu : dimensions (liste des jeux) ----- */
#gamesCommercifyModal .modal-dialog,
#gamesCommercifyModal.show .modal-dialog,
body.modal-games-open #gamesCommercifyModal .modal-dialog {
    margin: 20px !important;
    width: 90% !important;
    max-width: 1144px !important;
    max-height: calc(100vh - 40px) !important;
    height: auto !important;
    min-height: 0 !important;
}

#gamesCommercifyModal .modal-content,
#gamesCommercifyModal .games-modal-content,
body.modal-games-open #gamesCommercifyModal .modal-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 40px) !important;
    flex: 0 1 auto !important;
}

#gamesCommercifyModal .modal-body,
#gamesCommercifyModal .games-modal-body {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* ----- Changement d'éditeur : largeur adaptée à la grille d'avatars, remontée avec margin ----- */
#modalPublisherSwitch .modal-dialog,
#modalPublisherSwitch.show .modal-dialog,
body.modal-publisher-switch-open #modalPublisherSwitch .modal-dialog {
    margin: 20px !important;
    max-height: calc(100vh - 40px) !important;
    height: auto !important;
    min-height: 0 !important;
}

#modalPublisherSwitch .modal-content,
#modalPublisherSwitch .visitor-modal-content,
body.modal-publisher-switch-open #modalPublisherSwitch .visitor-modal-content,
#modalPublisherSwitch .modal-dialog .modal-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 40px) !important;
    flex: 0 1 auto !important;
}

#modalPublisherSwitch .modal-body,
#modalPublisherSwitch .visitor-modal-body {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

} /* fin @media (min-width: 1280px) */

@media (min-width: 1280px) and (max-width: 2559.98px) {
}

@media (min-width: 2560px) {
}

/* ----- Changement d'éditeur : largeur selon résolution (HD vs 2K) ----- */
@media (min-width: 1280px) and (max-width: 2559.98px) {
    #modalPublisherSwitch .modal-dialog,
    #modalPublisherSwitch.show .modal-dialog,
    body.modal-publisher-switch-open #modalPublisherSwitch .modal-dialog {
        width: 85% !important;
        max-width: 1440px !important;
    }
}

@media (min-width: 2560px) {
    #modalPublisherSwitch .modal-dialog,
    #modalPublisherSwitch.show .modal-dialog,
    body.modal-publisher-switch-open #modalPublisherSwitch .modal-dialog {
        width: 60% !important;
        max-width: 1800px !important;
    }
}
