/* R181 - Layout publico DESKTOP: busca sem sobreposicao e carrinho acima da ficha.
   O Mobile/PWA e o Admin permanecem com os estilos ja publicados. */
@media (min-width:821px) {
  html.gg-profile-desktop body:not(.r22-admin-mode)>.top .wrap.nav {
    gap:clamp(8px,.8vw,14px)!important;
  }

  /* A busca passa a ocupar um espaco proprio no flex do cabecalho.
     Diferente do absolute/left:50%, nunca atravessa INICIO ou CATALOGO. */
  html.gg-profile-desktop body:not(.r22-admin-mode) #r86DesktopSearch,
  html.gg-profile-desktop body:not(.r22-admin-mode) #r86DesktopSearch.r93-search-ready {
    position:relative!important;
    left:auto!important;
    top:auto!important;
    right:auto!important;
    transform:none!important;
    display:block!important;
    flex:1 1 300px!important;
    width:auto!important;
    min-width:0!important;
    max-width:450px!important;
    margin:0 0 0 52px!important;
    z-index:6!important;
  }
  html.gg-profile-desktop body:not(.r22-admin-mode) #ggEnhancedNav {
    position:relative!important;
    flex:0 0 auto!important;
    min-width:0!important;
    margin-left:auto!important;
    gap:clamp(5px,.75vw,14px)!important;
  }
  html.gg-profile-desktop body:not(.r22-admin-mode) .top .brand {
    flex:0 0 auto!important;
  }
  html.gg-profile-desktop body:not(.r22-admin-mode) #r86DesktopSearch form {
    min-width:0!important;
    width:100%!important;
  }
  html.gg-profile-desktop body:not(.r22-admin-mode) #r86DesktopSearch form #r86DesktopSearchInput{
    min-width:0!important;
    width:100%!important;
  }
  html.gg-profile-desktop body:not(.r22-admin-mode) #r90HeaderBack:not([hidden]){
    left:-48px!important;
    z-index:15!important;
    cursor:pointer!important;
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }

  /* A ficha do produto tem z-index de 2.000.000.000 e o header
     2.147.482.000: o z-index 21.000 da R180 era insuficiente.
     Coloca o carrinho acima de AMBOS, preservando a ficha no fundo. */
  html.gg-profile-desktop body:not(.r22-admin-mode) #cartModal.open {
    position:fixed!important;
    inset:0!important;
    z-index:2147483400!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:18px!important;
    background:rgba(24,18,14,.52)!important;
    pointer-events:auto!important;
  }
  html.gg-profile-desktop body:not(.r22-admin-mode) #cartModal.open > .modal-card{
    display:block!important;
    position:relative!important;
    z-index:1!important;
    flex:0 1 700px!important;
    width:min(700px,calc(100vw - 36px))!important;
    max-width:700px!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100dvh - 36px)!important;
    margin:auto!important;
    padding:18px!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    border-radius:20px!important;
    background:#fffdf9!important;
    color:#2d241d!important;
  }
  html.gg-profile-desktop body.dark:not(.r22-admin-mode) #cartModal.open > .modal-card{
    background:#181614!important;
    color:#f5ebe0!important;
  }
}
@media (min-width:821px) and (max-width:1350px) {
  html.gg-profile-desktop body:not(.r22-admin-mode) #r86DesktopSearch.r93-search-ready,
  html.gg-profile-desktop body:not(.r22-admin-mode) #r86DesktopSearch {
    flex-basis:240px!important;
    max-width:370px!important;
    margin-left:48px!important;
  }
  html.gg-profile-desktop body:not(.r22-admin-mode) #ggEnhancedNav {
    gap:5px!important;
  }
}
