/* ── Jalpi Page Builder — Starter Sites Admin Page ───────────────────────────── */

/* ── Page layout ─────────────────────────────────────────────────────────── */

.cbss-wrap { max-width: 1200px; }

.cbss-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.cbss-heading {
  margin: 12px 0 6px !important;
  font-size: 23px !important;
  font-weight: 400 !important;
  color: #1d2327 !important;
  line-height: 1.3 !important;
}

.cbss-intro {
  margin: 0 0 16px !important;
  color: #646970;
  font-size: 14px;
}

/* ── Category tabs ───────────────────────────────────────────────────────── */

.cbss-tabs { margin-bottom: 20px; }

.cbss-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.08);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 5px;
  vertical-align: middle;
}
.nav-tab-active .cbss-tab-count { background: rgba(255,255,255,.3); }

/* ── Kit grid ────────────────────────────────────────────────────────────── */

.cbss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 4px;
}

/* ── Kit card ────────────────────────────────────────────────────────────── */

.cbss-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s;
  display: flex;
  flex-direction: column;
}
.cbss-card:hover {
  border-color: #b5b5ba;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

/* Preview area */
.cbss-card__preview {
  position: relative;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}

/* Real screenshot thumbnail.
   Anchored to the top so the hero is always what you see first. On hover the
   image slides up to reveal more of the page, the way template libraries
   preview a full-length screenshot inside a short card. */
.cbss-card__shot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
  transition: transform 2.4s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.cbss-card:hover .cbss-card__shot {
  /* Reveal the rest of the page; capped so a very long screenshot cannot
     scroll past its own bottom edge. */
  transform: translateY(calc(-100% + 180px));
}

@media (prefers-reduced-motion: reduce) {
  .cbss-card__shot { transition: none; }
  .cbss-card:hover .cbss-card__shot { transform: none; }
}

/* Wireframe mockup */
.cbss-card__wire {
  position: absolute;
  inset: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.cbss-card__wire-bar {
  height: 14px;
  border-radius: 4px;
  width: 100%;
}
.cbss-card__wire-hero {
  height: 52px;
  border-radius: 6px;
  flex-shrink: 0;
}
.cbss-card__wire-cols {
  display: flex;
  gap: 6px;
  flex: 1;
}
.cbss-card__wire-cols > div {
  flex: 1;
  border-radius: 4px;
}
.cbss-card__wire-footer {
  height: 18px;
  border-radius: 4px;
}

/* Hover overlay */
.cbss-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .18s;
}
.cbss-card:hover .cbss-card__overlay { opacity: 1; }
.cbss-card__overlay .button,
.cbss-card__overlay .button-primary {
  font-size: 13px;
  padding: 8px 18px;
  height: auto;
  line-height: 1.4;
}
.cbss-card__overlay .button {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.5);
  color: #fff;
}
.cbss-card__overlay .button:hover {
  background: rgba(255,255,255,.25);
  color: #fff;
}

/* Card body */
.cbss-card__body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cbss-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cbss-card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cbss-card__name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cbss-card__pages-badge {
  font-size: 11px;
  font-weight: 600;
  background: #f0f0f1;
  color: #646970;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.cbss-card__desc {
  margin: 0;
  font-size: 12px;
  color: #787c82;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.cbss-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #787c82;
}
.cbss-empty svg {
  display: block;
  margin: 0 auto 12px;
  opacity: .25;
}
.cbss-empty p { font-size: 14px; margin: 0; }

/* ── Modal overlay ───────────────────────────────────────────────────────── */

.cbss-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
.cbss-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.cbss-modal {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  width: min(460px, 94vw);
  overflow: hidden;
  animation: cbss-modal-in .18s ease;
}

