/* Damn Good Background Removal - shared admin + front-end styles */

.dgbr-app {
  --dgbr-ink: #14161a;
  --dgbr-muted: #6b7280;
  --dgbr-line: #e4e6eb;
  --dgbr-accent: #ff4d2d;
  --dgbr-radius: 14px;

  margin: 20px 0;
  max-width: 900px;
  color: var(--dgbr-ink);
  font-size: 15px;
  line-height: 1.55;
}

.dgbr-wrap .dgbr-lede {
  max-width: 700px;
  color: #50575e;
}

.dgbr-file {
  display: none;
}

.dgbr-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 20px;
  border: 2px dashed var(--dgbr-line);
  border-radius: var(--dgbr-radius);
  background: #fafafa;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.dgbr-drop:hover,
.dgbr-drop.is-over {
  border-color: var(--dgbr-accent);
  background: #fff5f2;
}

.dgbr-drop__icon {
  font-size: 26px;
  line-height: 1;
}

.dgbr-drop__hint {
  color: var(--dgbr-muted);
  font-size: 13px;
}

.dgbr-status {
  margin: 14px 0 0;
  min-height: 22px;
  font-weight: 600;
}

.dgbr-status.is-error { color: #b3261e; }
.dgbr-status.is-success { color: #1a7f37; }

.dgbr-app.is-busy .dgbr-status::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: dgbr-spin .7s linear infinite;
}

@keyframes dgbr-spin { to { transform: rotate(360deg); } }

.dgbr-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.dgbr-figure {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--dgbr-line);
  border-radius: var(--dgbr-radius);
  background: #fff;
  text-align: center;
}

.dgbr-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
}

