/* Nisa editorial motion layer — strictly additive, preserves all existing styles & animations */

#nisa-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 1350;
  pointer-events: none;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(
    90deg,
    var(--site-main-primary, #204566) 0%,
    var(--color-gold, #c9a34f) 100%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: transform;
}

#nisa-scroll-progress.is-active {
  opacity: 0.9;
}

:dir(rtl) #nisa-scroll-progress {
  transform-origin: right center;
}

/* Editorial hairline draw beneath section titles on viewport entry */
.section-title.nisa-title-ready {
  position: relative;
  display: inline-block;
}

.section-title.nisa-title-ready::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: min(56px, 42%);
  height: 1.5px;
  background: linear-gradient(
    90deg,
    var(--color-gold, #c9a34f),
    color-mix(in srgb, var(--site-main-primary, #204566) 35%, transparent)
  );
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
  pointer-events: none;
}

:dir(rtl) .section-title.nisa-title-ready::after {
  left: auto;
  right: 0;
  transform-origin: right center;
}

.section-title.nisa-title-ready.nisa-title-drawn::after {
  transform: scaleX(1);
  opacity: 0.85;
}

/* Tactile arrow/icon nudge on section links and newsletter submit */
.section-link svg,
.newsletter-submit svg {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-link:hover svg,
.section-link:focus-visible svg,
.newsletter-submit:hover svg,
.newsletter-submit:focus-visible svg {
  transform: translateX(3px);
}

:dir(rtl) .section-link:hover svg,
:dir(rtl) .section-link:focus-visible svg,
:dir(rtl) .newsletter-submit:hover svg,
:dir(rtl) .newsletter-submit:focus-visible svg {
  transform: translateX(-3px);
}

/* Footer link editorial underline draw */
.footer-links a {
  position: relative;
  width: fit-content;
}

.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0.55;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

:dir(rtl) .footer-links a::after {
  transform-origin: right center;
}

.footer-links a:hover::after,
.footer-links a:focus-visible::after {
  transform: scaleX(1);
}

/* Cart badge confirmation pop when count updates */
@keyframes nisa-badge-pop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.28);
  }
  70% {
    transform: scale(0.94);
  }
  100% {
    transform: scale(1);
  }
}

.cart-count.nisa-badge-pop {
  animation: nisa-badge-pop 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Add-to-cart editorial star burst */
.nisa-star-burst {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;
}

.nisa-star {
  position: fixed;
  pointer-events: none;
  color: var(--color-gold, #c9a34f);
  filter: drop-shadow(0 0 6px rgba(201, 163, 79, 0.75));
  will-change: transform, opacity;
  animation: nisa-star-fly var(--nisa-dur, 920ms) cubic-bezier(0.16, 1, 0.3, 1) var(--nisa-delay, 0ms) forwards;
}

.nisa-star--alt {
  color: var(--site-main-primary, #204566);
}

html[data-nisa-theme="dark"] .nisa-star--alt {
  color: #f3d98b;
}

@keyframes nisa-star-fly {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.25) rotate(0deg);
  }
  18% {
    opacity: 1;
    transform: translate3d(calc(-50% + var(--nisa-dx) * 0.25), calc(-50% + var(--nisa-dy) * 0.25), 0) scale(var(--nisa-scale, 1)) rotate(calc(var(--nisa-rot, 25deg) * 0.35));
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--nisa-dx)), calc(-50% + var(--nisa-dy)), 0) scale(0.2) rotate(var(--nisa-rot, 25deg));
  }
}

