/* =========================
   DRAG & DROP SITE BUILDER
   ========================= */

:root {
  --sb-toolbar: 56px;
  --sb-sidebar: 280px;
  --sb-bg: #0a0a0e;
  --sb-surface: #121217;
  --sb-border: rgba(255,255,255,0.06);
}

/* ── Layout ── */
.sb-wrapper {
  padding-top: var(--nav-height);
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--sb-bg);
  overflow: hidden;
}

.sb-toolbar {
  height: var(--sb-toolbar);
  background: rgba(12,12,16,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 50;
}
.sb-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sb-toolbar-left .sb-logo {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.sb-toolbar-left .sb-logo span {
  color: #ff9f0a;
}
.sb-toolbar-left .sb-divider {
  width: 1px;
  height: 24px;
  background: var(--sb-border);
}
.sb-toolbar-left .sb-page-name {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}
.sb-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-toolbar-right button, .sb-toolbar-right a {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
}
.sb-btn-preview {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  border: 1px solid var(--sb-border);
}
.sb-btn-preview:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sb-btn-save {
  background: linear-gradient(135deg, #ff9f0a, #ff6a00);
  color: #000;
  box-shadow: 0 4px 15px rgba(255,159,10,0.2);
}
.sb-btn-save:hover { filter: brightness(1.05); box-shadow: 0 6px 20px rgba(255,159,10,0.3); }
.sb-btn-publish {
  background: rgba(0,200,83,0.12);
  color: #00c853;
  border: 1px solid rgba(0,200,83,0.2);
}
.sb-btn-publish:hover { background: rgba(0,200,83,0.18); }

/* ── Body ── */
.sb-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
.sb-sidebar {
  width: var(--sb-sidebar);
  min-width: var(--sb-sidebar);
  background: rgba(12,12,16,0.6);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 12px;
  gap: 4px;
}
.sb-sidebar::-webkit-scrollbar { width: 4px; }
.sb-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 4px; }

.sb-sidebar-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,159,10,0.5);
  padding: 12px 8px 6px;
}

.sb-draggable {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 500;
  cursor: grab;
  transition: all 0.2s;
  user-select: none;
}
.sb-draggable:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,159,10,0.12);
  color: #fff;
}
.sb-draggable:active { cursor: grabbing; }
.sb-draggable i {
  font-size: 16px;
  color: #ff9f0a;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.sb-draggable.dragging {
  opacity: 0.5;
  background: rgba(255,159,10,0.08);
  border-color: rgba(255,159,10,0.2);
}

/* ── Canvas Area ── */
.sb-canvas-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 30px 20px 80px;
  background: radial-gradient(circle at 50% 30%, #121217, #0a0a0e);
  position: relative;
}
.sb-canvas-wrap::-webkit-scrollbar { width: 6px; }
.sb-canvas-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 4px; }

.sb-canvas {
  width: 100%;
  max-width: 900px;
  min-height: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(255,159,10,0.03);
  position: relative;
  color: #1a1a1a;
  font-family: 'Inter', -apple-system, sans-serif;
}
.sb-canvas.drag-over {
  outline: 2px dashed #ff9f0a;
  outline-offset: -2px;
}

/* ── Empty State ── */
.sb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: #bbb;
  min-height: 400px;
}
.sb-empty i {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 16px;
}
.sb-empty h3 {
  font-size: 18px;
  font-weight: 700;
  color: #555;
  margin: 0 0 6px;
}
.sb-empty p {
  font-size: 13px;
  color: #999;
  margin: 0;
  max-width: 300px;
}

/* ── Canvas Section ── */
.sb-section {
  position: relative;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  min-height: 60px;
}
.sb-section:hover { border-color: #ff9f0a; }
.sb-section.selected {
  border-color: #ff9f0a;
  box-shadow: inset 0 0 0 1px rgba(255,159,10,0.15);
}

.sb-section-tools {
  position: absolute;
  top: -32px;
  right: 0;
  display: none;
  align-items: center;
  gap: 4px;
  background: #ff9f0a;
  border-radius: 8px 8px 0 0;
  padding: 4px 6px;
  z-index: 10;
}
.sb-section:hover .sb-section-tools,
.sb-section.selected .sb-section-tools { display: flex; }

.sb-section-tools button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.15);
  color: #000;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.sb-section-tools button:hover { background: rgba(0,0,0,0.3); }