.dgbr-figure figcaption {
  margin-top: 8px;
  color: var(--dgbr-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.dgbr-figure--checker img {
  background-image:
    linear-gradient(45deg, #eceff3 25%, transparent 25%),
    linear-gradient(-45deg, #eceff3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eceff3 75%),
    linear-gradient(-45deg, transparent 75%, #eceff3 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.dgbr-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--dgbr-muted);
  font-size: 13px;
}

.dgbr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.dgbr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--dgbr-line);
  border-radius: 999px;
  background: #fff;
  color: var(--dgbr-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.dgbr-btn:hover { border-color: #c9ccd3; }

.dgbr-btn--primary {
  border-color: var(--dgbr-accent);
  background: var(--dgbr-accent);
  color: #fff;
}

.dgbr-btn--primary:hover { background: #e63f21; color: #fff; }
.dgbr-btn--ghost { border-style: dashed; color: var(--dgbr-muted); }
.dgbr-btn[disabled] { opacity: .6; cursor: not-allowed; }

.dgbr-tips {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: var(--dgbr-radius);
  background: #f6f7f9;
}

.dgbr-tips h4 { margin: 0 0 8px; font-size: 14px; }
.dgbr-tips ul { margin: 0; padding-left: 18px; color: #4b5563; font-size: 14px; }

.dgbr-credit {
  margin-top: 12px;
  color: var(--dgbr-muted);
  font-size: 12px;
}

.dgbr-credit a {
  color: inherit;
  text-decoration: underline;
}

.dgbr-credit a:hover {
  color: var(--dgbr-accent, #ff4d2d);
}

/* Badge shown next to processed media files */
.dgbr-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #14161a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* Admin cards */
.dgbr-card {
  max-width: 760px;
  margin: 16px 0;
  padding: 18px 22px;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  background: #fff;
}

.dgbr-card h2 { margin-top: 0; }
.dgbr-list { margin: 0; padding-left: 18px; }
.dgbr-card ul.dgbr-list { list-style: disc; }

/* Front-end product block */
.dgbr-frontend {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid #e4e6eb;
  border-radius: 16px;
  background: #fff;
}

.dgbr-frontend__title { margin: 0 0 4px; font-size: 18px; }
.dgbr-frontend__lede { margin: 0; color: #6b7280; font-size: 14px; }

/* Native WooCommerce "Legg i handlekurv" button: hidden by dgbr-frontend.js
 * once the tool's own one-click add-to-cart flow is wired up. Only ever
 * applied by JS so a script/module failure leaves it as a working fallback. */
.dgbr-native-cta-hidden {
	display: none !important;
}

/* ---------------------------------------------------------------------------
 * Step-by-step editor (Steg 1-4)
 * ------------------------------------------------------------------------ */

.dgbr-step {
	margin: 0 0 24px;
	padding: 18px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	background: #fff;
}

.dgbr-step.is-hidden,
.is-hidden {
	display: none;
}

.dgbr-step__title {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 700;
}

.dgbr-privacy {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 12px 0 0;
	font-size: 12px;
	color: #4b5563;
}

.dgbr-privacy span::before {
	content: "🔒 ";
}

.dgbr-stage {
	position: relative;
	max-height: 520px;
	overflow: auto;
	border-radius: 10px;
	padding: 12px;
	text-align: center;
}

.dgbr-stage--checker {
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
		linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
		linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
	background-size: 18px 18px;
	background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.dgbr-stage--dark {
	background: #14161a;
}

.dgbr-stage--light {
	background: #f4f4f5;
}

.dgbr-stage.is-painting {
	cursor: crosshair;
}

.dgbr-canvas {
	display: inline-block;
	max-width: none;
	height: auto;
	touch-action: none;
}

.dgbr-switch {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.dgbr-chip {
	display: inline-block;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #fff;
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 12px;
	font-family: inherit;
	line-height: 1.4;
	white-space: nowrap;
	cursor: pointer;
	/* Explicit + !important: some themes apply global button resets (e.g.
	 * gradient/clip-path text effects via background-clip + transparent
	 * text-fill-color) that otherwise leave these pills visually empty. */
	color: var(--dgbr-ink, #14161a) !important;
	opacity: 1 !important;
	text-shadow: none !important;
	text-indent: 0 !important;
	background-clip: border-box !important;
	-webkit-background-clip: border-box !important;
	-webkit-text-fill-color: currentColor !important;
}

.dgbr-chip.is-active {
	background: #111827;
	border-color: #111827;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

.dgbr-tools {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
	margin-top: 16px;
}

.dgbr-tool {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 12px;
}

.dgbr-tool__label {
	font-weight: 600;
}

.dgbr-tool__hint {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 4px;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.08);
	color: var(--dgbr-muted, #6b7280);
	font-size: 10px;
	font-weight: 700;
	font-style: normal;
	cursor: help;
	vertical-align: middle;
}

.dgbr-tool__hint:hover,
.dgbr-tool__hint:focus-visible {
	background: var(--dgbr-accent, #ff4d2d);
	color: #fff;
	outline: none;
}

.dgbr-tool input[type="range"] {
	width: 100%;
}

.dgbr-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
	margin-bottom: 16px;
}

.dgbr-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
}

.dgbr-field--check {
	flex-direction: row;
	align-items: center;
	gap: 8px;
}

.dgbr-field__hint {
	color: var(--dgbr-muted, #6b7280);
	font-size: 11px;
	font-weight: 400;
}

.dgbr-field input[type="number"] {
	padding: 8px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	width: 100%;
}

.dgbr-field__label {
	font-weight: 600;
}

.dgbr-panel {
	border-radius: 10px;
	padding: 14px;
	margin-bottom: 14px;
	background: #f8fafc;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.dgbr-panel.is-ok {
	background: #ecfdf5;
	border-color: #a7f3d0;
}

.dgbr-panel.is-warn {
	background: #fff7ed;
	border-color: #fed7aa;
}

.dgbr-panel__head {
	margin: 0 0 10px;
	font-weight: 700;
}

.dgbr-panel__list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
}

.dgbr-panel__list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
	border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.dgbr-panel__list li:last-child {
	border-bottom: 0;
}

.dgbr-price {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 800;
}

.dgbr-price strong {
	font-weight: 800;
}

.dgbr-price--net {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 600;
	color: var(--dgbr-muted, #6b7280);
}
