/**
 * Tax Exempt Checkout
 * Deliberately low-specificity and theme-neutral: colours inherit where possible.
 */

.tax-exempt-row > .tax-exempt-cell {
	padding-top: 12px !important;
	padding-bottom: 12px !important;
}

.tax-exempt-wrap {
	margin: 16px 0;
}

.tax-exempt {
	/* Matches the "Tax" heading in the order review table. */
	--tax-exempt-text-size: 15px;
	font-size: 0.95em;
	line-height: 1.45;
	text-align: left;
}

/* -- Checkbox -------------------------------------------------------- */

.tax-exempt__toggle {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	cursor: pointer;
	font-weight: 600;
}

.tax-exempt__toggle input[type="checkbox"] {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	cursor: pointer;
}

.tax-exempt__toggle-text {
	flex: 1 1 auto;
	font-size: var( --tax-exempt-text-size, 15px );
}

/* -- Panel ----------------------------------------------------------- */

.tax-exempt__panel {
	margin-top: 10px;
	padding: 12px;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 4px;
	background: rgba( 0, 0, 0, 0.02 );
}

.tax-exempt__panel[hidden] {
	display: none;
}

.tax-exempt__help {
	margin: 0 0 10px;
	font-size: var( --tax-exempt-text-size, 15px );
	opacity: 0.85;
}

.tax-exempt__note {
	margin: 0;
	font-size: 0.9em;
	opacity: 0.85;
}

/* -- Drop zone ------------------------------------------------------- */

.tax-exempt__drop {
	position: relative;
	padding: 16px 12px;
	border: 1px dashed rgba( 0, 0, 0, 0.28 );
	border-radius: 4px;
	background: rgba( 255, 255, 255, 0.6 );
	text-align: center;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tax-exempt__drop.is-over {
	border-color: currentColor;
	background: rgba( 0, 0, 0, 0.04 );
}

.tax-exempt__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.tax-exempt__drop-label {
	display: block;
	margin: 0;
	cursor: pointer;
	font-weight: 400;
}

.tax-exempt__drop-label:focus-within {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.tax-exempt__drop-cta {
	text-decoration: underline;
	font-weight: 600;
}

.tax-exempt__drop-hint {
	opacity: 0.7;
}

.tax-exempt__constraints {
	margin: 6px 0 0;
	font-size: 0.8em;
	opacity: 0.65;
}

/* -- Uploaded file --------------------------------------------------- */

.tax-exempt__file {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid rgba( 0, 0, 0, 0.14 );
	border-radius: 4px;
	background: rgba( 255, 255, 255, 0.85 );
}

.tax-exempt__file-icon {
	flex: 0 0 auto;
	font-size: 1.2em;
	line-height: 1;
}

.tax-exempt__file-meta {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.tax-exempt__file-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

.tax-exempt__file-size {
	font-size: 0.8em;
	opacity: 0.65;
}

.tax-exempt__remove {
	flex: 0 0 auto;
	padding: 4px 8px;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
	border-radius: 3px;
	background: transparent;
	color: inherit;
	font-size: 0.82em;
	line-height: 1.4;
	cursor: pointer;
}

.tax-exempt__remove:hover {
	background: rgba( 0, 0, 0, 0.06 );
}

/* -- Feedback -------------------------------------------------------- */

.tax-exempt__error {
	margin-bottom: 10px;
	padding: 8px 10px;
	border-left: 3px solid #b32d2e;
	background: rgba( 179, 45, 46, 0.08 );
	color: #8a2223;
	font-size: 0.88em;
}

.tax-exempt__error[hidden] {
	display: none;
}

.tax-exempt__progress {
	height: 4px;
	margin-top: 10px;
	border-radius: 2px;
	background: rgba( 0, 0, 0, 0.1 );
	overflow: hidden;
}

.tax-exempt__progress[hidden] {
	display: none;
}

.tax-exempt__progress-bar {
	display: block;
	width: 0;
	height: 100%;
	background: currentColor;
	transition: width 0.2s ease;
}

.tax-exempt.is-busy {
	opacity: 0.6;
	pointer-events: none;
}

/* -- Cart page notice ------------------------------------------------ */

.tax-exempt-cart-notice {
	margin-top: 6px;
	font-size: 0.85em;
	font-weight: 400;
	line-height: 1.5;
	opacity: 0.8;
}

/* When it replaced the cell content there is nothing above it. */
.tax-exempt-cart-notice:first-child {
	margin-top: 0;
}

.tax-exempt-cart-notice p {
	margin: 0 0 6px;
}

.tax-exempt-cart-notice p:last-child {
	margin-bottom: 0;
}

/* On its own row (itemised tax display) there is nothing above it. */
.tax-exempt-cart-notice-row .tax-exempt-cart-notice {
	margin-top: 0;
}

/* In the Cart block the notice stands alone under the totals. */
.tax-exempt-cart-notice-wrap .tax-exempt-cart-notice {
	margin-top: 0;
	padding-top: 12px;
}

/* -- Block checkout -------------------------------------------------- */

.wc-block-components-totals-wrapper .tax-exempt,
.wp-block-woocommerce-checkout .tax-exempt {
	margin-top: 4px;
}