.sb-section-tools .sb-del { color: #000; }
.sb-section-tools .sb-move-up { color: #000; }
.sb-section-tools .sb-move-down { color: #000; }

/* Drag handle area */
.sb-section-drag {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  cursor: grab;
  background: transparent;
  transition: background 0.2s;
}
.sb-section:hover .sb-section-drag { background: rgba(255,159,10,0.15); }

/* ── Dragover placeholder ── */
.sb-placeholder {
  height: 4px;
  background: #ff9f0a;
  border-radius: 2px;
  margin: 2px 0;
  transition: all 0.2s;
}

/* ── Section block default styles (white canvas) ── */
.sb-section.sb-hero-block { padding: 60px 40px; text-align: center; }
.sb-section.sb-hero-block h1 { font-size: 36px; font-weight: 800; color: #1a1a1a; margin: 0 0 12px; }
.sb-section.sb-hero-block p { font-size: 16px; color: #666; margin: 0 0 24px; max-width: 500px; margin-left: auto; margin-right: auto; }
.sb-section.sb-hero-block .sb-hero-cta { display: inline-block; padding: 12px 32px; background: #ff9f0a; color: #fff; border-radius: 8px; font-weight: 600; font-size: 14px; }

.sb-section.sb-text-block { padding: 40px; }
.sb-section.sb-text-block h2 { font-size: 28px; font-weight: 700; color: #1a1a1a; margin: 0 0 16px; }
.sb-section.sb-text-block p { font-size: 15px; color: #555; line-height: 1.7; margin: 0; }

.sb-section.sb-features-block { padding: 40px; }
.sb-section.sb-features-block h2 { font-size: 28px; font-weight: 700; color: #1a1a1a; text-align: center; margin: 0 0 30px; }
.sb-section.sb-features-block .sb-feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sb-section.sb-features-block .sb-feat-item { padding: 20px; background: #f5f5f5; border-radius: 12px; text-align: center; }
.sb-section.sb-features-block .sb-feat-item i { font-size: 28px; color: #ff9f0a; margin-bottom: 12px; display: block; }
.sb-section.sb-features-block .sb-feat-item h4 { font-size: 15px; font-weight: 700; color: #1a1a1a; margin: 0 0 6px; }
.sb-section.sb-features-block .sb-feat-item p { font-size: 13px; color: #666; margin: 0; }

.sb-section.sb-stats-block { padding: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.sb-section.sb-stats-block .sb-stat-item strong { display: block; font-size: 28px; font-weight: 800; color: #ff9f0a; }
.sb-section.sb-stats-block .sb-stat-item span { font-size: 13px; color: #888; }

.sb-section.sb-image-block { padding: 20px 40px; text-align: center; }
.sb-section.sb-image-block .sb-img-placeholder { width: 100%; max-width: 600px; height: 200px; background: #eee; border-radius: 12px; margin: 0 auto; display: flex; align-items: center; justify-content: center; color: #999; font-size: 14px; border: 2px dashed #ddd; }

.sb-section.sb-contact-block { padding: 40px; }
.sb-section.sb-contact-block h2 { font-size: 28px; font-weight: 700; color: #1a1a1a; text-align: center; margin: 0 0 30px; }
.sb-section.sb-contact-block .sb-contact-form { max-width: 500px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.sb-section.sb-contact-block .sb-contact-form input,
.sb-section.sb-contact-block .sb-contact-form textarea { padding: 12px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit; }
.sb-section.sb-contact-block .sb-contact-form button { padding: 12px; background: #ff9f0a; color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }

.sb-section.sb-footer-block { padding: 30px 40px; text-align: center; border-top: 1px solid #eee; }
.sb-section.sb-footer-block p { font-size: 13px; color: #999; margin: 0; }

.sb-section.sb-pricing-block { padding: 40px; }
.sb-section.sb-pricing-block h2 { font-size: 28px; font-weight: 700; color: #1a1a1a; text-align: center; margin: 0 0 30px; }
.sb-section.sb-pricing-block .sb-price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sb-section.sb-pricing-block .sb-price-card { padding: 24px 16px; background: #f5f5f5; border-radius: 12px; text-align: center; }
.sb-section.sb-pricing-block .sb-price-card h4 { font-size: 16px; font-weight: 700; color: #1a1a1a; margin: 0 0 8px; }
.sb-section.sb-pricing-block .sb-price-card .sb-amount { font-size: 28px; font-weight: 800; color: #ff9f0a; margin: 0 0 12px; }
.sb-section.sb-pricing-block .sb-price-card p { font-size: 13px; color: #666; margin: 0; }

.sb-section.sb-testimonials-block { padding: 40px; }
.sb-section.sb-testimonials-block h2 { font-size: 28px; font-weight: 700; color: #1a1a1a; text-align: center; margin: 0 0 30px; }
.sb-section.sb-testimonials-block .sb-testi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.sb-section.sb-testimonials-block .sb-testi-card { padding: 20px; background: #f5f5f5; border-radius: 12px; }
.sb-section.sb-testimonials-block .sb-testi-card p { font-size: 13px; color: #555; font-style: italic; margin: 0 0 10px; }
.sb-section.sb-testimonials-block .sb-testi-card cite { font-size: 12px; color: #999; font-style: normal; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sb-sidebar { width: 220px; min-width: 220px; }
}
@media (max-width: 768px) {
  .sb-sidebar { display: none; }
  .sb-canvas { max-width: 100%; border-radius: 0; }
  .sb-canvas-wrap { padding: 16px 10px 60px; }
  .sb-section.sb-hero-block { padding: 40px 20px; }
  .sb-section.sb-hero-block h1 { font-size: 26px; }
  .sb-section.sb-features-block .sb-feat-grid { grid-template-columns: 1fr; }
  .sb-section.sb-stats-block { grid-template-columns: repeat(2, 1fr); }
  .sb-section.sb-pricing-block .sb-price-grid { grid-template-columns: 1fr; }
  .sb-section.sb-testimonials-block .sb-testi-grid { grid-template-columns: 1fr; }
  .sb-toolbar { padding: 0 12px; }
  .sb-toolbar-right button { padding: 6px 12px; font-size: 11px; }
}

/* ── Iframe Mode Overrides ── */
.in-iframe #nav, 
.in-iframe footer, 
.in-iframe .cookie-banner,
.in-iframe #ajFab,
.in-iframe #ajFabMobile {
  display: none !important;
}
.in-iframe .sb-wrapper {
  padding-top: 0 !important;
  height: 100vh !important;
}

