/* Campos Complementares — ficha do produto (frontend). */
.dshe_extra_fields { margin: 16px 0; display: flex; flex-direction: column; gap: 14px; }
.dshe_extra_fields_row { display: flex; flex-direction: column; gap: 6px; }
.dshe_extra_fields_row[hidden] { display: none !important; }
.dshe_extra_fields_row > :is(label, .dshe-ef-legend) { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dshe_extra_fields_row label{ font-size: 14px;}
.dshe-ef-tip { color: #888; cursor: help; display: inline-flex; }
.dshe-ef-tip .dsh-i { font-size: 14px; }
.dshe-ef-qtybadge { margin-left: auto; font-size: 12px; font-weight: 500; color: #555; background: #f2f3f5; border-radius: 12px; padding: 2px 10px; }
.dshe_extra_fields_row select.dshe-ef-select { width: 100%; min-height: 44px; }

/* Mesmo visual do contador das Categorias de Preço (.price-cat-group-qtd). */
.dshe-ef-qtygroup { display: inline-flex; align-items: center; gap: 0; flex: 0 0 auto; width: max-content; border: 1px solid #d5d8dd; border-radius: 8px; overflow: hidden; }
.dshe-ef-qtygroup[hidden] { display: none !important; }
.dshe-ef-qtygroup button { border: 0; background: #f6f7f9; width: 28px; height: 38px; font-size: 18px; cursor: pointer; line-height: 1; }
.dshe-ef-qtygroup button:hover { background: #eceef1; }
.dshe-ef-qty { width: 40px; height: 38px; border: 0; border-left: 1px solid #d5d8dd; border-right: 1px solid #d5d8dd; text-align: center; -moz-appearance: textfield; }
.dshe-ef-qty::-webkit-outer-spin-button, .dshe-ef-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.dshe_extra_fields_notice { background: #fcf0f1; color: #b32d2e; border: 1px solid #f1c6c8; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.dshe_extra_fields_notice[hidden] { display: none !important; }

/* Obrigatório: asterisco vermelho após o nome. */
.ef-field-required { color: #dc2626; font-weight: 700; }

/* select2 no front — largura total e altura coerente com os campos. */
.dshe_extra_fields .select2-container.dsh-select2 { width: 100% !important; }
.dshe_extra_fields .select2-container.dsh-select2 .select2-selection { min-height: 44px; display: flex; align-items: center; }
/* Caret padrão (simples e múltipla): ícone `dsh-icon-regular dsh-icon-angle-down` (glifo \f107) a 12px da direita,
   centralizado na altura; a seta nativa do select2 sai e o select nativo perde o estilo do navegador. */
.dshe_extra_fields select.dshe-ef-select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: none; padding-right: 40px; }
.dshe_extra_fields select.dshe-ef-select::-ms-expand { display: none; }
/* Option com value em branco ("") — escolhida no campo e na própria lista → cor de placeholder, igual ao select2. */
.dshe_extra_fields select.dshe-ef-select:has(option[value=""]:checked),
.dshe_extra_fields select.dshe-ef-select option[value=""],
.dshe_extra_fields .select2-container .select2-selection__placeholder { color: #8a9099 !important; }
.dshe_extra_fields select.dshe-ef-select option:not([value=""]) { color: #15181c; }
.dshe_extra_fields .select2-container .select2-selection__arrow { display: none !important; }
.dshe_extra_fields .select2-container .select2-selection { position: relative; padding-right: 40px; cursor: pointer; }
.dshe_extra_fields .select2-container .select2-selection::after {
	content: "\f107";
	position: absolute;
	top: 50%;
	right: 12px;
	font: var(--dshi-font-regular, normal 400 1em/1 "dsh-icon");
	font-size: 16px;
	line-height: 1;
	color: currentColor;
	transform: translateY(-50%);
	transition: transform .2s ease;
	pointer-events: none;
	-webkit-font-smoothing: antialiased;
}
.dshe_extra_fields .select2-container--open .select2-selection::after { transform: translateY(-50%) rotate(180deg); }
/* Select2 4.1: `ul` dos escolhidos + `span` da busca (textarea) são irmãos. `display: contents` no ul → chips e busca
   viram itens do mesmo flex: alinhados à esquerda, inline, quebrando linha quando não cabem. */
.dshe_extra_fields .select2-container .select2-selection--multiple { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px; text-align: left; }
.dshe_extra_fields .select2-container .select2-selection--multiple .select2-selection__rendered { display: contents; }
.dshe_extra_fields .select2-container .select2-selection--multiple .select2-selection__choice { display: inline-flex; align-items: center; max-width: 100%; margin: 0; }
.dshe_extra_fields .select2-container .select2-selection--multiple .select2-search--inline { display: flex; flex: 1 1 8em; min-width: 8em; }
.dshe_extra_fields .select2-container .select2-selection--multiple .select2-search__field { width: 100% !important; height: auto; min-height: 24px; margin: 0; padding: 0; font: inherit; line-height: 1.5; text-align: left; vertical-align: middle; }
.dshe_extra_fields .select2-container .select2-search--inline .select2-search__field::placeholder { color: #8a9099; }
/* Placeholder centralizado na vertical: a busca é um <textarea> (select2 4.1) — altura = 1 linha, sem a margem/altura do
   select2 nem padding/altura mínima do tema; o bloco da busca fica no centro da caixa. */
.dshe_extra_fields .select2-container .select2-selection--multiple .select2-search--inline { align-self: center; align-items: center; height: auto; margin: 0; }
.dshe_extra_fields .select2-container .select2-selection--multiple textarea.select2-search__field {
	display: block;
	box-sizing: content-box;
	height: 1.5em !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	line-height: 1.5em !important;
	overflow: hidden;
	resize: none;
}

/* Lista das seleções (carrinho/pedido/e-mail). */
ul.dshe-extra-fields { list-style: none; margin: 6px 0 0; padding: 0; font-size: .92em; }
ul.dshe-extra-fields li { margin: 2px 0; color: #555; }
ul.dshe-extra-fields li strong { font-weight: 600; }

/* Lista de Checkbox (Seleção Múltipla): cada opção é um cartão clicável com caixa própria e o custo ao lado. */
.dshe_extra_fields { --dshe-ef-accent: #15181c; --dshe-ef-line: #d5d8dd; }
.dshe-ef-checks { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.dshe-ef-check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--dshe-ef-line);
	border-radius: 10px;
	background: #fff;
	font-weight: 400;
	cursor: pointer;
	transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.dshe-ef-check:hover { border-color: #9aa1ab; }
.dshe-ef-check:has(.dshe-ef-check-input:checked) { border-color: var(--dshe-ef-accent); background: #f8f9fb; box-shadow: inset 0 0 0 1px var(--dshe-ef-accent); }
.dshe-ef-check:has(.dshe-ef-check-input:disabled) { cursor: not-allowed; opacity: .55; }
/* Input nativo invisível, mas focável (teclado/leitor de tela). */
.dshe-ef-check-input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.dshe-ef-check-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	border: 2px solid #9aa1ab;
	border-radius: 6px;
	background: #fff;
	transition: background-color .15s, border-color .15s;
}
.dshe-ef-check-box::after {
	content: "";
	width: 10px;
	height: 5px;
	margin-top: -3px;
	border-bottom: 2px solid #fff;
	border-left: 2px solid #fff;
	transform: rotate(-45deg) scale(0);
	transition: transform .15s ease;
}
.dshe-ef-check-input:checked + .dshe-ef-check-box { border-color: var(--dshe-ef-accent); background: var(--dshe-ef-accent); }
.dshe-ef-check-input:checked + .dshe-ef-check-box::after { transform: rotate(-45deg) scale(1); }
.dshe-ef-check-input:focus-visible + .dshe-ef-check-box { outline: 2px solid #214dff; outline-offset: 2px; }
.dshe-ef-check-label { flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; color: #15181c; }
.dshe-ef-check-price { flex-shrink: 0; font-size: 14px; font-weight: 600; color: #0a7a3e; white-space: nowrap; }
/* Título + linha de custo (preço + tipo de cobrança). */
.dshe-ef-check-label { display: flex; flex-direction: column; gap: 2px; }
.dshe-ef-check-title { font-weight: 600; }
.dshe-ef-check-cost { color: var(--dshe-ef-accent, #214dff); font-size: 13px; font-weight: 400; line-height: 1.4; }
.dshe-ef-check-cost.is-free { color: #687079; }

/* Grupo em Valor Único: rádio (caixa redonda + ponto). */
.dshe-ef-checks.is-single .dshe-ef-check-box { border-radius: 50%; }
.dshe-ef-checks.is-single .dshe-ef-check-box::after { width: 8px; height: 8px; margin: 0; border: 0; border-radius: 50%; background: #fff; transform: scale(0); }
.dshe-ef-checks.is-single .dshe-ef-check-input:checked + .dshe-ef-check-box::after { transform: scale(1); }

/* Grupo de Cores: pílulas (amostra da cor + nome; title = nome), lado a lado. */
.dshe-ef-checks--colors { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.dshe-ef-chip { gap: 8px; padding: 8px 14px; border-radius: 999px; }
.dshe-ef-chip:has(.dshe-ef-check-input:focus-visible) { outline: 2px solid #214dff; outline-offset: 2px; }
.dshe-ef-swatch { flex: 0 0 auto; width: 20px; height: 20px; border: 1px solid rgba(0, 0, 0, .15); border-radius: 50%; background: var(--dshe-ef-swatch, #000); }
.dshe-ef-chip-name { font-size: 14px; font-weight: 600; line-height: 1.2; color: #15181c; }
.dshe-ef-chip-cost { font-size: 12px; color: var(--dshe-ef-accent, #214dff); white-space: nowrap; }

/* Controle Individual: quantidade por opção escolhida. */
.dshe-ef-optqty[hidden] { display: none !important; }
/* Hint do erro do campo (abaixo dele): texto vermelho. Quantidade (dshe-extra-fields.js) e Cart Form (--cf). */
.dshe-ef-fieldhint { margin: 8px 0 0; padding: 0; color: #c62828; font-size: 13px; line-height: 1.45; }
.dshe-ef-fieldhint[hidden] { display: none !important; }
.dshe-ef-optqtys { display: flex; flex-direction: column; }
.dshe-ef-optqty--line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--dshe-ef-line); }
/* Última linha VISÍVEL sem borda (as não escolhidas ficam [hidden] — :last-child não serve). */
.dshe-ef-optqty--line:not(:has(~ .dshe-ef-optqty--line:not([hidden]))) { border-bottom: 0; }
.dshe-ef-optqty-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dshe-ef-optqty-info strong { font-size: 15px; font-weight: 600; color: #15181c; }
.dshe-ef-optqty-info small { font-size: 12px; line-height: 1.4; color: #687079; }
.dshe-ef-optqty--inline { flex: 0 0 auto; margin-left: auto; cursor: default; }
.dshe-ef-optqty .dshe-ef-qtygroup { flex: 0 0 auto; }
.dshe-ef-optqty--inline .dshe-ef-qtygroup button { width: 28px; height: 38px; }
.dshe-ef-optqty--inline .dshe-ef-qty { width: 40px; height: 38px; }
.dshe-ef-qtygroup button:disabled { opacity: .35; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
	.dshe-ef-check, .dshe-ef-check-box, .dshe-ef-check-box::after { transition: none; }
	.dshe_extra_fields .select2-container .select2-selection::after { transition: none; }
}

/* Campo com erro (obrigatório, quantidade, retorno do servidor): borda vermelha. */
.dshe_extra_fields_row.has-error .select2-container .select2-selection,
.dshe_extra_fields_row.has-error .dshe-ef-select,
.dshe_extra_fields_row.has-error .dshe-ef-check,
.dshe_extra_fields_row.has-error .dshe-ef-optqty:not([hidden]) .dshe-ef-qtygroup {
	border-color: #c62828 !important;
	box-shadow: 0 0 0 1px #c62828;
}
.dshe_extra_fields_row.has-error > label,
.dshe_extra_fields_row.has-error > .dshe-ef-legend { color: #9b1c1c; }

/* Dentro do Cart Form o aviso geral é um só (.dshe-cf__error); o motivo de cada campo fica no hint abaixo dele. */
form.cart:has([data-cf-error]) .dshe_extra_fields_notice { display: none !important; }

