/* =========================================================
   MODAL BASE
========================================================= */

.mm-modal {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
}

/* =========================================================
   BACKDROP
========================================================= */

.mm-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.45);
	opacity: 0;
	transition: opacity .2s ease;
}

.mm-modal.show .mm-backdrop {
	opacity: 1;
}

.mm-modal.closing .mm-backdrop {
	opacity: 0;
}

/* =========================================================
   WINDOW (BASE STATE = HIDDEN)
========================================================= */

.mm-window {
	position: relative;
	background: #fff;
	border-radius: 8px;
	padding: 0px;
	width: 480px;
	min-width: 320px;
	max-width: 95vw;
	max-height: 100%;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0,0,0,.3);

	display: flex;
	flex-direction: column;

	opacity: 0;
	transform: translateY(20px);
	transition:
		opacity .2s ease,
		transform .2s ease;
}

/* =========================================================
   MODAL SIZES (Bootstrap-like)
========================================================= */
.mm-body {
	flex: 1 1 auto;
	overflow-y: auto;
	overflow-x: hidden;
	min-height: 0; /* MUITO IMPORTANTE para flexbox */
	padding: 0px 15px 20px;
}
.mm-header,
.mm-footer {
	flex: 0 0 auto;
}

/* Extra small */
.mm-window.mm-size-xs {
	width: 300px !important;
}

/* Small */
.mm-window.mm-size-sm {
	width: 500px !important;
}

/* Medium (default) */
.mm-window.mm-size-md {
	width: 600px !important;
}

/* Large */
.mm-window.mm-size-lg {
	width: 800px !important;
}

/* Extra large */
.mm-window.mm-size-xl {
	width: 1100px !important;
}
/* Full-width */
.mm-window.mm-size-xxl {
	width: 100% !important;
}


.mm-window.mm-size-pdf
{
	width: 50% !important;
	min-width: 50% !important;
	max-width: 50% !important;
	padding: 0px !important;
}
.mm-window.mm-size-pdf .mm-body
{
	background-color: #1d1d1d;
	padding: 0px !important;
}
.mm-window.mm-size-pdf .mm-header
{
	padding: 10px 16px 0px 16px !important;
}
.mm-window.mm-size-pdf .mm-header .mm-title
{
	font-size: 1rem !important;
}
@media (max-width: 750px)
{
	.mm-window.mm-size-pdf
	{
		width: 100% !important;
		min-width: 100% !important;
		max-width: 100% !important;
	}
}
@media (min-width: 1500px)
{
	.mm-window.mm-size-pdf
	{
		width: 50% !important;
		min-width: 50% !important;
		max-width: 50% !important;
	}
}
@media (min-width: 2000px)
{
	.mm-window.mm-size-pdf
	{
		width: 40% !important;
		min-width: 40% !important;
		max-width: 40% !important;
	}
}

.mm-modal.pos-center .mm-window.mm-size-pdf
{
	width: 95vw !important;
	min-width: 95vw !important;
	max-width: 95vw !important;
	padding: 0px !important;
}
.mm-modal.pos-center .mm-window.mm-size-pdf .mm-body
{
	padding: 0 !important;
	overflow-x: auto;
	overflow-y: auto;
}
.mm-modal.pos-center .mm-window.mm-size-pdf .mm-footer
{
	margin: 0px;
	padding: 0px;
	border: unset;
}

/* Fullscreen overrides size */
.mm-modal.fullscreen .mm-window {
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
}



/* =========================================================
   WINDOW – SHOW
========================================================= */

.mm-modal.show .mm-window {
	opacity: 1;
	transform: translateY(0);
}

/* =========================================================
   PROCESSING OVERLAY
========================================================= */

.mm-processing-overlay {
	position: absolute;
	inset: 0;

	width: 100%;
	height: 100%;

	background: rgba(255,255,255,.75);

	display: none;
	align-items: center;
	justify-content: center;
	text-align: center;

	z-index: 20;
}

.mm-modal.is-processing .mm-processing-overlay {
	display: flex;
}

.mm-processing-box {
	padding: 20px 30px;
}

.mm-processing-text {
	font-size: 1rem;
	font-weight: 600;
	color: #333;
}

/* =========================================================
   WINDOW – CLOSE (SLIDE UP + FADE OUT)
========================================================= */

.mm-modal.closing .mm-window {
	opacity: 0;
	transform: translateY(-20px);
}

/* =========================================================
   POSITIONS
========================================================= */

/* TOP */
.mm-modal.pos-top {
	align-items: flex-start;
	padding-top: 40px;
}

.mm-modal.pos-top .mm-window {
	transform: translateY(-20px);
}

