/**
 * Blue Billywig — CTA editor (ADO #18532).
 * Injected inside the slide-in edit drawer (#18529).
 */

.bb-cta-editor {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--bb-drawer-border, #e0e0e0);
}
.bb-cta-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.bb-cta-editor__header h3 {
    font-size: 14px;
    margin: 0;
    font-weight: 600;
}
.bb-cta-editor__tabs {
    display: inline-flex;
    border: 1px solid var(--bb-drawer-border, #e0e0e0);
    border-radius: 6px;
    overflow: hidden;
}
.bb-cta-editor__tab {
    background: #fff;
    border: 0;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    color: var(--bb-drawer-muted, #6b6b7b);
    border-right: 1px solid var(--bb-drawer-border, #e0e0e0);
}
.bb-cta-editor__tab:last-child { border-right: 0; }
.bb-cta-editor__tab.is-active {
    background: var(--bb-drawer-primary, #2271b1);
    color: #fff;
}

.bb-cta-editor__hint {
    margin: 8px 0;
    font-size: 12px;
    color: var(--bb-drawer-muted, #6b6b7b);
    font-style: italic;
}

/* --- Canvas --- */
.bb-cta-editor__canvas-wrap { margin-bottom: 12px; }
.bb-cta-editor__canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111 center/cover no-repeat;
    background-image: linear-gradient(135deg, #222 0%, #444 100%);
    border-radius: 4px;
    overflow: hidden;
    user-select: none;
}
.bb-cta-editor__widget {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    box-sizing: border-box;
    font-weight: 600;
    text-align: center;
    white-space: pre-line;
    padding: 4px 8px;
    overflow: hidden;
    line-height: 1.2;
}
.bb-cta-editor__widget:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.bb-cta-editor__widget-text {
    pointer-events: none;
    max-width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
}
.bb-cta-editor__handle--se {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid var(--bb-drawer-primary, #2271b1);
    border-radius: 3px;
    cursor: se-resize;
}
.bb-cta-editor__canvas-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--bb-drawer-muted, #6b6b7b);
    font-style: italic;
}

/* --- Form --- */
.bb-cta-editor__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bb-cta-editor__group {
    border: 1px solid var(--bb-drawer-border, #e0e0e0);
    border-radius: 4px;
    padding: 8px 12px 10px;
    background: #fafafc;
    margin: 0;
}
.bb-cta-editor__group legend {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bb-drawer-muted, #6b6b7b);
    padding: 0 4px;
}
.bb-cta-editor__row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}
.bb-cta-editor__row:last-child { margin-bottom: 0; }
.bb-cta-editor__row .bb-edit-drawer__field { min-width: 0; }
.bb-cta-editor__form input[type="color"] {
    width: 100%;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--bb-drawer-border, #e0e0e0);
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}
.bb-cta-editor__form input[type="range"] {
    width: 100%;
}
.bb-cta-editor__form output {
    font-size: 11px;
    color: var(--bb-drawer-muted, #6b6b7b);
    margin-left: 4px;
}

/* --- Footer --- */
.bb-cta-editor__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--bb-drawer-border, #e0e0e0);
}
.bb-cta-editor__save { margin-left: auto; }
.bb-cta-editor__delete { order: -1; }
.bb-cta-editor__status {
    font-size: 12px;
    color: var(--bb-drawer-muted, #6b6b7b);
    min-width: 80px;
}
.bb-cta-editor__status[data-kind="success"] { color: #15723a; }
.bb-cta-editor__status[data-kind="error"]   { color: var(--bb-drawer-danger, #b72323); }

/* Image picker mini-browser */
.bb-cta-editor__image-picker summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.bb-cta-editor__image-search {
    width: 100%;
    padding: 6px 8px;
    margin: 6px 0;
    border: 1px solid var(--bb-drawer-border, #e0e0e0);
    border-radius: 4px;
    font: inherit;
    font-size: 12px;
    box-sizing: border-box;
}
.bb-cta-editor__image-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
}
.bb-cta-editor__image-result {
    border: 2px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
    background: #000;
    overflow: hidden;
    text-align: center;
}
.bb-cta-editor__image-result:hover,
.bb-cta-editor__image-result:focus {
    border-color: var(--bb-drawer-primary, #1e4ad4);
}
.bb-cta-editor__image-result img {
    width: 100%;
    height: 50px;
    object-fit: cover;
    display: block;
}
.bb-cta-editor__image-result span {
    display: block;
    font-size: 9px;
    color: #888;
    padding: 2px;
}
.bb-cta-editor__image-id-input {
    width: 120px;
}
