/**
 * 页脚移动端（≤1024px）：折叠卡片居中 + 3D 边框 + 底栏布局
 */

@media (max-width: 1024px) {
  /* 外层留出左右对称边距，避免卡片贴右 */
  #haru-footer .elementor-element-dcdabb6 {
    padding-top: 1rem !important;
    padding-right: 1rem !important;
    padding-bottom: 0 !important;
    padding-left: 1rem !important;
    box-sizing: border-box;
  }

  #haru-footer .elementor-element-dcdabb6 > .e-con-inner.nhp-footer-accordion {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    max-width: 100%;
    margin: 1rem auto 0 !important;
    box-sizing: border-box;
    border: 1px solid #d0d5dc;
    border-radius: 10px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.95) inset,
      0 -1px 0 rgba(0, 0, 0, 0.04) inset,
      0 2px 0 rgba(255, 255, 255, 0.6),
      0 3px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background: #fff;
    padding: 0 !important;
  }

  #haru-footer .nhp-footer-accordion__list {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  #haru-footer .nhp-footer-accordion__item {
    border-bottom: 1px solid #e5e8eb;
    padding: 0 !important;
    width: 100%;
  }

  #haru-footer .nhp-footer-accordion__item:last-child {
    border-bottom: none;
  }

  #haru-footer .nhp-footer-accordion__trigger {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.3;
    cursor: pointer;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  #haru-footer .nhp-footer-accordion__trigger:focus-visible {
    outline: 2px solid var(--nhp-green, #2c4c3b);
    outline-offset: -2px;
  }

  #haru-footer .nhp-footer-accordion__chevron {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    transform: rotate(45deg);
    margin-top: -0.15rem;
    transition: transform 0.2s ease;
    pointer-events: none;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .nhp-footer-accordion__chevron {
    transform: rotate(225deg);
    margin-top: 0.1rem;
  }

  #haru-footer .nhp-footer-accordion__item > .elementor-widget-haru-heading > .elementor-widget-container {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 默认折叠：隐藏标题以外的 widget（含 Get in touch 的 contact ul） */
  #haru-footer .nhp-footer-accordion__item:not(.is-open) > .elementor-widget:not(.elementor-widget-haru-heading) {
    display: none !important;
  }

  #haru-footer .nhp-footer-accordion__item.is-open > .elementor-widget:not(.elementor-widget-haru-heading) {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 1rem 1rem;
  }

  /* Elementor 常对 widget-container 设 flex，展开时需强制可见 */
  #haru-footer .nhp-footer-accordion__item.is-open > .elementor-widget:not(.elementor-widget-haru-heading) .elementor-widget-container {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
  }

  /* 标题整行可点（含 elementor-widget-container 空白区） */
  #haru-footer .nhp-footer-accordion__item > .elementor-widget-haru-heading,
  #haru-footer .nhp-footer-accordion__item > .elementor-widget-haru-heading .elementor-widget-container {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  /* Get in touch 展开后的联系列表样式 */
  #haru-footer .nhp-footer-accordion__item.is-open .haru-contact--style-2 ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .haru-contact--style-2 li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .haru-contact--style-2 li:last-child {
    margin-bottom: 0;
  }

  /* 白色图标需衬底：圆形 + 主题绿底 */
  #haru-footer .nhp-footer-accordion__item.is-open .haru-contact__icon {
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--nhp-green, #2c4c3b);
    overflow: hidden;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .haru-contact__icon img {
    width: 1.125rem;
    height: 1.125rem;
    object-fit: contain;
    display: block;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .haru-contact__title {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 0.15rem;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .haru-contact__desc {
    font-size: 0.8rem;
    line-height: 1.4;
    word-wrap: break-word;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .haru-footer-link ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .haru-footer-link li {
    margin-bottom: 0.35rem;
  }

  #haru-footer .nhp-footer-accordion__item.is-open .haru-footer-link a {
    font-size: 0.875rem;
    color: #4a5a63;
  }

  /* 底栏：支付 → 版权 → 条款 */
  #haru-footer .elementor-element-facff03 > .e-con-inner.nhp-footer-bar-mobile {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem !important;
  }

  #haru-footer .nhp-footer-bar-mobile__pay {
    order: 1;
    width: 100%;
    justify-content: center !important;
  }

  #haru-footer .nhp-footer-bar-mobile__pay img {
    display: block;
    max-width: min(286px, 100%);
    height: auto;
    margin: 0 auto;
  }

  #haru-footer .nhp-footer-bar-mobile__copy {
    order: 2;
    width: 100%;
    flex-direction: column !important;
    align-items: center !important;
  }

  #haru-footer .nhp-footer-bar-mobile__copy .haru-heading-title--footer-copyright-2 {
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    text-align: center;
    margin: 0;
    line-height: 1.4;
  }

  #haru-footer .nhp-footer-bar-mobile__copy .haru-footer-link--style-2 ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #haru-footer .nhp-footer-bar-mobile__copy .haru-footer-link--style-2 li {
    display: inline-flex;
    align-items: center;
  }

  #haru-footer .nhp-footer-bar-mobile__copy .haru-footer-link--style-2 li + li::before {
    content: '|';
    margin: 0 0.65rem;
    color: #6b7c85;
    font-weight: 400;
  }

  #haru-footer .nhp-footer-bar-mobile__copy .haru-footer-link--style-2 a {
    font-size: 0.875rem;
    color: #4a5a63;
    text-decoration: none;
  }

  #haru-footer .nhp-footer-bar-mobile__copy .haru-footer-link--style-2 a:hover {
    text-decoration: underline;
  }
}

@media (min-width: 1025px) {
  #haru-footer .nhp-footer-accordion__chevron {
    display: none;
  }

  #haru-footer .nhp-footer-accordion__trigger {
    cursor: default;
    pointer-events: none;
  }

  #haru-footer .nhp-footer-accordion__list {
    display: contents;
  }

  #haru-footer .nhp-footer-accordion__item:not(.is-open) > .elementor-widget:not(.elementor-widget-haru-heading) {
    display: revert !important;
  }
}
