/**
 * codeSelector. v1.3.0 — Estilos del Puente Visual-Código, Edición de Texto/Enlaces y Editor de Imágenes/Carruseles
 * Identidad visual Marketincode (#0A0A0A, #1A1A1A, #FFFFFF, #25D366, #27272A)
 */

.codeselector-canvas {
	position: relative;
}

/* Congelar animaciones CSS (marquesinas/carruseles infinitos) mientras se edita un texto o imagen en vivo */
body.cs-live-editing-lock .codeselector-canvas,
body.cs-live-editing-lock .codeselector-canvas * {
	animation-play-state: paused !important;
}

/* Pulso visual cuando se sincroniza un elemento con 1 clic o desde el código */
.cs-target-matched {
	outline: 2px solid #25D366 !important;
	outline-offset: 3px !important;
	box-shadow: 0 0 0 6px rgba(37, 211, 102, 0.22) !important;
	transition: outline 0.15s ease, box-shadow 0.15s ease !important;
}

/* Modo de edición de texto en vivo directamente en el preview */
.cs-inline-editing {
	outline: 2px solid #25D366 !important;
	outline-offset: 4px !important;
	box-shadow: 0 0 0 6px rgba(37, 211, 102, 0.25), 0 8px 24px rgba(0, 0, 0, 0.45) !important;
	border-radius: 4px !important;
	cursor: text !important;
	caret-color: #25D366 !important;
}

/* Barra flotante superior sobre el elemento que se está editando en vivo (soporta edición de enlaces href) */
#cs-inline-edit-toolbar {
	position: fixed;
	z-index: 999998;
	display: none;
	flex-direction: column;
	gap: 6px;
	background: #0A0A0A;
	color: #FFFFFF;
	border: 1px solid #25D366;
	border-radius: 9px;
	padding: 6px 11px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 11px;
	font-weight: 600;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.78);
	pointer-events: auto;
	white-space: nowrap;
}

#cs-inline-edit-toolbar.is-active {
	display: inline-flex;
}

#cs-inline-edit-toolbar .cs-iet-top {
	display: flex;
	align-items: center;
	gap: 8px;
}

#cs-inline-edit-toolbar .cs-iet-green {
	color: #25D366;
}

#cs-inline-edit-toolbar .cs-iet-hint {
	color: #A1A1AA;
	font-weight: 400;
	font-size: 10px;
}

#cs-inline-edit-toolbar .cs-iet-line {
	font-family: monospace;
	font-size: 10px;
	background: #25D366;
	color: #0A0A0A;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 4px;
}

/* Fila adicional en la barra flotante cuando el elemento editado es un enlace <a> */
#cs-inline-edit-toolbar .cs-iet-link-row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding-top: 5px;
	border-top: 1px solid #27272A;
}

#cs-inline-edit-toolbar .cs-iet-link-label {
	font-family: monospace;
	font-size: 10px;
	color: #25D366;
}

#cs-inline-edit-toolbar .cs-iet-link-input {
	background: #141414;
	color: #FFFFFF;
	border: 1px solid #27272A;
	border-radius: 5px;
	padding: 3px 7px;
	font-family: monospace;
	font-size: 11px;
	width: 210px;
	outline: none;
}

#cs-inline-edit-toolbar .cs-iet-link-input:focus {
	border-color: #25D366;
}

#cs-inline-edit-toolbar .cs-iet-save-btn {
	background: #25D366;
	color: #0A0A0A;
	border: 0;
	border-radius: 5px;
	padding: 3px 8px;
	font-size: 10px;
	font-weight: 700;
	cursor: pointer;
}

/* Popover Flotante para Edición de Imágenes y Carruseles (#cs-image-edit-popover) */
#cs-image-edit-popover {
	position: fixed;
	z-index: 999999;
	display: none;
	flex-direction: column;
	gap: 10px;
	width: 350px;
	max-width: calc(100vw - 24px);
	background: #0A0A0A;
	color: #FFFFFF;
	border: 1px solid #25D366;
	border-radius: 12px;
	padding: 12px 14px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 11px;
	box-shadow: 0 18px 42px rgba(0, 0, 0, 0.85);
	pointer-events: auto;
}

#cs-image-edit-popover.is-active {
	display: flex;
}

.cs-iep-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-bottom: 8px;
	border-bottom: 1px solid #27272A;
}

