/* Bio-Well America · Home interactions v1.2
 * Activated only on the front page; Elementor widgets remain editable.
 * Progressive enhancement: content is always visible without JavaScript.
 */

/* Anchor targets stay below the fixed-height sticky navigation. */
body.home .elementor-menu-anchor,
body.home #contacto,
body.home #conoce-biowell { scroll-margin-top: 110px; }

.bw-scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 1100;
  width: 100%;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, #fba70b, #f4813f 48%, #f1556a);
  transform: scaleX(var(--bw-scroll, 0));
  transform-origin: 0 50%;
  will-change: transform;
}
.admin-bar .bw-scroll-progress { top: 32px; }

/* Hero entrance: typographic hierarchy first, device second. */
body.home.bw-home-enhanced:not(.bw-hero-visible) .elementor-element-h10003,
body.home.bw-home-enhanced:not(.bw-hero-visible) .elementor-element-h10004,
body.home.bw-home-enhanced:not(.bw-hero-visible) .elementor-element-h10005,
body.home.bw-home-enhanced:not(.bw-hero-visible) .elementor-element-h10006 {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}
body.home .elementor-element-h10003,
body.home .elementor-element-h10004,
body.home .elementor-element-h10005,
body.home .elementor-element-h10006 {
  transition: opacity .66s cubic-bezier(.22,1,.36,1), transform .66s cubic-bezier(.22,1,.36,1);
}
body.home .elementor-element-h10004 { transition-delay: .07s; }
body.home .elementor-element-h10005 { transition-delay: .16s; }
body.home .elementor-element-h10006 { transition-delay: .24s; }
body.home.bw-home-enhanced:not(.bw-hero-visible) .elementor-element-h10011 {
  opacity: 0;
  transform: translate3d(24px, 0, 0) scale(.98);
}
body.home .elementor-element-h10011 {
  transition: opacity .85s cubic-bezier(.22,1,.36,1), transform 1.05s cubic-bezier(.22,1,.36,1);
  transition-delay: .10s;
}

/* Very small pointer-driven response of the original Bio-Well illustration. */
body.home .elementor-element-h10011 img {
  transform: translate3d(var(--bw-pointer-x, 0px), var(--bw-pointer-y, 0px), 0);
  transition: transform .38s ease-out;
  will-change: auto;
}

/* Section/card entrances: JS attaches .bw-reveal-target only when observer is ready. */
body.home.bw-reveal-ready .bw-reveal-target:not(.bw-inview) {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
}
body.home .bw-reveal-target {
  transition: opacity .72s cubic-bezier(.22,1,.36,1), transform .72s cubic-bezier(.22,1,.36,1);
  transition-delay: var(--bw-delay, 0ms);
}

/* Cards, image and CTAs respond consistently without changing Elementor JSON. */
body.home .elementor-element-h20010,
body.home .elementor-element-h20011,
body.home .elementor-element-h20012,
body.home .elementor-element-h4010,
body.home .elementor-element-h4011,
body.home .elementor-element-h4012,
body.home .elementor-element-h4013,
body.home .elementor-element-h4014,
body.home .elementor-element-h4015,
body.home .elementor-element-h50010,
body.home .elementor-element-h50020,
body.home .elementor-element-h50030,
body.home .elementor-element-h50040,
body.home .elementor-element-h6010,
body.home .elementor-element-h6011,
body.home .elementor-element-h6012 {
  transition: transform .28s cubic-bezier(.2,.75,.3,1), box-shadow .28s ease, border-color .28s ease;
}
@media (hover: hover) and (pointer: fine) {
  body.home .elementor-element-h20010:hover,
  body.home .elementor-element-h20011:hover,
  body.home .elementor-element-h20012:hover,
  body.home .elementor-element-h4010:hover,
  body.home .elementor-element-h4011:hover,
  body.home .elementor-element-h4012:hover,
  body.home .elementor-element-h4013:hover,
  body.home .elementor-element-h4014:hover,
  body.home .elementor-element-h4015:hover,
  body.home .elementor-element-h50010:hover,
  body.home .elementor-element-h50020:hover,
  body.home .elementor-element-h50030:hover,
  body.home .elementor-element-h50040:hover,
  body.home .elementor-element-h6010:hover,
  body.home .elementor-element-h6011:hover,
  body.home .elementor-element-h6012:hover {
    transform: translate3d(0, -6px, 0);
    box-shadow: 0 18px 42px rgba(43, 26, 19, .10);
    border-color: rgba(244, 129, 63, .4);
  }
  body.home .elementor-element-h50007 .elementor-widget-image img {
    transition: transform .4s cubic-bezier(.2,.75,.3,1);
  }
  body.home .elementor-element-h50007 > .e-con-inner > .e-con:hover .elementor-widget-image img,
  body.home .elementor-element-h50007 > .e-con:hover .elementor-widget-image img { transform: scale(1.045); }
  body.home .elementor-element-h10006 .elementor-button:hover,
  body.home .elementor-element-h50007 .elementor-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 11px 26px rgba(244, 129, 63, .18);
  }
}
body.home .elementor-button { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease; }
body.home .elementor-button:focus-visible,
body.home .bw-video-dialog__close:focus-visible,
body.home .bw-video-dialog__fallback:focus-visible {
  outline: 3px solid #fba70b;
  outline-offset: 4px;
}

