/**
 * Shared attachment uploader (My Account + admin).
 * Resets theme .button styles that otherwise paint white blocks.
 */

.dc-uploader {
	--dc-up-border: color-mix(in srgb, currentColor 18%, transparent);
	--dc-up-soft: color-mix(in srgb, currentColor 6%, transparent);
	--dc-up-soft-2: color-mix(in srgb, currentColor 10%, transparent);
	--dc-up-muted: color-mix(in srgb, currentColor 58%, transparent);
	--dc-up-danger: #e07070;
	--dc-up-danger-soft: color-mix(in srgb, #e07070 22%, transparent);
	box-sizing: border-box;
	width: 100%;
	color: inherit;
}

.dc-uploader *,
.dc-uploader *::before,
.dc-uploader *::after {
	box-sizing: border-box;
}

.dc-uploader__toolbar {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.55rem;
}

.dc-uploader__title {
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
}

.dc-uploader__count {
	font-size: 0.78rem;
	color: var(--dc-up-muted);
	font-variant-numeric: tabular-nums;
}

.dc-uploader__drop {
	margin: 0 0 0.75rem;
	padding: 1.15rem 1rem;
	border: 1.5px dashed var(--dc-up-border);
	border-radius: 12px;
	background: var(--dc-up-soft);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.dc-uploader__drop:hover {
	border-color: color-mix(in srgb, currentColor 32%, transparent);
	background: var(--dc-up-soft-2);
}

.dc-uploader.is-dragover .dc-uploader__drop,
.dc-uploader.is-dragover .dc-uploader__stage {
	border-color: color-mix(in srgb, currentColor 42%, transparent);
	background: var(--dc-up-soft-2);
}

.dc-uploader__drop[hidden] {
	display: none !important;
}

.dc-uploader__drop-title {
	margin: 0 0 0.25rem;
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
}

.dc-uploader__drop-hint {
	margin: 0;
	font-size: 0.78rem;
	color: var(--dc-up-muted);
}

/* Tiles + add control share one grid */
.dc-uploader__stage {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr));
	gap: 0.7rem;
	margin: 0 0 0.35rem;
	align-items: stretch;
}

.dc-uploader__grid {
	display: contents;
}

.dc-uploader__tile {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 0.35rem;
	border: 1px solid var(--dc-up-border);
	border-radius: 12px;
	background: var(--dc-up-soft);
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.dc-uploader__tile.is-removed {
	opacity: 0.4;
}

.dc-uploader__tile.is-removed::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: 12px;
	background: repeating-linear-gradient(
		-45deg,
		transparent,
		transparent 5px,
		var(--dc-up-danger-soft) 5px,
		var(--dc-up-danger-soft) 10px
	);
	pointer-events: none;
}

