/* ============================================================
   Front Modal  ——  Re. Boutique
   ------------------------------------------------------------
   前台彈跳視窗：取代瀏覽器原生 alert / confirm
   依附 brand CSS variables（--brand-ink / --brand-line 等），
   按鈕使用 .btn 系列既有樣式以保持視覺一致
   ============================================================ */

/* 容器：全螢幕覆蓋，僅在 is-open 時顯示 */
.front-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.front-modal.is-open { display: flex; }

/* 遮罩：點擊空白處可關閉（由 JS 處理） */
.front-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* 主面板 */
.front-modal__panel {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 440px;
    padding: 40px 32px 32px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: front-modal-in 0.22s ease;
}

@keyframes front-modal-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 圓形 icon 框，依 data-type 切色 */
.front-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--brand-line, #E5E5E5);
    border-radius: 50%;
    color: var(--brand-ink, #3A3A3A);
}
.front-modal__icon[data-type="success"] { border-color: var(--brand-accent, #C56278); color: var(--brand-accent, #C56278); }
.front-modal__icon[data-type="error"]   { border-color: #C53030; color: #C53030; }
.front-modal__icon[data-type="warning"] { border-color: #D69E2E; color: #D69E2E; }
.front-modal__icon[data-type="info"]    { border-color: var(--brand-ink, #3A3A3A); color: var(--brand-ink, #3A3A3A); }
.front-modal__icon svg { width: 28px; height: 28px; }
.front-modal__icon[hidden] { display: none; }

/* 標題 */
.front-modal__title {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 12px;
    color: var(--brand-ink, #3A3A3A);
    letter-spacing: 0.02em;
}
.front-modal__title:empty { display: none; }

/* 內文訊息（支援自動換行） */
.front-modal__message {
    font-size: 14px;
    line-height: 1.75;
    color: var(--brand-muted, #888);
    margin: 0 0 28px;
    white-space: pre-line;
    word-break: break-word;
}
.front-modal__message:empty { display: none; }

/* 操作列 */
.front-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.front-modal__actions .btn {
    min-width: 110px;
    padding: 12px 24px;
}

/* 開啟時鎖捲動 */
body.is-modal-open { overflow: hidden; }

/* 手機尺寸微調 */
@media (max-width: 480px) {
    .front-modal__panel { padding: 32px 20px 24px; }
    .front-modal__title { font-size: 18px; }
}