@keyframes cbss-modal-in {
  from { transform: translateY(12px) scale(.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── Modal states ────────────────────────────────────────────────────────── */

.cbss-state { display: flex; flex-direction: column; }

/* Modal header */
.cbss-modal__hd {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #dcdcde;
}

.cbss-modal__hd-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f0f1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #2271b1;
}
.cbss-modal__hd-icon--success { background: #d1fae5; color: #059669; }
.cbss-modal__hd-icon--error   { background: #fee2e2; color: #dc2626; }

.cbss-modal__hd-text { flex: 1; }

.cbss-modal__title {
  margin: 0 0 3px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #1d2327 !important;
  line-height: 1.3 !important;
}

.cbss-modal__sub {
  margin: 0 !important;
  font-size: 12px;
  color: #787c82;
}

.cbss-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  color: #787c82;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background .12s, color .12s;
}
.cbss-modal__close:hover { background: #f0f0f1; color: #1d2327; }

/* Modal body */
.cbss-modal__body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Modal footer */
.cbss-modal__ft {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #dcdcde;
}

/* Notice box inside confirm */
.cbss-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f0f6fc;
  border: 1px solid #c8d8ea;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 13px;
  color: #1d2327;
  line-height: 1.5;
}
.cbss-notice svg { flex-shrink: 0; margin-top: 2px; color: #2271b1; }
.cbss-notice p { margin: 0; }

.cbss-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1d2327;
  cursor: pointer;
}
.cbss-checkbox-row input { margin: 0; }

/* Progress state */
.cbss-progress-body {
  text-align: center;
  padding: 40px 20px !important;
  align-items: center;
}

.cbss-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: #2271b1;
  border-radius: 50%;
  animation: cbss-spin .7s linear infinite;
  margin-bottom: 16px;
}
@keyframes cbss-spin { to { transform: rotate(360deg); } }

.cbss-progress-label {
  margin: 0 0 4px !important;
  font-size: 15px !important;
  font-weight: 600;
  color: #1d2327;
}
.cbss-progress-sub {
  margin: 0 !important;
  font-size: 13px;
  color: #787c82;
}

/* Success state */
.cbss-success-label {
  margin: 0 0 8px !important;
  font-size: 13px;
  font-weight: 600;
  color: #1d2327;
}

.cbss-page-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.cbss-page-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
}

.cbss-page-list .cbss-page-title { font-weight: 600; color: #1d2327; }

.cbss-page-list .cbss-page-links { display: flex; gap: 6px; }

.cbss-page-list a {
  font-size: 12px;
  text-decoration: none;
  color: #2271b1;
  white-space: nowrap;
}
.cbss-page-list a:hover { text-decoration: underline; }

/* ── Card actions row (Preview + Import buttons) ─────────────────────────── */

.cbss-card__actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.cbss-card__actions .button {
  flex: 1;
  text-align: center;
  justify-content: center;
  font-size: 12px;
}

/* Hover overlay — side-by-side buttons */
.cbss-card__overlay { gap: 8px; }

/* ═══════════════════════ Preview Modal ══════════════════════════════════ */

.cbss-modal--preview {
  width: min(860px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Floating close button */
.cbss-preview-close-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0,0,0,.45) !important;
  color: #fff !important;
  border-radius: 50% !important;
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background .12s;
}
.cbss-preview-close-x:hover { background: rgba(0,0,0,.65) !important; }

/* Split layout */
.cbss-preview-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left — visual panel */
.cbss-preview-left {
  flex: 0 0 55%;
  min-height: 420px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

/* Right — details panel */
.cbss-preview-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;
  overflow-y: auto;
  gap: 20px;
}

/* Meta */
.cbss-preview-meta { display: flex; flex-direction: column; gap: 6px; }

.cbss-preview-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #787c82;
}

.cbss-preview-title {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #1d2327 !important;
  line-height: 1.25 !important;
}

.cbss-preview-desc {
  margin: 0 !important;
  font-size: 13px;
  color: #646970;
  line-height: 1.55;
}

/* Page list */
.cbss-preview-pages { display: flex; flex-direction: column; gap: 8px; flex: 1; }

.cbss-preview-pages__label {
  margin: 0 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #787c82;
}

.cbss-preview-page-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cbss-preview-page-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  font-size: 13px;
  color: #1d2327;
}

.cbss-pv-page-icon { display: flex; align-items: center; color: #787c82; flex-shrink: 0; }

/* Each "Included pages" row is a link that opens that page's preview. */
.cbss-preview-page-list li:has(> .cbss-pv-page-link) { padding: 0; background: transparent; border: none; }
.cbss-pv-page-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  font-size: 13px;
  color: #1d2327;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.cbss-pv-page-link:hover,
.cbss-pv-page-link:focus {
  background: #f0f0ff;
  border-color: #4f46e5;
  color: #4f46e5;
  box-shadow: none;
}
.cbss-pv-page-link:hover .cbss-pv-page-icon { color: #4f46e5; }

/* Preview actions */
.cbss-preview-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f1;
  flex-shrink: 0;
}
.cbss-preview-actions .button { flex: 1; text-align: center; justify-content: center; }

/* Detailed wireframe */
.cbss-pv-wire {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  gap: 2px;
}

.cbss-pv-wire__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 6px 6px 0 0;
}
.cbss-pv-wire__logo { width: 56px; height: 12px; border-radius: 3px; }
.cbss-pv-wire__nav-links { display: flex; align-items: center; gap: 8px; }
.cbss-pv-wire__nav-links > div { width: 32px; height: 8px; border-radius: 3px; }
.cbss-pv-wire__nav-btn { width: 52px !important; height: 22px !important; border-radius: 4px !important; }