/* Video interaction: no third-party modal dependency and no eager MP4 requests. */
.bw-video-dialog[hidden] { display: none !important; }
.bw-video-dialog {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 40px);
  background: rgba(22, 22, 29, .79);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bw-video-dialog__panel {
  width: min(100%, 960px);
  max-height: min(92dvh, 900px);
  overflow-y: auto;
  background: #fff;
  border-radius: 17px;
  box-shadow: 0 26px 90px rgba(0,0,0,.28);
  padding: clamp(16px, 3vw, 28px);
  animation: bw-dialog-in .26s ease-out both;
}
.bw-video-dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.bw-video-dialog__title { font: 700 clamp(17px,2.4vw,23px)/1.3 Poppins,sans-serif; margin: 0; color: #222226; }
.bw-video-dialog__close {
  border: 0;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  background: #fff0e8; color: #a9442b;
  font-size: 27px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.bw-video-dialog__player { display: block; width: 100%; max-height: 65dvh; background: #111; border-radius: 8px; aspect-ratio: 16 / 9; }
.bw-video-dialog__status { color: #666; font: 400 13px/1.6 Poppins,sans-serif; margin: 12px 0 0; }
.bw-video-dialog__fallback { display: inline-block; color: #b54d2d; text-decoration: underline; margin-top: 8px; }
@keyframes bw-dialog-in { from {opacity:0;transform:translateY(10px) scale(.99)} to {opacity:1;transform:none} }
@media(max-width:680px) {
  body.home .elementor-element-h10001 { overflow: clip; }
  body.home .elementor-element-h10011 img { will-change:auto; }
  .bw-video-dialog__panel { border-radius: 12px; }
  body.home #contacto, body.home #conoce-biowell { scroll-margin-top: 84px; }
}
@media(max-width:782px){ .admin-bar .bw-scroll-progress { top: 46px; } }
@media(prefers-reduced-motion:reduce){
  body.home .elementor-element-h10003,
  body.home .elementor-element-h10004,
  body.home .elementor-element-h10005,
  body.home .elementor-element-h10006,
  body.home .elementor-element-h10011,
  body.home .bw-reveal-target,
  body.home .elementor-element-h10011 img,
  body.home .elementor-button,
  body.home .elementor-element-h20010,
  body.home .elementor-element-h20011,
  body.home .elementor-element-h20012,
  body.home .elementor-element-h4010,
  body.home .elementor-element-h4011,
  body.home .elementor-element-h4012,
  body.home .elementor-element-h4013,
  body.home .elementor-element-h4014,
  body.home .elementor-element-h4015,
  body.home .elementor-element-h50010,
  body.home .elementor-element-h50020,
  body.home .elementor-element-h50030,
  body.home .elementor-element-h50040,
  body.home .elementor-element-h6010,
  body.home .elementor-element-h6011,
  body.home .elementor-element-h6012,
  .bw-video-dialog__panel { animation:none!important;transition:none!important;transform:none!important;opacity:1!important; }
}
