:root {
  --pb-accent: #2563eb;
  --pb-accent-soft: rgba(37, 99, 235, 0.14);
  --pb-grid-color: rgba(37, 99, 235, 0.08);
}

[data-builder-root] {
  position: relative;
}

.pb-layout-managed {
  will-change: transform, width, height;
}

.pb-custom-layer {
  position: absolute;
  inset: 0;
  z-index: 950;
  pointer-events: none;
}

.pb-custom-element {
  position: absolute;
  pointer-events: auto;
  overflow: hidden;
}

.pb-custom-card,
.pb-custom-section,
.pb-custom-gallery,
.pb-custom-button,
.pb-custom-image,
.pb-custom-spacer {
  width: 100%;
  height: 100%;
}

.pb-custom-card,
.pb-custom-section,
.pb-custom-gallery {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
  padding: 1.4rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(14, 55, 70, 0.1);
  box-shadow: 0 18px 44px rgba(8, 42, 54, 0.12);
  color: var(--dark);
}

.pb-custom-heading,
.pb-custom-text,
.pb-custom-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
}

.pb-custom-heading span,
.pb-custom-text span,
.pb-custom-button span {
  max-width: 100%;
  word-break: break-word;
}

.pb-custom-button a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.95rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  color: var(--white);
  background: var(--primary);
  box-shadow: 0 10px 26px rgba(8, 42, 54, 0.22);
}

.pb-custom-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}

.pb-custom-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  height: 100%;
}

.pb-custom-gallery-grid img {
  width: 100%;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  border-radius: 16px;
}

.pb-custom-spacer {
  border: 2px dashed rgba(14, 55, 70, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(201, 164, 106, 0.12), rgba(14, 55, 70, 0.08));
}

body.pb-preview-mode .pb-custom-layer {
  pointer-events: none;
}

body.pb-preview-mode .pb-custom-element,
body.pb-preview-mode [data-builder-id] {
  cursor: move;
}

body.pb-preview-mode a[data-builder-id],
body.pb-preview-mode [data-builder-id] a {
  pointer-events: auto;
}

body.pb-preview-mode [data-builder-root]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  background-image:
    linear-gradient(to right, var(--pb-grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--pb-grid-color) 1px, transparent 1px);
  background-size: var(--pb-grid-size, 20px) var(--pb-grid-size, 20px);
  z-index: 940;
}

body.pb-preview-mode[data-grid-enabled="1"] [data-builder-root]::before {
  opacity: 1;
}

.pb-selection-box {
  position: absolute;
  display: none;
  border: 2px solid var(--pb-accent);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7), 0 10px 35px rgba(37, 99, 235, 0.18);
  pointer-events: none;
  z-index: 9999;
}

.pb-selection-box.is-visible {
  display: block;
}

.pb-selection-box .pb-selection-label {
  position: absolute;
  top: -34px;
  left: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--pb-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pb-selection-box .pb-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--pb-accent);
  pointer-events: auto;
}

.pb-selection-box .pb-handle[data-resize-handle="nw"] {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}

.pb-selection-box .pb-handle[data-resize-handle="ne"] {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}

.pb-selection-box .pb-handle[data-resize-handle="sw"] {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}

.pb-selection-box .pb-handle[data-resize-handle="se"] {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

body.pb-preview-mode .pb-is-selected {
  outline: 2px dashed rgba(37, 99, 235, 0.55);
  outline-offset: 6px;
}

