/* SGB Branches front end. Everything is scoped under .sgb-branches-wrap. */

.sgb-branches-wrap {
	--sgb-teal: #0B5D66;
	--sgb-navy: #14233B;
	--sgb-amber: #F2A33A;
	--sgb-red: #D8343A;
	--sgb-bg: #F6F8F9;
	--sgb-card: #FFFFFF;
	--sgb-border: #D9E0E5;
	--sgb-muted: #5B6B7A;
	--sgb-up: #2E9E6B;
	--sgb-down: #C93A3A;
	--sgb-font-head: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--sgb-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	box-sizing: border-box;
	margin: 1.5em 0;
	color: var(--sgb-navy);
	font-family: var(--sgb-font-body);
	font-size: 1rem;
	line-height: 1.5;
}

.sgb-branches-wrap *,
.sgb-branches-wrap *::before,
.sgb-branches-wrap *::after {
	box-sizing: inherit;
}

.sgb-branches-wrap a {
	color: var(--sgb-teal);
}

.sgb-branches-wrap a:focus-visible,
.sgb-branches-wrap input:focus-visible,
.sgb-branches-wrap select:focus-visible,
.sgb-branches-wrap button:focus-visible {
	outline: 2px solid var(--sgb-teal);
	outline-offset: 2px;
}

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

/* Controls ------------------------------------------------------------ */

.sgb-branches-controls {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.sgb-branches-field label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.875rem;
	font-weight: 600;
}

.sgb-branches-field input,
.sgb-branches-field select {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 0 0.75rem;
	border: 1px solid var(--sgb-border);
	border-radius: 6px;
	background: var(--sgb-card);
	color: var(--sgb-navy);
	font: inherit;
}

.sgb-branches-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 1rem;
	border: 2px solid var(--sgb-teal);
	border-radius: 6px;
	background: var(--sgb-teal);
	color: #FFFFFF !important;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.sgb-branches-btn:hover {
	background: var(--sgb-navy);
	border-color: var(--sgb-navy);
}

.sgb-branches-btn--ghost {
	background: transparent;
	color: var(--sgb-teal) !important;
}

.sgb-branches-btn--ghost:hover {
	background: var(--sgb-teal);
	border-color: var(--sgb-teal);
	color: #FFFFFF !important;
}

.sgb-branches-btn[hidden] {
	display: none;
}

.sgb-branches-count {
	margin: 0 0 0.75rem;
	color: var(--sgb-muted);
	font-size: 0.875rem;
}

/* Table: stacked cards on narrow screens ------------------------------- */

.sgb-branches-table {
	display: block;
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: transparent;
}

.sgb-branches-table thead {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.sgb-branches-table tbody {
	display: block;
}

.sgb-branches-table tr {
	display: block;
	margin: 0 0 0.75rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--sgb-border);
	border-radius: 8px;
	background: var(--sgb-card);
}

.sgb-branches-table tr[hidden] {
	display: none;
}

.sgb-branches-table td {
	display: block;
	padding: 0.375rem 0;
	border: 0;
	background: transparent;
	color: var(--sgb-navy);
	font-size: 1rem;
	overflow-wrap: anywhere;
}

.sgb-branches-table td::before {
	content: attr(data-label);
	display: block;
	color: var(--sgb-muted);
	font-size: 0.8125rem;
	font-weight: 600;
}

.sgb-branches-cell--name {
	font-family: var(--sgb-font-head);
	font-weight: 600;
}

.sgb-branches-table td.sgb-branches-cell--name::before {
	display: none;
}

.sgb-branches-dist {
	display: inline-block;
	margin-left: 0.5rem;
	color: var(--sgb-muted);
	font-family: var(--sgb-font-body);
	font-size: 0.8125rem;
	font-weight: 400;
}

.sgb-branches-dist:empty {
	display: none;
}

.sgb-branches-dir-wrap {
	display: block;
}

.sgb-branches-dir {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
}

.sgb-branches-none {
	color: var(--sgb-muted);
}

.sgb-branches-empty {
	padding: 1rem;
	border: 1px dashed var(--sgb-border);
	border-radius: 8px;
	background: var(--sgb-bg);
	color: var(--sgb-muted);
}

.sgb-branches-empty[hidden] {
	display: none;
}

.sgb-branches-disclaimer {
	margin: 1rem 0 0;
	color: var(--sgb-muted);
	font-size: 0.875rem;
}

/* Details card (single branch page) ------------------------------------ */

.sgb-branches-wrap.sgb-branches-card {
	margin-right: 0 !important;
	margin-left: 0 !important;
	padding: 0 !important;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-size: inherit;
	line-height: inherit;
}

/* Plain h2: font, size, colour and weight come from the theme's h2 style. */
.sgb-branches-card__title {
	margin-bottom: 0.75rem;
}

.sgb-branches-intro {
	margin: 0 0 1rem;
	line-height: 1.6;
}