.cs-iep-title {
	font-weight: 700;
	font-size: 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.cs-iep-title span {
	color: #25D366;
}

.cs-iep-close {
	background: #1A1A1A;
	color: #A1A1AA;
	border: 1px solid #27272A;
	border-radius: 6px;
	width: 22px;
	height: 22px;
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cs-iep-close:hover {
	color: #FFFFFF;
	border-color: #25D366;
}

/* Selector de Slides cuando la imagen pertenece a un Carrusel o Galería */
.cs-iep-carousel-bar {
	background: #141414;
	border: 1px solid #27272A;
	border-radius: 8px;
	padding: 7px 9px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cs-iep-carousel-label {
	font-size: 10px;
	color: #A1A1AA;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.cs-iep-carousel-label strong {
	color: #25D366;
}

.cs-iep-slides-strip {
	display: flex;
	align-items: center;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 2px;
}

.cs-iep-slide-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #0A0A0A;
	color: #A1A1AA;
	border: 1px solid #27272A;
	border-radius: 6px;
	padding: 3px 7px;
	font-family: monospace;
	font-size: 10px;
	cursor: pointer;
	flex: 0 0 auto;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.cs-iep-slide-btn img {
	width: 22px;
	height: 16px;
	object-fit: cover;
	border-radius: 3px;
}

.cs-iep-slide-btn:hover,
.cs-iep-slide-btn.is-current {
	border-color: #25D366;
	color: #FFFFFF;
	background: rgba(37, 211, 102, 0.14);
}

.cs-iep-wpmedia-btn {
	width: 100%;
	background: rgba(37, 211, 102, 0.14);
	color: #25D366;
	border: 1px solid #25D366;
	border-radius: 8px;
	padding: 7px 10px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: background 0.18s ease, color 0.18s ease;
}

.cs-iep-wpmedia-btn:hover {
	background: #25D366;
	color: #0A0A0A;
}

.cs-iep-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cs-iep-field label {
	font-size: 10px;
	color: #A1A1AA;
	font-family: monospace;
}

.cs-iep-input {
	width: 100%;
	background: #141414;
	color: #FFFFFF;
	border: 1px solid #27272A;
	border-radius: 6px;
	padding: 6px 8px;
	font-family: monospace;
	font-size: 11px;
	outline: none;
	box-sizing: border-box;
}

.cs-iep-input:focus {
	border-color: #25D366;
}

.cs-iep-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 2px;
}

.cs-iep-save {
	background: #25D366;
	color: #0A0A0A;
	border: 0;
	border-radius: 6px;
	padding: 6px 14px;
	font-size: 11px;
	font-weight: 800;
	cursor: pointer;
}

/* Tooltip flotante de confirmación en el lienzo de vista previa */
#cs-preview-toast {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 8px;
	background: #0A0A0A;
	color: #FFFFFF;
	border: 1px solid #25D366;
	border-radius: 99px;
	padding: 8px 14px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 12px;
	font-weight: 600;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
	pointer-events: none;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

#cs-preview-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

#cs-preview-toast .cs-toast-brand-selector {
	color: #25D366;
}

#cs-preview-toast .cs-toast-line {
	font-family: monospace;
	font-size: 11px;
	background: #25D366;
	color: #0A0A0A;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 99px;
}

/* Prompt rápido de imagen (1x Clic): "¿Quieres cambiar esta imagen?" */
#cs-image-quick-prompt {
	position: fixed;
	z-index: 999998;
	display: none;
	align-items: center;
	gap: 10px;
	background: #0A0A0A;
	color: #FFFFFF;
	border: 1px solid #25D366;
	border-radius: 8px;
	padding: 6px 10px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 11px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: auto;
}

#cs-image-quick-prompt.is-active {
	display: flex;
	opacity: 1;
	transform: translateY(0);
}

.cs-iqp-text {
	font-weight: 600;
	color: #FFFFFF;
	white-space: nowrap;
}

.cs-iqp-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.cs-iqp-btn {
	border: 0;
	border-radius: 5px;
	cursor: pointer;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	transition: background 0.15s ease, transform 0.1s ease;
}

.cs-iqp-btn-change {
	background: #25D366;
	color: #0A0A0A;
	padding: 4px 10px;
}

.cs-iqp-btn-change:hover {
	background: #20BA5A;
}

.cs-iqp-btn-close {
	background: #1F1F23;
	color: #A1A1AA;
	padding: 4px 7px;
	font-size: 10px;
}

.cs-iqp-btn-close:hover {
	background: #27272A;
	color: #FFFFFF;
}

/* Toast flotante para avisar de funciones Pro */
#cs-pro-locked-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 10px;
	background: #0A0A0A;
	color: #FFFFFF;
	border: 1px solid #EAB308;
	border-radius: 99px;
	padding: 8px 16px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

#cs-pro-locked-toast.is-active {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

#cs-pro-locked-toast .cs-plt-upgrade-btn {
	display: inline-flex;
	align-items: center;
	margin-left: 8px;
	padding: 5px 12px;
	background: #00E676;
	color: #0A0A0A;
	font-weight: 700;
	font-size: 11px;
	border-radius: 99px;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0, 230, 118, 0.4);
	transition: background 0.15s ease, transform 0.1s ease;
}

#cs-pro-locked-toast .cs-plt-upgrade-btn:hover {
	background: #25D366;
	transform: scale(1.04);
}

#cs-pro-locked-toast .cs-plt-icon {
	font-size: 14px;
}

#cs-pro-locked-toast .cs-plt-body {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

#cs-pro-locked-toast strong {
	color: #FACC15;
	font-weight: 700;
	font-size: 12px;
}

#cs-pro-locked-toast span {
	color: #A1A1AA;
	font-size: 10px;
}

