/* BranchLex – storefront styles. Inherit theme typography and colours where possible. */

.branchlex-branch-selector {
	margin: 0 0 1.5em;
}

.branchlex-branch-selector__form.is-loading,
.branchlex-modal form.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.branchlex-branch-selector__title {
	display: block;
	font-weight: 600;
	margin-bottom: 0.4em;
}

.branchlex-branch-selector__select {
	width: 100%;
	max-width: 420px;
}

.branchlex-branch-selector__details,
.branchlex-branch-list__address,
.branchlex-branch-list__phone,
.branchlex-nearest__address {
	display: block;
	font-size: 0.875em;
	opacity: 0.8;
}

.branchlex-branch-selector__details {
	margin-top: 0.4em;
}

.branchlex-branch-selector__note {
	font-size: 0.875em;
	margin: 0.4em 0 0;
}

.branchlex-branch-selector__message {
	font-size: 0.875em;
	margin-top: 0.4em;
}

.branchlex-branch-selector__message.is-error {
	color: #b32d2e;
}

.branchlex-branch-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.5em;
}

.branchlex-branch-list__item label {
	display: block;
	padding: 0.75em 1em 0.75em 2.5em;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	cursor: pointer;
	position: relative;
}

.branchlex-branch-list__item input[type="radio"] {
	position: absolute;
	left: 1em;
	top: 1em;
}

.branchlex-branch-list__item.is-selected label {
	border-color: currentColor;
	box-shadow: 0 0 0 1px currentColor;
}

.branchlex-branch-list__name {
	font-weight: 600;
}

.branchlex-badge {
	display: inline-block;
	font-size: 0.75em;
	line-height: 1.6;
	padding: 0 0.5em;
	margin-left: 0.5em;
	border-radius: 999px;
	vertical-align: middle;
}

.branchlex-badge--open {
	background: #e6f4ea;
	color: #1e6b34;
}

.branchlex-badge--closed {
	background: #f6e6e6;
	color: #8a1f1f;
}

.branchlex-link-button {
	background: none;
	border: 0;
	padding: 0;
	margin-top: 0.5em;
	text-decoration: underline;
	cursor: pointer;
	color: inherit;
	font-size: 0.875em;
}

.branchlex-nearest__list {
	list-style: none;
	margin: 0.5em 0;
	padding: 0;
	display: grid;
	gap: 0.4em;
}

.branchlex-branch-button {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	cursor: pointer;
}

.branchlex-branch-bar {
	display: flex;
	justify-content: center;
	padding: 0.4em 16px;
	background: rgba(0, 0, 0, 0.04);
	font-size: 0.9em;
}

.branchlex-branch-bar .branchlex-branch-button {
	background: none;
	border: 0;
	color: inherit;
	padding: 0.2em 0.4em;
}

/* Modal */
.branchlex-modal[hidden] {
	display: none;
}

.branchlex-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.branchlex-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.branchlex-modal__dialog {
	position: relative;
	background: #fff;
	color: #1e1e1e;
	border-radius: 8px;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 1.5em;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.branchlex-modal__close {
	position: absolute;
	top: 0.5em;
	right: 0.5em;
	background: none;
	border: 0;
	font-size: 1.75em;
	line-height: 1;
	cursor: pointer;
	color: inherit;
}

.branchlex-modal__title {
	margin: 0 0 0.25em;
	font-size: 1.4em;
}

.branchlex-modal__intro {
	margin: 0 0 1em;
	font-size: 0.9em;
	opacity: 0.8;
}

.branchlex-locate-button {
	margin-bottom: 0.75em;
}

body.branchlex-modal-open {
	overflow: hidden;
}

/* Product availability */
.branchlex-availability {
	margin: 1em 0;
	font-size: 0.925em;
}

.branchlex-availability__title {
	font-weight: 600;
	margin: 0 0 0.4em;
}

.branchlex-availability__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.branchlex-availability__item {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding: 0.25em 0;
	border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.branchlex-availability__item.is-current {
	font-weight: 600;
}

.branchlex-availability__status--in_stock::before,
.branchlex-availability__status--low_stock::before {
	content: "\2713\00a0";
	color: #1e6b34;
}

.branchlex-availability__status--out_of_stock::before {
	content: "\2715\00a0";
	color: #b32d2e;
}

/* Checkout / order details */
.branchlex-checkout-branch,
.branchlex-order-branch {
	margin: 0 0 1.5em;
	padding: 1em;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
}

.branchlex-checkout-branch h3,
.branchlex-order-branch h2 {
	margin-top: 0;
}

.branchlex-checkout-branch dl,
.branchlex-order-branch dl {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.25em 1em;
	margin: 0;
}

.branchlex-checkout-branch dt,
.branchlex-order-branch dt {
	font-weight: 600;
}

.branchlex-checkout-branch dd,
.branchlex-order-branch dd {
	margin: 0;
}

@media (max-width: 480px) {
	.branchlex-checkout-branch dl,
	.branchlex-order-branch dl {
		grid-template-columns: 1fr;
	}
}
