.article-template > *:first-child:not(.article-template__hero-container) {
  margin-top: 5rem;
}

.article-template__hero-container {
  max-width: 130rem;
  margin: 0 auto;
}

@media screen and (min-width: 1320px) {
  .article-template__hero-container:first-child {
    margin-top: 5rem;
  }
}

.article-template__hero-medium {
  height: 15.6rem;
}

.article-template__hero-large {
  height: 19rem;
}

@media screen and (min-width: 750px) and (max-width: 989px) {
  .article-template__hero-medium {
    height: 34.9rem;
  }

  .article-template__hero-large {
    height: 42.3rem;
  }
}

@media screen and (min-width: 990px) {
  .article-template__hero-medium {
    height: 54.5rem;
  }

  .article-template__hero-large {
    height: 66rem;
  }
}

.article-template header {
  margin-top: 4.4rem;
  margin-bottom: 2rem;
  line-height: 0.8;
}

@media screen and (min-width: 750px) {
  .article-template header {
    margin-top: 5rem;
  }
}

.article-template__title {
  margin: 0;
}

.article-template__title:not(:only-child) {
  margin-bottom: 1rem;
}

.article-template__link {
  font-size: 1.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.article-template__link .icon-wrap {
  margin-right: 1rem;
  transform: rotate(180deg);
}

.article-template__content {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.article-template__social-sharing {
  margin-top: 3rem;
}

.article-template__social-sharing + header, .article-template__social-sharing + .article-template__content {
  margin-top: 1.5rem;
}

.article-template__comment-wrapper {
  margin-top: 5rem;
}

@media screen and (min-width: 750px) {
  .article-template__comment-wrapper {
    margin-top: 6rem;
  }
}

.article-template__comment-wrapper h2 {
  margin-top: 0;
}

.article-template__comments {
  margin-bottom: 5rem;
}

@media screen and (min-width: 750px) {
  .article-template__comments {
    margin-bottom: 7rem;
  }
}

.article-template__comments-fields {
  margin-bottom: 4rem;
}

.article-template__comments-comment {
  color: rgba(var(--color-foreground), 0.75);
  background-color: rgb(var(--color-background));
  margin-bottom: 1.5rem;
  padding: 2rem 2rem 1.5rem;
}

@media screen and (min-width: 750px) {
  .article-template__comments-comment {
    padding: 2rem 2.5rem;
  }
}

.article-template__comments-comment p {
  margin: 0 0 1rem;
}

.article-template__comment-fields > * {
  margin-bottom: 3rem;
}

@media screen and (min-width: 750px) {
  .article-template__comment-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-column-gap: 4rem;
  }
}

.article-template__comment-warning {
  margin: 2rem 0 2.5rem;
}

@media screen and (min-width: 990px) {
  .article-template__comments .pagination-wrapper {
    margin: 5rem 0 8rem;
  }
}

/* Button - social share */

.share-button {
  display: block;
  position: relative;
}

.share-button details {
  width: fit-content;
}

.share-button__button {
  font-size: 1.4rem;
  display: flex;
  min-height: 2.4rem;
  align-items: center;
  color: rgba(var(--color-link), var(--alpha-link));
  margin-left: 0;
  padding-left: 0;
}

.share-button__button:hover,
details[open] > .share-button__button {
  color: rgb(var(--color-link));
}

details[open] > .share-button__fallback {
  animation: animateMenuOpen var(--duration-default) ease;
}

.share-button__button:hover {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.share-button__button,
.share-button__fallback button {
  cursor: pointer;
  background-color: transparent;
  border: none;
}

.share-button__button .icon-share {
  margin-right: 1rem;
}

.share-button__fallback {
  background: rgb(var(--color-background));
  display: flex;
  align-items: center;
  position: absolute;
  top: 3rem;
  left: 0.1rem;
  z-index: 6;
  width: 100%;
  min-width: 31rem;
  box-shadow: 0 0 0 0.1rem rgba(var(--color-foreground), 0.55);
  

}

.share-button__fallback button {
  width: 4.4rem;
  height: 4.4rem;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.share-button__fallback button:hover {
  color: rgba(var(--color-foreground), 0.75);
}

.share-button__fallback button:hover svg {
  transform: scale(1.07);
}

.share-button__close:not(.hidden) + .share-button__copy {
  display: none;
}

.share-button__close,
.share-button__copy {
  background-color: transparent;
  color: rgb(var(--color-foreground));
}

.share-button__fallback .field__input {
  box-shadow: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.share-button__fallback .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.share-button__message:not(:empty) {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  margin-top: 0;
  padding: 0.8rem 0 0.8rem 1.5rem;
}

.share-button__message:not(:empty):not(.hidden) ~ * {
  display: none;
}

/* arrow animation */

.animate-arrow .icon-wrap .icon-arrow{
  transform: translateX(-0.25rem);
  transition: transform var(--duration-short) ease;
}

.animate-arrow .icon-wrap .icon-arrow:hover{
  transform: translateX(-0.05rem);
}
/* ==================================================
   部落格文章底部－相關商品安全版
================================================== */

.article-related-products {
  width: 100%;
  margin-top: 72px;
  background: #fff;
  box-sizing: border-box;
}

.article-related-products__inner {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

/* 相關商品標題置中 */
.article-related-products h2 {
  margin: 0;
  padding: 28px 20px 24px;
  font-size: 26px;
  line-height: 1.4;
  font-weight: 400;
  text-align: center;
}

/* 三欄排列與完整外框 */
.article-related-products .grid,
.article-related-products .grid-uniform,
.article-related-products .product-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;

  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;

  border-top: 1px solid #e5e5e5;
  border-left: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;

  list-style: none !important;
  box-sizing: border-box;
}

/* 每個商品框 */
.article-related-products .grid__item,
.article-related-products .product_grid-item {
  float: none !important;
  width: 100% !important;
  max-width: none !important;

  margin: 0 !important;
  padding: 48px 36px 46px !important;

  border-right: 1px solid #e5e5e5;
  box-sizing: border-box;
  text-align: center;

  /* 不使用 flex，避免原始圖片容器消失 */
  display: block !important;
  min-height: 570px;
}

/* 恢復商品連結原本的區塊排列 */
.article-related-products .grid__item a,
.article-related-products .product_grid-item a,
.article-related-products .grid-link {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  text-align: center;
}

/* 恢復並放大商品圖片 */
.article-related-products .grid__item img,
.article-related-products .product_grid-item img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;

  width: 100% !important;
  max-width: 320px !important;
  max-height: none !important;
  height: auto !important;

  margin: 0 auto 28px !important;
  object-fit: contain;
}

/* 商品名稱置中 */
.article-related-products .grid-link__title,
.article-related-products .product-title,
.article-related-products .card__heading {
  margin: 0 auto 12px !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  font-weight: 400 !important;
  text-align: center !important;
}

/* 價格置中 */
.article-related-products .grid-link__meta,
.article-related-products .product-price,
.article-related-products .price,
.article-related-products .money {
  margin-left: auto !important;
  margin-right: auto !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  text-align: center !important;
}

/* 平板一排兩件 */
@media screen and (max-width: 989px) {
  .article-related-products .grid,
  .article-related-products .grid-uniform,
  .article-related-products .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .article-related-products .grid__item,
  .article-related-products .product_grid-item {
    min-height: 520px;
  }
}

/* 手機一排一件 */
@media screen and (max-width: 749px) {
  .article-related-products {
    margin-top: 48px;
  }

  .article-related-products h2 {
    padding: 24px 16px 18px;
    font-size: 22px;
  }

  .article-related-products .grid,
  .article-related-products .grid-uniform,
  .article-related-products .product-grid {
    grid-template-columns: 1fr !important;
  }

  .article-related-products .grid__item,
  .article-related-products .product_grid-item {
    min-height: auto;
    padding: 28px 18px 34px !important;
  }

  .article-related-products .grid__item img,
  .article-related-products .product_grid-item img {
    max-width: 290px !important;
    margin-bottom: 22px !important;
  }
}
/* 相關商品價格：真正置中，不影響原價顯示邏輯 */
.article-related-products .grid-link__meta,
.article-related-products .product-price,
.article-related-products .price {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 8px auto 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
  justify-content: center !important;
}

/* 取消金額原本的靠左浮動，但不強制顯示隱藏價格 */
.article-related-products .grid-link__meta .money,
.article-related-products .product-price .money,
.article-related-products .price .money,
.article-related-products .money {
  float: none !important;
  display: inline !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: inherit !important;
}