/* Preview overlay chrome only — listing body reuses ad-view.css */

.ad-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26, 26, 46, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 12px 28px;
  overflow-y: auto;
}

.ad-preview-overlay.is-open {
  display: flex;
}

.ad-preview-chrome {
  width: min(1120px, 100%);
  margin: 0 auto;
  animation: adPreviewIn 0.3s ease forwards;
}

@keyframes adPreviewIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.ad-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ad-preview-toolbar__text {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #fff;
}

.ad-preview-toolbar__text strong {
  font-size: 16px;
  font-weight: 800;
}

.ad-preview-badge {
  background: rgba(255, 255, 255, 0.92);
  color: var(--burgundy-deep, #7a2e4a);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.ad-preview-close {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--text-secondary, #5c4a52);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.ad-preview-close:hover {
  background: #faf2f5;
  color: var(--burgundy-deep, #7a2e4a);
}

.ad-view-shell--preview {
  background: var(--bg-soft, #faf7f8);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  padding-bottom: 8px;
}

.ad-view-shell--preview .ad-view-grid {
  padding: 18px;
}

.ad-view-shell--preview .ad-view-similar {
  margin: 0 18px 18px;
}

.ad-view-contacts--preview {
  pointer-events: none;
  opacity: 0.72;
}

.ad-preview-contact-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.ad-view-shell--preview .ad-view-main-image.is-empty {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0e8ec;
}

.ad-view-shell--preview .ad-view-no-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 700;
}

.ad-view-shell--preview .ad-view-no-img[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .ad-preview-overlay {
    padding: 0;
    align-items: stretch;
    background: var(--bg-soft, #faf7f8);
  }

  .ad-preview-chrome {
    width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    margin: 0;
    animation: none;
  }

  .ad-preview-toolbar {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0;
    padding: 12px 14px;
    background: var(--burgundy-deep, #7a2e4a);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
  }

  .ad-preview-close {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 800;
    color: var(--burgundy-deep, #7a2e4a);
  }

  .ad-view-shell--preview {
    border-radius: 0;
    border: none;
    box-shadow: none;
    flex: 1;
  }

  .ad-preview-footer {
    position: sticky;
    bottom: 0;
    z-index: 30;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(253, 248, 246, 0.98);
    border-top: 1px solid #decbc0;
    flex-shrink: 0;
  }

  .ad-preview-footer-close {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 14px;
    background: var(--burgundy-deep, #7a2e4a);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
  }

  .ad-view-shell--preview .ad-view-grid {
    padding: 12px;
  }
}
