/**
 * NDPE Preview Popup – Full production styles.
 * @package NDPE
 */

.ndpe-preview-popup {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ndpe-preview-popup[hidden] { display: none; }

/* Backdrop */
.ndpe-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: ndpe-popup-fade 200ms ease;
}

/* Container */
.ndpe-popup-container {
  position: relative;
  z-index: 1;
  width: min(96vw, 1400px);
  height: min(92vh, 900px);
  background: #0f0f0f;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: ndpe-popup-enter 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ndpe-popup-enter {
  from { opacity: 0; transform: scale(0.94) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes ndpe-popup-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Header */
.ndpe-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.ndpe-popup-title-wrap { display: flex; align-items: center; gap: 10px; }
.ndpe-popup-product-name {
  color: #fff;
  font-family: var(--ndpe-font, -apple-system, BlinkMacSystemFont, sans-serif);
  font-weight: 600;
  font-size: 0.9375rem;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ndpe-popup-badge {
  padding: 2px 8px;
  background: rgba(232, 93, 4, 0.15);
  border: 1px solid rgba(232, 93, 4, 0.3);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e85d04;
}

/* Header Actions */
.ndpe-popup-header-actions { display: flex; align-items: center; gap: 8px; }
.ndpe-popup-open-new,
.ndpe-popup-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}
.ndpe-popup-open-new:hover,
.ndpe-popup-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.ndpe-popup-close:hover { background: rgba(220, 38, 38, 0.2); color: #ef4444; }

/* Device Bar */
.ndpe-popup-device-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  background: #141414;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}
.ndpe-device-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--ndpe-font, inherit);
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 180ms ease;
}
.ndpe-device-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}
.ndpe-device-btn.ndpe-device-active {
  background: rgba(232, 93, 4, 0.15);
  color: #e85d04;
}

/* Frame Area */
.ndpe-popup-frame-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: padding 300ms cubic-bezier(0.16, 1, 0.3, 1),
              background 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ndpe-popup-frame-area[data-device="desktop"] { padding: 0; }
.ndpe-popup-frame-area[data-device="tablet"]  { padding: 20px 100px; background: #222; }
.ndpe-popup-frame-area[data-device="mobile"]  { padding: 20px 200px; background: #222; }

/* iframe */
.ndpe-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ndpe-popup-frame-area[data-device="tablet"] .ndpe-preview-iframe,
.ndpe-popup-frame-area[data-device="mobile"] .ndpe-preview-iframe {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Video */
.ndpe-preview-video {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.ndpe-preview-video video {
  max-width: 100%;
  max-height: 100%;
}

/* Loading */
.ndpe-popup-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-family: var(--ndpe-font, inherit);
  z-index: 5;
}
.ndpe-popup-loading p { margin: 0; }
.ndpe-popup-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #e85d04;
  border-radius: 50%;
  animation: ndpe-popup-spin 0.7s linear infinite;
}
@keyframes ndpe-popup-spin { to { transform: rotate(360deg); } }

/* Footer */
.ndpe-popup-footer {
  padding: 12px 20px;
  background: #1a1a1a;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ndpe-popup-product-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.ndpe-popup-price {
  font-family: var(--ndpe-font, inherit);
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
}
.ndpe-popup-price del {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
  margin-right: 6px;
}
.ndpe-popup-buy-btn {
  margin-left: auto;
  padding: 10px 28px;
  background: #e85d04;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--ndpe-font, inherit);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
  display: inline-flex;
  align-items: center;
}
.ndpe-popup-buy-btn:hover {
  background: #dc4c00;
  color: #fff;
  transform: translateY(-1px);
}

/* ═══ Card Preview Trigger Button ═══ */
.ndpe-btn-preview-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: transparent;
  color: var(--ndpe-primary, #e85d04);
  border: 1.5px solid var(--ndpe-primary, #e85d04);
  border-radius: var(--ndpe-btn-radius, 8px);
  font-family: var(--ndpe-font, inherit);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--ndpe-duration, 200ms) var(--ndpe-ease, ease);
}
.ndpe-btn-preview-trigger:hover {
  background: var(--ndpe-primary, #e85d04);
  color: #fff;
}
.ndpe-btn-preview-trigger svg { flex-shrink: 0; }

/* Product Master preview trigger — full-width outline */
.ndpe-preview-trigger-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  color: var(--ndpe-accent, #e85d04);
  border: 2px solid var(--ndpe-accent, #e85d04);
  border-radius: var(--ndpe-radius-sm, 8px);
  font-family: var(--ndpe-font, inherit);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 200ms ease;
}
.ndpe-preview-trigger-full:hover {
  background: var(--ndpe-accent, #e85d04);
  color: #fff;
  transform: translateY(-1px);
}
.ndpe-preview-trigger-full svg { flex-shrink: 0; }

/* ═══ Mobile ═══ */
@media (max-width: 768px) {
  .ndpe-popup-container { width: 100vw; height: 100vh; border-radius: 0; }
  .ndpe-popup-device-bar { display: none; }
  .ndpe-popup-frame-area[data-device] { padding: 0 !important; background: #f0f0f0 !important; }
  .ndpe-popup-product-name { max-width: 200px; }
  .ndpe-popup-footer { flex-wrap: wrap; gap: 8px; }
  .ndpe-popup-buy-btn { margin-left: 0; flex: 1; text-align: center; justify-content: center; }
}