.cbss-pv-wire__hero { padding: 28px 20px; border-radius: 4px; }
.cbss-pv-wire__hero-inner {
  max-width: 260px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cbss-pv-wire__line { border-radius: 3px; height: 8px; }
.cbss-pv-wire__line--xl { width: 80%; height: 16px; }
.cbss-pv-wire__line--lg { width: 65%; height: 10px; }
.cbss-pv-wire__line--md { width: 50%; }
.cbss-pv-wire__line--sm { width: 55%; height: 8px; margin-bottom: 4px; }
.cbss-pv-wire__line--xs { width: 75%; height: 6px; }
.cbss-pv-wire__btns { display: flex; gap: 8px; margin-top: 4px; }
.cbss-pv-wire__btn { width: 72px; height: 24px; border-radius: 4px; }
.cbss-pv-wire__btn--ghost { background: transparent !important; border: 2px solid; }

.cbss-pv-wire__features {
  display: flex;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 4px;
}
.cbss-pv-wire__feat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.cbss-pv-wire__feat-icon { width: 28px; height: 28px; border-radius: 6px; margin-bottom: 4px; }

.cbss-pv-wire__cta {
  padding: 16px 12px;
  border-radius: 4px;
  text-align: center;
}

.cbss-pv-wire__footer {
  padding: 12px 16px;
  border-radius: 0 0 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Responsive */
@media (max-width: 700px) {
  .cbss-preview-split { flex-direction: column; }
  .cbss-preview-left  { flex: 0 0 200px; min-height: 200px; }
  .cbss-modal--preview { max-height: 98vh; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Full-Site Preview Overlay
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes cbss-fadein { from { opacity: 0; } to { opacity: 1; } }

.cbss-fullpv-overlay {
  position: fixed;
  inset: 0;
  z-index: 199999;
  background: rgba(0, 0, 0, .85);
  display: none;
  align-items: center;
  justify-content: center;
}
.cbss-fullpv-overlay.is-open {
  display: flex;
  animation: cbss-fadein .18s ease;
}

/* Main frame */
.cbss-fullpv-wrap {
  width: 96vw;
  height: 96vh;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 96px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */

.cbss-fullpv-bar {
  height: 52px;
  flex-shrink: 0;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

/* Left section */
.cbss-fullpv-bar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
  max-width: 200px;
}

.cbss-fullpv-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.cbss-fullpv-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.cbss-fullpv-bar__name {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Page tabs (center) */
.cbss-fullpv-bar__pages {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 4px;
}
.cbss-fullpv-bar__pages::-webkit-scrollbar { display: none; }

.cbss-fullpv-page-tab {
  flex-shrink: 0;
  padding: 5px 14px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .14s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.cbss-fullpv-page-tab:hover  { background: rgba(255,255,255,.06); color: #cbd5e1; }
.cbss-fullpv-page-tab.is-active {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.1);
  color: #f1f5f9;
}

/* Right section */
.cbss-fullpv-bar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Viewport switcher */
.cbss-fullpv-vp {
  display: flex;
  align-items: center;
  gap: 1px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 3px;
}

.cbss-fullpv-vp__btn {
  width: 28px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: #475569;
  cursor: pointer;
  transition: all .14s;
}
.cbss-fullpv-vp__btn:hover    { color: #94a3b8; background: rgba(255,255,255,.06); }
.cbss-fullpv-vp__btn.is-active { background: rgba(255,255,255,.12); color: #e2e8f0; }

/* Import button */
.cbss-fullpv-import-btn {
  height: 34px;
  padding: 0 18px;
  background: #2271b1;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.cbss-fullpv-import-btn:hover { background: #135e96; }

/* ── Stage (iframe area) ──────────────────────────────────────────────────── */

.cbss-fullpv-stage {
  flex: 1;
  position: relative;
  background: #cbd5e1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

/* Loading overlay */
.cbss-fullpv-loader {
  position: absolute;
  inset: 0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 5;
}
.cbss-fullpv-loader__text {
  color: #64748b;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cbss-fullpv-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #2271b1;
  border-radius: 50%;
  animation: cbss-spin .7s linear infinite;
}

/* iframe shell — controls viewport width */
.cbss-fullpv-frame-shell {
  flex: 1;
  display: flex;
  align-items: stretch;
  transition: padding .25s ease;
}

/* Tablet & Mobile add padding to show device frame */
.cbss-fullpv-frame-shell.vp-tablet { padding: 16px; background: #cbd5e1; align-items: center; justify-content: center; }
.cbss-fullpv-frame-shell.vp-mobile  { padding: 20px 60px; background: #94a3b8; align-items: center; justify-content: center; }

.cbss-fullpv-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
  transition: opacity .18s, width .25s ease, box-shadow .25s;
}

.cbss-fullpv-frame-shell.vp-tablet .cbss-fullpv-iframe {
  flex: none;
  width: min(768px, 100%);
  height: 100%;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15), 0 12px 40px rgba(0,0,0,.3);
}

.cbss-fullpv-frame-shell.vp-mobile .cbss-fullpv-iframe {
  flex: none;
  width: min(390px, 100%);
  height: 100%;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 16px 50px rgba(0,0,0,.4);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .cbss-fullpv-wrap { width: 100vw; height: 100vh; border-radius: 0; }
  .cbss-fullpv-bar__name { display: none; }
  .cbss-fullpv-vp { display: none; }
}
