/*
 * 商城彈窗（賣家公告 / 蓋版廣告）共用樣式。
 *
 * 色值走 var(--mall-accent, …)，由各版型主題的 style.css 定義。
 * class 一律加 mall-overlay 前綴，不沿用舊的 .close-btn（全域名字，影片 modal 也在用）。
 */
.mall-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

/* 賣家公告：寬度與遮罩色對齊舊 site-dialog（width 600 / rgba(0,0,0,.7)） */
.mall-overlay__card {
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  border-top: 4px solid var(--mall-accent, #e75280);
  overflow: hidden;
}

.mall-overlay__header {
  padding: 16px 20px 12px;
  text-align: center;
  border-bottom: 1px solid #ececec;
}

.mall-overlay__header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  color: var(--mall-accent, #e75280);
}

.mall-overlay__body {
  padding: 16px 20px;
  overflow-y: auto;
  color: #29353f;
  word-wrap: break-word;
}

.mall-overlay__foot {
  padding: 12px 20px 16px;
  text-align: center;
}

.mall-overlay__btn {
  min-width: 120px;
  padding: 10px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--mall-accent, #e75280);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

/* 公告內容是 CKEditor HTML，主題的 reset 會把 p/h2/ul 吃光，還原瀏覽器預設 */
.mall-overlay__body.ck-content p,
.mall-overlay__body.ck-content h2,
.mall-overlay__body.ck-content h3,
.mall-overlay__body.ck-content h4,
.mall-overlay__body.ck-content strong,
.mall-overlay__body.ck-content i,
.mall-overlay__body.ck-content a,
.mall-overlay__body.ck-content ul,
.mall-overlay__body.ck-content ol,
.mall-overlay__body.ck-content li {
  all: revert;
}

/* 蓋版廣告 */
.mall-overlay__ad {
  position: relative;
  padding: 20px 10px;
  text-align: center;
}

.mall-overlay__ad img {
  display: block;
  width: 450px;
  height: 450px;
  object-fit: contain;
}

.mall-overlay__close {
  position: absolute;
  top: -10px;
  right: -17px;
  font-size: 40px;
  cursor: pointer;
  padding: 5px;
  color: #ffffff;
}

@media (max-width: 767px) {
  .mall-overlay__ad {
    width: 90%;
    margin: 0 auto;
    padding: 10px;
  }

  .mall-overlay__ad img {
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
  }

  .mall-overlay__close {
    top: -25px;
    right: 5px;
  }
}
