/**
 * TE Multi Address - front-end styles.
 *
 * Deliberately low-specificity single class selectors so a theme can override
 * anything without !important, and no layout assumptions beyond flex wrapping.
 */

/* Shared TE base button
 *
 * Deliberately unprefixed: .te-button is common to every TE plugin so buttons
 * match across the estate. Kept to behaviour a button always wants and nothing
 * visual, because a colour or radius set here would fight whichever theme or
 * sibling plugin also styles it. Sits alongside WooCommerce's own .button, which
 * still provides the theme's look.
 */

.te-button {
	cursor: pointer;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	text-align: center;
	vertical-align: middle;
	touch-action: manipulation;
}

.te-button:disabled,
.te-button[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.6;
}

.te-button:focus-visible {
	/* Never remove the focus ring: these controls are reachable by keyboard only
	   on the account page, where losing it makes the page unusable. */
	outline: 2px solid currentColor;
	outline-offset: 2px;
}


.te-multi-address-address-book {
	margin-bottom: 2em;
}

.te-multi-address-book-section {
	margin-bottom: 2.5em;
}

.te-multi-address-book-title {
	margin-bottom: 0.75em;
}

.te-multi-address-address-list {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	margin: 0 0 1em;
	padding: 0;
	list-style: none;
}

.te-multi-address-address-card {
	flex: 1 1 260px;
	/* A min-width as well as a flex-basis: without it a narrow flex parent can
	   squeeze the card to zero width, which looks like the card is missing. */
	min-width: 220px;
	padding: 1em;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 4px;
}

.te-multi-address-address-card.is-default {
	border-color: rgba( 0, 0, 0, 0.35 );
}

.te-multi-address-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
	margin-bottom: 0.5em;
}

.te-multi-address-card-label {
	font-weight: 600;
}

.te-multi-address-badge {
	display: inline-block;
	padding: 0.15em 0.6em;
	border-radius: 999px;
	font-size: 0.75em;
	line-height: 1.6;
	white-space: nowrap;
	background: #2f855a;
	color: #fff;
}

.te-multi-address-address-card address {
	font-style: normal;
	line-height: 1.5;
}

.te-multi-address-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin-top: 0.75em;
}

.te-multi-address-empty-state {
	padding: 1.25em;
	border: 1px dashed rgba( 0, 0, 0, 0.2 );
	border-radius: 4px;
	text-align: center;
}

.te-multi-address-empty-state p {
	margin-bottom: 0.75em;
}

.te-multi-address-form {
	margin-top: 1.5em;
	padding-top: 1.5em;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
}

.te-multi-address-form-actions {
	display: flex;
	gap: 0.5em;
}

.te-multi-address-form-errors:empty {
	display: none;
}

.te-multi-address-error {
	margin: 0.25em 0;
	color: #b32d2e;
}

.te-multi-address-invalid {
	border-color: #b32d2e !important;
}

.te-multi-address-limit {
	margin-left: 0.75em;
	opacity: 0.7;
	font-size: 0.9em;
}

/* Checkout selector */

.te-multi-address-selector {
	margin-bottom: 1.5em;
}

.te-multi-address-selector-actions {
	margin: 0.35em 0 0;
	font-size: 0.9em;
}

.te-multi-address-locked-field,
input.te-multi-address-locked-field {
	background: rgba( 0, 0, 0, 0.04 );
	cursor: not-allowed;
}

/* Per-line destinations */

.te-multi-address-item-destination {
	display: block;
	margin-top: 0.6em;
	font-size: 0.9em;
}

.te-multi-address-item-label {
	display: block;
	margin-bottom: 0.2em;
	font-weight: 600;
}

.te-multi-address-item-select,
.te-multi-address-item-notes {
	width: 100%;
	max-width: 22em;
}

.te-multi-address-item-status {
	display: inline-block;
	margin-top: 0.3em;
	min-height: 1.2em;
}

.te-multi-address-item-status.is-ok {
	color: #2f855a;
}

.te-multi-address-item-status.is-error {
	color: #b32d2e;
}

.te-multi-address-fixed-quantity {
	display: inline-block;
	min-width: 2em;
	text-align: center;
}