/* Medfy — banner e painel de cookies. Paleta: #003741 / #386277 / #7F99A4 / #E5E2DD. */
.medfy-consent, .medfy-consent-overlay { font-family: 'Neue Montreal', sans-serif; color: #003741; }
.medfy-consent[hidden], .medfy-consent-overlay[hidden] { display: none !important; }

/* Banner: faixa compacta junto à base da tela */
.medfy-consent {
	position: fixed; z-index: 99990; left: 16px; right: 16px; bottom: 16px;
	max-width: 1040px; margin: 0 auto;
	display: flex; align-items: center; justify-content: space-between; gap: 28px;
	padding: 22px 28px;
	background: #E5E2DD; border: 1px solid rgba(0, 55, 65, 0.28); border-radius: 2px;
	box-shadow: 0 10px 36px rgba(0, 55, 65, 0.16);
	opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.medfy-consent.is-visible { opacity: 1; transform: none; }
.medfy-consent__text { flex: 1 1 auto; min-width: 0; }
.medfy-consent__title { margin: 0 0 6px; font-family: 'Questrial', sans-serif; font-size: 20px; line-height: 1.25; font-weight: 400; color: #003741; }
.medfy-consent__desc { margin: 0; font-size: 15px; line-height: 1.55; color: #003741; }
.medfy-consent__desc a, .medfy-consent-panel__intro a { color: #003741; text-decoration: underline; text-underline-offset: 3px; }
.medfy-consent__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }

.medfy-consent__btn {
	appearance: none; -webkit-appearance: none; cursor: pointer; margin: 0;
	min-height: 48px; padding: 12px 22px; border-radius: 2px;
	font-family: 'Neue Montreal', sans-serif; font-size: 16px; line-height: 1.2; font-weight: 400; white-space: nowrap;
	border: 1px solid #003741; transition: background-color .2s, color .2s;
}
.medfy-consent__btn--main { background: #003741; color: #E5E2DD; }
.medfy-consent__btn--main:hover { background: #002a32; }
.medfy-consent__btn--ghost { background: transparent; color: #003741; }
.medfy-consent__btn--ghost:hover { background: rgba(0, 55, 65, 0.08); }
.medfy-consent__btn:focus-visible, .medfy-consent-panel__close:focus-visible, .medfy-legal-links__btn:focus-visible,
.medfy-switch input:focus-visible + .medfy-switch__ui { outline: 2px solid #386277; outline-offset: 3px; }

/* o conteúdo não fica escondido atrás do banner */
html.medfy-consent-open body { padding-bottom: calc(var(--medfy-consent-h, 0px) + 32px); }

/* Painel de preferências */
.medfy-consent-overlay {
	position: fixed; inset: 0; z-index: 99995; display: flex; align-items: center; justify-content: center; padding: 16px;
	background: rgba(0, 55, 65, 0.55); opacity: 0; transition: opacity .2s ease;
}
.medfy-consent-overlay.is-visible { opacity: 1; }
html.medfy-consent-lock { overflow: hidden; }
.medfy-consent-panel {
	display: flex; flex-direction: column; width: 100%; max-width: 600px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
	background: #E5E2DD; border-radius: 2px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25); outline: none;
}
.medfy-consent-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 28px 0; }
.medfy-consent-panel__head h2 { margin: 0; font-family: 'Questrial', sans-serif; font-size: 24px; line-height: 1.2; font-weight: 400; color: #003741; }
.medfy-consent-panel__close {
	appearance: none; -webkit-appearance: none; cursor: pointer; flex: 0 0 auto; width: 44px; height: 44px; margin: -8px -10px 0 0; padding: 0;
	background: transparent; border: 0; border-radius: 2px; color: #003741; font-size: 30px; line-height: 1;
}
.medfy-consent-panel__body { padding: 14px 28px 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.medfy-consent-panel__intro { margin: 0 0 18px; font-size: 16px; line-height: 1.55; color: #003741; }
.medfy-cat { padding: 16px 0; border-top: 1px solid rgba(0, 55, 65, 0.2); }
.medfy-cat[hidden] { display: none; }
.medfy-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.medfy-cat__name { font-size: 17px; font-weight: 500; color: #003741; }
.medfy-cat__state { font-size: 14px; color: #386277; }
.medfy-cat__desc { margin: 4px 0 0; font-size: 15px; line-height: 1.55; color: #003741; }
.medfy-cat__desc code { font-size: 13px; background: rgba(0, 55, 65, 0.08); padding: 1px 5px; border-radius: 2px; }
.medfy-cat__tools { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: #386277; }
.medfy-consent-panel__none, .medfy-consent-panel__note { margin: 4px 0 14px; font-size: 14px; line-height: 1.55; color: #386277; }
.medfy-consent-panel__none { font-size: 16px; color: #003741; padding-top: 14px; border-top: 1px solid rgba(0, 55, 65, 0.2); }
.medfy-consent-panel__none[hidden], .medfy-consent-panel__note[hidden] { display: none; }
.medfy-consent-panel__actions { display: flex; gap: 10px; padding: 16px 28px 24px; border-top: 1px solid rgba(0, 55, 65, 0.2); }
.medfy-consent-panel__actions .medfy-consent__btn { flex: 1 1 0; }
.medfy-consent-panel__actions .medfy-consent__btn[hidden] { display: none; }

/* Interruptor (checkbox nativo acessível) */
.medfy-switch { position: relative; flex: 0 0 auto; width: 52px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.medfy-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.medfy-switch__ui { position: relative; width: 46px; height: 26px; border-radius: 13px; background: #E5E2DD; border: 2px solid #386277; box-sizing: border-box; transition: background-color .2s, border-color .2s; }
.medfy-switch__ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #386277; transition: transform .2s, background-color .2s; }
.medfy-switch input:checked + .medfy-switch__ui { background: #003741; border-color: #003741; }
.medfy-switch input:checked + .medfy-switch__ui::after { transform: translateX(20px); background: #E5E2DD; }

/* Rodapé: links legais (editáveis pelo widget de texto do Elementor) */
.medfy-legal-links { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: inherit; }
.medfy-legal-links a, .medfy-legal-links__btn { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.medfy-legal-links__btn { appearance: none; -webkit-appearance: none; cursor: pointer; padding: 0; margin: 0; background: none; border: 0; font: inherit; }
.medfy-legal-links a:hover, .medfy-legal-links__btn:hover { text-decoration-thickness: 2px; }

/* Tablet e celular */
@media (max-width: 1024px) {
	.medfy-consent { padding: 20px 22px; gap: 20px; }
	.medfy-consent__btn { padding: 12px 16px; }
}
@media (max-width: 767px) {
	.medfy-consent { left: 12px; right: 12px; bottom: 12px; flex-direction: column; align-items: stretch; gap: 16px; padding: 20px 18px 18px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }
	.medfy-consent__title { font-size: 20px; }
	.medfy-consent__desc { font-size: 15px; }
	.medfy-consent__actions { flex-direction: column; align-items: stretch; gap: 10px; }
	.medfy-consent__btn { width: 100%; min-height: 50px; white-space: normal; }
	.medfy-consent-overlay { padding: 12px; align-items: flex-end; }
	.medfy-consent-panel { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
	.medfy-consent-panel__head { padding: 20px 20px 0; }
	.medfy-consent-panel__head h2 { font-size: 22px; }
	.medfy-consent-panel__body { padding: 12px 20px 4px; }
	.medfy-consent-panel__actions { flex-direction: column; padding: 14px 20px 20px; }
	.medfy-legal-links__btn, .medfy-legal-links a { display: inline-block; padding: 12px 6px; }
}
@media (prefers-reduced-motion: reduce) {
	.medfy-consent, .medfy-consent-overlay, .medfy-switch__ui, .medfy-switch__ui::after, .medfy-consent__btn { transition: none !important; }
	.medfy-consent { transform: none; }
}

/* Especificidade extra: o tema aplica cor/borda próprias a button/[type=button]; aqui prevalece a identidade MEDFY. */
body button.medfy-consent__btn { background-color: transparent; color: #003741; border: 1px solid #003741; border-radius: 2px; box-shadow: none; text-transform: none; letter-spacing: normal; font-family: 'Neue Montreal', sans-serif; font-size: 16px; font-weight: 400; line-height: 1.2; min-height: 48px; padding: 12px 22px; }
body button.medfy-consent__btn.medfy-consent__btn--main { background-color: #003741; color: #E5E2DD; }
body button.medfy-consent__btn.medfy-consent__btn--main:hover, body button.medfy-consent__btn.medfy-consent__btn--main:focus { background-color: #002a32; color: #E5E2DD; }
body button.medfy-consent__btn.medfy-consent__btn--ghost { background-color: transparent; color: #003741; }
body button.medfy-consent__btn.medfy-consent__btn--ghost:hover, body button.medfy-consent__btn.medfy-consent__btn--ghost:focus { background-color: rgba(0, 55, 65, 0.08); color: #003741; }
body button.medfy-consent-panel__close { background: transparent; color: #003741; border: 0; box-shadow: none; padding: 0; font-size: 30px; line-height: 1; width: 44px; height: 44px; }
body button.medfy-consent-panel__close:hover, body button.medfy-consent-panel__close:focus { background: rgba(0, 55, 65, 0.08); color: #003741; }
body button.medfy-legal-links__btn { background: none; color: inherit; border: 0; box-shadow: none; padding: 0; font: inherit; text-transform: none; letter-spacing: normal; text-decoration: underline; text-underline-offset: 3px; }
body button.medfy-legal-links__btn:hover, body button.medfy-legal-links__btn:focus { background: none; color: inherit; }
@media (max-width: 1024px) { body button.medfy-consent__btn { padding: 12px 16px; } }
@media (max-width: 767px) {
	body button.medfy-consent__btn { min-height: 50px; padding: 12px 16px; }
	body button.medfy-legal-links__btn { display: inline-block; padding: 12px 6px; }
}

/* Celular: banner compacto (Aceitar e Rejeitar com o mesmo peso, lado a lado; Personalizar em largura total) */
@media (max-width: 767px) {
	.medfy-consent { gap: 12px; padding: 16px 16px 14px; }
	.medfy-consent__title { font-size: 18px; margin-bottom: 4px; }
	.medfy-consent__desc { font-size: 14.5px; line-height: 1.45; }
	.medfy-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	body button.medfy-consent__btn { min-height: 46px; padding: 9px 10px; font-size: 15px; line-height: 1.2; white-space: normal; }
	body button.medfy-consent__btn.medfy-consent__btn--ghost { grid-column: 1 / -1; }
	/* painel: botões com a mesma regra */
	.medfy-consent-panel__actions { flex-direction: row; gap: 8px; padding: 14px 20px 18px; }
	.medfy-consent-panel__actions .medfy-consent__btn { flex: 1 1 0; }
}
body .elementor-widget-text-editor .medfy-legal-links a { text-decoration: underline; text-underline-offset: 3px; color: inherit; }

/* Áreas seguras: banner e painel não ficam sob o entalhe nem sobre a barra de gestos */
.medfy-consent { left: calc(16px + var(--medfy-sal, env(safe-area-inset-left, 0px))); right: calc(16px + var(--medfy-sar, env(safe-area-inset-right, 0px))); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.medfy-consent-overlay { padding-left: calc(16px + var(--medfy-sal, env(safe-area-inset-left, 0px))); padding-right: calc(16px + var(--medfy-sar, env(safe-area-inset-right, 0px))); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 767px) {
	.medfy-consent { left: calc(12px + var(--medfy-sal, env(safe-area-inset-left, 0px))); right: calc(12px + var(--medfy-sar, env(safe-area-inset-right, 0px))); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
