/**
 * WPW Checkout Files Upload - modern frontend styles
 * Can be disabled in WooCommerce > Settings > Checkout Files Upload > Design.
 *
 * @since 2.4.0.1
 */

.wpw-cfu-form {
	--wpw-cfu-accent: var(--wp--preset--color--primary, #2271b1);
	--wpw-cfu-border: rgba(0, 0, 0, .14);
	--wpw-cfu-bg: rgba(0, 0, 0, .025);
	--wpw-cfu-radius: 10px;
	position: relative;
	margin: 0 0 1.5em;
	padding: 16px 18px;
	border: 2px dashed var(--wpw-cfu-border);
	border-radius: var(--wpw-cfu-radius);
	background: var(--wpw-cfu-bg);
	transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
	box-sizing: border-box;
}
.wpw-cfu-form *,
.wpw-cfu-form *::before,
.wpw-cfu-form *::after {
	box-sizing: border-box;
}
.wpw-cfu-form.wpw-cfu-dragover {
	border-color: var(--wpw-cfu-accent);
	background: rgba(34, 113, 177, .06);
	box-shadow: 0 0 0 4px rgba(34, 113, 177, .12);
}
.wpw-cfu-form table,
.wpw-cfu-form tbody,
.wpw-cfu-form tr,
.wpw-cfu-form td {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0 !important;
	background: transparent !important;
}
.wpw-cfu-form label,
.wpw-cfu-form .wpw-cfu-label {
	display: inline-block;
	margin: 0 0 10px;
	font-weight: 600;
	line-height: 1.4;
	cursor: default;
}
.wpw-cfu-form abbr.required {
	color: #d63638;
	text-decoration: none;
	border: 0;
}

/* Button */
.wpw-cfu-form .wpw-cfu-button-wrap {
	margin-bottom: 10px !important;
}
.wpw-cfu-form .alg_checkout_files_upload_button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 8px 18px;
	border: 1px solid var(--wpw-cfu-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--wpw-cfu-accent);
	font-size: .95em;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, transform .1s ease;
	-webkit-appearance: none;
	appearance: none;
}
.wpw-cfu-form .alg_checkout_files_upload_button:hover,
.wpw-cfu-form .alg_checkout_files_upload_button:focus-visible {
	background: var(--wpw-cfu-accent);
	color: #fff;
	outline: none;
}
.wpw-cfu-form .alg_checkout_files_upload_button:active {
	transform: translateY(1px);
}

/* Uploaded files */
.wpw-cfu-form .wpw-cfu-result:not([style*="display: none"]):not([style*="display:none"]) {
	display: flex !important;
	align-items: center;
	gap: 12px;
	margin: 0 0 8px !important;
	padding: 8px 12px;
	border: 1px solid var(--wpw-cfu-border);
	border-radius: 8px;
	background: #fff;
	animation: wpw-cfu-in .25s ease;
}
.wpw-cfu-form .alg_checkout_files_upload_result_image {
	flex: 0 0 auto;
	line-height: 0;
}
.wpw-cfu-form .alg_checkout_files_upload_result_image img {
	margin: 0 !important;
	max-width: 56px;
	height: auto;
	max-height: 56px;
	object-fit: cover;
	border-radius: 6px;
	background: var(--wpw-cfu-bg);
}
.wpw-cfu-form .alg_checkout_files_upload_result_file_name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.wpw-cfu-form .alg_checkout_files_upload_result_file_name a {
	text-decoration: none;
	font-weight: 500;
}
.wpw-cfu-form .alg_checkout_files_upload_result_file_name a:hover {
	text-decoration: underline;
}
.wpw-cfu-form .alg_checkout_files_upload_result_delete {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	text-decoration: none !important;
	transition: background-color .2s ease;
}
.wpw-cfu-form .alg_checkout_files_upload_result_delete:hover,
.wpw-cfu-form .alg_checkout_files_upload_result_delete:focus-visible {
	background: rgba(214, 54, 56, .1);
	outline: none;
}

/* Notices */
.wpw-cfu-notices:empty {
	display: none;
}
.wpw-cfu-notice {
	position: relative;
	margin: 8px 0 0;
	padding: 10px 36px 10px 12px;
	border-left: 4px solid var(--wpw-cfu-accent);
	border-radius: 6px;
	background: #fff;
	font-size: .92em;
	line-height: 1.45;
	animation: wpw-cfu-in .25s ease;
}
.wpw-cfu-notice-error {
	border-left-color: #d63638;
	background: #fcf0f1;
}
.wpw-cfu-notice-success {
	border-left-color: #00a32a;
	background: #edfaef;
}
.wpw-cfu-notice-close {
	position: absolute;
	top: 50%;
	right: 6px;
	width: 26px;
	height: 26px;
	margin-top: -13px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: .6;
}
.wpw-cfu-notice-close:hover {
	opacity: 1;
	background: rgba(0, 0, 0, .06);
}

/* Progress bar */
.wpw-cfu-form ~ .alg-wc-checkout-files-upload-progress-wrapper,
.wpw-cfu-form .alg-wc-checkout-files-upload-progress-wrapper {
	height: 22px;
	border-radius: 999px;
	overflow: hidden;
}
.wpw-cfu-form .alg-wc-checkout-files-upload-progress-wrapper .alg-wc-checkout-files-upload-progress-bar {
	border-radius: 999px;
	background-color: var(--wpw-cfu-accent);
	transition: width .2s ease;
}
.wpw-cfu-form .alg-wc-checkout-files-upload-progress-wrapper .alg-wc-checkout-files-upload-progress-status {
	top: 1px;
	font-size: 12px;
	font-weight: 600;
	mix-blend-mode: difference;
}

/* Order details list */
.wpw-cfu-order-files {
	word-break: break-word;
}

@keyframes wpw-cfu-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.wpw-cfu-form,
	.wpw-cfu-form * {
		animation: none !important;
		transition: none !important;
	}
}

@media (max-width: 480px) {
	.wpw-cfu-form {
		padding: 14px;
	}
	.wpw-cfu-form .alg_checkout_files_upload_button {
		width: 100%;
		justify-content: center;
	}
}
