/**
 * KNUCKLE CASE のプレゼント（inc/knuckle-case-present.php）。
 * カートの枠・「あと ¥◯◯」・ポップアップ、決済の枠、商品ページの案内。
 * 色は黒と白だけ（サイトのボタンと同じ）。動きは付けない。
 */

/* --- 文節のかたまり（mymoods_kc_present_phrases()）。かたまりの間でだけ折り返し、言葉の途中で行を変えない。
       幅が1かたまりより狭いときだけ、かたまりの中でも折り返す（はみ出さない）。2026-11-14 石川さん「改行して」 --- */
.mm-kc-phrase {
  display: inline-block;
}

/* --- カート・決済の「カートに追加する」の枠 --- */
.mm-kc-present {
  margin: 0 0 28px;
  font-family: var(--font-body-family);
  text-align: left;
}

.mm-kc-present.is-offer {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid #111;
  border-radius: 10px;
}

.mm-kc-present__media {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef1f3;
}

.mm-kc-present__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mm-kc-present__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mm-kc-present__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: #111;
}

.mm-kc-present__text {
  font-size: 12px;
  line-height: 1.6;
  color: #555;
}

.mm-kc-present__error,
.mm-kc-modal__error {
  font-size: 12px;
  line-height: 1.6;
  color: #c0392b;
}

.mm-kc-present__add {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  height: 40px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.mm-kc-present__add:disabled,
.mm-kc-modal__add:disabled {
  opacity: 0.5;
  cursor: wait;
}

@media (max-width: 749px) {
  .mm-kc-present.is-offer {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .mm-kc-present__media {
    width: 56px;
    height: 56px;
  }

  .mm-kc-present__add {
    grid-column: 1 / -1;
    width: 100%;
    height: 44px;
  }
}

/* 決済の右の列は狭いので、ボタンを下に回す。 */
.mm-kc-present-checkout.is-offer {
  margin: 16px 0;
  grid-template-columns: 56px minmax(0, 1fr);
}

.mm-kc-present-checkout .mm-kc-present__media {
  width: 56px;
  height: 56px;
}

.mm-kc-present-checkout .mm-kc-present__add {
  grid-column: 1 / -1;
  width: 100%;
  height: 44px;
}

/* --- カート・決済のプレゼントの行の「プレゼント: 商品代金 ¥15,000 以上のご注文の特典」
       1つの文として続けて並べる（ブラウザの既定の dd の字下げ・WooCommerce の dt の float を外す。
       WooCommerce の .woocommerce td.product-name dl.variation dt より強くするため tr・td を付ける）。
       「プレゼント:」と文の間の空きは、テンプレートの dt と dd の間の改行（1文字分の空き）。 --- */
.woocommerce tr.mm-kc-present-item td dl.variation {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.woocommerce tr.mm-kc-present-item td dl.variation dt,
.woocommerce tr.mm-kc-present-item td dl.variation dd,
.woocommerce tr.mm-kc-present-item td dl.variation dd p {
  display: inline;
  float: none;
  margin: 0;
  padding: 0;
}

/* --- 「あと ¥◯◯ で KNUCKLE CASE が無料でついてくる！」の POP（カート・期間中だけ） --- */
.mm-kc-present.is-progress {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 2px solid #111;
  border-radius: 12px;
}

.mm-kc-present.is-progress .mm-kc-present__media {
  width: 72px;
  height: 72px;
}

.mm-kc-present__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: #111;
}

.mm-kc-present__lead {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  color: #111;
}

/* 金額は黄色のマーカー（サイトの「最大◯%OFF」の札と同じ黄色） */
.mm-kc-present__gap {
  padding: 0 4px;
  background: linear-gradient(transparent 52%, #f2e94e 52%);
  font-size: 1.2em;
  font-weight: 900;
}

.mm-kc-present__bar {
  display: block;
  height: 8px;
  margin-top: 10px;
  background: #ecebe7;
  border-radius: 999px;
  overflow: hidden;
}

.mm-kc-present__bar i {
  display: block;
  height: 100%;
  background: #111;
  border-radius: 999px;
}

.mm-kc-present__note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #555;
}

@media (max-width: 749px) {
  .mm-kc-present.is-progress {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
  }

  .mm-kc-present.is-progress .mm-kc-present__media {
    width: 56px;
    height: 56px;
  }

  .mm-kc-present__lead {
    font-size: 15px;
  }
}

/* --- ポップアップ（カート） --- */
html.mm-kc-modal-open {
  overflow: hidden;
}

.mm-kc-modal[hidden] {
  display: none;
}

.mm-kc-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* 中身の無い div なので、base.css の div:empty { display: none } に消される。詳細度を上げて出す。 */
.mm-kc-modal > .mm-kc-modal__overlay {
  display: block;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.mm-kc-modal__panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  overflow: auto;
  padding: 28px 24px 18px;
  background: #fff;
  border-radius: 16px;
  text-align: center;
  font-family: var(--font-body-family);
}

.mm-kc-modal__x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #333;
  cursor: pointer;
}

.mm-kc-modal__eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #888;
}

.mm-kc-modal__image {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 14px;
  border-radius: 12px;
  object-fit: cover;
}

.mm-kc-modal__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: #111;
}

.mm-kc-modal__text {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.7;
  color: #222;
}

.mm-kc-modal__note {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #666;
}

.mm-kc-modal__error {
  margin: 0 0 10px;
}

.mm-kc-modal__add {
  appearance: none;
  display: block;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.mm-kc-modal__later {
  appearance: none;
  margin-top: 8px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: #555;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* --- 商品ページの案内（ケース・セット） --- */
.mm-kc-pdp-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #f7f7f5;
  border: 1px solid #e6e4e0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #333;
}

.mm-kc-pdp-note p {
  margin: 0;
}

.mm-kc-pdp-note p + p {
  margin-top: 8px;
}

.mm-kc-pdp-note__present strong {
  display: block;
  color: #111;
}

.mm-kc-pdp-note__shipping {
  color: #555;
}
