/* ODI — wizytówka agenta (front) */

.odi-agents-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin: 25px 0;
	width: 100%;
	max-width: none;
	box-sizing: border-box;
	align-items: stretch;
	justify-items: stretch;
}

.odi-agents-grid > .odi-agent-card {
	min-width: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	box-sizing: border-box;
}

/* Jedna karta w oddziale - na pełną szerokość sekcji. */
.odi-agents-grid > .odi-agent-card:only-child {
	grid-column: 1 / -1;
}

.odi-agents-grid--list {
	grid-template-columns: 1fr;
	gap: 12px;
}

.odi-agents-grid--list .odi-agent-card--list {
	align-items: stretch;
}

.odi-agents-grid--list .odi-agent-card--list .odi-agent-photo-wrap {
	width: 120px;
	min-width: 120px;
	flex-shrink: 0;
}

.odi-agents-empty {
	color: #555d61;
	text-align: center;
	padding: 20px;
}

.odi-agents-team {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}

.odi-agents-region {
	margin: 0 0 36px;
	width: 100%;
	max-width: none;
}

.odi-agents-region:last-child {
	margin-bottom: 0;
}

.odi-agents-region-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 18px;
}

.odi-agents-region-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border-radius: var(--odi-card-radius, 8px);
	background: var(--odi-brand-soft-bg, #f8f9fa);
	border: 1px solid var(--odi-brand-gray-light, #e5e8eb);
	font-size: 12px;
	font-weight: 700;
	color: var(--odi-brand-slate, #555d61);
	white-space: nowrap;
}

.odi-agents-team--grouped .odi-agents-region .odi-agents-grid {
	margin-top: 0;
}

.odi-agents-team--grouped .odi-agent-region {
	display: none;
}

.odi-agents-team--flat .odi-agents-grid {
	margin: 25px 0;
}

.odi-single-agent-wrap {
	width: 100%;
	max-width: none;
	margin: 0;
	display: flex;
}

.odi-agent-card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	min-height: 380px;
	padding: 0;
}

.odi-agent-photo-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	min-width: 0;
	flex-shrink: 0;
	background: #eef1f3;
	border-radius: 0;
	overflow: hidden;
	box-shadow: none;
}

.odi-agent-photo-wrap--empty {
	background: #eef1f3;
	border: 1px solid #e5e8eb;
	box-sizing: border-box;
}

.odi-agent-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

.odi-agent-img--empty {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18%;
	box-sizing: border-box;
	background: #eef1f3;
	color: #8a9196;
}

.odi-agent-img-logo {
	position: relative;
	inset: auto;
	width: 72%;
	max-width: 110px;
	height: auto;
	max-height: 56%;
	object-fit: contain;
	object-position: center;
	filter: grayscale(1) contrast(0.92) brightness(1.05);
	opacity: 0.38;
	pointer-events: none;
}

.odi-agent-img-fallback {
	font-weight: 800;
	letter-spacing: 0.08em;
	font-size: 13px;
	color: #9aa1a6;
}

.odi-agent-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
}

.odi-agent-identity {
	min-width: 0;
}

.odi-agent-cover {
	display: inline-block;
	font-size: 10px;
	font-weight: 800;
	color: #fff;
	background: #d3212b;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
	padding: 3px 7px;
	border-radius: 3px;
}

.odi-agent-cover--under-photo {
	display: block;
	margin: 10px 16px 0;
}

.odi-agent-name {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 800;
	color: #2b2f33;
	line-height: 1.2;
}

.odi-agent-role {
	font-size: 12px;
	font-weight: 600;
	color: #555d61;
	margin-bottom: 2px;
}

.odi-agent-region {
	font-size: 11px;
	font-weight: 600;
	color: #555d61;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.odi-agent-license {
	font-size: 11px;
	color: #555d61;
	font-style: italic;
	line-height: 1.35;
}

.odi-agent-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	border-top: 1px dashed #e5e8eb;
	padding-top: 12px;
	min-width: 0;
	margin-top: auto;
}

.odi-agent-contact {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid #e5e8eb;
	border-radius: 8px;
	background: #f8f9fa;
	text-decoration: none;
	color: #2b2f33;
	box-sizing: border-box;
}

.odi-agent-contact--phone {
	background: #fff;
	border-color: #e5e8eb;
	color: #2b2f33;
}