.mm-modal.pos-top.show .mm-window {
	transform: translateY(0);
}

.mm-modal.pos-top.closing .mm-window {
	transform: translateY(-40px);
}

/* RIGHT (DRAWER) */
.mm-modal.pos-right {
	align-items: stretch;
	justify-content: flex-end;
}

.mm-modal.pos-right .mm-window {
	width: 420px;
	height: 100%;
	max-height: 100%;
	border-radius: 0;
	transform: translateX(100%);
}

.mm-modal.pos-right.show .mm-window {
	transform: translateX(0);
}

.mm-modal.pos-right.closing .mm-window {
	transform: translateX(100%);
}

/* =========================================================
   FULLSCREEN
========================================================= */

.mm-modal.fullscreen {
	align-items: stretch;
	justify-content: stretch;
}

.mm-modal.fullscreen .mm-window {
	width: 100vw;
	height: 100vh;
	max-width: 100vw;
	max-height: 100vh;
	border-radius: 0;
	transform: none;
}

.mm-modal.fullscreen.show .mm-window {
	opacity: 1;
}

.mm-modal.fullscreen.closing .mm-window {
	opacity: 0;
}

/* =========================================================
   HEADER / FOOTER
========================================================= */

.mm-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	padding: 16px 16px 10px 16px;
}

.mm-title {
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: 1.1rem;
	font-weight: 700;
}
.mm-title img.brand-logo
{
	width: 20px;
	margin-right: 10px;
	vertical-align: middle;
	background: #fff;
	border-radius: 100%;
}

.mm-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 4px;
	font-size: 28px;
	cursor: pointer;
	opacity: .5;
	line-height: 1;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: 100 !important;
	color: #000;
}

.mm-close:hover {
	background: #f1f3f5;
	opacity: 1;
}
.mm-close:focus,
.mm-close:focus-visible {
	background: #f1f3f5;
	outline: 0;
	box-shadow: none;
	opacity: 1;
}
.mm-close.is-disabled {
	opacity: .3;
	cursor: not-allowed;
	pointer-events: none;
}
/* =========================================================
   FOOTER BUTTONS
========================================================= */

.mm-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 0px;

	padding: 16px 28px;
	border-top: 1px solid #e4eaec;
	background: #fafafa;
}

.mm-footer button {
	min-width: 90px;
	padding: 6px 14px;
	border-radius: 4px;
	border: none;
	cursor: pointer;
}
.mm-footer button.is-disabled {
	opacity: .6;
	cursor: not-allowed;
}
.mm-footer button.mm-btn-cancel:focus
{
	outline: #666666 auto 5px;
}
.mm-footer button.mm-btn-confirm:focus
{
	outline: #0f499f auto 5px;
}

.mm-btn-cancel {
	background: #e0e0e0;
}
.mm-btn-confirm {
	background: #0d6efd;
	color: #fff;
	position: relative;
}
.mm-btn-warning {
	background: #ffc107;
	color: #000;
}
.mm-btn-danger {
	background: #dc3545;
	color: #fff;
}


.mm-btn-confirm.is-loading {
	color: transparent;              /* esconde texto */
	pointer-events: none;
}

.mm-btn-confirm.is-loading::after {
	content: "";
	width: 16px;
	height: 16px;

	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;

	position: absolute;
	top: 50%;
	left: 50%;
	margin-left: -8px;      /* metade do width */
	margin-top: -8px;       /* metade do height */

	animation: mm-spin .6s linear infinite;
	transform-origin: center;
}

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

/* feedback global */
.mm-modal.is-processing {
	cursor: wait;
}


/* =========================================================
   BODY SCROLL LOCK
========================================================= */

body.mm-no-scroll {
	overflow: hidden;
}


/* =========================================================
   SCROLL SHADOWS NO HEADER / FOOTER
========================================================= */

.mm-header,
.mm-footer {
	position: relative;
	z-index: 5;
}

/* sombra no header (quando há conteúdo acima) */
.mm-header.has-shadow {
	box-shadow: 0 6px 6px -4px rgba(0,0,0,.25);
}

/* sombra no footer (quando há conteúdo abaixo) */
.mm-footer.has-shadow {
	box-shadow: 0 -6px 6px -4px rgba(0,0,0,.25);
}







/* drawer (right) */
.mm-modal.pos-right {
	padding: 0;
}
.mm-modal.pos-right .mm-window.mm-size-pdf .mm-footer{
	padding: 0 !important;
}
/* modal PDF */
.mm-modal:has(.mm-window.mm-size-pdf) {
	padding: 0;
}
.mm-modal {
	padding: 20px 0;
}
