/* -------------------------------------------------------------------------
 * Imetric Distributors — frontend styles
 * ---------------------------------------------------------------------- */

.idist-wrap {
	--idist-accent: #0a6cff;
	--idist-border: #e6e8ec;
	--idist-text: #1d2127;
	--idist-muted: #5b6471;
	--idist-card-bg: #fff;
	--idist-radius: 14px;

	margin: 0 auto;
	/* Generous bottom padding so the footer never crowds the last row. */
	padding: 8px 0 80px;
	max-width: 1140px;
	color: var( --idist-text );
	-webkit-font-smoothing: antialiased;
}

/* ---- Country selector ---- */

.idist-controls {
	margin-bottom: 40px;
}

.idist-select-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --idist-muted );
	margin-bottom: 8px;
}

.idist-select {
	min-width: 320px;
	max-width: 100%;
	padding: 13px 44px 13px 16px;
	font-size: 16px;
	line-height: 1.2;
	color: var( --idist-text );
	border: 1px solid var( --idist-border );
	border-radius: 10px;
	background-color: #fff;
	/* Custom chevron so the control looks consistent across browsers. */
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6471' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: right 16px center;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.idist-select:hover {
	border-color: #c9ced6;
}

.idist-select:focus {
	outline: none;
	border-color: var( --idist-accent );
	box-shadow: 0 0 0 3px rgba( 10, 108, 255, 0.15 );
}

/* Native <select> is hidden once the JS combobox enhances it. */
.idist-select--enhanced {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	clip-path: inset( 50% );
	white-space: nowrap;
}

/* ---- Searchable combobox ---- */

.idist-combo {
	position: relative;
	min-width: 320px;
	max-width: 420px;
}

.idist-combo-input {
	width: 100%;
	padding: 13px 42px 13px 16px;
	font-size: 16px;
	line-height: 1.2;
	color: var( --idist-text );
	border: 1px solid var( --idist-border );
	border-radius: 10px;
	background-color: #fff;
	/* Search glyph on the right. */
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6471' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: right 14px center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.idist-combo-input:hover {
	border-color: #c9ced6;
}

.idist-combo-input:focus {
	outline: none;
	border-color: var( --idist-accent );
	box-shadow: 0 0 0 3px rgba( 10, 108, 255, 0.15 );
}

.idist-combo-list {
	position: absolute;
	z-index: 20;
	left: 0;
	right: 0;
	top: calc( 100% + 6px );
	max-height: 280px;
	margin: 0;
	padding: 6px;
	list-style: none;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var( --idist-border );
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba( 16, 24, 40, 0.14 );
}

.idist-combo-list[hidden] {
	display: none;
}

.idist-combo-option {
	padding: 10px 12px;
	font-size: 15px;
	line-height: 1.3;
	color: var( --idist-text );
	border-radius: 7px;
	cursor: pointer;
}

.idist-combo-option:hover,
.idist-combo-option.is-active {
	background: #eef4ff;
	color: #084ec2;
}

.idist-combo-option[aria-selected="true"] {
	font-weight: 600;
}

.idist-combo-empty {
	padding: 12px;
	font-size: 14px;
	color: var( --idist-muted );
	text-align: center;
}

/* ---- Empty / prompt message ---- */

.idist-message {
	color: var( --idist-muted );
	font-size: 16px;
	margin: 8px 0 0;
	padding: 28px;
	text-align: center;
	border: 1px dashed var( --idist-border );
	border-radius: var( --idist-radius );
	background: #fafbfc;
}

/* ---- Cards grid ---- */

.idist-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 28px;
}

.idist-card {
	position: relative;
	display: flex;
	flex-direction: column;
	/* Allow the card to shrink within its grid track so long content wraps. */
	min-width: 0;
	padding: 28px 24px;
	background: var( --idist-card-bg );
	border: 1px solid var( --idist-border );
	border-radius: var( --idist-radius );
	box-shadow: 0 1px 2px rgba( 16, 24, 40, 0.04 );
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.idist-card:hover {
	transform: translateY( -3px );
	border-color: #d6dbe2;
	box-shadow: 0 12px 28px rgba( 16, 24, 40, 0.10 );
}

.idist-card-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	/* Fixed height so every logo occupies an identical, centered area. */
	height: 110px;
	margin-bottom: 18px;
	padding-bottom: 18px;
	border-bottom: 1px solid var( --idist-border );
}

.idist-card-logo img {
	/* Scale to fit the box without distortion; stays centered via the flex parent. */
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.idist-card-name {
	margin: 0 0 14px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	color: var( --idist-text );
	/* Wrap long, unbroken names (e.g. "Straumann/neodent") inside the card. */
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.idist-card-meta {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: auto;
}

.idist-card-meta p {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	font-size: 14.5px;
	line-height: 1.5;
	color: var( --idist-muted );
}

/* Inline label icons rendered with pseudo-elements (no asset deps). */
.idist-card-meta p::before {
	flex: 0 0 auto;
	width: 16px;
	margin-top: 1px;
	text-align: center;
	opacity: 0.7;
}

.idist-card-address::before {
	content: "\1F4CD"; /* 📍 */
}

.idist-card-phone::before {
	content: "\1F4DE"; /* 📞 */
}

.idist-card-website::before {
	content: "\1F310"; /* 🌐 */
}

.idist-card-meta a {
	color: var( --idist-accent );
	text-decoration: none;
	word-break: break-word;
	transition: color 0.15s ease;
}

.idist-card-meta a:hover {
	color: #084ec2;
	text-decoration: underline;
}

/* ---- Small screens ---- */

@media ( max-width: 600px ) {
	.idist-wrap {
		padding-bottom: 56px;
	}

	.idist-select,
	.idist-combo {
		min-width: 0;
		width: 100%;
		max-width: 100%;
	}

	.idist-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}
