/* ============================================================
   WC Personalizer — Preview Modal
   ============================================================ */

/* ── Trigger button ───────────────────────────────────────── */
.wcp-preview-trigger-wrap {
  margin: 8px 0 16px;
}

.wcp-preview-trigger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--wcp-btn-bg, #1a1a1a);
  color: var(--wcp-btn-text, #fff);
  border: 2px solid var(--wcp-btn-bg, #1a1a1a);
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, opacity 0.18s;
  font-family: inherit;
}

.wcp-preview-trigger-btn:hover {
  opacity: 0.88;
}

.wcp-preview-trigger-btn svg {
  flex-shrink: 0;
}

/* ── Modal overlay ────────────────────────────────────────── */
.wcp-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  /* Must be above Flatsome's sticky header (z-index: 9999) and nav */
  z-index: 999999;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wcp-modal-overlay.wcp-modal-open {
  display: flex;
}

/* ── Modal card ───────────────────────────────────────────── */
.wcp-modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  animation: wcp-modal-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes wcp-modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Modal header ─────────────────────────────────────────── */
.wcp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.wcp-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.wcp-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f4f4f4;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: background 0.15s;
  flex-shrink: 0;
}

.wcp-modal-close:hover { background: #e8e8e8; color: #111; }

/* ── Modal body — two-column on wider screens ─────────────── */
.wcp-modal-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 520px) {
  .wcp-modal-body {
    grid-template-columns: 1fr 260px;
  }
}

/* ── Preview image panel ──────────────────────────────────── */
.wcp-modal-image-panel {
  padding: 20px;
  background: #f7f5f2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #f0f0f0;
  min-height: 200px;
}

.wcp-modal-image-panel img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.wcp-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #999;
  font-size: .85rem;
}

.wcp-modal-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid #e0e0e0;
  border-top-color: var(--wcp-btn-bg, #1a1a1a);
  border-radius: 50%;
  animation: wcp-spin 0.7s linear infinite;
}

@keyframes wcp-spin { to { transform: rotate(360deg); } }

/* ── Summary panel ────────────────────────────────────────── */
.wcp-modal-summary {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wcp-modal-summary-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #888;
  margin: 0;
}

.wcp-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.wcp-summary-item:last-of-type { border-bottom: none; }

.wcp-summary-label {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #aaa;
}

.wcp-summary-value {
  font-size: .9rem;
  color: #1a1a1a;
  font-weight: 500;
  line-height: 1.3;
}

.wcp-summary-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  vertical-align: middle;
  margin-right: 5px;
}

.wcp-summary-gift {
  background: #fffbf0;
  border: 1px solid #e8d98a;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: .82rem;
  color: #5c4a00;
  font-style: italic;
  line-height: 1.4;
}

/* ── Modal actions ────────────────────────────────────────── */
.wcp-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.wcp-modal-atc-btn {
  width: 100%;
  padding: 14px;
  background: var(--wcp-btn-bg, #1a1a1a);
  color: var(--wcp-btn-text, #fff);
  font-size: .88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.wcp-modal-atc-btn:hover { background: var(--wcp-btn-hover, #333); }

.wcp-modal-edit-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: #666;
  font-size: .82rem;
  font-weight: 600;
  border: 1.5px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}

.wcp-modal-edit-btn:hover { border-color: #bbb; color: #333; }

/* ── Mobile: single column ────────────────────────────────── */
@media (max-width: 519px) {
  .wcp-modal-image-panel { border-right: none; border-bottom: 1px solid #f0f0f0; }
}