.sgb-branches-intro p {
	margin: 0 0 0.75rem;
}

.sgb-branches-intro p:last-child {
	margin-bottom: 0;
}

.sgb-branches-card__intro {
	margin: 0 0 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--sgb-border);
	line-height: 1.6;
}

.sgb-branches-card__intro p {
	margin: 0 0 0.75rem;
}

.sgb-branches-card__intro p:last-child {
	margin-bottom: 0;
}

.sgb-branches-card__list {
	margin: 0 0 1rem;
}

.sgb-branches-card__item {
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--sgb-border);
}

.sgb-branches-card__item:last-child {
	border-bottom: 0;
}

.sgb-branches-card__item dt {
	margin: 0;
	color: var(--sgb-muted);
	font-size: 0.8125rem;
	font-weight: 600;
}

.sgb-branches-card__item dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.sgb-branches-card .sgb-map-wrap {
	margin: 1rem 0;
}

/* Wider screens: real table -------------------------------------------- */

@media (min-width: 768px) {
	.sgb-branches-controls {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-end;
	}

	.sgb-branches-field {
		flex: 0 1 220px;
	}

	.sgb-branches-field--search {
		flex: 1 1 280px;
	}

	.sgb-branches-table {
		display: table;
		border: 1px solid var(--sgb-border);
		background: var(--sgb-card);
	}

	.sgb-branches-table thead {
		position: static;
		display: table-header-group;
		width: auto;
		height: auto;
		margin: 0;
		overflow: visible;
		clip: auto;
	}

	.sgb-branches-table tbody {
		display: table-row-group;
	}

	.sgb-branches-table tr {
		display: table-row;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: transparent;
	}

	.sgb-branches-table tr[hidden] {
		display: none;
	}

	.sgb-branches-table th,
	.sgb-branches-table td {
		display: table-cell;
		padding: 0.75rem 1rem;
		border-bottom: 1px solid var(--sgb-border);
		vertical-align: top;
		text-align: left;
	}

	.sgb-branches-table th {
		border-bottom: 2px solid var(--sgb-teal);
		background: var(--sgb-bg);
		color: var(--sgb-navy);
		font-family: var(--sgb-font-head);
		font-size: 0.9375rem;
		font-weight: 600;
	}

	/* Operating hours: keep each day's line together instead of being squeezed. */
	.sgb-branches-table .sgb-branches-cell--hours {
		min-width: 13rem;
	}

	.sgb-branches-table .sgb-branches-cell--address {
		min-width: 14rem;
	}

	/* Service type: each service on its own line, never split mid-phrase. */
	.sgb-branches-table .sgb-branches-cell--service {
		min-width: 10rem;
	}

	.sgb-branches-table .sgb-branches-service {
		white-space: nowrap;
	}

	.sgb-branches-table td::before {
		display: none;
	}

	.sgb-branches-table tbody tr:hover td {
		background: var(--sgb-bg);
	}

	.sgb-branches-dir {
		min-height: 0;
		margin-top: 0.25rem;
	}

	.sgb-branches-card {
		padding: 1.5rem;
	}

	.sgb-branches-card__item {
		display: grid;
		grid-template-columns: 11rem 1fr;
		gap: 1rem;
	}

	.sgb-branches-card__item dt {
		font-size: 0.9375rem;
	}
}

/* Plain "Get Directions" text link under the map on the details card. */
.sgb-branches-dir-link {
	margin: 0.4em 0 0 !important;
	font-size: 0.95em;
	line-height: 1.4;
}

.sgb-branches-dir-link a {
	display: inline-block;
	padding: 0.15em 0;
	text-decoration: none;
}

/* On the details card the disclaimer sits under the details list, above the map. */
.sgb-branches-card .sgb-branches-disclaimer {
	margin: 0.75rem 0 1rem !important;
	line-height: 1.4;
}

/* The directions link is the last line of the card: no trailing space. */
.sgb-branches-card .sgb-branches-dir-link {
	margin-bottom: 0 !important;
}

.sgb-branches-dir-link a:hover,
.sgb-branches-dir-link a:focus {
	text-decoration: underline;
}

/* Desktop: never wrap inside a single hours line ("Mon - Fri: 11.00am to 6.00pm"). Lines still break at the <br>. */
@media (min-width: 1024px) {
	.sgb-branches-table .sgb-branches-cell--hours {
		white-space: nowrap;
	}
}

/* Service type: one service per line (all screen sizes). */
.sgb-branches-service {
	display: block;
}

/* Branch FAQ. */
.sgb-branches-faq {
	margin: 1.5rem 0;
}

.sgb-branches-faq__item {
	margin: 0 0 1rem;
}

.sgb-branches-faq__q {
	margin: 0 0 0.25rem;
}

.sgb-branches-faq__a {
	margin: 0;
	line-height: 1.5;
}
