/* Nestor rehydration shim — restores JS behaviors stripped during site import.
   Scoped with nl- prefixes so it can't collide with the captured theme. */

/* Lightbox */
.nl-lb{position:fixed;inset:0;z-index:2147483000;display:none;align-items:center;justify-content:center;
  background:rgba(0,0,0,.9);opacity:0;transition:opacity .2s ease;}
.nl-lb.open{display:flex;opacity:1;}
.nl-lb-fig{margin:0;max-width:92vw;max-height:88vh;display:flex;align-items:center;justify-content:center;}
.nl-lb-img{max-width:92vw;max-height:88vh;object-fit:contain;border-radius:4px;box-shadow:0 6px 40px rgba(0,0,0,.5);}
.nl-lb button{position:absolute;background:rgba(0,0,0,.35);color:#fff;border:0;cursor:pointer;line-height:1;
  width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-size:34px;transition:background .2s;}
.nl-lb button:hover{background:rgba(255,255,255,.22);}
.nl-lb-close{top:18px;right:18px;font-size:30px;}
.nl-lb-prev{left:18px;top:50%;transform:translateY(-50%);}
.nl-lb-next{right:18px;top:50%;transform:translateY(-50%);}
.nl-lb-count{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);background:none;color:#fff;
  width:auto;height:auto;font-size:14px;opacity:.8;border-radius:0;}
@media(max-width:640px){.nl-lb button{width:44px;height:44px;font-size:26px;}}

/* Defensive sticky header (only applied when the captured header lost its fixed CSS) */
.nl-fixed-header{position:sticky;top:0;z-index:1000;background:var(--nl-header-bg,#fff);
  box-shadow:0 2px 12px rgba(0,0,0,.08);}

/* Carousel arrows we may need to reveal */
.nl-car-arrow-shown{opacity:1!important;visibility:visible!important;pointer-events:auto!important;}

/* Captured purchase UI — every Betty import carries the header cart button
   and per-product add-to-cart buttons, dead in the mirror. All of it stays
   hidden unless the ordering runtime (only injected when ordering is enabled
   and the page is in scope) loads its menu and stamps data-nl-ordering on
   <html> — otherwise a disabled shop still LOOKS purchasable. Lives in this
   always-injected stylesheet so there's no pre-hide flash; prices and size
   labels remain visible (they're menu content, not purchase controls). */
[id^="show-cart-btn"]:not([data-nl-ord-cart]){display:none!important;}
html:not([data-nl-ordering]) .add-to-cart-btn,
html:not([data-nl-ordering]) [id^="show-cart-btn"]{display:none!important;}

/* Back-to-top button (nl-back-to-top). Scoped to the marker the shim stamps when
   it takes ownership of a captured .back-to-top-module — a capture we don't drive
   keeps whatever visibility its own theme gave it, so this can ship to everyone. */
[data-nl-btt]{opacity:0;visibility:hidden;transition:opacity .25s ease,visibility .25s ease;}
[data-nl-btt].nl-btt-visible{opacity:1;visibility:visible;}

/* Entrance animations (nl-entry-anim — opt-in per tenant via nestor.rehydrate.json).
   The transition sits only on the "on" state: arming has to hide instantly, or
   already-visible content would fade OUT and back in on load. The reveal still
   animates, because a transition declared in the after-change style is what
   starts the animation. */
[data-nl-anim-fade="pending"]{opacity:0!important;transform:translateY(18px);}
[data-nl-anim-fade="on"]{opacity:1!important;transform:none;
  transition:opacity .7s ease,transform .7s ease;}
[data-nl-anim-slide="pending"]{clip-path:inset(0 100% 0 0);}
[data-nl-anim-slide="on"]{clip-path:inset(0);transition:clip-path .8s ease;}
@media(prefers-reduced-motion:reduce){
  [data-nl-anim]{opacity:1!important;transform:none!important;clip-path:none!important;
    transition:none!important;}
}
