/* PS UX Builder Addons — Modal */

.ps-uxb-modal { --ps-modal-width: 640px; --ps-modal-bg: #fff; --ps-modal-radius: 12px; --ps-modal-overlay: rgba(15, 27, 43, .6); --ps-modal-accent: #446084; box-sizing: border-box; min-width: 0; }
.ps-uxb-modal *, .ps-uxb-modal *::before, .ps-uxb-modal *::after { box-sizing: inherit; min-width: 0; }
.ps-uxb-modal--align-center { text-align: center; }
.ps-uxb-modal--align-right { text-align: right; }
.ps-uxb-modal__trigger { display: inline-flex; align-items: center; gap: 8px; padding: .7em 1.6em; border: 0; border-radius: 999px; background: var(--ps-modal-accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; transition: filter .25s ease; }
.ps-uxb-modal__trigger:hover { filter: brightness(1.1); }
.ps-uxb-modal__trigger--link { padding: 0; background: none; color: var(--ps-modal-accent); text-decoration: underline; }
.ps-uxb-modal__trigger--icon { padding: .6em; border-radius: 50%; }
.ps-uxb-modal__trigger--image { padding: 0; background: none; border-radius: 8px; overflow: hidden; }

.ps-uxb-modal__overlay { position: fixed; inset: 0; z-index: 99999; display: flex; width: 100%; max-width: 100%; padding: 20px; background: var(--ps-modal-overlay); opacity: 0; transition: opacity .3s ease; overflow-x: hidden; overflow-y: auto; }
.ps-uxb-modal__overlay.is-open { opacity: 1; }
.ps-uxb-modal--pos-center { align-items: center; justify-content: center; }
.ps-uxb-modal--pos-top { align-items: flex-start; justify-content: center; }
.ps-uxb-modal--pos-bottom { align-items: flex-end; justify-content: center; }
.ps-uxb-modal--pos-left { align-items: stretch; justify-content: flex-start; padding: 0; }
.ps-uxb-modal--pos-right { align-items: stretch; justify-content: flex-end; padding: 0; }

.ps-uxb-modal__dialog { position: relative; display: flex; flex-direction: column; width: 100%; max-width: min(var(--ps-modal-width), 100%); min-height: 0; padding: 30px; overflow-x: hidden; background: var(--ps-modal-bg); border-radius: var(--ps-modal-radius); text-align: left; transition: transform .35s cubic-bezier(.16, 1, .3, 1), opacity .3s ease; }
.ps-uxb-modal--pos-left .ps-uxb-modal__dialog,
.ps-uxb-modal--pos-right .ps-uxb-modal__dialog { width: min(var(--ps-modal-width), 100%); max-width: 100%; height: 100%; border-radius: 0; overflow-x: hidden; overflow-y: auto; }
.ps-uxb-modal--anim-fade .ps-uxb-modal__dialog { opacity: 0; }
.ps-uxb-modal--anim-zoom .ps-uxb-modal__dialog { transform: scale(.9); opacity: 0; }
.ps-uxb-modal--anim-slide .ps-uxb-modal__dialog { transform: translateY(40px); opacity: 0; }
.ps-uxb-modal--anim-flip .ps-uxb-modal__dialog { transform: perspective(1000px) rotateX(-12deg); opacity: 0; }
.ps-uxb-modal--pos-right.ps-uxb-modal--anim-slide .ps-uxb-modal__dialog { transform: translateX(60px); }
.ps-uxb-modal--pos-left.ps-uxb-modal--anim-slide .ps-uxb-modal__dialog { transform: translateX(-60px); }
.ps-uxb-modal__overlay.is-open .ps-uxb-modal__dialog { transform: none; opacity: 1; }

.ps-uxb-modal__close { position: absolute; top: 10px; right: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px !important; min-width: 34px !important; height: 34px !important; min-height: 34px !important; margin: 0; padding: 0 !important; border: 0; border-radius: 50%; appearance: none; background: rgba(15, 27, 43, .06); color: inherit; font: inherit; font-size: 20px; font-weight: 700; line-height: 1 !important; text-align: center; cursor: pointer; transition: background-color .2s ease; }
.ps-uxb-modal__close span { display: block; line-height: 1; transform: translateY(-.02em); }
.ps-uxb-modal__close:hover { background: rgba(15, 27, 43, .14); }
.ps-uxb-modal__title { margin: 0 34px .6em 0; }
.ps-uxb-modal__body { min-width: 0; overflow-wrap: anywhere; }
.ps-uxb-modal__body > * { max-width: 100%; }
.ps-uxb-modal__body > :last-child { margin-bottom: 0; }

body.ps-uxb-modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.ps-uxb-modal__overlay, .ps-uxb-modal__dialog { transition: none; }
}

/* Trong trình dựng: hiện hộp thoại ngay trong trang. */
.ps-uxb-modal--builder .ps-uxb-modal__preview { margin-top: 14px; padding: 14px; border: 1px dashed rgba(0, 0, 0, .16); border-radius: 8px; background: rgba(0, 0, 0, .02); }
.ps-uxb-modal--builder .ps-uxb-modal__dialog { position: static; width: 100%; max-width: min(var(--ps-modal-width), 100%); margin: 0 auto; transform: none; opacity: 1; }

@media (max-width: 599px) {
	.ps-uxb-modal__overlay { padding: 14px; }
	.ps-uxb-modal__dialog { padding: 24px 20px; }
	.ps-uxb-modal--pos-left,
	.ps-uxb-modal--pos-right { padding: 0; }
	.ps-uxb-modal--pos-left .ps-uxb-modal__dialog,
	.ps-uxb-modal--pos-right .ps-uxb-modal__dialog { width: min(var(--ps-modal-width), 100%); padding: 24px 20px; }
}
