/**
 * Avaliações — GuiaWP · estilos do front.
 *
 * Herda a paleta do core pela variável --gcep-color-primary quando ela existe, com fallback
 * literal para o caso de o tema não a definir. O amarelo das estrelas é fixo de propósito:
 * estrela é convenção universal, não identidade visual do guia.
 */

:root {
	--avgw-star: #f59e0b;
	--avgw-star-off: #e2e8f0;
}

/* ---------------------------------------------------------------- estrelas */

.avgw-stars {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	line-height: 1;
	vertical-align: middle;
}

.avgw-star { display: block; flex-shrink: 0; }
.avgw-star.is-full path { fill: var(--avgw-star); }
.avgw-star.is-empty path { fill: var(--avgw-star-off); }
.avgw-star.is-half .avgw-star__bg { fill: var(--avgw-star-off); }
.avgw-star.is-half .avgw-star__fg { fill: var(--avgw-star); }

/* ------------------------------------------------- estrelinhas do card */

.avgw-card-stars {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 6px;
	font-size: 12px;
	line-height: 1;
}

.avgw-card-stars__nota { font-weight: 800; color: #0f172a; }
.avgw-card-stars__total { color: #94a3b8; }

/* --------------------------------------------- resumo no topo do single */

.avgw-header-resumo {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 8px;
	text-decoration: none;
	font-size: 14px;
	color: #475569;
	transition: opacity .15s;
}

.avgw-header-resumo:hover { opacity: .75; }
.avgw-resumo__nota { font-weight: 800; color: #0f172a; }
.avgw-resumo__total,
.avgw-header-resumo__cta { color: #64748b; }
.avgw-header-resumo__cta { font-weight: 600; }

/* ------------------------------------------------------------ bloco */

.avgw-bloco {
	margin: 32px 0;
	padding: 0 16px;
}

.avgw-bloco__inner {
	max-width: 1100px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 18px;
	padding: 26px;
}

.avgw-bloco__head { margin-bottom: 20px; }

.avgw-bloco__title {
	margin: 0;
	font-size: 22px;
	font-weight: 900;
	letter-spacing: -.02em;
	color: #0f172a;
}

.avgw-bloco__sub {
	margin: 4px 0 0;
	color: #64748b;
	font-size: 14px;
}

/* nota agregada + distribuição */

.avgw-nota {
	display: grid;
	grid-template-columns: minmax(140px, 200px) 1fr;
	gap: 24px;
	align-items: center;
	padding: 18px;
	background: #f8fafc;
	border-radius: 14px;
	margin-bottom: 22px;
}

@media (max-width: 640px) {
	.avgw-nota { grid-template-columns: 1fr; gap: 16px; }
	.avgw-bloco__inner { padding: 18px; }
}

.avgw-nota__media { text-align: center; }

.avgw-nota__numero {
	display: block;
	font-size: 42px;
	font-weight: 900;
	line-height: 1;
	color: #0f172a;
	margin-bottom: 6px;
}

.avgw-nota__total {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	color: #64748b;
}

/* min-width:0 é obrigatório: sem isso o item de grid usa o tamanho mínimo do conteúdo e as
   barras de distribuição estouram a coluna em telas estreitas. */
.avgw-nota__dist { min-width: 0; }

/* Cada linha é um botão: clicar filtra a lista por aquela nota. */
.avgw-dist-linha {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	font: inherit;
	font-size: 12px;
	color: #64748b;
	background: none;
	border: 0;
	padding: 3px 6px;
	margin-bottom: 2px;
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
	transition: background-color .15s;
}

.avgw-dist-linha:hover:not(:disabled) { background: #f1f5f9; }
.avgw-dist-linha:disabled { cursor: default; opacity: .55; }
.avgw-dist-linha.is-ativo { background: #e2e8f0; }
.avgw-dist-linha.is-ativo .avgw-dist-linha__label { color: #0f172a; }
.avgw-dist-linha:focus-visible { outline: 2px solid var(--gcep-color-primary, #0052cc); outline-offset: 1px; }

.avgw-dist-limpar {
	margin-top: 6px;
	padding: 5px 12px;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	color: var(--gcep-color-primary, #0052cc);
	background: none;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	cursor: pointer;
}

.avgw-dist-limpar:hover { background: #f8fafc; }

.avgw-dist-linha__label { width: 10px; font-weight: 700; color: #475569; }

.avgw-dist-linha__barra {
	flex: 1;
	height: 7px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
}

.avgw-dist-linha__barra > span {
	display: block;
	height: 100%;
	background: var(--avgw-star);
	border-radius: 999px;
}

.avgw-dist-linha__num { width: 26px; text-align: right; }

/* lista */

.avgw-lista {
	list-style: none;
	margin: 0;
	padding: 0;
}

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

.avgw-bloco .is-hidden { display: none !important; }

.avgw-item {
	padding: 18px 0;
	border-top: 1px solid #f1f5f9;
}

.avgw-item:first-child { border-top: 0; padding-top: 0; }

.avgw-item__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.avgw-item__avatar {
	width: 38px;
	height: 38px;
	border-radius: 999px;
	background: var(--gcep-color-primary, #0052cc);
	color: #fff;
	font-weight: 800;
	font-size: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.avgw-item__meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

.avgw-item__nome {
	font-weight: 700;
	color: #0f172a;
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.avgw-item__data { font-size: 12px; color: #94a3b8; }

.avgw-item__texto {
	margin: 0;
	color: #334155;
	font-size: 14.5px;
	line-height: 1.6;
}

.avgw-item__resposta {
	margin-top: 12px;
	margin-left: 48px;
	padding: 12px 14px;
	background: #f8fafc;
	border-left: 3px solid var(--gcep-color-primary, #0052cc);
	border-radius: 0 10px 10px 0;
}

@media (max-width: 640px) {
	.avgw-item__resposta { margin-left: 0; }
}

.avgw-item__resposta-label {
	display: block;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--gcep-color-primary, #0052cc);
	margin-bottom: 4px;
}

.avgw-item__resposta-label em { font-weight: 500; text-transform: none; letter-spacing: 0; color: #94a3b8; }

.avgw-item__resposta p {
	margin: 0;
	font-size: 14px;
	color: #475569;
	line-height: 1.6;
}

.avgw-vazio {
	margin: 0;
	padding: 22px;
	text-align: center;
	color: #64748b;
	background: #f8fafc;
	border-radius: 12px;
}

/* Comentário longo: 3 linhas no card, o resto no modal. O botão só aparece quando o texto
   realmente passa do corte — quem mede é o JS, porque a mesma frase quebra diferente em cada tela. */
.avgw-clamp {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* min-width:0 impede o texto longo sem espaços (URL colada, por exemplo) de esticar o card. */
.avgw-item__content { min-width: 0; }

.avgw-item__more {
	margin-top: 4px;
	padding: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--gcep-color-primary, #0052cc);
	background: none;
	border: 0;
	cursor: pointer;
}

.avgw-item__more:hover { text-decoration: underline; }

.avgw-item__foot {
	display: flex;
	justify-content: flex-end;
	margin-top: 8px;
}

/* #ID discreto: existe para a pessoa citar no pedido de remoção. */
.avgw-item__id {
	font-size: 11px;
	color: #cbd5e1;
	letter-spacing: .03em;
	cursor: help;
}

/* ------------------------------------------------------- ver mais / modal */

.avgw-more {
	display: block;
	width: 100%;
	margin-top: 16px;
	padding: 11px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 700;
	color: #475569;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 11px;
	cursor: pointer;
	transition: background-color .15s;
}

.avgw-more:hover:not(:disabled) { background: #f8fafc; }
.avgw-more:disabled { opacity: .6; cursor: default; }

.avgw-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.avgw-modal[hidden] { display: none; }

.avgw-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .55);
}

.avgw-modal__box {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: 85vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}

.avgw-modal__x {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 32px;
	height: 32px;
	font-size: 24px;
	line-height: 1;
	color: #94a3b8;
	background: none;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.avgw-modal__x:hover { background: #f1f5f9; color: #0f172a; }

.avgw-modal__title {
	margin: 0 0 6px;
	padding-right: 28px;
	font-size: 17px;
	font-weight: 800;
	color: #0f172a;
}

.avgw-modal__sub {
	margin: 0 0 16px;
	font-size: 13.5px;
	color: #64748b;
	line-height: 1.5;
}

.avgw-read .avgw-item__head { margin-bottom: 12px; }
.avgw-read .avgw-item__texto { font-size: 14.5px; }

/* --------------------------------------------------- pedido de remoção */

.avgw-removal-cta {
	margin-top: 18px;
	text-align: center;
}

.avgw-removal-open {
	font: inherit;
	font-size: 12.5px;
	color: #94a3b8;
	background: none;
	border: 0;
	padding: 4px;
	cursor: pointer;
	text-decoration: underline;
}

.avgw-removal-open:hover { color: #475569; }

.avgw-removal-file {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	padding: 11px 13px;
	margin-bottom: 12px;
	border: 1px dashed #cbd5e1;
	border-radius: 10px;
	cursor: pointer;
	font-size: 13px;
	color: #64748b;
}

.avgw-removal-file:hover { background: #f8fafc; }
.avgw-removal-file__label { font-weight: 600; }
.avgw-removal-file__nome { color: #0f172a; font-weight: 700; }
.avgw-removal-file input[type="file"] { max-width: 100%; font-size: 12px; }

/* ------------------------------------------------------------ formulário */

.avgw-form {
	margin-top: 26px;
	padding-top: 24px;
	border-top: 1px solid #f1f5f9;
}

.avgw-form__title {
	margin: 0 0 14px;
	font-size: 17px;
	font-weight: 800;
	color: #0f172a;
}

.avgw-star-input {
	display: inline-flex;
	flex-direction: row-reverse;
	gap: 2px;
	margin-bottom: 16px;
}

/* O input fica invisível mas continua focável — o foco é desenhado no label. */
.avgw-star-input input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.avgw-star-input label {
	cursor: pointer;
	line-height: 0;
	padding: 2px;
	border-radius: 6px;
}

.avgw-star-input label .avgw-star path { fill: var(--avgw-star-off); transition: fill .12s; }

/* row-reverse + `~` pinta a estrela sob o cursor e todas à esquerda dela. */
.avgw-star-input label:hover .avgw-star path,
.avgw-star-input label:hover ~ label .avgw-star path,
.avgw-star-input input:checked ~ label .avgw-star path { fill: var(--avgw-star); }

.avgw-star-input input:focus-visible + label { box-shadow: 0 0 0 3px rgba(245, 158, 11, .35); }

.avgw-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

@media (max-width: 640px) {
	.avgw-form__row { grid-template-columns: 1fr; }
}

.avgw-field {
	display: block;
	margin-bottom: 12px;
}

.avgw-field > span {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #334155;
	margin-bottom: 5px;
}

.avgw-field small {
	display: block;
	margin-top: 4px;
	font-size: 11.5px;
	color: #94a3b8;
}

.avgw-field input,
.avgw-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 13px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	color: #0f172a;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}

.avgw-field input:focus,
.avgw-field textarea:focus {
	outline: 0;
	border-color: var(--gcep-color-primary, #0052cc);
	box-shadow: 0 0 0 3px rgba(0, 82, 204, .12);
}

.avgw-field textarea { resize: vertical; min-height: 92px; }

/* Honeypot: fora da tela, sem display:none — bots ignoram campos escondidos por display. */
.avgw-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.avgw-form__privacy {
	margin: 0 0 12px;
	font-size: 12px;
	color: #94a3b8;
	line-height: 1.5;
}

.avgw-form__foot {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 6px;
}

.avgw-btn {
	background: var(--gcep-color-primary, #0052cc);
	color: #fff;
	border: 0;
	border-radius: 11px;
	padding: 12px 26px;
	font: inherit;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	transition: filter .15s, opacity .15s;
}

.avgw-btn:hover { filter: brightness(.93); }
.avgw-btn[disabled] { opacity: .6; cursor: default; }

.avgw-form__msg {
	margin: 0;
	font-size: 13.5px;
	font-weight: 600;
}

.avgw-form__msg.is-ok { color: #15803d; }
.avgw-form__msg.is-err { color: #b91c1c; }

/* Atalho na linha do anúncio, no painel do anunciante. */
.avgw-row-action {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 700;
	color: #475569;
	text-decoration: none;
}

.avgw-row-action .material-symbols-outlined { font-size: 18px; }
.avgw-row-action:hover { color: var(--gcep-color-primary, #0052cc); }
