/* Bennet Headless V082 — pente fino sobre V081. Somente apresentação e UX.
   Shopify V88 original: assets/theme.css (logo v10 e banner collections).
   NÃO altera preço, estoque, checkout, frete comercial ou API Shopify. */

/* 1 — PDP: V081 forçava cover e recortava os pés e topo de algumas fotos.
   Proporção mais longa no mobile e fit contain para todas as imagens,
   respeitando a proporção intrínseca, sem zoom, crop ou deformação. */
@media (max-width:1023.98px) {
  body.template-product .product-gallery__main {
    aspect-ratio:9 / 19 !important;
    height:auto !important;
    max-height:none !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% !important;
    height:100% !important;
    object-fit:contain !important;
    object-position:center center !important;
    transform:none !important;
  }
}
@media (min-width:1024px) {
  body.template-product .product-gallery__main [data-gallery-slide] > img {
    object-fit:contain !important;
    object-position:center center !important;
  }
}

/* 2 — Menu lateral: preservar a fonte/logo oficial do V88, sempre preta,
   sem herdar o branco aplicado apenas ao header sobre a foto.
   [fix aplicação VPS] O drawer mora DENTRO de .site-header, então as regras
   brancas de header-overlay (v078 home (1,4,1), v081 PDP (1,5,1), ambas
   !important) pintavam também a logo do menu no topo das páginas. Dois IDs
   no seletor vencem qualquer delas em qualquer template/estado de scroll. */
#site-top-bar #mobile-menu-drawer .mobile-menu-panel .logo-stack__main,
#site-top-bar #mobile-menu-drawer .mobile-menu-panel .logo-stack__sub {
  color:#111 !important;
  text-shadow:none !important;
  filter:none !important;
  opacity:1 !important;
  visibility:visible !important;
}
.mobile-menu-panel .logo-stack--sm {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  line-height:1;
}

/* 3 — Transição do header como o Shopify V88 original: BENNET permanece
   visível; JEANS é absorvido ao descer e reaparece progressivamente ao subir.
   V080 desabilitava as animações e V081 ocultava com visibility:hidden,
   provocando salto em vez de movimento contínuo. */
#site-top-bar .header-logo .logo-stack__main {
  transition:font-size .75s cubic-bezier(.16,1,.3,1),color .32s ease !important;
}
#site-top-bar .header-logo .logo-stack__sub {
  display:block !important;
  overflow:hidden;
  max-height:14px;
  opacity:1;
  visibility:visible !important;
  transform:translateY(0) scale(1);
  transform-origin:center top;
  filter:none;
  transition:opacity .65s cubic-bezier(.6,0,.4,1),
    transform .75s cubic-bezier(.55,0,.3,1),
    letter-spacing .75s cubic-bezier(.55,0,.3,1),
    max-height .75s cubic-bezier(.16,1,.3,1),
    margin-top .75s ease,filter .6s ease,color .32s ease !important;
}
#site-top-bar.is-scrolled .header-logo .logo-stack__sub {
  opacity:0 !important;
  visibility:visible !important; /* animate opacity, not a sudden hide */
  max-height:0 !important;
  margin-top:0 !important;
  transform:translateY(-13px) scale(.35) !important;
  letter-spacing:.05em !important;
  filter:blur(3px) !important;
  pointer-events:none !important;
  /* [fix aplicação VPS] O fixes-v080 trava `transition:none !important`
     exatamente neste seletor (mesma specificity). A transição que governa
     a ida base→scrolled é a do estado DESTINO: sem redeclará-la aqui o
     descer continuava instantâneo (salto) e só a volta animava. */
  transition:opacity .65s cubic-bezier(.6,0,.4,1),
    transform .75s cubic-bezier(.55,0,.3,1),
    letter-spacing .75s cubic-bezier(.55,0,.3,1),
    max-height .75s cubic-bezier(.16,1,.3,1),
    margin-top .75s ease,filter .6s ease,color .32s ease !important;
}
#site-top-bar.is-scrolled .header-logo .logo-stack__main {
  animation:bjLogoAbsorb .75s cubic-bezier(.16,1,.3,1) 1 !important;
  /* [fix aplicação VPS] idem: vence o transition:none do v080 no estado scrolled. */
  transition:font-size .75s cubic-bezier(.16,1,.3,1),color .32s ease !important;
}
#site-top-bar .site-header {
  transition:height .65s cubic-bezier(.16,1,.3,1),
    background-color .3s ease,border-color .3s ease,box-shadow .3s ease !important;
}
/* [fix aplicação VPS] theme.css real anima o padding do inner (.75s);
   sem isso o menu desktop dava micro-salto vertical ao compactar. */
#site-top-bar .site-header__inner {
  transition:padding .75s cubic-bezier(.16,1,.3,1) !important;
}

/* 4 — Banners de coleções Home: sem laterais vazias, sem crop e mesma
   proporção para todos; preserva links e overlays do tema. */
@media (max-width:1023.98px) {
  .collections-swiper {
    padding:0 !important;
    position:relative;
    left:50%;
    transform:translateX(-50%);
    width:100vw !important;
    max-width:100vw !important;
    overflow-x:auto !important;
    scroll-snap-type:x mandatory;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }
  .collections-swiper .swiper-wrapper {
    gap:10px !important;
    padding:0 !important;
    justify-content:flex-start !important;
    max-width:none !important;
  }
  .collections-swiper .collection-card {
    flex:0 0 min(88vw,355px) !important;
    width:min(88vw,355px) !important;
    max-width:none !important;
    aspect-ratio:9 / 16 !important;
    height:auto !important;
    scroll-snap-align:start;
  }
  .collections-swiper .collection-card__img {
    object-fit:contain !important;
    object-position:center !important;
    transform:none !important;
  }
}
@media (min-width:1024px) {
  .collections-swiper .collection-card {aspect-ratio:9 / 16 !important}
  .collections-swiper .collection-card__img {
    object-fit:contain !important;
    object-position:center !important;
  }
}

/* 5 — Rails Home/PDP compartilham gesto nativo de swipe, scroll snap e setas.
   Mobile: cards enquadrados sem scroll vertical bloqueado; desktop: setas.
   Não usa biblioteca adicional nem eventos de touchmove. */
.bj-related-rail .related-carousel {
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-x pan-y;
  scrollbar-width:none;
}
.bj-related-rail .related-carousel::-webkit-scrollbar{display:none}
.bj-related-rail .related-carousel__item {scroll-snap-align:start}
@media (max-width:1023.98px) {
  .bj-related-rail .related-wrap {max-width:100%}
  .bj-related-rail .related-track {padding-inline:0;gap:10px}
  .bj-related-rail .related-arrow {display:none}
}
@media (min-width:1024px) {
  .bj-related-rail .related-arrow {display:flex}
}
/* Não deslocar a bolha quando se oculta: evita oscilações no detector de
   interseção na borda de CTAs ao rolar para cima/baixo. */
.bj-whatsapp-float[data-hidden="true"] {transform:none !important}

@media (prefers-reduced-motion:reduce) {
  #site-top-bar .header-logo .logo-stack__main,
  #site-top-bar .header-logo .logo-stack__sub,
  #site-top-bar .site-header,
  #site-top-bar .site-header__inner {animation:none !important;transition:none !important}
  .bj-related-rail .related-carousel,.collections-swiper {scroll-behavior:auto !important}
}
