/**
 * 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; }
}

/* ════ FIX: Kill all theme color inheritance in modal ════ */

/* Nuclear reset — nothing inside the modal inherits theme colors */
.ndpe-preview-popup,
.ndpe-preview-popup * {
  box-sizing: border-box !important;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Hide WooCommerce screen reader text that looks cheap in popup */
.ndpe-preview-popup .screen-reader-text {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  white-space: nowrap !important;
}

/* Header — force exact colors & premium padding */
.ndpe-preview-popup .ndpe-popup-header {
  background: #0b0b0c !important;
  border-bottom: 1px solid rgba(255,255,255,0.03) !important;
  color: #ffffff !important;
  padding: 16px 24px !important;
}

/* Product name text */
.ndpe-preview-popup .ndpe-popup-product-name {
  color: #fff !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}

/* LIVE PREVIEW badge */
.ndpe-preview-popup .ndpe-popup-badge {
  background: rgba(232, 93, 4, 0.1) !important;
  border: 1px solid rgba(232, 93, 4, 0.2) !important;
  color: #e85d04 !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
}

/* Device switcher buttons */
.ndpe-preview-popup .ndpe-device-btn {
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  color: rgba(255,255,255,0.4) !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
  padding: 6px 16px !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
}
.ndpe-preview-popup .ndpe-device-btn:hover {
  background: rgba(255,255,255,0.04) !important;
  color: rgba(255,255,255,0.8) !important;
}
.ndpe-preview-popup .ndpe-device-btn.ndpe-device-active {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

/* Device bar container */
.ndpe-preview-popup .ndpe-popup-device-bar {
  background: #0b0b0c !important;
  border-bottom: 1px solid rgba(255,255,255,0.03) !important;
  border-top: none !important;
  padding: 10px !important;
}

/* Close & Open New buttons */
.ndpe-preview-popup .ndpe-popup-close,
.ndpe-preview-popup .ndpe-popup-open-new {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: rgba(255,255,255,0.6) !important;
  border-radius: 10px !important;
  width: 40px !important;
  height: 40px !important;
}
.ndpe-preview-popup .ndpe-popup-close:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}
.ndpe-preview-popup .ndpe-popup-open-new:hover {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

/* Footer */
.ndpe-preview-popup .ndpe-popup-footer {
  background: #0b0b0c !important;
  border-top: 1px solid rgba(255,255,255,0.03) !important;
  padding: 16px 24px !important;
}

/* Price */
.ndpe-preview-popup .ndpe-popup-price {
  color: #fff !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
}
.ndpe-preview-popup .ndpe-popup-price del {
  color: rgba(255,255,255,0.3) !important;
  font-size: 0.875rem !important;
  margin-right: 8px !important;
}
.ndpe-preview-popup .ndpe-popup-price ins {
  text-decoration: none !important;
  color: #fff !important;
}

/* Buy Now button */
.ndpe-preview-popup .ndpe-popup-buy-btn {
  background: linear-gradient(135deg, #e85d04 0%, #dc4c00 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  padding: 12px 32px !important;
  font-weight: 700 !important;
  font-size: 0.9375rem !important;
  box-shadow: 0 4px 12px rgba(232, 93, 4, 0.2) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.ndpe-preview-popup .ndpe-popup-buy-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(232, 93, 4, 0.3) !important;
  color: #ffffff !important;
}

/* Backdrop */
.ndpe-popup-backdrop {
  background: rgba(0,0,0,0.85) !important;
  backdrop-filter: blur(8px) !important;
}

/* Container shell */
.ndpe-preview-popup .ndpe-popup-container {
  background: #0b0b0c !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8) !important;
}

