/* BENNET HEADLESS V081 — paridade com Shopify V88, ajustes 1–12.
   Carregado APÓS V080 para corrigir a cascata, sem mudar tema legado ou checkout. */

/* #4 e #9 — Header: foto da PDP entra atrás do cabeçalho no topo, scroll o torna branco.
   V078 e V080 tinham regras de header branco na PDP que contrariavam o V88. */
body.template-product.header-overlay #site-top-bar:not(.is-scrolled) .site-header,
body.template-product.header-overlay #site-top-bar:not(.is-scrolled) .site-header::before {
  background:transparent!important;border-color:transparent!important;box-shadow:none!important;
}
body.template-product.header-overlay #site-top-bar:not(.is-scrolled) .site-header::before {display:none!important}
/* [fix homologação 10/11] o theme.css tem, só no desktop (min-width:1024px),
   uma regra legada (1,5,1)!important que pintava logo/nav/ícones de escuro
   sobre a foto — ilegível. Incluímos .site-header no seletor para empatar em
   specificity e vencer pela ordem (folha posterior). Idem nav/ícones/svg. */
body.template-product.header-overlay #site-top-bar:not(.is-scrolled) .site-header .logo-stack__main,
body.template-product.header-overlay #site-top-bar:not(.is-scrolled) .site-header .logo-stack__sub,
body.template-product.header-overlay #site-top-bar:not(.is-scrolled) .site-header .header-nav__link,
body.template-product.header-overlay #site-top-bar:not(.is-scrolled) .site-header .header-icon-btn {color:#fff!important;text-shadow:0 1px 7px rgba(0,0,0,.55)!important}
body.template-product.header-overlay #site-top-bar:not(.is-scrolled) .site-header .header-icon-btn svg {stroke:#fff!important;filter:drop-shadow(0 1px 6px rgba(0,0,0,.55))!important}
/* [fix homologação] cart-count segue o tema V88 real (accent, badge branca)
   em TODAS as larguras — a tentativa de branco/222 do rascunho perdia no
   desktop e divergia do real no mobile. */
