/* AutoMart Global 1360 Width V37.0
   Desktop-only width authority layered after V32.1.
   Goal: widen all public/account/auth marketplace pages consistently.
   Typography and mobile/tablet responsive behavior are intentionally untouched. */

:root{
  --am-v37-shell-max:1360px;
  --am-v37-gutter-total:64px;
  --am-v37-auth-max:1240px;
  --am-v37-register-max:1080px;
  --am-v37-account-side:220px;

  /* Re-map known V32.1 variables so existing V32.1 selectors inherit the new architecture. */
  --am-v321-shell-max:1360px;
  --am-v321-gutter-total:64px;
  --am-v321-auth-max:1240px;
  --am-v321-account-side:220px;
}

/* Desktop width changes only. Tablet/mobile keep their existing breakpoints. */
@media (min-width:1101px){

  /* =========================================================
     GLOBAL / STANDARD PAGE CONTAINERS
     ========================================================= */
  html body.site-page main > .container,
  html body.home-page main > .container,
  html body.site-page main section > .container,
  html body.home-page main section > .container,
  html body.site-page .market-searchbar > .container,
  html body.home-page .market-searchbar > .container{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* =========================================================
     GLOBAL HEADER / NAV / SEARCH STACK
     ========================================================= */
  html body .premium-topbar .premium-nav-shell,
  html body .premium-topbar .premium-search-shell,
  html body .premium-topbar .global-search-shell,
  html body .premium-topbar .global-search-shell-v18,
  html body .premium-topbar .global-search-shell-v18-1,
  html body .premium-topbar .am-global-search-shell-v18,
  html body .premium-topbar .am-global-search-shell-v18-1,
  html body .premium-topbar .global-search-stack-v18-1,
  html body .premium-topbar .global-header-search-stack-v18-1,
  html body .premium-topbar > .container{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* Catch the live two-row header/search shell without changing inner controls. */
  html body .premium-topbar .premium-nav-shell + form,
  html body .premium-topbar .premium-nav-shell + div{
    max-width:var(--am-v37-shell-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* =========================================================
     VEHICLE SEARCH / LISTING PAGES
     ========================================================= */
  html body main .vehicles-page > .container,
  html body main .vehicle-list-page > .container,
  html body main .vehicle-search-page > .container,
  html body main .listing-page > .container,
  html body main .marketplace-page > .container{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
  }

  /* =========================================================
     VEHICLE DETAIL
     Neutralizes the audited legacy 1500px detail width.
     ========================================================= */
  html body main .vehicle-detail-page > .container{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
  }

  html body main .vehicle-detail-page .similar-vehicles-shell,
  html body main .vehicle-detail-page .vehicle-detail-similar-shell,
  html body main .similar-vehicles-v26,
  html body main .similar-vehicles-v26-1{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* =========================================================
     DEALER FINDER / DEALERS
     ========================================================= */
  html body.home-page main > .dealer-finder-v12:first-child .dealer-finder-shell-v12,
  html body.home-page main .dealer-finder-v12 .dealer-finder-shell-v12,
  html body.site-page main .dealer-finder-v12 .dealer-finder-shell-v12{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* =========================================================
     SELL WORKFLOW
     ========================================================= */
  html body main .am-sell-v35__shell{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
  }

  /* Give the widened sell page a slightly wider preview rail while
     keeping the existing workflow proportions. */
  html body main .am-sell-v35__layout{
    grid-template-columns:minmax(0,1fr) 330px!important;
  }

  /* =========================================================
     BUYER / ACCOUNT SUITE
     ========================================================= */
  html body main .am-account-v31 > .am-account-shell-v31,
  html body main section.am-account-v31 > .am-account-shell-v31{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
    grid-template-columns:var(--am-v37-account-side) minmax(0,1fr)!important;
  }

  /* =========================================================
     COMPARE PAGE
     ========================================================= */
  html body main .am-compare362-shell{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
  }

  /* =========================================================
     LOGIN
     Auth remains intentionally narrower than the marketplace shell,
     but is widened from the audited 1160px to 1240px.
     ========================================================= */
  html body main section.am-login-v30 > div.am-login-v30__shell{
    width:min(var(--am-v37-auth-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-auth-max)!important;
  }

  html body main .am-login-v30__panel-inner{
    max-width:590px!important;
  }

  /* =========================================================
     REGISTER
     Widened from the audited 960px shell to 1080px while keeping
     the registration form visually controlled.
     ========================================================= */
  html body main section.am-register-v33 > div.am-register-v33__shell,
  html body main .am-register-v33 > .am-register-v33__shell{
    width:min(var(--am-v37-register-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-register-max)!important;
  }

  /* =========================================================
     GENERIC AUTH / FORM PAGES
     ========================================================= */
  html body main .auth-page .auth-card,
  html body main .auth-page .auth-card.wide{
    max-width:1040px!important;
  }

  /* =========================================================
     FOOTER INNER CONTENT
     ========================================================= */
  html body.site-page footer.footer > div.container,
  html body.home-page footer.footer > div.container,
  html body footer.footer > div.container,
  html body footer.footer > .container{
    width:min(var(--am-v37-shell-max),calc(100vw - var(--am-v37-gutter-total)))!important;
    max-width:var(--am-v37-shell-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
}
