/* NBT Custom Popup - frontend styles. All selectors scoped under .ncp-popup-wrapper. */

.ncp-popup-wrapper {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  box-sizing: border-box;
}

.ncp-popup-wrapper[hidden] {
  display: none;
}

.ncp-popup-wrapper *,
.ncp-popup-wrapper *::before,
.ncp-popup-wrapper *::after {
  box-sizing: border-box;
}

.ncp-overlay {
  position: absolute;
  inset: 0;
  background: var(--ncp-overlay, rgba(0, 0, 0, 0.5));
}

.ncp-popup {
  position: relative;
  width: var(--ncp-width, 480px);
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: auto;
  padding: 28px;
  background: var(--ncp-bg, #fff);
  color: var(--ncp-text, #1a1a1a);
  border-radius: var(--ncp-radius, 8px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  font-family: inherit;
  line-height: 1.5;
}

/* Positions */
.ncp-pos-center {
  align-items: center;
  justify-content: center;
}

.ncp-pos-top-bar,
.ncp-pos-bottom-bar {
  align-items: stretch;
}

.ncp-pos-top-bar .ncp-popup,
.ncp-pos-bottom-bar .ncp-popup {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-radius: 0;
}

.ncp-pos-top-bar {
  align-items: flex-start;
}

.ncp-pos-bottom-bar {
  align-items: flex-end;
}

.ncp-pos-top-left {
  align-items: flex-start;
  justify-content: flex-start;
}

.ncp-pos-top-right {
  align-items: flex-start;
  justify-content: flex-end;
}

.ncp-pos-bottom-left {
  align-items: flex-end;
  justify-content: flex-start;
}

.ncp-pos-bottom-right {
  align-items: flex-end;
  justify-content: flex-end;
}

.ncp-pos-top-left .ncp-popup,
.ncp-pos-top-right .ncp-popup,
.ncp-pos-bottom-left .ncp-popup,
.ncp-pos-bottom-right .ncp-popup {
  margin: 20px;
}

/* Title + content */
.ncp-title {
  margin: 0 0 12px;
  font-size: 1.4em;
  color: var(--ncp-text, #1a1a1a);
}

.ncp-content {
  margin-bottom: 16px;
}

.ncp-content :last-child {
  margin-bottom: 0;
}

/* Close button */
.ncp-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--ncp-text, #1a1a1a);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
}

.ncp-close:hover,
.ncp-close:focus {
  opacity: 1;
}

/* Buttons placed inside popup content (e.g. a CTA link styled as a button). */
.ncp-content .ncp-button,
.ncp-content .wp-block-button__link {
  display: inline-block;
  padding: 11px 16px;
  font-size: 1em;
  font-weight: 600;
  color: var(--ncp-btn-text, #fff);
  background: var(--ncp-btn-bg, #1a1a1a);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

/* Animations */
.ncp-popup-wrapper.is-open .ncp-overlay {
  animation: ncp-fade-in 0.2s ease forwards;
}

.ncp-anim-fade.is-open .ncp-popup {
  animation: ncp-fade-in 0.25s ease forwards;
}

.ncp-anim-zoom.is-open .ncp-popup {
  animation: ncp-zoom-in 0.25s ease forwards;
}

.ncp-anim-slide-down.is-open .ncp-popup {
  animation: ncp-slide-down 0.25s ease forwards;
}

.ncp-anim-slide-up.is-open .ncp-popup {
  animation: ncp-slide-up 0.25s ease forwards;
}

@keyframes ncp-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ncp-zoom-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes ncp-slide-down {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ncp-slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ncp-popup-wrapper.is-open .ncp-overlay,
  .ncp-popup-wrapper.is-open .ncp-popup {
    animation: none !important;
  }
}
