/* weixinhaofa H5 mobile override layer. All layout rules are media-scoped to protect PC. */
@media (max-width: 768px) {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 16px !important;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
  }

  img,
  video,
  canvas,
  iframe,
  table {
    max-width: 100%;
  }

  .container,
  .wrap,
  .main-container,
  .content,
  .product-landing {
    width: auto !important;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .topbar,
  .main-header,
  header {
    max-width: 100%;
  }

  .topbar {
    min-height: 54px;
    height: auto !important;
    padding: 8px 14px !important;
    gap: 10px;
  }

  .topbar-brand {
    min-width: 0;
    font-size: 16px !important;
    line-height: 1.25;
  }

  .topbar-nav {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .topbar-nav::-webkit-scrollbar { display: none; }

  .hero {
    width: 100%;
    min-height: auto !important;
    padding: 34px 16px 30px !important;
    overflow: hidden;
  }

  .hero-inner {
    width: 100%;
    max-width: 100% !important;
  }

  .hero h1,
  .hero h1 span,
  .hero h1 strong {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    font-size: 28px !important;
    line-height: 1.22 !important;
    letter-spacing: 0 !important;
  }

  .hero p {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    max-width: 100% !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
  }

  .hero-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 12px !important;
    font-size: 13px !important;
  }

  .notice-bar,
  .notice-flow {
    max-width: 100%;
    padding: 8px 12px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  .category-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 8px !important;
  }

  .category-tabs::-webkit-scrollbar { display: none; }

  .cat-tab {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    min-width: max-content;
    padding: 9px 13px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  .product-grid,
  .product-grid.grouped-products,
  .category-product-section .product-grid,
  .goods-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100%;
  }

  .product-card,
  .goods-card {
    min-width: 0;
    border-radius: 14px !important;
  }

  .product-info {
    padding: 10px !important;
  }

  .product-image,
  .product-hero-img {
    max-width: 100%;
    height: auto;
  }

  .product-title {
    font-size: 15px !important;
    line-height: 1.4 !important;
    min-height: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
  }

  .product-desc,
  .product-stock,
  .product-cat,
  .product-tag,
  .product-meta,
  .goods-card span,
  .goods-card em {
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  .product-price,
  .price-line,
  .goods-card b {
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  .section-header,
  .seo-guide-section,
  .guide-card,
  .card,
  .article,
  .goods-detail,
  .product-hero-card,
  .order-box,
  .seo-copy,
  .buy-form,
  .account-format-card {
    max-width: 100%;
  }

  .seo-guide-section,
  .guide-card,
  .card,
  .article,
  .goods-detail,
  .product-hero-card,
  .order-box,
  .seo-copy,
  .buy-form,
  .account-format-card {
    border-radius: 16px !important;
    padding: 18px !important;
  }

  .topic-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .topic-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 8px !important;
    text-align: center;
    white-space: normal !important;
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.35 !important;
    font-size: 14px !important;
  }

  .guide-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .guide-card strong {
    font-size: 15px !important;
    line-height: 1.35 !important;
  }

  .guide-card span {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  .article,
  .seo-copy,
  .goods-detail {
    font-size: 15px !important;
    line-height: 1.75 !important;
  }

  .article h1,
  .goods-detail h1,
  .product-hero-card h1 {
    font-size: 24px !important;
    line-height: 1.28 !important;
    overflow-wrap: anywhere;
  }

  .article h2,
  .seo-copy h2,
  .order-box h2,
  .card h2 {
    font-size: 20px !important;
    line-height: 1.35 !important;
  }

  .product-hero-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .product-hero-img {
    width: 100% !important;
    max-height: 220px;
    object-fit: cover;
  }

  .order-list,
  .buy-form {
    gap: 10px !important;
  }

  .order-list li,
  .info-row,
  .account-format-row {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .order-list input,
  .buy-form input,
  .buy-form select,
  .buy-form textarea,
  input,
  select,
  textarea {
    max-width: 100%;
    font-size: 16px !important;
  }

  .pay-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .pay-row button,
  .btn-pay,
  .btn-primary {
    width: 100%;
    min-height: 44px;
  }

  .article-nav {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .container,
  .wrap,
  .main-container,
  .content,
  .product-landing {
    width: auto !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .hero {
    padding: 28px 14px 24px !important;
  }

  .hero h1,
  .hero h1 span,
  .hero h1 strong {
    font-size: 24px !important;
  }

  .hero p {
    font-size: 14px !important;
  }

  .section-header h2,
  .seo-guide-section h2 {
    font-size: 19px !important;
  }

  .product-grid,
  .product-grid.grouped-products,
  .category-product-section .product-grid,
  .goods-grid {
    gap: 10px !important;
  }

  .product-title {
    font-size: 14px !important;
  }

  .product-info,
  .goods-card {
    padding: 9px !important;
  }

  .seo-guide-section,
  .guide-card,
  .card,
  .article,
  .goods-detail,
  .product-hero-card,
  .order-box,
  .seo-copy,
  .buy-form,
  .account-format-card {
    padding: 16px !important;
  }
}

@media (max-width: 380px) {
  .topic-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 360px) {
  .hero h1,
  .hero h1 span,
  .hero h1 strong {
    font-size: 22px !important;
  }

  .hero p,
  .article,
  .seo-copy,
  .goods-detail {
    font-size: 14px !important;
  }

  .cat-tab {
    padding: 8px 11px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 340px) {
  .product-grid,
  .product-grid.grouped-products,
  .category-product-section .product-grid,
  .goods-grid {
    grid-template-columns: 1fr !important;
  }
}

/* H5 product readability spacing patch 202605211755 */
@media (min-width: 481px) and (max-width: 768px) {
  .product-grid,
  .product-grid.grouped-products,
  .category-product-section .product-grid,
  .goods-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

@media (max-width: 480px) {
  .products-section {
    margin-top: 32px !important;
    padding-bottom: 56px !important;
  }

  .section-header {
    align-items: flex-start !important;
    gap: 8px !important;
    margin: 22px 0 16px !important;
  }

  .section-header h2 {
    font-size: 20px !important;
    line-height: 1.35 !important;
  }

  .section-header span {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  .category-product-section {
    margin-top: 26px !important;
  }

  .product-grid,
  .product-grid.grouped-products,
  .category-product-section .product-grid,
  .goods-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .product-card,
  .goods-card {
    border-radius: 18px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
    overflow: hidden !important;
  }

  .product-card {
    min-height: 0 !important;
  }

  .product-image {
    aspect-ratio: 16 / 10 !important;
  }

  .product-image img {
    object-fit: cover !important;
  }

  .product-info {
    padding: 14px !important;
  }

  .product-title {
    font-size: 16px !important;
    line-height: 1.45 !important;
    min-height: 0 !important;
    margin-bottom: 12px !important;
    -webkit-line-clamp: 3 !important;
  }

  .product-bottom {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 7px !important;
  }

  .product-price,
  .price-line,
  .goods-card b {
    font-size: 19px !important;
    line-height: 1.25 !important;
  }

  .product-price small {
    display: inline-block !important;
    margin-left: 6px !important;
    font-size: 13px !important;
  }

  .product-stock,
  .product-sales,
  .product-meta {
    width: 100% !important;
    text-align: left !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    color: #6B7280 !important;
  }

  .product-tag {
    margin-top: 10px !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    padding: 5px 11px !important;
  }
}

@media (max-width: 380px) {
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .topic-link {
    min-height: 44px !important;
    padding: 9px 6px !important;
    font-size: 13px !important;
  }
}

