/* ============================================================
 * Oumos Popup Menu — 前端樣式
 * ============================================================ */

.oumos-popup-wrap {
	--oumos-fade: 0.3s;
	--oumos-icon-fade: 0.3s;
}

/* ---------- 觸發 Icon ---------- */
.oumos-popup-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	cursor: pointer;
	line-height: 1;
	background: #111;
	color: #fff;
	opacity: 1;
	transition: opacity var(--oumos-icon-fade) ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.oumos-popup-trigger:hover {
	filter: brightness(1.08);
}

.oumos-popup-trigger .oumos-trigger-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.oumos-popup-trigger .oumos-trigger-icon svg {
	width: 1em;
	height: 1em;
}

/* 由捲動控制隱藏 icon（fade out） */
.oumos-popup-wrap.oumos-hidden .oumos-popup-trigger {
	opacity: 0;
	pointer-events: none;
}

/* ---------- 遮罩 Overlay ---------- */
.oumos-popup-overlay {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity var(--oumos-fade) ease, visibility var(--oumos-fade) ease;
	z-index: 99999;
	-webkit-overflow-scrolling: touch;
}

.oumos-popup-overlay.oumos-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* ---------- 面板 Panel ---------- */
.oumos-popup-panel {
	position: relative;
	display: flex;
	/* 用 row：justify-content = 水平軸、align-items = 垂直軸，對齊控制才正確 */
	flex-direction: row;
	flex-wrap: nowrap;
	box-sizing: border-box;
	background: #fff;
	max-width: 100%;
	overflow: auto;
	transition: transform var(--oumos-fade) ease, opacity var(--oumos-fade) ease;
}

/* 面板內用來放容器：靠 justify-content / align-items 控制容器對齊 */
.oumos-popup-panel {
	justify-content: center; /* 水平：預設置中 */
	align-items: flex-start; /* 垂直：預設靠上 */
}

/* --- 滿版 100% --- */
.oumos-popup-panel[data-type="fullscreen"] {
	width: 100%;
	height: 100%;
}

/* --- 右側滑出 --- */
.oumos-popup-overlay[data-active="right"] {
	justify-content: flex-end;
}
.oumos-popup-panel[data-type="right"] {
	height: 100%;
	margin-left: auto;
	transform: translateX(100%);
}

/* --- 左側滑出 --- */
.oumos-popup-overlay[data-active="left"] {
	justify-content: flex-start;
}
.oumos-popup-panel[data-type="left"] {
	height: 100%;
	margin-right: auto;
	transform: translateX(-100%);
}

/* --- 滿版時淡入即可（不位移） --- */
.oumos-popup-panel[data-type="fullscreen"] {
	transform: none;
	opacity: 0;
}

/* 開啟後：滑入 / 淡入到位 */
.oumos-popup-overlay.oumos-open .oumos-popup-panel[data-type="right"],
.oumos-popup-overlay.oumos-open .oumos-popup-panel[data-type="left"] {
	transform: translateX(0);
}
.oumos-popup-overlay.oumos-open .oumos-popup-panel[data-type="fullscreen"] {
	opacity: 1;
}

/* ---------- 內容容器 ---------- */
.oumos-popup-container {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	padding: 0; /* 預設 padding 0 */
	/* 不因 flex 被拉伸或壓縮，寬度設定才會確實生效 */
	flex: 0 0 auto;
}

/* 讓召喚進來的 Elementor 範本填滿容器寬度，容器寬度調整才看得出效果 */
.oumos-popup-container > .elementor {
	width: 100%;
}

.oumos-popup-empty {
	padding: 24px;
	color: #888;
	font-size: 14px;
	text-align: center;
}

/* ---------- 關閉鈕 ---------- */
.oumos-popup-close {
	position: absolute;
	top: 10px;
	right: 14px;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	color: #111;
	z-index: 5;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.oumos-popup-close:hover {
	transform: rotate(90deg);
	opacity: 0.7;
}

/* ---------- 開啟時鎖住背景捲動 ---------- */
body.oumos-popup-lock {
	overflow: hidden;
}

/* ============================================================
 * 編輯器內：讓觸發 icon 一定看得到，方便編輯預覽
 * ============================================================ */
.elementor-editor-active .oumos-popup-wrap.oumos-hidden .oumos-popup-trigger {
	opacity: 1;
	pointer-events: auto;
}
