/**
 * ToonedUp Cartoon generator styles.
 *
 * @package DevsEye\ToonedUp
 */

.de-toonedup-generator {
	margin: 0 0 1.5em;
}

.de-toonedup-heading {
	margin: 0 0 0.5em;
	font-size: 1.1em;
}

.de-toonedup-hint {
	margin: 0 0 0.75em;
	font-size: 0.9em;
	opacity: 0.8;
}

.de-toonedup-file-label {
	display: inline-block;
	margin: 0 0 0.75em;
}

.de-toonedup-consent {
	display: flex;
	gap: 0.5em;
	align-items: flex-start;
	margin: 0 0 1em;
	font-size: 0.9em;
	line-height: 1.4;
}

.de-toonedup-message {
	margin: 0.75em 0 0;
	font-size: 0.9em;
}

.de-toonedup-message-error {
	color: #b32d2e;
}

.de-toonedup-styles {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 140px, 1fr ) );
	gap: 1em;
	margin: 0 0 1em;
	padding: 0;
	list-style: none;
}

.de-toonedup-style {
	margin: 0;
	padding: 0.5em;
	border: 2px solid transparent;
	border-radius: 6px;
	text-align: center;
}

.de-toonedup-style-selected {
	border-color: #2271b1;
	background: rgba( 34, 113, 177, 0.06 );
}

.de-toonedup-style-preview {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	border-radius: 4px;

	/* A checkerboard makes a transparent background visible rather than reading as white. */
	background-color: #fff;
	background-image:
		linear-gradient( 45deg, rgba( 0, 0, 0, 0.06 ) 25%, transparent 25% ),
		linear-gradient( -45deg, rgba( 0, 0, 0, 0.06 ) 25%, transparent 25% ),
		linear-gradient( 45deg, transparent 75%, rgba( 0, 0, 0, 0.06 ) 75% ),
		linear-gradient( -45deg, transparent 75%, rgba( 0, 0, 0, 0.06 ) 75% );
	background-size: 16px 16px;
	background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.de-toonedup-style-image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.de-toonedup-style-error {
	margin: 0;
	padding: 0.5em;
	font-size: 0.8em;
	color: #b32d2e;
}

.de-toonedup-style-label {
	margin: 0.5em 0;
	font-size: 0.9em;
	font-weight: 600;
}

.de-toonedup-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid rgba( 0, 0, 0, 0.15 );
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: de-toonedup-spin 0.9s linear infinite;
}

@keyframes de-toonedup-spin {

	to {
		transform: rotate( 360deg );
	}
}

.de-toonedup-note {
	margin: 0;
	font-size: 0.85em;
	opacity: 0.75;
}

.de-toonedup-cart-thumb {
	max-width: 100%;
	height: auto;
}

.de-toonedup-style-image {
	cursor: zoom-in;
}

.de-toonedup-style-zoom[hidden] {
	display: none;
}

.de-toonedup-style-zoom {
	display: block;
	margin: 0.25em 0 0;
	font-size: 0.75em;
	opacity: 0.7;
}

.de-toonedup-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75em;
	padding: 4vmin;
	background: rgba( 0, 0, 0, 0.85 );
	cursor: zoom-out;
}

.de-toonedup-lightbox img {
	background-color: #fff;
	background-image:
		linear-gradient( 45deg, rgba( 0, 0, 0, 0.06 ) 25%, transparent 25% ),
		linear-gradient( -45deg, rgba( 0, 0, 0, 0.06 ) 25%, transparent 25% ),
		linear-gradient( 45deg, transparent 75%, rgba( 0, 0, 0, 0.06 ) 75% ),
		linear-gradient( -45deg, transparent 75%, rgba( 0, 0, 0, 0.06 ) 75% );
	background-size: 22px 22px;
	background-position: 0 0, 0 11px, 11px -11px, -11px 0;
	max-width: min( 92vw, 900px );
	max-height: 80vh;
	width: auto;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.5 );
	cursor: default;
}