body.template-product.header-overlay main{margin-top:calc(-1 * var(--header-height))!important}
#site-top-bar{top:0!important}
#site-top-bar .site-header{transition:height .45s cubic-bezier(.16,1,.3,1),background .35s ease,border-color .35s ease,box-shadow .35s ease}
#site-top-bar.is-scrolled .site-header{background:#fff!important;border-bottom:1px solid var(--color-border)!important}
#site-top-bar.is-scrolled .logo-stack__main,
#site-top-bar.is-scrolled .header-icon-btn,
#site-top-bar.is-scrolled .header-nav__link{color:#1a1a1a!important;text-shadow:none!important}
#site-top-bar.is-scrolled .header-icon-btn svg{stroke:#1a1a1a!important;filter:none!important}
/* Shopify V88 esconde JEANS no estado compacto, BENNET continua enquadrado. */
#site-top-bar.is-scrolled .header-logo .logo-stack__sub{opacity:0!important;visibility:hidden!important;max-height:0!important;margin:0!important;pointer-events:none!important;transform:translateY(-8px)!important}
#site-top-bar.is-scrolled .header-logo .logo-stack__main{font-size:1.23rem!important;line-height:1.1!important;opacity:1!important;visibility:visible!important}
#site-top-bar.is-scrolled .header-logo{overflow:visible!important;min-height:32px;white-space:nowrap}
#site-top-bar.is-scrolled .site-header__inner{align-items:center!important}
@media(min-width:1024px){
  body.template-product.header-overlay main{margin-top:-101px!important}
  /* Preserva o menu desktop, inclusive dropdown; compacto em altura, sem corte. */
  #site-top-bar.is-scrolled .site-header{height:auto!important;min-height:52px!important}
  #site-top-bar.is-scrolled .site-header__inner{height:auto!important;grid-template-areas:"left logo actions" "nav nav nav"}
  #site-top-bar.is-scrolled .site-header__inner>.header-nav{display:flex!important;padding:6px 0 8px!important}
}
@media(max-width:1023.98px){
  body.template-product .product-page{margin:0!important;padding:0!important;max-width:100%!important}
  body.template-product .product-gallery{width:100vw;max-width:100%;margin:0!important;padding:0!important}
  body.template-product .product-gallery__main{width:100%;height:auto!important;max-height:none!important;aspect-ratio:3 / 5!important;background:#fff!important}
  body.template-product .product-gallery__main [data-gallery-slide]{background:#fff!important}
  body.template-product .product-gallery__main [data-gallery-slide]>img{width:100%;height:100%;object-fit:cover!important;object-position:center top!important;background:#fff!important}
  #site-top-bar.is-scrolled .site-header{height:var(--header-height)!important}
  #site-top-bar .header-logo{min-width:75px;overflow:visible}
  #site-top-bar .header-logo .logo-stack__main{line-height:1.14}
  #site-top-bar.is-scrolled .header-logo .logo-stack__main{font-size:1.15rem!important;line-height:1.14!important}
  #site-top-bar.is-scrolled .site-header__inner{height:var(--header-height)!important;grid-template-columns:minmax(0,1fr) minmax(80px,auto) minmax(0,1fr)!important}
}
/* #1 #5 #10 #12 — WhatsApp: fora do CTA e ocultação por interseção geométrica. */
.bj-whatsapp-float[data-hidden="true"]{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(5px)!important}
@media(max-width:1023.98px){
 .bj-whatsapp-float{right:calc(14px + env(safe-area-inset-right));bottom:calc(24px + env(safe-area-inset-bottom));width:50px;height:50px}
 body.template-product:has(.bj-pdp-sticky) .bj-whatsapp-float{bottom:calc(88px + env(safe-area-inset-bottom))}
}
/* #2 — modal pagamento no padrão do V88, sem alterar condições do BJ Checkout. */
.bj-dialog-backdrop:has([aria-label="Formas de pagamento"]){background:rgba(0,0,0,.72)}
.bj-dialog-backdrop [aria-label="Formas de pagamento"].bj-guide-dialog{width:min(370px,calc(100vw - 28px));max-width:none;padding:24px 22px 22px;border-radius:0;font-family:var(--font-body);text-align:center}
.bj-dialog-backdrop [aria-label="Formas de pagamento"].bj-guide-dialog h2{font-family:var(--font-body);font-size:1rem;font-weight:700;margin:0 28px 16px}
.bj-dialog-backdrop [aria-label="Formas de pagamento"].bj-guide-dialog p{font-family:var(--font-body);font-size:.89rem;line-height:1.65}
/* #7 — título e preço do modal de encomenda em tipografia Bennet padrão. */
.bj-preorder-modal h2,.bj-preorder-price strong{font-family:var(--font-body)!important;letter-spacing:normal!important}
.bj-preorder-modal h2{font-size:1.22rem!important;font-weight:700!important;line-height:1.3}
.bj-preorder-price strong{font-size:1.55rem!important;font-weight:700!important}
/* #8 — visual limpo: aviso superior único; nada de duplicidade inferior. */
.bj-preorder-mini{margin:8px auto 14px}
/* #10 — botão AVISE-ME e modal de reposição conforme snippets/notify-modal.liquid. */
.product-info__sizes .btn--atc.bj-sticky-notify{background:#141414!important;border-color:#141414!important;color:#fff!important}
.product-info__sizes #main-atc-btn[data-stock-alert="true"]{background:#141414!important;border-color:#141414!important;color:#fff!important}
.bj-alert-dialog{width:min(420px,calc(100vw - 24px));padding:24px 18px;border-radius:18px;text-align:left;max-height:85dvh}
.bj-alert-dialog h2{font-family:var(--font-body);font-size:1.04rem;font-weight:700;text-align:left;margin:0 28px 9px 0}
.bj-alert-dialog .bj-alert-intro{color:var(--color-text-muted);font-size:.8rem;line-height:1.6;margin:0 0 17px}
.bj-alert-form{display:flex;flex-direction:column;gap:10px}
.bj-alert-form input{width:100%;height:46px;border:1px solid #dedbd8;background:var(--color-bg-soft);border-radius:6px;padding:0 12px;outline:none;font:400 .88rem var(--font-body)}
.bj-alert-form input:focus{border-color:var(--color-accent)}
.bj-alert-form .bj-guide-note{margin:2px 0;font-size:.68rem;text-align:left}
.bj-alert-form .btn--atc{width:100%;margin-top:4px;min-height:51px}
/* #11 — miniatura inteira, sem crop e sem distorção. */
.cart-drawer .cart-item__img{width:76px!important;height:104px!important;object-fit:contain!important;object-position:center!important;flex:0 0 76px;background:#f8f6f4;border-radius:6px}
@media(max-width:600px){.cart-drawer .cart-item__img{width:69px!important;height:97px!important;flex-basis:69px!important}}
@media(prefers-reduced-motion:reduce){#site-top-bar .site-header,.bj-whatsapp-float{transition:none!important}}

/* Ao retornar ao topo JEANS reaparece suavemente por trás de BENNET. */
#site-top-bar .header-logo .logo-stack__sub{transition:opacity .35s ease,transform .4s cubic-bezier(.16,1,.3,1),max-height .4s ease!important}
