/**
 * Estilos do Plugin Certisign Unidades
 * Prefixo: .csun- (Certisign Unidades) para evitar conflitos
 * Layout fiel ao site Certisign
 * 
 * @package Certisign_Unidades
 */

/* Container Principal */
.csun-container {
	max-width: 100%;
	margin: 0 auto 40px;
	padding: 20px;
	box-sizing: border-box;
}

/* Título */
.csun-title {
	font-size: 28px;
	font-weight: 700;
	color: #333;
	margin-bottom: 30px;
	text-align: center;
}

/* Área de Filtros */
.csun-filters {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 0;
	padding: 25px;
	background: #ffffff;
	border-radius: 0;
}

@media (max-width: 768px) {
	.csun-filters {
		grid-template-columns: 1fr;
		gap: 15px;
		padding: 20px 15px;
	}
}

/* Wrapper de Cada Filtro */
.csun-filter-group {
	display: flex;
	flex-direction: column;
}

.csun-filter-label {
	font-size: 14px;
	font-weight: 600;
	color: #555;
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.csun-filter-select {
	width: 100%;
	padding: 12px 15px;
	font-size: 16px;
	color: #6b4ce0;
	background-color: #f5f3ff;
	border: 1px solid #d4c5f9;
	border-radius: 5px;
	cursor: pointer;
	transition: all 0.3s ease;
	appearance: none;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%236b4ce0" d="M6 9L1 4h10z"/></svg>');
	background-repeat: no-repeat;
	background-position: right 15px center;
	padding-right: 40px;
}

.csun-filter-select:hover {
	border-color: #6b4ce0;
	background-color: #ede9fe;
}

.csun-filter-select:focus {
	outline: none;
	border-color: #6b4ce0;
	box-shadow: 0 0 0 3px rgba(107, 76, 224, 0.1);
}

.csun-filter-select:disabled {
	background-color: #f5f5f5;
	color: #999;
	cursor: not-allowed;
	border-color: #e0e0e0;
}

/* Área de Loading */
.csun-loading {
	text-align: center;
	padding: 40px 20px;
	font-size: 16px;
	color: #666;
}

.csun-loading-spinner {
	display: inline-block;
	width: 40px;
	height: 40px;
	border: 4px solid rgba(107, 76, 224, 0.2);
	border-top-color: #6b4ce0;
	border-radius: 50%;
	animation: csun-spin 0.8s linear infinite;
	margin-bottom: 10px;
}

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

/* Resultados */
.csun-results {
	margin-top: 0;
	background: #efefef;
	padding: 30px 25px;
}

/* Header com Cidade | Estado */
.csun-location-header {
	font-size: 20px;
	font-weight: 700;
	color: #333333;
	margin-bottom: 20px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.csun-results-header {
	font-size: 14px;
	font-weight: 400;
	color: #666;
	margin-bottom: 16px;
	padding-bottom: 0;
	border-bottom: none;
}

.csun-results-count {
	font-weight: 400;
	color: #666;
	font-size: 14px;
}

/* Grid de Cards - 2 colunas conforme layout Certisign */
.csun-cards-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	margin-top: 0;
}

@media (max-width: 768px) {
	.csun-cards-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

/* Card Individual - estilo Certisign */
.csun-card {
	background: #ffffff;
	border: none;
	border-radius: 8px;
	padding: 24px;
	transition: all 0.2s ease;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.csun-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.csun-card-title-wrapper {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 14px;
	border-bottom: 1px solid #e8e8e8;
}

.csun-card-title-wrapper i,
.csun-card-title-wrapper span {
	font-size: 22px;
	color: #555555;
	flex-shrink: 0;
}

.csun-card-title {
	font-size: 15px;
	font-weight: 700;
	color: #333333;
	margin: 0;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: uppercase;
}

.csun-card-info {
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding-left: 0;
}

.csun-card-info:last-child {
	margin-bottom: 0;
}

.csun-card-info i,
.csun-card-info span {
	flex-shrink: 0;
	font-size: 18px;
	color: #555555;
	width: 20px;
	text-align: center;
}

.csun-card-info.phone i,
.csun-card-info.phone span {
	color: #555555;
}

.csun-card-info.email i,
.csun-card-info.email span {
	color: #555555 !important;
}

.csun-card-text {
	flex: 1;
	font-size: 14px !important;
	color: #333333 !important;
	word-break: break-word;
	line-height: 1.5;
}

.csun-card-text a {
	color: #333333 !important;
	font-size: 14px !important;
	text-decoration: none;
	transition: color 0.2s ease;
	font-weight: 400;
}

.csun-card-text a:hover {
	color: #6b4ce0;
	text-decoration: underline;
}

/* Mensagem de Nenhum Resultado */
.csun-no-results {
	text-align: center;
	padding: 60px 20px;
	background: #ffffff;
	border-radius: 8px;
	margin-top: 0;
}

.csun-no-results-icon {
	font-size: 48px;
	margin-bottom: 15px;
	opacity: 0.5;
}

.csun-no-results-text {
	font-size: 18px;
	color: #666;
	line-height: 1.5;
}

/* Mensagem de Erro */
.csun-error {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 5px;
	padding: 15px 20px;
	margin: 20px 0;
	color: #856404;
	display: flex;
	align-items: center;
	gap: 10px;
}

.csun-error::before {
	content: "⚠️";
	font-size: 24px;
}

/* Estados para acessibilidade */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Animações */
@keyframes csun-fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.csun-card {
	animation: csun-fadeIn 0.4s ease-out;
}

/* Responsividade adicional para dispositivos muito pequenos */
@media (max-width: 480px) {
	.csun-container {
		padding: 15px 10px;
	}

	.csun-title {
		font-size: 24px;
		margin-bottom: 20px;
	}

	.csun-card {
		padding: 20px 15px;
	}

	.csun-card-title {
		font-size: 14px;
	}
}

/* Print Styles */
@media print {
	.csun-filters {
		display: none;
	}

	.csun-card {
		break-inside: avoid;
		page-break-inside: avoid;
		box-shadow: none;
		border: 1px solid #ccc;
	}
}

/* Fallback para Font Awesome se Elementor não estiver carregado */
.csun-card-title-wrapper .fa,
.csun-card-title-wrapper .fas,
.csun-card-info .fa,
.csun-card-info .fas {
	font-size: 18px;
	color: #555555;
}

/* Mapeamento de ícones do Elementor para Font Awesome */
.csun-card-title-wrapper .fa-map-marker-alt::before,
.csun-card-title-wrapper i[class*="eicon-map"]::before {
	content: "\f3c5"; /* Font Awesome map-marker-alt */
}

.csun-card-info.phone .fa-phone::before,
.csun-card-info.phone i[class*="eicon-phone"]::before {
	content: "\f095"; /* Font Awesome phone */
}

.csun-card-info.email .fa-envelope::before,
.csun-card-info.email i[class*="eicon-envelope"]::before {
	content: "\f0e0"; /* Font Awesome envelope */
}

/* Suporte para ícones sem Font Awesome - fallback Unicode */
@supports not (font-family: "Font Awesome 6 Free") {
	.csun-card-title-wrapper i[class*="eicon-"]::before {
		content: "📍";
		font-family: inherit;
		font-style: normal;
	}
	
	.csun-card-info.phone i[class*="eicon-"]::before {
		content: "📞";
		font-family: inherit;
		font-style: normal;
	}
	
	.csun-card-info.email i[class*="eicon-"]::before {
		content: "✉";
		font-family: inherit;
		font-style: normal;
	}
}
