/* ==========================================================================
   Reseller Directory – Frontend Styles
   Modern minimal card grid, matching the UI reference screenshot.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
.rd-wrapper *,
.rd-wrapper *::before,
.rd-wrapper *::after {
	box-sizing: border-box;
}

.rd-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
		Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
	color: #1a1a2e;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 16px 48px;
}

/* --------------------------------------------------------------------------
   Search bar
   -------------------------------------------------------------------------- */
.rd-search-bar {
	display: flex;
	gap: 16px;
	align-items: center;
	margin-bottom: 40px;
	flex-wrap: wrap;
}

.rd-search-input-wrap {
	position: relative;
	flex: 0 0 170px;
}

.rd-input {
	width: 100%;
	height: 48px;
	border: 1.5px solid #dde1ea;
	border-radius: 8px;
	padding: 0 44px 0 16px;
	font-size: 15px;
	color: #111827;
	-webkit-text-fill-color: #111827;
	background: #fff;
	outline: none;
	transition: border-color 0.2s;
}

.rd-input::placeholder {
	color: #6b7280;
	opacity: 1;
}

.rd-input:focus {
	border-color: #4f6ef7;
	box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

.rd-input:disabled {
	color: #6b7280;
	-webkit-text-fill-color: #6b7280;
	background: #f8fafc;
	border-color: #e5e7eb;
	cursor: not-allowed;
	opacity: 1;
}

.rd-search-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #9da3af;
	pointer-events: none;
	display: flex;
	align-items: center;
}

.rd-country-wrap,
.rd-city-wrap {
	flex: 0 0 200px;
}

.rd-select {
	width: 100%;
	height: 48px;
	border: 1.5px solid #dde1ea;
	border-radius: 8px;
	padding: 0 36px 0 16px;
	font-size: 15px;
	color: #333;
	background: #fff 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='%239da3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	outline: none;
	cursor: pointer;
	transition: border-color 0.2s;
}

.rd-select:focus {
	border-color: #4f6ef7;
	box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

/* --------------------------------------------------------------------------
   Card grid
   -------------------------------------------------------------------------- */
.rd-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

@media (max-width: 1100px) {
	.rd-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 780px) {
	.rd-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.rd-grid {
		grid-template-columns: 1fr;
	}
	.rd-country-wrap,
	.rd-city-wrap,
	.rd-search-input-wrap {
		flex: 1 1 100%;
	}
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.rd-card {
	background: #ffffff;
	border: 1px solid #eaecf0;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	padding: 24px 20px 20px;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.25s, transform 0.2s;
}

.rd-card:hover {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
	transform: translateY(-2px);
}

/* Logo area */
.rd-card__logo {
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 18px;
}

.rd-logo-img {
	max-height: 80px;
	max-width: 100%;
	width: auto;
	object-fit: contain;
}

/* Fallback initials placeholder */
.rd-logo-placeholder {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.rd-logo-placeholder span {
	font-size: 26px;
	font-weight: 700;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* Card body */
.rd-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rd-card__name {
	font-size: 16px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 6px;
	line-height: 1.35;
}

.rd-card__address {
	font-size: 13.5px;
	color: #6b7280;
	margin: 0 0 6px;
	line-height: 1.5;
}

.rd-card__meta {
	font-size: 13px;
	color: #6b7280;
	margin: 0;
	display: flex;
	align-items: flex-start;
	gap: 6px;
	line-height: 1.4;
}

.rd-card__meta a {
	color: #4f6ef7;
	text-decoration: none;
	word-break: break-all;
}

.rd-card__meta a:hover {
	text-decoration: underline;
}

/* Inline icons via CSS (no font-icon dependency) */
.rd-icon {
	flex-shrink: 0;
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-top: 1px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0.55;
}

.rd-icon--phone {
	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='%234f6ef7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 11.1a19.79 19.79 0 01-3.07-8.67A2 2 0 012 .5h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L6.09 8.09a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z'/%3E%3C/svg%3E");
	opacity: 1;
}

.rd-icon--email {
	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='%234f6ef7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
	opacity: 1;
}

.rd-icon--web {
	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='%234f6ef7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z'/%3E%3C/svg%3E");
	opacity: 1;
}

/* --------------------------------------------------------------------------
   No results message
   -------------------------------------------------------------------------- */
.rd-no-results {
	text-align: center;
	padding: 60px 20px;
	color: #6b7280;
	font-size: 15px;
}

/* --------------------------------------------------------------------------
   Loading spinner overlay
   -------------------------------------------------------------------------- */
.rd-loading {
	display: none;
	text-align: center;
	padding: 60px 20px;
}

.rd-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid #e5e7eb;
	border-top-color: #4f6ef7;
	border-radius: 50%;
	animation: rd-spin 0.65s linear infinite;
	margin: 0 auto;
}

@keyframes rd-spin {
	to { transform: rotate(360deg); }
}
