/* FAQ List — 固定版式：标题居中 + 双列细边框手风琴卡片 */

.shop-faq-list {
  --faq-bg: #ffffff;
  --faq-title: #1a1a1a;
  --faq-border: #ede9e3;
  --faq-card-bg: #ffffff;
  --faq-question: #2b2b2e;
  --faq-answer: #5a5a64;
  --faq-plus: #8a8a94;
  --faq-radius: 6px;
  --faq-font: var(
    --font-body,
    "Noto Sans SC",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    Arial,
    sans-serif
  );

  box-sizing: border-box;
  width: 100%;
  margin: 1.75em 0;
  padding: 36px 28px 40px;
  background: var(--faq-bg);
  font-family: var(--faq-font);
}

/* Full-bleed background (frontend only): the block background spans the full
   viewport width, while __inner stays centered at max-width:1100px so the
   internal layout is unchanged. Editor (.is-editor) keeps the card look. */
.shop-faq-list:not(.is-editor) {
  width: 100vw;
  max-width: 100vw;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
}

/* Deletable elements: hover an element in the editor to reveal its × button.
   Only rendered inside the editor (root has .is-editor). */
.shop-faq-list .is-deletable {
  position: relative;
}
.shop-faq-list__icon-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shop-faq-list .shop-del-btn {
  position: absolute;
  top: -9px;
  right: -9px;
  z-index: 6;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #e11d48;
  border-radius: 50%;
  background: #fff;
  color: #e11d48;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.is-editor .is-deletable:hover > .shop-del-btn,
.is-editor .shop-del-btn:focus {
  display: inline-flex;
}

.shop-faq-list *,
.shop-faq-list *::before,
.shop-faq-list *::after {
  box-sizing: border-box;
}

.shop-faq-list__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.shop-faq-list__title {
  margin: 0 0 28px;
  text-align: center;
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--faq-title);
  letter-spacing: -0.02em;
}

/* 用户通过对齐工具栏选择的对齐方式覆盖默认值（标题居中/问题左对齐） */
.shop-faq-list.has-text-align-left .shop-faq-list__title,
.shop-faq-list.has-text-align-right .shop-faq-list__title,
.shop-faq-list.has-text-align-left .shop-faq-list__question,
.shop-faq-list.has-text-align-center .shop-faq-list__question,
.shop-faq-list.has-text-align-right .shop-faq-list__question {
  text-align: inherit;
}

.shop-faq-list__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.shop-faq-list__card {
  background: var(--faq-card-bg);
  border: 1px solid var(--faq-border);
  border-radius: var(--faq-radius);
}

.shop-faq-list__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--faq-question);
}

.shop-faq-list__q-text {
  flex: 1;
  min-width: 0;
}

.shop-faq-list__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--faq-plus);
  font-size: 16px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.2s ease;
}

.shop-faq-list__card.is-open .shop-faq-list__icon {
  transform: rotate(45deg);
}

.shop-faq-list__answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.shop-faq-list__card.is-open .shop-faq-list__answer {
  grid-template-rows: 1fr;
}

.shop-faq-list__answer-inner {
  overflow: hidden;
}

.shop-faq-list__answer-text {
  padding: 0 16px 14px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--faq-answer);
}

/* ---------- Editor only ---------- */
.shop-faq-list.is-editor .shop-faq-list__title.block-editor-rich-text__editable,
.shop-faq-list.is-editor
  .shop-faq-list__q-text.block-editor-rich-text__editable,
.shop-faq-list.is-editor
  .shop-faq-list__answer-text.block-editor-rich-text__editable {
  outline: none;
}

.shop-faq-list.is-editor .shop-faq-list__card {
  position: relative;
}

.shop-faq-list__card-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.shop-faq-list__remove {
  position: absolute;
  top: 4px;
  right: 28px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0ece6;
  color: #8a847e;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.shop-faq-list__remove:hover {
  background: #e8e2da;
  color: #5a5550;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .shop-faq-list {
    padding: 24px 18px 28px;
  }
  .shop-faq-list__grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .shop-faq-list {
    padding: 20px 14px 24px;
  }
  .shop-faq-list__title {
    margin-bottom: 18px;
  }
  .shop-faq-list__question {
    padding: 12px 14px;
    font-size: 12.5px;
  }
}

/* ---------- Rich-text inline formats (system toolbar) ---------- */
.shop-faq-list mark,
.shop-faq-list mark.has-inline-background-color {
  padding: 0.05em 0.25em;
  border-radius: 3px;
  background-color: #fdeeb3;
  color: inherit;
}

.shop-faq-list code {
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.shop-faq-list kbd {
  padding: 0.1em 0.4em;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.04);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.shop-faq-list a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shop-faq-list sub,
.shop-faq-list sup {
  font-size: 0.72em;
  line-height: 0;
}

.shop-faq-list img {
  max-width: 100%;
  height: auto;
}

.shop-faq-list .rich-text *,
.shop-faq-list [data-rich-text-format-boundary] {
  box-sizing: border-box;
}
