/*
Theme Name: Mugensha 2026 Child
Theme URI: https://mugensha.blue/
Description: Mugensha 2026 の子テーマ。将来のデザイン変更・テンプレート上書き用。
Author: Mugensha
Template: mugensha-2026
Version: 7.0.4
Text Domain: mugensha-2026-child
*/

/*
 * 通常の追加CSSはこの下へ記述します。
 * 親テーマのカスタマイザー設定はそのまま利用できます。
 */


/* ---------------------------------------------------------
 * Header cart inside the primary navigation
 * CART is appended to the main menu; the old standalone
 * right-side link from the parent header is hidden.
 * --------------------------------------------------------- */
.site-header__actions > .mg-cart {
  display: none !important;
}

.primary-nav .mg-menu-cart > a {
  white-space: nowrap;
}

/* ---------------------------------------------------------
 * News / Journal single post
 * このセクションは子テーマ側だけで自由に変更できます。
 * --------------------------------------------------------- */
.mg-article {
  padding: clamp(72px, 8vw, 120px) 0 clamp(100px, 11vw, 160px);
}

.mg-article__header {
  max-width: 1180px;
}

.mg-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--mg-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mg-article__meta a {
  border-bottom: 1px solid currentColor;
}

.mg-article__title {
  max-width: 1100px;
  margin: 0;
  font-family: var(--mg-serif);
  font-size: clamp(48px, 7vw, 112px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.035em;
}

.mg-article__lead {
  max-width: 760px;
  margin: 34px 0 0;
  color: var(--mg-muted);
  font-family: var(--mg-serif);
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.7;
}

.mg-article__hero {
  width: min(calc(100% - 64px), 1440px);
  max-width: 1440px;
  margin-top: clamp(52px, 7vw, 92px);
}

.mg-article__hero img {
  width: 100%;
  height: auto;
  max-height: 86vh;
  object-fit: contain;
  background: transparent;
}

.mg-article__body-wrap {
  margin-top: clamp(60px, 8vw, 100px);
}

.mg-article__content {
  width: min(100%, 820px);
  margin-inline: auto;
  font-family: var(--mg-serif);
  font-size: clamp(17px, 1.25vw, 20px);
  line-height: 2;
}

.mg-article__content > * {
  margin-top: 0;
  margin-bottom: 1.8em;
}

.mg-article__content h2,
.mg-article__content h3,
.mg-article__content h4 {
  margin-top: 2.6em;
  margin-bottom: 1em;
  font-weight: 500;
  line-height: 1.45;
}

.mg-article__content h2 {
  font-size: clamp(28px, 3vw, 44px);
}

.mg-article__content h3 {
  font-size: clamp(22px, 2.3vw, 32px);
}

.mg-article__content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.mg-article__content blockquote {
  margin: 2.7em 0;
  padding: .2em 0 .2em 1.6em;
  border-left: 1px solid var(--mg-ink);
  font-size: 1.1em;
}

.mg-article__content figure,
.mg-article__content .wp-block-image {
  margin-top: 3.3em;
  margin-bottom: 3.3em;
}

/* 投稿本文内の画像を、リンク付き・旧エディター形式でも中央配置 */
.mg-article__content figure.wp-block-image {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.mg-article__content figure.wp-block-image > a {
  display: inline-block;
}

.mg-article__content figure.wp-block-image img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/*
 * WordPressの本文では、画像ブロックではなく
 * <p><a><img></a></p> の形で保存されることもある。
 * 親テーマの img { display:block; } と組み合わさると左寄せになるため、
 * 画像を直接包むリンク自体を内容幅で中央に置く。
 */
.mg-article__content a:has(> img) {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.mg-article__content a:has(> img) > img {
  margin-left: auto;
  margin-right: auto;
}

.mg-article__content .alignwide {
  width: min(1100px, calc(100vw - 64px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.mg-article__content .alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.mg-article__content figcaption {
  margin-top: 10px;
  color: var(--mg-muted);
  font-family: var(--mg-sans);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .03em;
}

.mg-article__footer {
  margin-top: clamp(72px, 9vw, 120px);
  padding-top: 28px;
  border-top: 1px solid var(--mg-line);
}

.mg-article__back {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.mg-article__back span:first-child {
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}

@media (max-width: 720px) {
  .mg-article {
    padding-top: 56px;
  }
  .mg-article__title {
    font-size: clamp(42px, 13vw, 72px);
  }
  .mg-article__lead {
    margin-top: 24px;
  }
  .mg-article__hero {
    width: calc(100% - 32px);
    margin-top: 42px;
  }
  .mg-article__body-wrap {
    margin-top: 48px;
  }
  .mg-article__content {
    font-size: 17px;
    line-height: 1.95;
  }
  .mg-article__content .alignwide {
    width: calc(100vw - 32px);
  }
}


/* ---------------------------------------------------------
 * WooCommerce / Square-ready presentation
 * WooCommerceの機能そのものはプラグイン側に任せ、
 * 子テーマでは見た目だけを整えます。
 * --------------------------------------------------------- */

/* ---------------------------------------------------------
 * v5.0 Purchase flow
 * BUY THIS BOOK adds a simple WooCommerce product and lands
 * directly on CART. Checkout/payment remain 100% WooCommerce.
 * --------------------------------------------------------- */
.mg-purchase-link[aria-disabled="true"] {
  opacity: .45;
  pointer-events: none;
}

body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button,
body.woocommerce-checkout .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button {
  min-height: 56px;
}

/* Store notices */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  margin: 0 0 28px;
  padding: 18px 22px;
  border: 1px solid var(--mg-line);
  border-top-width: 1px;
  background: #fff;
  color: var(--mg-ink);
  font-size: 14px;
  line-height: 1.7;
  list-style: none;
}

/* Classic Cart / Checkout fallback */
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main,
body.woocommerce-account .site-main {
  padding: clamp(64px, 8vw, 112px) 0 clamp(90px, 10vw, 150px);
}

body.woocommerce-cart .woocommerce,
body.woocommerce-checkout .woocommerce,
body.woocommerce-account .woocommerce {
  width: min(calc(100% - 64px), 1180px);
  margin-inline: auto;
}

.woocommerce table.shop_table {
  border: 0;
  border-collapse: collapse;
  border-radius: 0;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
  padding: 18px 12px;
  border: 0;
  border-bottom: 1px solid var(--mg-line);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .quantity .qty {
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid var(--mg-line);
  border-radius: 0;
  background: #fff;
  color: var(--mg-ink);
}

.woocommerce form .form-row textarea {
  min-height: 130px;
}

.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button {
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--mg-ink);
  border-radius: 999px;
  background: var(--mg-ink);
  color: #fff;
  font-weight: 700;
  letter-spacing: .06em;
}

.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button:hover {
  background: transparent;
  color: var(--mg-ink);
}

/* Cart / Checkout Blocks.
 * WooCommerce公式の推奨に合わせ、内部DOMの深い階層には依存せず、
 * 公開コンポーネントのトップレベルクラスを中心に調整します。
 */
.wc-block-cart,
.wc-block-checkout,
.wc-block-order-confirmation-status,
.wc-block-order-confirmation-summary,
.wc-block-order-confirmation-totals-wrapper {
  width: min(calc(100% - 64px), 1180px);
  margin-inline: auto;
}

.wc-block-cart,
.wc-block-checkout {
  padding-top: clamp(56px, 7vw, 96px);
  padding-bottom: clamp(80px, 9vw, 130px);
}

.wc-block-components-button {
  min-height: 52px;
  border: 1px solid var(--mg-ink);
  border-radius: 999px;
  background: var(--mg-ink);
  color: #fff;
  font-weight: 700;
  letter-spacing: .05em;
}

.wc-block-components-button:hover {
  background: transparent;
  color: var(--mg-ink);
}

.wc-block-components-text-input input,
.wc-block-components-combobox-control input,
.wc-block-components-address-form input,
.wc-block-components-textarea {
  border-radius: 0;
}

.wc-block-components-order-summary,
.wc-block-components-totals-wrapper,
.wc-block-components-sidebar-layout .wc-block-components-main,
.wc-block-components-sidebar-layout .wc-block-components-sidebar {
  border-color: var(--mg-line);
}

/* Payment area: Squareや他のゲートウェイ固有DOMを直接上書きしない。
 * 決済プラグインの更新に追従しやすいよう、WooCommerce共通の枠だけ整える。
 */
.wc-block-checkout__payment-method,
.woocommerce-checkout-payment {
  background: transparent;
}

.woocommerce-checkout-payment {
  border-top: 1px solid var(--mg-line);
  padding-top: 22px;
}

/* Account */
.woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0 0 34px;
  padding: 0;
  border-top: 1px solid var(--mg-line);
}

.woocommerce-MyAccount-navigation li {
  border-bottom: 1px solid var(--mg-line);
}

.woocommerce-MyAccount-navigation a {
  display: block;
  padding: 14px 0;
}

@media (max-width: 720px) {
  body.woocommerce-cart .woocommerce,
  body.woocommerce-checkout .woocommerce,
  body.woocommerce-account .woocommerce,
  .wc-block-cart,
  .wc-block-checkout,
  .wc-block-order-confirmation-status,
  .wc-block-order-confirmation-summary,
  .wc-block-order-confirmation-totals-wrapper {
    width: calc(100% - 32px);
  }
}


/* ---------------------------------------------------------
 * ABOUT: final CTA
 * 「03 / PUBLISHER INFORMATION」と住所・営業時間は表示せず、
 * CONTACT / VIEW BOOKS の導線だけを残します。
 * --------------------------------------------------------- */
.mg-about-info__head,
.mg-about-info__grid {
  display: none;
}

.mg-about-info {
  padding: clamp(62px, 7vw, 92px) 0;
}

.mg-about-info__actions {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  text-align: center;
}

@media (max-width: 600px) {
  .mg-about-info {
    padding: 58px 0 64px;
  }

  .mg-about-info__actions {
    margin-top: 0;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
  }
}


/* ---------------------------------------------------------
 * ABOUT: lower editable block
 * Address / hours / logo explanation are managed in Customizer and centered.
 * --------------------------------------------------------- */
.mg-about-lower {
  padding: clamp(78px, 9vw, 128px) 0 clamp(96px, 10vw, 150px);
  background: var(--mg-bg);
  border-top: 1px solid var(--mg-line);
  text-align: center;
}

.mg-about-lower__inner {
  max-width: 820px;
  margin-inline: auto;
}

.mg-about-lower__info {
  display: grid;
  gap: 4px;
  justify-items: center;
  margin: 0 auto clamp(48px, 6vw, 76px);
  color: var(--mg-muted);
  font-size: 13px;
  line-height: 1.8;
}

.mg-about-lower__info p,
.mg-about-lower__text {
  margin: 0;
}

.mg-about-lower__symbol {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mg-about-lower__symbol h2 {
  margin: 0 0 28px;
  font-family: var(--mg-serif);
  font-size: clamp(22px, 2.2vw, 31px);
  font-weight: 500;
  line-height: 1.4;
}

.mg-about-lower__logo {
  width: min(100%, var(--mg-about-logo-width, 120px));
  margin: 0 auto 32px;
}

.mg-about-lower__logo img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.mg-about-lower__text {
  max-width: 680px;
  margin-inline: auto;
  font-family: var(--mg-serif);
  font-size: 16px;
  line-height: 1.95;
}

@media (max-width: 600px) {
  .mg-about-lower {
    padding: 68px 0 86px;
  }
  .mg-about-lower__inner {
    width: min(calc(100% - 40px), 820px);
  }
  .mg-about-lower__info {
    margin-bottom: 46px;
  }
  .mg-about-lower__symbol h2 {
    margin-bottom: 24px;
  }
  .mg-about-lower__logo {
    margin-bottom: 26px;
  }
  .mg-about-lower__text {
    font-size: 15px;
  }
}


/* ---------------------------------------------------------
 * Product detail: clearer VIEW ALL BOOKS link
 * --------------------------------------------------------- */
.mg-publication-hero__actions {
  width: min(100%, 430px);
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.mg-publication-hero__actions .mg-purchase-link--hero {
  width: 100%;
  margin-right: 0;
}
.mg-publication-back-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 11px 2px 8px;
  border-bottom: 1px solid var(--mg-line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.mg-publication-back-link span:last-child {
  font-size: 16px;
  font-weight: 400;
  transition: transform .2s ease;
}
.mg-publication-back-link:hover { opacity: 1; }
.mg-publication-back-link:hover span:last-child { transform: translateX(4px); }

@media (max-width: 600px) {
  .mg-publication-hero__actions { width: 100%; }
  .mg-publication-back-link { padding-top: 13px; }
}


/* ---------------------------------------------------------
 * Featured Book: preserve the source image aspect ratio
 * Never crop or stretch Featured Book photography.
 * The media area follows the image's natural proportions;
 * any remaining area uses the section background.
 * --------------------------------------------------------- */
.mg-feature__media {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #161616;
}

.mg-feature__media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 760px;
  object-fit: contain;
}

/* ---------------------------------------------------------
 * Featured Book: mobile reading order
 * On smartphones, show the book information before the image.
 * Desktop/tablet layout is unchanged.
 * --------------------------------------------------------- */
@media (max-width: 600px) {
  .mg-feature__copy {
    order: 1;
  }

  .mg-feature__media {
    order: 2;
  }
}

/* ---------------------------------------------------------
 * CONTACT page: centered page axis
 * Keep form labels/fields left aligned for usability while
 * centering the title and the whole form column on the page.
 * --------------------------------------------------------- */
.mg-contact-page {
  padding: clamp(72px, 8vw, 112px) 0 clamp(100px, 10vw, 150px);
}

.mg-contact-page__shell {
  width: min(calc(100% - 64px), 1180px);
  margin-inline: auto;
}

.mg-contact-page__title {
  margin: 0 auto clamp(46px, 6vw, 76px);
  text-align: center;
}

.mg-contact-page__content {
  width: min(100%, 720px);
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

/* Contact Form 7 and ordinary form markup */
.mg-contact-page__content .wpcf7,
.mg-contact-page__content form {
  width: 100%;
  max-width: 620px;
  margin-inline: auto;
  text-align: left;
}

.mg-contact-page__content .wpcf7-form > p,
.mg-contact-page__content form > p {
  margin-left: 0;
  margin-right: 0;
}

.mg-contact-page__content input[type="text"],
.mg-contact-page__content input[type="email"],
.mg-contact-page__content input[type="tel"],
.mg-contact-page__content input[type="url"],
.mg-contact-page__content input[type="number"],
.mg-contact-page__content select,
.mg-contact-page__content textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.mg-contact-page__content textarea {
  min-height: 220px;
  resize: vertical;
}

.mg-contact-page__content .wpcf7-list-item:first-child {
  margin-left: 0;
}

.mg-contact-page__content .wpcf7-submit,
.mg-contact-page__content input[type="submit"],
.mg-contact-page__content button[type="submit"] {
  display: block;
  margin: 22px auto 0;
}

/* Headings or introductory copy placed in the page content stay centered. */
.mg-contact-page__content > h2,
.mg-contact-page__content > h3,
.mg-contact-page__content > h4 {
  text-align: center;
}

@media (max-width: 720px) {
  .mg-contact-page__shell {
    width: min(calc(100% - 36px), 1180px);
  }
  .mg-contact-page__content,
  .mg-contact-page__content .wpcf7,
  .mg-contact-page__content form {
    width: 100%;
  }
}



/* ---------------------------------------------------------
 * reCAPTCHA badge
 * Google permits hiding the badge when reCAPTCHA branding
 * (Privacy Policy / Terms links) is shown visibly in the form flow.
 * --------------------------------------------------------- */
.grecaptcha-badge {
  visibility: hidden !important;
}


/* v4.1 — full ABOUT text and explicit INSIDE THE BOOK gallery */
.mg-publication-story__text p { margin: 0 0 1.15em; }
.mg-publication-story__text p:last-child { margin-bottom: 0; }


/* ---------------------------------------------------------
 * v5.1 CART / CHECKOUT cleanup
 * Keep WooCommerce Blocks / Square functional markup intact.
 * The theme only establishes a calmer Mugensha page layout.
 * --------------------------------------------------------- */
body.woocommerce-cart .mg-page,
body.woocommerce-checkout .mg-page {
  padding-top: clamp(68px, 7vw, 104px);
}

body.woocommerce-cart .mg-page__title,
body.woocommerce-checkout .mg-page__title {
  margin-bottom: 18px;
  font-size: clamp(48px, 7vw, 92px);
}

body.woocommerce-cart .mg-content,
body.woocommerce-checkout .mg-content {
  max-width: none;
  width: 100%;
  font-family: inherit;
  font-size: 16px;
}

body.woocommerce-cart .mg-content > * + *,
body.woocommerce-checkout .mg-content > * + * {
  margin-top: 0;
}

.mg-commerce-intro {
  max-width: 720px;
  margin: 0 0 clamp(38px, 5vw, 62px);
  color: var(--mg-muted);
  font-size: 14px;
  line-height: 1.85;
}

.mg-commerce-intro p {
  margin: 0;
}

/* The page shell already supplies the outer width. Avoid a second inset. */
body.woocommerce-cart .wc-block-cart,
body.woocommerce-checkout .wc-block-checkout {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-top: 0;
}

/* Cart: keep the book itself visually clear and remove unrelated cross-sells. */
body.woocommerce-cart .wc-block-cart-item__image img,
body.woocommerce-cart .product-thumbnail img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

body.woocommerce-cart .cross-sells {
  display: none;
}

body.woocommerce-cart .wc-block-components-product-name,
body.woocommerce-checkout .wc-block-components-product-name {
  font-family: var(--mg-serif);
  font-weight: 500;
  line-height: 1.45;
}

/* Totals / order summary use simple rules rather than boxed cards. */
body.woocommerce-cart .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-components-sidebar {
  border-top: 1px solid var(--mg-line);
  padding-top: 24px;
}

body.woocommerce-cart .wc-block-components-totals-wrapper,
body.woocommerce-checkout .wc-block-components-totals-wrapper,
body.woocommerce-checkout .wc-block-components-order-summary {
  border-color: var(--mg-line);
}

/* Fields: square, quiet, and roomy. */
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-combobox-control input,
body.woocommerce-checkout .wc-block-components-address-form input,
body.woocommerce-checkout .wc-block-components-textarea,
body.woocommerce-checkout .select2-selection,
body.woocommerce-checkout .input-text {
  min-height: 52px;
  border-radius: 0 !important;
  border-color: var(--mg-line) !important;
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-components-textarea {
  min-height: 120px;
}

/* Primary purchase actions are unmistakable, while leaving gateway internals alone. */
body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button,
body.woocommerce-checkout .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button,
body.woocommerce-checkout #place_order {
  width: 100%;
  min-height: 58px;
  justify-content: center;
}

body.woocommerce-checkout .wc-block-checkout__payment-method,
body.woocommerce-checkout .woocommerce-checkout-payment {
  margin-top: 20px;
}

@media (max-width: 720px) {
  body.woocommerce-cart .mg-page,
  body.woocommerce-checkout .mg-page {
    padding-top: 52px;
  }

  body.woocommerce-cart .mg-page__title,
  body.woocommerce-checkout .mg-page__title {
    margin-bottom: 14px;
  }

  .mg-commerce-intro {
    margin-bottom: 34px;
    font-size: 13px;
  }

  body.woocommerce-cart .wc-block-cart,
  body.woocommerce-checkout .wc-block-checkout {
    width: 100%;
  }
}




/* ---------------------------------------------------------
 * v5.7 CHECKOUT: Address line 2 always visible + softer hints
 * --------------------------------------------------------- */
/*
 * WooCommerce Blocks uses floating labels for many fields rather than true
 * placeholders. Both are softened here so the guidance inside an empty field
 * reads as guidance, not as user-entered text.
 */
body.woocommerce-checkout input::placeholder,
body.woocommerce-checkout textarea::placeholder,
body.woocommerce-checkout .wc-block-components-text-input input::placeholder,
body.woocommerce-checkout .wc-block-components-combobox-control input::placeholder,
body.woocommerce-checkout .wc-block-components-address-form input::placeholder {
  color: #9a9a9a !important;
  opacity: 1 !important;
}

body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-combobox-control label,
body.woocommerce-checkout .wc-block-components-form .wc-block-components-text-input label {
  color: #8c8c8c;
}

body.woocommerce-checkout .wc-block-components-text-input.is-active label,
body.woocommerce-checkout .wc-block-components-text-input.has-error label,
body.woocommerce-checkout .wc-block-components-combobox-control.is-active label {
  color: #666;
}




/* ---------------------------------------------------------
 * v6.2 CART: empty-cart state
 * Keep WooCommerce's empty-cart recommendations but make the
 * state visually consistent with Mugensha.
 * --------------------------------------------------------- */
body.woocommerce-cart .wc-block-cart__empty-cart__title.with-empty-cart-icon::before,
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .with-empty-cart-icon::before {
  display: none !important;
  content: none !important;
  background: none !important;
}

body.woocommerce-cart .wc-block-cart__empty-cart__title.with-empty-cart-icon,
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .with-empty-cart-icon {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.woocommerce-cart .mg-empty-cart-shop {
  margin: 24px 0 44px;
  text-align: center;
}

body.woocommerce-cart .mg-empty-cart-shop .mg-button,
body.woocommerce-cart .mg-empty-cart-shop a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 46px;
  padding: 12px 24px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1;
  text-decoration: none;
}

body.woocommerce-cart .mg-empty-cart-shop .mg-button:hover,
body.woocommerce-cart .mg-empty-cart-shop a:hover {
  background: transparent;
  color: #111;
}\n\n/* ---------------------------------------------------------
 * v6.6 CART: add-more-books button
 * Place it directly below the cart products and make it a
 * visible secondary purchase action.
 * --------------------------------------------------------- */
body.woocommerce-cart .mg-cart-add-more {
  margin: 26px 0 10px;
  text-align: left;
}

body.woocommerce-cart .mg-cart-add-more__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 48px;
  padding: 13px 24px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}

body.woocommerce-cart .mg-cart-add-more__button:hover {
  background: transparent;
  color: #111;
}

@media (max-width: 720px) {
  body.woocommerce-cart .mg-cart-add-more {
    margin: 22px 0 8px;
  }
  body.woocommerce-cart .mg-cart-add-more__button {
    width: 100%;
    min-width: 0;
  }
}


/* ---------------------------------------------------------
 * v6.7 My Account dashboard
 * Keep WooCommerce navigation/endpoints, but make the dashboard itself
 * feel consistent with the Mugensha editorial layout.
 * --------------------------------------------------------- */
body.woocommerce-account .woocommerce-MyAccount-content {
  min-width: 0;
}

.mg-account-dashboard {
  width: 100%;
}

.mg-account-dashboard__intro {
  padding: 0 0 clamp(38px, 5vw, 62px);
  border-bottom: 1px solid var(--mg-line);
}

.mg-account-dashboard__eyebrow {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--mg-muted, #777);
}

.mg-account-dashboard__intro h2 {
  margin: 0 0 18px;
  font-family: var(--mg-serif, serif);
  font-size: clamp(34px, 4.5vw, 62px);
  font-weight: 400;
  line-height: 1.05;
}

.mg-account-dashboard__intro > p:last-child {
  max-width: 620px;
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
}

.mg-account-recent {
  padding-top: clamp(34px, 4vw, 54px);
}

.mg-account-recent__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.mg-account-recent__head h3 {
  margin: 0;
  font-family: var(--mg-serif, serif);
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 400;
}

.mg-account-recent__head a {
  flex: 0 0 auto;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.mg-account-orders {
  border-top: 1px solid var(--mg-line);
}

.mg-account-order {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(90px, .7fr) minmax(100px, .7fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--mg-line);
}

.mg-account-order__main {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mg-account-order__number {
  font-weight: 600;
}

.mg-account-order__main time,
.mg-account-order__status {
  font-size: 12px;
  color: var(--mg-muted, #777);
}

.mg-account-order__total {
  font-size: 14px;
  white-space: nowrap;
}

.mg-account-order__view,
.mg-account-shop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--mg-ink, #111);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}

.mg-account-order__view:hover,
.mg-account-shop-button:hover {
  background: var(--mg-ink, #111);
  color: #fff;
}

.mg-account-empty-orders {
  padding: 28px 0 4px;
  border-top: 1px solid var(--mg-line);
}

.mg-account-empty-orders p {
  margin: 0 0 20px;
}

/* Add-to-cart confirmations are useful on CART/SHOP, but stale notices on the
 * account dashboard are distracting. JS removes only add-to-cart notices;
 * other WooCommerce account notices remain visible. */

@media (max-width: 820px) {
  .mg-account-order {
    grid-template-columns: 1fr auto;
  }

  .mg-account-order__status,
  .mg-account-order__total {
    grid-column: 1;
  }

  .mg-account-order__view {
    grid-column: 2;
    grid-row: 1 / span 3;
  }
}

@media (max-width: 560px) {
  .mg-account-recent__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mg-account-order {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mg-account-order__status,
  .mg-account-order__total,
  .mg-account-order__view {
    grid-column: 1;
    grid-row: auto;
  }

  .mg-account-order__view {
    width: max-content;
    margin-top: 8px;
  }
}


/* ---------------------------------------------------------
 * v6.8 My Account final polish
 * - Remove the unused Downloads navigation item.
 * - Avoid repeating "マイページ" inside the dashboard.
 * - Keep important WooCommerce account notices, but render them quietly.
 * --------------------------------------------------------- */
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 30px;
  padding: 14px 16px;
  border: 1px solid var(--mg-line);
  background: rgba(255,255,255,.5);
  color: var(--mg-ink);
  font-size: 12px;
  line-height: 1.75;
}

/* WooCommerce's stock notice icon can appear as a small broken-looking mark
 * with some font stacks. Account notices do not need it visually. */
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info::before,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message::before,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error::before {
  display: none !important;
  content: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info .button,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message .button,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error .button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid var(--mg-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--mg-ink);
  font-size: 10px;
  letter-spacing: .04em;
  white-space: nowrap;
}

body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info .button:hover,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message .button:hover,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error .button:hover {
  background: var(--mg-ink);
  color: #fff;
}

/* The page already has the large outer "マイページ" heading. Keep the
 * dashboard intro small so it reads as supporting information, not a second title. */
.mg-account-dashboard__intro {
  padding-bottom: clamp(30px, 4vw, 46px);
}

.mg-account-dashboard__intro .mg-account-dashboard__eyebrow {
  margin-bottom: 16px;
}

.mg-account-dashboard__summary {
  max-width: 620px;
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
}

@media (max-width: 640px) {
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info,
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message,
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* ---------------------------------------------------------
 * v6.9 My Account layout correction
 * WooCommerce notices place the action link before the text in the HTML.
 * Using flex made that button appear on the left and pushed the message into
 * an awkward position. Return notices to normal document flow and float the
 * action button to the right, so message = left / action = right.
 * --------------------------------------------------------- */
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-Message {
  display: block !important;
  min-height: 58px;
  margin: 0 0 34px;
  padding: 17px 18px !important;
  overflow: hidden;
  border: 1px solid var(--mg-line);
  background: rgba(255,255,255,.5);
  color: var(--mg-ink);
  font-size: 13px;
  line-height: 1.8;
}

body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info::after,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message::after,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error::after,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-Message::after {
  content: "";
  display: table;
  clear: both;
}

body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info .button,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message .button,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error .button,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-Message .button {
  float: right !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  min-height: 42px;
  margin: -4px 0 -4px 24px !important;
  padding: 0 18px !important;
  border: 1px solid var(--mg-ink) !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--mg-ink) !important;
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.2 !important;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info .button:hover,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message .button:hover,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error .button:hover,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-Message .button:hover {
  background: var(--mg-ink) !important;
  color: #fff !important;
}

/* Empty payment-method state is owned by the child template in v6.9. */
.mg-account-payment-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--mg-line);
  background: rgba(255,255,255,.5);
}

.mg-account-payment-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}

.mg-account-payment-empty__button,
body.woocommerce-account .woocommerce-MyAccount-content > .mg-account-payment-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 156px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--mg-ink);
  border-radius: 999px;
  background: var(--mg-ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.2;
  text-decoration: none;
}

.mg-account-payment-empty__button:hover,
body.woocommerce-account .woocommerce-MyAccount-content > .mg-account-payment-add:hover {
  background: transparent;
  color: var(--mg-ink);
}

/* When methods already exist, keep the add button below the table but give it
 * deliberate spacing instead of WooCommerce's default loose placement. */
body.woocommerce-account .woocommerce-MyAccount-content > .mg-account-payment-add {
  margin-top: 24px;
}

@media (max-width: 640px) {
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info,
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message,
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error,
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-Message {
    padding: 16px !important;
  }

  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info .button,
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message .button,
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-error .button,
  body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-Message .button {
    float: none !important;
    width: 100%;
    margin: 12px 0 0 !important;
  }

  .mg-account-payment-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .mg-account-payment-empty__button,
  body.woocommerce-account .woocommerce-MyAccount-content > .mg-account-payment-add {
    width: 100%;
  }
}


/* ---------------------------------------------------------
 * v7.0 My Account order action button
 * The WooCommerce default global button styling made the order "表示" action
 * black and its text could look vertically off-center. Keep this secondary
 * action quiet and aligned with the outlined account-notice button.
 * --------------------------------------------------------- */
body.woocommerce-account .woocommerce-orders-table__cell-order-actions .button,
body.woocommerce-account .woocommerce-orders-table__cell-order-actions a.button,
body.woocommerce-account .woocommerce-orders-table__cell-order-actions .woocommerce-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 96px !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  border: 1px solid var(--mg-ink) !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--mg-ink) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .03em !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

body.woocommerce-account .woocommerce-orders-table__cell-order-actions .button:hover,
body.woocommerce-account .woocommerce-orders-table__cell-order-actions a.button:hover,
body.woocommerce-account .woocommerce-orders-table__cell-order-actions .woocommerce-button:hover {
  background: rgba(255,255,255,.7) !important;
  color: var(--mg-ink) !important;
}
