/* Retained NEF product-image cross-fade and opt-in two-color border chase. */

/* Secondary images preserve the same aspect ratio; no layout shift or extra links. */
.nef-product-image.has-hover-image { position:relative; }
.nef-product-image.has-hover-image .nef-product-image__primary { position:relative; z-index:0; transition:opacity .3s ease, transform .3s ease; }
.nef-product-image.has-hover-image .nef-product-image__hover {
  position:absolute;
  inset:0;
  z-index:1;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:0;
  pointer-events:none;
  transition:opacity .3s ease, transform .3s ease;
}
/* Hover images appear only when the image is hovered with a mouse/trackpad. */
@media (hover:hover) and (pointer:fine) {
  .nef-product-image.has-hover-image:hover .nef-product-image__primary { opacity:0; }
  .nef-product-image.has-hover-image:hover .nef-product-image__hover { opacity:1; transform:scale(1.025); }
}
/* Keyboard users can also preview the alternate image. */
.nef-product-image.has-hover-image:focus-visible .nef-product-image__primary { opacity:0; }
.nef-product-image.has-hover-image:focus-visible .nef-product-image__hover { opacity:1; }
/* Preserve the pre-existing gentle zoom only for cards without a secondary image. */
.nef-product-card:hover .nef-product-image.has-hover-image .nef-product-image__primary { transform:none; }
.nef-product-card:hover .nef-product-image.has-hover-image .nef-product-image__hover { transform:none; }
@media (hover:hover) and (pointer:fine) {
  .nef-product-image.has-hover-image:hover .nef-product-image__hover { transform:scale(1.025); }
}

/* NEF 1.5.6 — opt-in rotating border, restricted to requested CTAs only.
 * Add the `nef-glow-border` class to a link or button only when its moving
 * two-color border is requested. Normal buttons use their original styles.
 * Each brand color spans exactly 180 degrees / 50 percent of the full outline.
 */
@property --nef-border-chase-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.nef-glow-border {
  position: relative;
  isolation: isolate;
  /* Preserve the original border box dimensions, but never draw a static
   * border underneath the animation. This also defeats border-color hover
   * changes in the base theme without changing the button background. */
  border-color: transparent !important;
}

/* Filled CTAs and category pills: remove the native border entirely.
 * In v1.5.6 it was only made transparent. The retained 1–2px border box
 * could create a second outline/gap between the fill and animated ring.
 * Existing radii, backgrounds, and minimum heights remain untouched.
 * Outline-style actions (header WhatsApp and Continue Shopping)
 * are intentionally not changed by this modifier.
 */
.nef-glow-border.nef-glow-border--edge-only {
  border: 0 !important;
}

.nef-glow-border::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
  background: conic-gradient(
    from var(--nef-border-chase-angle),
    #A8C93A 0deg 180deg,
    #123D2A 180deg 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  filter: drop-shadow(0 0 2px rgba(168, 201, 58, .15));
  animation: nef-border-chase 3.6s linear infinite;
}

@keyframes nef-border-chase {
  to { --nef-border-chase-angle: 360deg; }
}

/* If masks are unsupported, suppress the pseudo-element instead of covering
 * labels. Filled CTAs remain borderless; unchanged outline CTAs may use their
 * native border as a graceful fallback. */
@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .nef-glow-border { border-color: currentColor !important; }
  .nef-glow-border::after { display: none; }
}

.nef-glow-border:disabled::after,
.nef-glow-border[aria-disabled="true"]::after {
  animation: none;
  opacity: .6;
}

@media (prefers-reduced-motion: reduce) {
  .nef-product-image.has-hover-image .nef-product-image__primary,
  .nef-product-image.has-hover-image .nef-product-image__hover {
    transition: none !important;
    transform: none !important;
  }
  .nef-glow-border::after { animation: none !important; }
}
