@use "theme-standard" as theme;

:root {
    --accent-color: #{theme.$content-header-background};
    --accent-color-rgba: rgba(240, 240, 241, 1);
    --border-color: #{theme.$content-line-color};
}

body {
	font-family: theme.$font-family;
	font-size: theme.$base-font-size;
	line-height: 1.5;
	color: theme.$content-color;
}

.screen-reader-text {
	border: 0;
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
}

header {
	background-color: var(--accent-color-rgba);
	border-top: 1px solid var(--border-color);
	border-bottom: 1px solid var(--border-color);
	font-weight: 600;
	line-height: 2;
	padding: 0 20px;
	text-transform: uppercase;
}

article,
.invoice-element {
	padding: 20px;
}

.invoice {
	margin: 0 auto;
	max-width: 600px;
	width: 100%;
}

.invoice-header {
	background-color: transparent;
	border-top: none;
	display: flex;
	align-items: center;
	width: 100%;
	padding: 20px;
	text-transform: capitalize;
	color: theme.$content-header-color;
	gap: 1em;

	> div {
		flex-grow: 1;
	}

	img {
		display: block;
		max-width: 100%;
	}
}

.invoice-details {
	flex-shrink: 0;
	text-align: right;
}

.order-number {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	text-transform: none;
}

h1 {
	font-weight: 400;
	font-size: 18px;
	color: theme.$content-header-color;
}

.payment-status-badge {
	background: theme.$status-color-paid;
	color: #fff;
	padding: 0 8px;
	border-radius: 3px;
	margin-left: 12px;
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	&.payment-partially_refunded,
	&.payment-refunded {
		background: theme.$status-color-pending;
	}
}

.date {
	font-weight: 400;
}

.invoice-label {
	font-weight: 600;
}

/**
 * Buttons
 */
.button {
	background: #fff;
	border: 1px solid theme.$content-line-color;
	border-radius: 3px;
	color: theme.$content-color;
	font-family: theme.$font-family;
	font-size: theme.$base-font-size;
	padding: 5px 10px;
	text-decoration: none;

	&:hover,
	&:focus {
		background: theme.$content-header-background;
		border-color: theme.$content-color;
		cursor: pointer;
	}
}

/**
* Contacts
*/
.contacts {
	display: flex;
	justify-content: space-between;

	.storefront,
	.customer {
		flex-basis: 50%;
	}

	.customer .button {
		float: right;
		margin: 0 0 10px 10px;
	}

	.address:not(:last-child) {
		margin-bottom: 18px;
	}
}

.storefront {
	border-right: 1px solid var(--border-color);
}

/**
* Items
*/
table {
	width: 100%;
	margin-bottom: 20px;

	td {
	    border: 0;
	}

	tbody {
		td {
			border-bottom: 1px solid var(--border-color);
			padding: 20px;
		}

		.name {
			font-weight: 400;
			text-align: left;
		}
	}

	.price {
		width: 100px;
		text-align: right;
	}

	tfoot {
		td {
			border-bottom: none;
			padding: 8px 20px;
			text-align: right;
		}

		.name {
			font-weight: 600;
		}
	}
}

.information {
	p {
		margin-bottom: 20px;
	}
}

.invoice-actions {
	border-top: 1px solid var(--border-color);
	padding: 20px;
}

body.bulk-invoices {
	& #bulk-invoices-print-notice {
		background-color: #f5f2e5;
		border-color: #996800;
		color: #996800;
		border-radius: 3px;
		padding: 10px;
		margin-bottom: 20px;
	}

	& div.edd-invoice-multiple:not(:last-child) {
		break-after: page;

		& .hide-on-print,
		& .invoice-actions,
		& .screen-reader-text {
			display: none !important;
		}
	}
}

@media print {
	.invoice-actions,
	.hide-on-print,
	#bulk-invoices-print-notice {
		display: none;
	}

	.invoice {
		max-width: 100%;
	}
}

@media screen and (max-width: 599px) {
	.invoice-header {
		flex-wrap: wrap;

		& img {
			margin: 0 auto 20px;
		}
	}

	.invoice-details {
		text-align: left;
	}

	.order-number {
		justify-content: left;
	}

	.contacts {
		display: block;
	}

	.storefront {
		border-right: none;
	}
}