/* Smooth hover image reveal & zoom on product, collection, and banner images */
.product-card__image--main,
.product-card__image--hover,
.collection-img-main,
.collection-img-hover,
.promo-banner-img,
.products-showcase-banner-img,
.media-item img {
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.product-card:hover .product-card__image--main,
.product-card:hover .product-card__image--hover,
.product-card:active .product-card__image--main,
.product-card:active .product-card__image--hover,
.collection-card:hover .collection-img-main,
.collection-card:hover .collection-img-hover,
.collection-card:active .collection-img-main,
.collection-card:active .collection-img-hover,
.media-item:hover img,
.media-item:active img {
  transform: scale(1.06) !important;
}

/* Tactile grow-and-return press feedback on all buttons */
@keyframes nisa-btn-press {
  0% {
    transform: scale(1);
  }
  38% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes nisa-header-btn-press {
  0% {
    transform: translateY(-50%) scale(1);
  }
  38% {
    transform: translateY(-50%) scale(1.1);
  }
  100% {
    transform: translateY(-50%) scale(1);
  }
}

.nisa-btn-pressed {
  animation: nisa-btn-press 0.34s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.header #nisa-theme-toggle.nisa-btn-pressed {
  animation: nisa-header-btn-press 0.34s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Editorial alert toast for color / size selection */
#nisa-toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translate3d(-50%, -14px, 0);
  z-index: 1550;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 440px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--site-main-primary, #204566);
  color: #fffaf0;
  border: 1px solid rgba(201, 163, 79, 0.55);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  font-family: var(--font-body, "Noto Sans", system-ui, sans-serif);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#nisa-toast.is-visible {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

html[data-nisa-theme="dark"] #nisa-toast {
  background: #182536;
  color: #e8eef5;
  border-color: var(--color-gold, #c9a34f);
}

/* Fluid modal & interactive option transitions */
@keyframes nisa-modal-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.965);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.quick-view-dialog {
  animation: nisa-modal-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.color-swatch,
.size-btn {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.22s ease !important;
}

.size-btn.selected {
  transform: scale(1.04);
}

.color-swatch.selected {
  transform: scale(1.1);
}

.promo-banner:hover .promo-banner-img,
.promo-banner:active .promo-banner-img,
.products-showcase-banner:hover .products-showcase-banner-img,
.products-showcase-banner:active .products-showcase-banner-img {
  transform: scale(1.04) !important;
}

/* Smooth Scroll-to-Top button */
#nisa-scroll-top {
  position: fixed;
  bottom: 22px;
  inset-inline-start: 22px;
  z-index: 1240;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--site-main-border, #d6e0ea);
  background: var(--site-main-surface, #ffffff);
  color: var(--site-main-text, #204566);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px var(--color-shadow-medium, rgba(0, 0, 0, 0.14));
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 12px, 0) scale(0.9);
  transition: opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

#nisa-scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

#nisa-scroll-top:hover {
  transform: translate3d(0, -3px, 0) scale(1.05);
  box-shadow: 0 10px 26px var(--color-shadow, rgba(0, 0, 0, 0.2));
}

#nisa-scroll-top svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#nisa-scroll-top:hover svg {
  transform: translateY(-2px);
}

html[data-nisa-theme="dark"] #nisa-scroll-top {
  background: #182536;
  border-color: #2a3d54;
  color: var(--color-gold, #c9a34f);
}

/* Floating background stars layer (like original seasonal stars) */
#nisa-bg-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.nisa-bg-star {
  position: absolute;
  top: -24px;
  background: color-mix(in srgb, var(--color-gold, #c9a34f) 82%, transparent);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--color-gold, #c9a34f) 38%, transparent));
  will-change: transform, opacity;
  animation: nisa-bg-star-fall var(--nisa-fall-dur, 18s) linear var(--nisa-fall-delay, 0s) infinite;
}

.nisa-bg-star--dot {
  border-radius: 50%;
  clip-path: none;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 248, 220, 0.9),
    color-mix(in srgb, var(--color-gold, #c9a34f) 55%, transparent) 45%,
    transparent 75%
  );
}

@keyframes nisa-bg-star-fall {
  0% {
    transform: translate3d(0, -6vh, 0) rotate(0deg) scale(0.9);
    opacity: 0;
  }
  8% {
    opacity: var(--nisa-star-opacity, 0.55);
  }
  50% {
    transform: translate3d(var(--nisa-drift, 14px), 52vh, 0) rotate(140deg) scale(1.05);
    opacity: var(--nisa-star-opacity, 0.65);
  }
  92% {
    opacity: var(--nisa-star-opacity, 0.45);
  }
  100% {
    transform: translate3d(calc(var(--nisa-drift, 14px) * -0.5), 108vh, 0) rotate(280deg) scale(0.9);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  #nisa-toast {
    top: 14px;
    padding: 9px 14px;
    font-size: 0.78rem;
  }

  #nisa-scroll-top {
    bottom: 16px;
    inset-inline-start: 14px;
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #nisa-bg-stars {
    display: none !important;
  }
  #nisa-scroll-progress {
    display: none !important;
  }
  .section-title.nisa-title-ready::after {
    transform: scaleX(1) !important;
    opacity: 0.85 !important;
    transition: none !important;
  }
  .section-link svg,
  .newsletter-submit svg,
  .footer-links a::after {
    transition: none !important;
  }
  .cart-count.nisa-badge-pop {
    animation: none !important;
  }
}