.de-toonedup-lightbox-caption {
	margin: 0;
	color: #fff;
	font-size: 1em;
	font-weight: 600;
}

.de-toonedup-lightbox-close {
	position: absolute;
	top: 2vmin;
	right: 3vmin;
	width: 2em;
	height: 2em;
	padding: 0;
	font-size: 1.6em;
	line-height: 1;
	color: #fff;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.de-toonedup-email-gate {
	margin: 1em 0 0;
	padding: 1em;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 6px;
	background: rgba( 0, 0, 0, 0.02 );
}

.de-toonedup-email-intro {
	margin: 0 0 0.75em;
	font-size: 0.9em;
}

.de-toonedup-email-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0 0 0.5em;
}

.de-toonedup-email-row input {
	flex: 1 1 12em;
	min-width: 0;
}

.de-toonedup-email-message {
	margin: 0;
	font-size: 0.85em;
}

.de-toonedup-advice {
	margin: 0 0 1em;
	padding: 0.85em 1em;
	font-size: 0.9em;
	line-height: 1.6;
	background: rgba( 34, 113, 177, 0.07 );
	border-left: 3px solid #2271b1;
	border-radius: 4px;
}

/* Working panel: a two minute wait needs to look like progress, not a stall. */
.de-toonedup-working {
	display: flex;
	gap: 0.9em;
	align-items: flex-start;
	margin: 1em 0 1.25em;
	padding: 1.1em 1.2em;
	background: linear-gradient( 135deg, rgba( 255, 107, 53, 0.09 ), rgba( 255, 154, 60, 0.05 ) );
	border: 1px solid rgba( 255, 107, 53, 0.28 );
	border-radius: 10px;
}

.de-toonedup-working-spinner {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	border: 3px solid rgba( 255, 107, 53, 0.25 );
	border-top-color: #ff6b35;
	border-radius: 50%;
	animation: de-toonedup-spin 0.9s linear infinite;
}

.de-toonedup-working-body {
	display: flex;
	flex-direction: column;
	gap: 0.3em;
}

.de-toonedup-working strong {
	font-size: 1.02em;
	line-height: 1.4;
}

.de-toonedup-working-note {
	font-size: 0.9em;
	line-height: 1.6;
	opacity: 0.85;
}

.de-toonedup-working-tip {
	font-size: 0.85em;
	font-style: italic;
	opacity: 0.75;
	animation: de-toonedup-fade 0.6s ease;
}

@keyframes de-toonedup-fade {

	from {
		opacity: 0;
		transform: translateY( 3px );
	}

	to {
		opacity: 0.75;
		transform: none;
	}
}

.de-toonedup-choose {
	width: 100%;
	padding: 0.7em 0.5em;
	font-size: 0.82em;
	line-height: 1.3;
	white-space: normal;
	hyphens: none;
}

@media ( min-width: 480px ) {

	.de-toonedup-choose {
		font-size: 0.86em;
	}
}

.de-toonedup-optional-toggle {
	display: flex;
	gap: 0.6em;
	align-items: center;
	margin: 0 0 1em;
	padding: 0.85em 1em;
	font-size: 0.95em;
	background: rgba( 20, 20, 40, 0.04 );
	border-radius: 8px;
	cursor: pointer;
}

.de-toonedup-area-title {
	margin: 0 0 0.75em;
	font-size: 1em;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.7;
}

.de-toonedup-generator + .de-toonedup-generator {
	margin-top: 1.5em;
	padding-top: 1.5em;
	border-top: 1px solid rgba( 20, 20, 40, 0.1 );
}

/* Background colour chooser, shown once artwork exists on products that offer it. */
.de-toonedup-backdrop {
	margin: 12px 0 0;
}

.de-toonedup-backdrop-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.de-toonedup-backdrop-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}

.de-toonedup-backdrop-colour {
	width: 46px;
	height: 32px;
	padding: 0;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
	border-radius: 4px;
	cursor: pointer;
	background: none;
}

.de-toonedup-backdrop-hint {
	font-size: 13px;
	opacity: 0.75;
}