.odi-agent-contact-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: inherit;
	opacity: 0.78;
}

.odi-agent-contact-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #2b2f33;
	flex-shrink: 0;
}

.odi-agent-contact-icon--at {
	font-size: 14px;
	font-weight: 900;
	line-height: 1;
}

.odi-agent-contact-value {
	display: block;
	min-width: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
}

.odi-agent-contact--phone .odi-agent-contact-value {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.odi-agent-contact--mail .odi-agent-contact-value {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.odi-agent-contact--mail:hover {
	border-color: #d3212b;
	color: #d3212b;
}

.odi-agent-contact--phone:hover {
	border-color: #d3212b;
	color: #d3212b;
}

.odi-agent-phone-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: fit-content;
	max-width: 100%;
	background: #d3212b;
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 800;
	padding: 8px 12px;
	border-radius: 6px;
	line-height: 1.2;
}

/* Flaga PL — monochromatyczny prostokąt (biały / czarny) */
.odi-pl-flag {
	display: inline-block;
	width: 14px;
	height: 9px;
	flex-shrink: 0;
	border: 1px solid #2b2f33;
	background: linear-gradient(to bottom, #ffffff 50%, #2b2f33 50%);
	vertical-align: middle;
}

.odi-agent-phone-label {
	min-width: 0;
}

.odi-agent-phone-btn:hover {
	background: #b71c1c;
	color: #fff;
}

.odi-agent-mail {
	min-width: 0;
	width: 100%;
}

.odi-agent-mail-link {
	display: block;
	color: #2b2f33;
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	white-space: normal;
	overflow: visible;
	text-overflow: unset;
	word-break: break-word;
}

.odi-agent-mail-link:hover {
	color: #d3212b;
	text-decoration: underline;
}

.odi-agent-mail-label {
	display: block;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #555d61;
	margin-bottom: 2px;
}

/* Wizytówka jak na ogłoszeniu: miniaturka + dane, kontakt na pełną szerokość
   (single = opiekun oferty, grid = lista „Nasz zespół”) */
.odi-agent-card--single,
.odi-agent-card--grid {
	max-width: none;
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	grid-template-rows: auto auto;
	align-items: start;
	column-gap: 0;
}

.odi-agent-card--single .odi-agent-photo-wrap,
.odi-agent-card--grid .odi-agent-photo-wrap {
	grid-column: 1;
	grid-row: 1;
	width: 96px;
	min-width: 96px;
	max-width: 96px;
	aspect-ratio: 1;
	max-height: 96px;
	align-self: start;
	flex-shrink: 0;
}

.odi-agent-card--single .odi-agent-cover--under-photo,
.odi-agent-card--grid .odi-agent-cover--under-photo {
	grid-column: 1 / -1;
	grid-row: 2;
	margin: 8px 14px 0;
}

.odi-agent-card--single .odi-agent-info,
.odi-agent-card--grid .odi-agent-info {
	display: contents;
}

.odi-agent-card--single .odi-agent-identity,
.odi-agent-card--grid .odi-agent-identity {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
	padding: 12px 14px 8px 12px;
	align-self: center;
}

.odi-agent-card--single .odi-agent-name,
.odi-agent-card--grid .odi-agent-name {
	font-size: 15px;
}

.odi-agent-card--single .odi-agent-role,
.odi-agent-card--single .odi-agent-region,
.odi-agent-card--single .odi-agent-license,
.odi-agent-card--grid .odi-agent-role,
.odi-agent-card--grid .odi-agent-region,
.odi-agent-card--grid .odi-agent-license {
	font-size: 12px;
}

.odi-agent-card--single .odi-agent-actions,
.odi-agent-card--grid .odi-agent-actions {
	grid-column: 1 / -1;
	grid-row: 2;
	gap: 6px;
	margin: 0;
	padding: 10px 14px 14px;
	border-top: 1px dashed #e5e8eb;
	width: 100%;
	box-sizing: border-box;
}

.odi-agent-card--single:has(.odi-agent-cover--under-photo) .odi-agent-actions,
.odi-agent-card--grid:has(.odi-agent-cover--under-photo) .odi-agent-actions {
	grid-row: 3;
}

.odi-agent-card--single .odi-agent-msg-btn,
.odi-agent-card--grid .odi-agent-msg-btn {
	padding: 8px 10px;
	font-size: 12px;
}

/* Lista agentów: ten sam układ kompaktowy */
.odi-agents-grid--list .odi-agent-card--list {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	grid-template-rows: auto auto;
	align-items: start;
	flex-direction: unset;
	min-height: 0;
}

.odi-agents-grid--list .odi-agent-card--list .odi-agent-photo-wrap {
	grid-column: 1;
	grid-row: 1;
	width: 96px;
	min-width: 96px;
	max-width: 96px;
	max-height: 96px;
	aspect-ratio: 1;
	flex-shrink: 0;
}

.odi-agents-grid--list .odi-agent-card--list .odi-agent-info {
	display: contents;
	padding: 0;
	flex: unset;
}

.odi-agents-grid--list .odi-agent-card--list .odi-agent-identity {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
	padding: 12px 14px 8px 12px;
	align-self: center;
}

.odi-agents-grid--list .odi-agent-card--list .odi-agent-actions {
	grid-column: 1 / -1;
	grid-row: 2;
	width: 100%;
	box-sizing: border-box;
	margin-top: 0;
	padding: 10px 14px 14px;
	border-top: 1px dashed #e5e8eb;
	gap: 6px;
}

.odi-agent-email-visible {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #2b2f33;
	text-decoration: none;
	line-height: 1.4;
	white-space: normal;
	overflow: visible;
	text-overflow: unset;
	word-break: break-word;
	margin-top: 2px;
}

.odi-agent-email-visible:hover {
	color: #d3212b;
	text-decoration: underline;
}

.odi-agent-msg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #E5E8EB;
	border-radius: 6px;
	background: #F8F9FA;
	color: #555d61;
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
	box-sizing: border-box;
}

.odi-agent-msg-btn:hover {
	border-color: #555d61;
	background: #555d61;
	color: #fff;
}

.odi-agent-msg-btn--whatsapp {
	border-color: #b7e0c2;
	background: #f0faf2;
	color: #1b5e20;
	text-align: center;
}

.odi-agent-msg-btn--whatsapp:hover {
	border-color: #25D366;
	background: #25D366;
	color: #fff;
}

.odi-agent-msg-btn--mail {
	border-color: #c5d4e8;
	background: #f4f8fc;
	color: #2b4a6b;
	text-align: center;
}

.odi-agent-msg-btn--mail:hover {
	border-color: #2b4a6b;
	background: #2b4a6b;
	color: #fff;
}

.odi-agent-card--single .odi-agent-msg-btn--whatsapp,
.odi-agent-card--grid .odi-agent-msg-btn--whatsapp,
.odi-agent-card--list .odi-agent-msg-btn--whatsapp {
	padding: 8px 10px;
	font-size: 12px;
}

@media (max-width: 991px) {
	.odi-agents-grid {
		grid-template-columns: 1fr;
		gap: 15px;
		max-width: none;
		margin-left: 0;
		margin-right: 0;
	}

	.odi-agent-card {
		min-height: 0;
	}

	.odi-agents-grid--list .odi-agent-card--list {
		grid-template-columns: 80px minmax(0, 1fr);
		grid-template-rows: auto auto;
		min-height: 0;
	}

	.odi-agents-grid--list .odi-agent-card--list .odi-agent-photo-wrap {
		grid-column: 1;
		grid-row: 1;
		width: 80px;
		min-width: 80px;
		max-width: 80px;
		max-height: 80px;
		aspect-ratio: 1;
	}

	.odi-agents-grid--list .odi-agent-card--list .odi-agent-identity {
		grid-column: 2;
		grid-row: 1;
		padding: 12px 14px 8px 12px;
	}

	.odi-agents-grid--list .odi-agent-card--list .odi-agent-actions {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.odi-agent-card--single,
	.odi-agent-card--grid {
		max-width: none;
		grid-template-columns: 80px minmax(0, 1fr);
	}

	.odi-agent-card--single .odi-agent-photo-wrap,
	.odi-agent-card--grid .odi-agent-photo-wrap {
		width: 80px;
		min-width: 80px;
		max-width: 80px;
		max-height: 80px;
		aspect-ratio: 1;
	}

	.odi-agents-grid--list,
	.odi-about-team .odi-agents-grid {
		max-width: none;
	}

	.odi-agents-region {
		margin-bottom: 28px;
	}

	.odi-agents-region-head {
		flex-direction: column;
		align-items: flex-start;
	}
}
