/* ========================================================================
   NOVTINIS — CADRE DESKTOP GLOBAL
   ------------------------------------------------------------------------
   Une seule règle de largeur pour les pages publiques :
   1. Astra ne limite plus #page / #primary à une ancienne largeur mobile.
   2. Chaque écran garde ensuite son shell propre, centré.
   3. Aucun changement sous 981 px : le smartphone reste inchangé.
   ======================================================================== */

@media (min-width: 981px) {
  html:has(body.nt-desktop-frame),
  body.nt-desktop-frame {
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    overflow-x: clip !important;
  }

  /* Chaîne Astra : la page publique utilise toujours toute la largeur réelle. */
  html body.nt-desktop-frame #page,
  html body.nt-desktop-frame .site,
  html body.nt-desktop-frame #content,
  html body.nt-desktop-frame .site-content,
  html body.nt-desktop-frame .site-content > .ast-container,
  html body.nt-desktop-frame .ast-container,
  html body.nt-desktop-frame #primary,
  html body.nt-desktop-frame .content-area,
  html body.nt-desktop-frame .site-main,
  html body.nt-desktop-frame article,
  html body.nt-desktop-frame .ast-article-single,
  html body.nt-desktop-frame .entry-content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    float: none !important;
  }

  html body.nt-desktop-frame #primary {
    flex: 0 0 100% !important;
  }

  /*
   * Les applications Novtinis sortent du conteneur hérité, même lorsqu'une
   * feuille ancienne injecte une largeur fixe dans le template. Le full-bleed
   * est intentionnel ; le shell interne de chaque page gère son max-width.
   */
  html body.nt-desktop-frame .seva-account-page,
  html body.nt-desktop-frame .seva-register-page,
  html body.nt-desktop-frame .seva-login-page,
  html body.nt-desktop-frame .nt-claim-page,
  html body.nt-desktop-frame .seva-claim-page,
  html body.nt-desktop-frame .claim-commerce-page,
  html body.nt-desktop-frame .search-app,
  html body.nt-desktop-frame .home-app,
  html body.nt-desktop-frame .listing-single-pro,
  html body.nt-desktop-frame .nt-subscription-page {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: 0 !important;
  }

  /* Les shells restent la source de vérité pour le centrage du contenu. */
  html body.nt-desktop-frame .seva-account-shell,
  html body.nt-desktop-frame .seva-register-shell,
  html body.nt-desktop-frame .seva-login-shell,
  html body.nt-desktop-frame .nt-claim-shell,
  html body.nt-desktop-frame .seva-claim-shell,
  html body.nt-desktop-frame .claim-commerce-shell {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /*
   * Mon compte : le shell est déjà une grille desktop ; cette règle corrige
   * seulement le contexte d'alignement, pas les données ni l'ordre mobile.
   */
  html body.nt-desktop-frame .seva-account-page {
    display: block !important;
  }

  html body.nt-desktop-frame .seva-account-shell {
    width: min(100% - 64px, 1360px) !important;
    max-width: 1360px !important;
  }

  /* Connexion / inscription : le duo formulaire + présentation se centre
     dans le viewport, indépendamment du cadre Astra. */
  html body.nt-desktop-frame .seva-register-shell,
  html body.nt-desktop-frame .seva-login-shell {
    width: min(100% - 96px, 1280px) !important;
    max-width: 1280px !important;
  }

  /* Revendication : même axe que le header et les cartes principales. */
  html body.nt-desktop-frame .nt-claim-shell,
  html body.nt-desktop-frame .seva-claim-shell,
  html body.nt-desktop-frame .claim-commerce-shell {
    width: min(100% - 64px, 1240px) !important;
    max-width: 1240px !important;
  }
}