/* Kill theme button chrome (Woodmart / Woo white blocks) */
.dc-uploader button.dc-uploader__remove,
.dc-account-cashback .dc-uploader button.dc-uploader__remove,
.dc-admin-wrap .dc-uploader button.dc-uploader__remove {
	position: absolute;
	top: 0.45rem;
	right: 0.45rem;
	z-index: 3;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 1.5rem !important;
	height: 1.5rem !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid color-mix(in srgb, #000 35%, transparent) !important;
	border-radius: 999px !important;
	background: color-mix(in srgb, #0a0a0a 72%, transparent) !important;
	color: #f5f5f5 !important;
	font-size: 0 !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-shadow: none !important;
	box-shadow: 0 2px 10px color-mix(in srgb, #000 35%, transparent) !important;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	cursor: pointer;
	appearance: none !important;
	-webkit-appearance: none !important;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.dc-uploader button.dc-uploader__remove svg {
	display: block;
	width: 0.85rem;
	height: 0.85rem;
	pointer-events: none;
}

.dc-uploader button.dc-uploader__remove:hover,
.dc-uploader button.dc-uploader__remove:focus {
	background: var(--dc-up-danger) !important;
	border-color: var(--dc-up-danger) !important;
	color: #fff !important;
	outline: none !important;
	transform: scale(1.06);
}

.dc-uploader__tile.is-removed button.dc-uploader__remove {
	background: var(--dc-up-danger) !important;
	border-color: var(--dc-up-danger) !important;
}

.dc-uploader__preview {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 9px;
	background: var(--dc-up-soft-2);
	color: inherit;
	text-decoration: none;
}

.dc-uploader__preview img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dc-uploader__file-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	padding: 0.35rem 0.45rem;
	border-radius: 7px;
	border: 1px solid var(--dc-up-border);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: var(--dc-up-muted);
}

.dc-uploader__meta {
	display: flex;
	flex-direction: column;
	gap: 0.08rem;
	margin-top: 0.4rem;
	min-width: 0;
	padding: 0 0.2rem 0.15rem;
}

.dc-uploader__name {
	overflow: hidden;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: normal;
	text-transform: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dc-uploader__sub {
	font-size: 0.66rem;
	color: var(--dc-up-muted);
	letter-spacing: normal;
	text-transform: none;
}

/* Add = dashed tile in the same grid */
.dc-uploader button.dc-uploader__add,
.dc-account-cashback .dc-uploader button.dc-uploader__add,
.dc-admin-wrap .dc-uploader button.dc-uploader__add {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	width: 100% !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0.75rem 0.5rem !important;
	aspect-ratio: 1;
	border: 1.5px dashed var(--dc-up-border) !important;
	border-radius: 12px !important;
	background: transparent !important;
	color: inherit !important;
	font-size: 0.72rem !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-align: center;
	text-shadow: none !important;
	box-shadow: none !important;
	cursor: pointer;
	appearance: none !important;
	-webkit-appearance: none !important;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dc-uploader button.dc-uploader__add:hover,
.dc-uploader button.dc-uploader__add:focus {
	background: var(--dc-up-soft) !important;
	border-color: color-mix(in srgb, currentColor 36%, transparent) !important;
	color: inherit !important;
	outline: none !important;
}

.dc-uploader__add[hidden] {
	display: none !important;
}

.dc-uploader__add-icon {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 2rem !important;
	height: 2rem !important;
	border-radius: 999px;
	border: 1px solid var(--dc-up-border);
	background: var(--dc-up-soft-2);
	color: inherit;
}

.dc-uploader__add-icon svg {
	display: block;
	width: 1rem;
	height: 1rem;
}

.dc-uploader__add-label {
	display: block;
	max-width: 100%;
	padding: 0 0.15rem;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.25;
}

.dc-uploader__input {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	border: 0 !important;
}

.dc-uploader__error {
	margin: 0.5rem 0 0;
	color: var(--dc-up-danger);
	font-size: 0.82rem;
	font-weight: 600;
}

.dc-uploader__error[hidden] {
	display: none !important;
}

.dc-uploader__hint {
	margin: 0.35rem 0 0;
	font-size: 0.76rem;
	color: var(--dc-up-muted);
}

.dc-uploader--readonly .dc-uploader__toolbar,
.dc-uploader--readonly .dc-uploader__add,
.dc-uploader--readonly .dc-uploader__hint,
.dc-uploader--readonly .dc-uploader__drop {
	display: none !important;
}

.dc-uploader--readonly .dc-uploader__stage {
	margin: 0;
}

/* WP admin light surface */
.dc-admin-wrap .dc-uploader {
	--dc-up-border: #c3c4c7;
	--dc-up-soft: #f0f0f1;
	--dc-up-soft-2: #fff;
	--dc-up-muted: #646970;
	--dc-up-danger: #d63638;
	max-width: 540px;
}

.dc-admin-wrap .dc-uploader button.dc-uploader__remove {
	background: color-mix(in srgb, #1d2327 78%, transparent) !important;
	border-color: color-mix(in srgb, #1d2327 40%, transparent) !important;
	color: #fff !important;
}
