html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
a[href],
select,
input[type="range"],
[data-category-card],
[data-expand-product],
[data-scroll-top],
[data-clear-cart] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

[data-scroll-top]:active,
[data-scroll-top]:focus,
[data-scroll-top]:focus-visible {
  outline: none !important;
  box-shadow: 0 16px 36px rgba(46, 32, 25, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}


/* O card de produto fica totalmente estático. O hover é exclusivo da área da foto. */
[data-product-card],
[data-product-card]:hover,
[data-product-card]:focus,
[data-product-card]:focus-within {
  transform: none !important;
  translate: none !important;
  scale: none !important;
  rotate: none !important;
  transition: none !important;
  box-shadow: 0 18px 52px rgba(46, 32, 25, 0.09) !important;
}

[data-card-product-image] {
  transform: scale(1);
  transition: transform 500ms ease;
}

[data-product-image-button]:hover [data-card-product-image],
[data-product-image-button]:focus-visible [data-card-product-image] {
  transform: scale(1.035);
}

[data-product-expand-icon] {
  transition: opacity 300ms ease, background-color 300ms ease, color 300ms ease;
}

[data-product-image-button]:hover [data-product-expand-icon],
[data-product-image-button]:focus-visible [data-product-expand-icon] {
  background-color: #FFC107;
  color: #2E2019;
  opacity: 1;
}

[data-product-image-modal],
[data-product-image-stage] {
  overscroll-behavior: contain;
}

html.cart-open,
html.cart-open body {
  overscroll-behavior: none;
}

#cart-panel,
#cart-panel .overflow-y-auto {
  overscroll-behavior: contain;
}

#cart-panel .overflow-y-auto {
  -webkit-overflow-scrolling: touch;
}

[data-product-zoom-reset]:active,
[data-product-zoom-reset]:focus:not(:hover),
[data-product-zoom-reset]:focus-visible:not(:hover) {
  background: #ffffff !important;
  color: #2E2019 !important;
  border-color: rgba(46, 32, 25, 0.15) !important;
  box-shadow: none !important;
  outline: none !important;
}

input[data-product-qty-input],
input[data-cart-qty-input] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[data-product-qty-input]::-webkit-inner-spin-button,
input[data-product-qty-input]::-webkit-outer-spin-button,
input[data-cart-qty-input]::-webkit-inner-spin-button,
input[data-cart-qty-input]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

[data-expand-product]:focus,
[data-expand-product]:focus-visible,
[data-expand-product]:active {
  outline: none !important;
  box-shadow: none !important;
  background-color: #F6F0D9 !important;
}

[data-add-product]:active,
[data-add-product]:focus,
[data-add-product]:focus-visible {
  outline: none !important;
  box-shadow: 0 10px 24px rgba(237, 175, 33, 0.24) !important;
  background-color: #EDAF21 !important;
}

[data-hero] {
  min-height: 100vh;
  min-height: 100svh;
}

[data-hero-bg] {
  background-attachment: scroll;
  background-position: center center;
  transform: translateZ(0);
  backface-visibility: hidden;
}

@media (min-width: 1024px) {
  [data-hero-bg] {
    background-attachment: fixed;
  }
}

@media (pointer: coarse) {
  [data-product-image-stage],
  [data-product-modal-image] {
    touch-action: none;
  }
}

.hero-cacau-bg {
  background-image: url('/assets/cacau.avif');
}

.hero-historia-bg {
  background-image: url('/assets/flor.avif');
}

@supports (content-visibility: auto) {
  main > section:not(:first-child) {
    content-visibility: auto;
    contain-intrinsic-size: 720px;
  }
}


/* Carregamento visual das fotos dos produtos. */
[data-product-image-frame] {
  isolation: isolate;
}

.product-image-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid rgba(46, 32, 25, 0.14);
  border-top-color: #EDAF21;
  border-radius: 9999px;
  animation: product-image-spin 700ms linear infinite;
}

@keyframes product-image-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .product-image-spinner {
    animation-duration: 1400ms;
  }
}


/* O navegador nunca deve desenhar alt/ícone quebrado enquanto a foto carrega. */
[data-card-product-image],
[data-product-modal-image] {
  color: transparent !important;
  font-size: 0 !important;
}

[data-product-image-frame].is-image-loading [data-card-product-image] {
  visibility: hidden !important;
  opacity: 0 !important;
}

/* O clique não deixa amarelo ou anel persistente; o hover continua no desktop. */
[data-gallery-arrow] {
  -webkit-tap-highlight-color: transparent;
}

[data-gallery-arrow]:focus:not(:focus-visible) {
  outline: none !important;
}

[data-gallery-arrow]:focus-visible {
  outline: 3px solid rgba(255, 193, 7, 0.62);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  [data-gallery-arrow]:hover {
    background-color: #FFC107;
  }

  [data-product-modal-prev]:hover,
  [data-product-modal-next]:hover {
    translate: 0 -55%;
  }
}

@media (hover: none) {
  [data-gallery-arrow]:hover,
  [data-gallery-arrow]:focus {
    background-color: rgba(255, 255, 255, 0.95);
  }

  [data-gallery-arrow]:active {
    background-color: #FFC107;
  }
}

/* Isola a área ampliada em uma camada própria e evita rastros durante o zoom. */
[data-product-image-stage] {
  contain: layout paint;
  isolation: isolate;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  clip-path: inset(0 round 1.5rem);
}

[data-product-modal-image] {
  will-change: transform, opacity;
  transform: translate3d(-50%, -50%, 0) scale3d(1, 1, 1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: auto;
}

/* Impede que navegadores móveis renderizem o texto alternativo ao fechar. */
[data-product-modal-image][hidden] {
  display: none !important;
}

@media (pointer: coarse) {
  html,
  body {
    touch-action: pan-y pinch-zoom;
  }

  [data-product-image-modal],
  [data-product-image-backdrop],
  [data-product-image-stage],
  [data-product-modal-image] {
    touch-action: none;
  }

  button,
  a,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  input[data-product-zoom] {
    touch-action: pan-x;
  }
}
