/* LGPD & Cookie - OPT: banner, botão de reabertura e modal de preferências.
   As cores vêm das variáveis --lgpd-* definidas no elemento #lgpd-consent-root. */
.lgpd-root { --lgpd-bg: #ffffff; --lgpd-text: #1e293b; --lgpd-link: #2563eb; --lgpd-primary: #4f46e5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.lgpd-root *, .lgpd-root *::before, .lgpd-root *::after { box-sizing: border-box; }
.lgpd-root [hidden] { display: none !important; }
.lgpd-icon { flex: 0 0 auto; }

/* ---- Banner ---- */
.lgpd-banner { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 999999; width: calc(100% - 48px); max-width: 440px; padding: 22px; border-radius: 16px; background: var(--lgpd-bg); color: var(--lgpd-text); border: 1px solid rgba(15,23,42,.1); box-shadow: 0 20px 35px rgba(0,0,0,.15), 0 5px 15px rgba(0,0,0,.08); animation: lgpdSlideUp .4s ease-out both; }
.lgpd-pos-left .lgpd-banner, .lgpd-pos-left .lgpd-reopen { left: 24px; }
.lgpd-pos-right .lgpd-banner, .lgpd-pos-right .lgpd-reopen { right: 24px; }
@keyframes lgpdSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.lgpd-banner h3 { margin: 0 0 8px; padding: 0; display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 700; line-height: 1.3; color: var(--lgpd-text); }
.lgpd-banner h3 .lgpd-icon { color: var(--lgpd-primary); }
.lgpd-banner p { margin: 0 0 14px; font-size: .88rem; line-height: 1.55; color: var(--lgpd-text); opacity: .92; }
.lgpd-policy-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 16px; font-size: .8rem; }
.lgpd-policy-links a { color: var(--lgpd-link); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lgpd-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.lgpd-btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font: inherit; font-size: .85rem; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; transition: transform .15s, opacity .15s, background .15s; }
.lgpd-btn:hover { transform: translateY(-1px); }
.lgpd-btn:focus-visible, .lgpd-reopen:focus-visible, .lgpd-modal-close:focus-visible, .lgpd-switch input:focus-visible + .lgpd-slider { outline: 3px solid var(--lgpd-link); outline-offset: 2px; }
.lgpd-btn-accept { background: var(--lgpd-primary); color: #fff; box-shadow: 0 4px 10px rgba(15,23,42,.18); }
.lgpd-btn-accept:hover { opacity: .92; }
.lgpd-btn-reject { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.lgpd-btn-reject:hover { background: #e2e8f0; color: #0f172a; }
.lgpd-btn-options { background: transparent; color: var(--lgpd-link); border-color: var(--lgpd-link); }
.lgpd-btn-options .lgpd-icon { width: 16px; height: 16px; }

/* ---- Botão para reabrir ---- */
.lgpd-reopen { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 999998; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--lgpd-bg); color: var(--lgpd-text); border: 1px solid rgba(15,23,42,.12); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,.12); transition: transform .15s, box-shadow .15s, border-color .15s; }
.lgpd-reopen .lgpd-icon { width: 16px; height: 16px; color: var(--lgpd-primary); }
.lgpd-reopen:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.18); border-color: var(--lgpd-primary); }

/* ---- Modal ---- */
.lgpd-modal { position: fixed; inset: 0; z-index: 9999999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,.7); backdrop-filter: blur(4px); }
.lgpd-modal-content { width: 100%; max-width: 550px; max-height: 90vh; overflow-y: auto; padding: 28px; border-radius: 18px; background: var(--lgpd-bg); color: var(--lgpd-text); box-shadow: 0 25px 50px -12px rgba(0,0,0,.3); }
.lgpd-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid rgba(15,23,42,.12); }
.lgpd-modal-header h3 { margin: 0; padding: 0; font-size: 1.2rem; color: var(--lgpd-text); }
.lgpd-modal-close { display: inline-flex; padding: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--lgpd-text); opacity: .7; cursor: pointer; }
.lgpd-modal-close:hover { opacity: 1; }
.lgpd-modal-intro { margin: 0 0 16px; font-size: .88rem; opacity: .85; }
.lgpd-option-block { padding: 14px 16px; margin-bottom: 12px; border-radius: 12px; border: 1px solid rgba(15,23,42,.12); background: rgba(15,23,42,.03); }
.lgpd-option-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.lgpd-option-title { font-weight: 700; font-size: .95rem; }
.lgpd-option-title small { font-weight: 500; opacity: .65; }
.lgpd-option-desc { margin: 0; font-size: .83rem; line-height: 1.5; opacity: .8; }
.lgpd-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.lgpd-modal-actions .lgpd-btn { flex: 0 1 auto; }

/* ---- Interruptor ---- */
.lgpd-switch { position: relative; display: inline-block; flex: 0 0 44px; width: 44px; height: 24px; }
.lgpd-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.lgpd-slider { position: absolute; inset: 0; border-radius: 24px; background: #cbd5e1; transition: background .2s; }
.lgpd-slider::before { content: ""; position: absolute; left: 3px; bottom: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.lgpd-switch input:checked + .lgpd-slider { background: var(--lgpd-primary); }
.lgpd-switch input:checked + .lgpd-slider::before { transform: translateX(20px); }
.lgpd-switch input:disabled { cursor: not-allowed; }
.lgpd-switch input:disabled + .lgpd-slider { opacity: .6; }

/* ---- Celular: banner na largura toda, com folga para a barra do tema ---- */
@media (max-width: 600px) {
	.lgpd-banner { left: 12px !important; right: 12px !important; width: auto; max-width: none; bottom: max(12px, env(safe-area-inset-bottom)); padding: 18px; }
	.lgpd-reopen { bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); } /* acima da barra fixa do tema (≈82px), que aparece ao rolar */
	.lgpd-pos-left .lgpd-reopen { left: 12px; }
	.lgpd-pos-right .lgpd-reopen { right: 12px; }
	.lgpd-action-buttons .lgpd-btn { flex: 1 1 100%; }
	.lgpd-modal-content { padding: 20px; }
	.lgpd-modal-actions .lgpd-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .lgpd-banner { animation: none; } .lgpd-btn, .lgpd-reopen, .lgpd-slider, .lgpd-slider::before { transition: none; } }
