/*
Theme Name: Blocksy Child
Template: blocksy
Version: 1.2.2
Description: 站点功能与样式扩展。
Text Domain: blocksy-child
*/

/* =============================================================
   OUAN – Mobile adaptation for B2B product showcase
   Scope : product archive (/products/) + product single
   Target: blocksy-child/style.css (loaded last, no !important needed
           for equal-specificity overrides — kept for plugin rules)
   Author: 2026-11
   ============================================================= */

/* ---------- Tablet: keep 3 columns instead of cramped 4 ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .fhwy-b2b-products-grid,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-2,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-3,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-4,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }

  /* the 300px sidebar squeezed the grid down to 154px cards here;
     tablet already has the horizontal category strip as an entry point */
  .fhwy-b2b-template2-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
  }

  .fhwy-b2b-template2-sidebar {
    display: none !important;
  }

  .fhwy-b2b-template2-content,
  .fhwy-b2b-content-column {
    width: 100% !important;
    max-width: 100% !important;
  }

  .fhwy-b2b-product-bottom-layout {
    display: block !important;
  }

  .fhwy-b2b-sidebar-column {
    display: none !important;
  }
}

/* =============================================================
   PHONE / SMALL TABLET  ≤ 768px
   ============================================================= */
@media (max-width: 768px) {

  /* ============ 1. SHARED: banner compaction ============ */
  .fhwy-b2b-template2-banner,
  .fhwy-b2b-single-banner {
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .fhwy-b2b-template2-banner .fhwy-b2b-banner-inner-wrapper,
  .fhwy-b2b-single-banner .fhwy-b2b-banner-inner-wrapper {
    position: static !important;
    height: auto !important;
    padding: 20px 14px !important;
    display: block !important;
  }

  .fhwy-b2b-banner-inner-content,
  .fhwy-b2b-banner-description {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .fhwy-b2b-template2-banner h1,
  .fhwy-b2b-single-banner h1,
  .fhwy-b2b-banner-title {
    font-size: 19px !important;
    line-height: 1.35 !important;
    margin: 0 0 8px !important;
  }

  /* breadcrumb: single scrollable line instead of 3 wrapped lines */
  .fhwy-b2b-breadcrumbs,
  .fhwy-b2b-breadcrumbs ol,
  .fhwy-b2b-breadcrumbs .fhwy-b2b-breadcrumb-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 11.5px !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 2px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .fhwy-b2b-breadcrumbs::-webkit-scrollbar,
  .fhwy-b2b-breadcrumbs ol::-webkit-scrollbar { display: none; }

  .fhwy-b2b-breadcrumbs li,
  .fhwy-b2b-breadcrumbs a,
  .fhwy-b2b-breadcrumbs span {
    white-space: nowrap !important;
    flex: 0 0 auto !important;
  }

  /* ============ 2. ARCHIVE: layout & sidebar ============ */
  .fhwy-b2b-template2-container {
    padding: 0 !important;
  }

  .fhwy-b2b-template2-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 14px 12px 24px !important;
  }

  /* sidebar moves above the grid, collapsed into filter chips */
  .fhwy-b2b-template2-sidebar {
    order: -1 !important;
    width: 100% !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .fhwy-b2b-template2-sidebar-inner {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* sidebar modules were centred inside the flex column, leaving a
     20px gutter on both sides and clipping the chip strip */
  .fhwy-b2b-template2-sidebar-inner > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* inner .fhwy-b2b-sidebar wrapper still carried 20px padding and a
     40px bottom margin, so chips and search sat inset and overflowed
     the sidebar box */
  .fhwy-b2b-template2-sidebar .fhwy-b2b-sidebar,
  .fhwy-b2b-template2-sidebar .fhwy-b2b-sidebar-inner {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .fhwy-b2b-template2-sidebar .fhwy-b2b-sidebar-module,
  .fhwy-b2b-template2-sidebar .fhwy-b2b-sidebar-module-content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .fhwy-b2b-template2-content {
    width: 100% !important;
    padding: 0 !important;
  }

  /* 2a. category list -> horizontally scrolling chips */
  .fhwy-b2b-sidebar-module-categories {
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .fhwy-b2b-sidebar-module-categories .fhwy-b2b-sidebar-module-title,
  .fhwy-b2b-sidebar-module-categories .fhwy-b2b-sidebar-module-header,
  .fhwy-b2b-sidebar-module-categories h2,
  .fhwy-b2b-sidebar-module-categories h3,
  .fhwy-b2b-sidebar-module-categories h4 {
    display: none !important;
  }

  .fhwy-b2b-sidebar-module-categories .fhwy-b2b-sidebar-module-content {
    padding: 0 !important;
  }

  /* this inner wrapper carries -25px margins to bleed past the card
     padding; zeroed out here it was collapsing the module height and
     letting the search box overlap the chips */
  .fhwy-b2b-sidebar-categories-style {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .fhwy-b2b-sidebar-category-list.amazon {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 2px 0 6px !important;
    margin: 0 !important;
    border: 0 !important;
    background: none !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .fhwy-b2b-sidebar-category-list.amazon::-webkit-scrollbar { display: none; }

  .fhwy-b2b-sidebar-category-item.amazon {
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    list-style: none !important;
  }

  .fhwy-b2b-sidebar-category-item.amazon > a,
  .fhwy-b2b-sidebar-category-item.amazon .fhwy-b2b-sidebar-category-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 9px 14px !important;
    border: 1px solid #E3E7EF !important;
    border-radius: 999px !important;
    background: #fff !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    color: #101828 !important;
    text-decoration: none !important;
  }

  .fhwy-b2b-sidebar-category-item.amazon .category-count {
    font-size: 11px !important;
    color: #98A2B3 !important;
    font-weight: 400 !important;
  }

  /* 2b. search box: flat, full width */
  .fhwy-b2b-sidebar-module-search {
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .fhwy-b2b-sidebar-module-search .fhwy-b2b-sidebar-module-title,
  .fhwy-b2b-sidebar-module-search .fhwy-b2b-sidebar-module-header,
  .fhwy-b2b-sidebar-module-search h2,
  .fhwy-b2b-sidebar-module-search h3 {
    display: none !important;
  }

  .fhwy-b2b-sidebar-module-search .fhwy-b2b-sidebar-module-content {
    padding: 0 !important;
  }

  .fhwy-b2b-product-search-wrapper {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* 2c. kill the empty filter card + "latest products" block on mobile */
  .fhwy-b2b-sidebar-module-filter,
  .fhwy-b2b-sidebar-module-recent-products {
    display: none !important;
  }

  /* ============ 3. ARCHIVE: product grid 4 -> 2 columns ============ */
  .fhwy-b2b-products-grid,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-1,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-2,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-3,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-4,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  /* ============ 4. ARCHIVE: product card internals ============ */
  .fhwy-b2b-product-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 9px 9px 11px !important;
    border-radius: 12px !important;
  }

  .fhwy-b2b-product-thumbnail {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    border-radius: 8px !important;
    overflow: hidden !important;
  }

  .fhwy-b2b-product-image-wrapper {
    width: 100% !important;
    height: 100% !important;
  }

  .fhwy-b2b-product-image-wrapper img,
  .fhwy-b2b-product-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  /* floating icons over the image were oversized */
  .fhwy-b2b-mh-quote-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    padding: 0 !important;
    right: 6px !important;
    bottom: 6px !important;
  }

  .fhwy-b2b-mh-quote-icon img,
  .fhwy-b2b-mh-quote-icon svg {
    width: 26px !important;
    height: 26px !important;
  }

  .fhwy-b2b-email-inquiry-btn {
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    top: 6px !important;
    right: 6px !important;
    border-radius: 50% !important;
  }

  .fhwy-b2b-email-inquiry-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .fhwy-b2b-product-info {
    width: 100% !important;
    padding: 8px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
  }

  .fhwy-b2b-product-title {
    font-size: 13.5px !important;
    line-height: 1.42 !important;
    margin: 0 0 6px !important;
    min-height: 0 !important;
    font-weight: 600 !important;
  }

  .fhwy-b2b-product-title a {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-break: break-word !important;
  }

  .fhwy-b2b-product-card-price-moq {
    margin: 0 0 6px !important;
  }

  .fhwy-b2b-card-price {
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    margin: 0 !important;
  }

  .fhwy-b2b-card-price strong {
    font-size: 15px !important;
    font-weight: 700 !important;
  }

  /* excerpt duplicates the title on this catalogue — drop it */
  .fhwy-b2b-product-excerpt {
    display: none !important;
  }

  .fhwy-b2b-product-meta {
    font-size: 11.5px !important;
    line-height: 1.45 !important;
    margin: 0 0 8px !important;
    color: #667085 !important;
  }

  .fhwy-b2b-product-category {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* CTA pinned to card bottom, never clipped */
  .fhwy-b2b-product-actions {
    margin-top: auto !important;
    padding: 8px 0 0 !important;
    width: 100% !important;
  }

  .fhwy-b2b-button-group {
    width: 100% !important;
    display: block !important;
  }

  .fhwy-b2b-add-to-quote-button {
    display: block !important;
    width: 100% !important;
    min-height: 38px !important;
    padding: 9px 4px !important;
    font-size: 12.5px !important;
    line-height: 1.2 !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .fhwy-b2b-btn-label {
    font-size: 12.5px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
  }

  /* ============ 5. ARCHIVE: pagination ============ */
  .fhwy-b2b-pagination,
  .fhwy-b2b-products-pagination,
  .woocommerce-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 16px 0 8px !important;
  }

  /* ============ 6. SINGLE PRODUCT: structure ============ */
  .fhwy-b2b-product-single-container {
    padding: 0 !important;
  }

  .fhwy-b2b-single-content-wrapper {
    padding: 0 12px !important;
  }

  .fhwy-b2b-product-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 14px 0 0 !important;
  }

  .fhwy-b2b-product-images-col,
  .fhwy-b2b-product-summary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* hero image: natural ratio, no dead space */
  .fhwy-b2b-gallery-main-image {
    height: auto !important;
    min-height: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .fhwy-b2b-gallery-main-image img,
  .fhwy-b2b-gallery-main-image .fhwy-b2b-zoom-image {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* thumbnails: horizontal strip */
  .fhwy-b2b-gallery-thumbnails {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 10px 0 4px !important;
    margin: 0 !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .fhwy-b2b-gallery-thumbnails::-webkit-scrollbar { display: none; }

  .fhwy-b2b-gallery-thumb {
    flex: 0 0 auto !important;
    width: 58px !important;
    height: 58px !important;
    margin: 0 !important;
    border-radius: 8px !important;
  }

  .fhwy-b2b-gallery-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  .fhwy-b2b-share-container.gallery-share {
    margin: 6px 0 0 !important;
  }

  /* summary block */
  .fhwy-b2b-product-info-box {
    padding: 4px 0 0 !important;
  }

  .fhwy-b2b-product-summary h1,
  .fhwy-b2b-product-summary .fhwy-b2b-product-title {
    font-size: 19px !important;
    line-height: 1.35 !important;
  }

  .fhwy-b2b-product-price-moq-block {
    font-size: 20px !important;
    margin: 10px 0 !important;
  }

  .fhwy-b2b-product-short-description {
    font-size: 14px !important;
    line-height: 1.65 !important;
  }

  .fhwy-b2b-add-to-quote-section {
    padding: 14px !important;
    border-radius: 12px !important;
  }

  .fhwy-b2b-add-to-quote-section .fhwy-b2b-add-to-quote-button,
  .fhwy-b2b-add-to-quote-section button {
    min-height: 46px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
  }

  /* ============ 7. SINGLE PRODUCT: tabs & content ============ */
  .fhwy-b2b-product-bottom-layout {
    display: block !important;
  }

  /* sidebar is pure noise on a phone: categories + search already
     reachable from the catalogue page */
  .fhwy-b2b-sidebar-column {
    display: none !important;
  }

  .fhwy-b2b-content-column {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .fhwy-b2b-tabs-navigation {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 0 0 6px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .fhwy-b2b-tabs-navigation::-webkit-scrollbar { display: none; }

  .fhwy-b2b-tabs-navigation > * {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: 13.5px !important;
  }

  .fhwy-b2b-scroll-progress-container {
    display: none !important;
  }

  /* arrow fades on the tab strip are pointless once it scrolls natively */
  .fhwy-b2b-tabs-nav-wrapper::before,
  .fhwy-b2b-tabs-nav-wrapper::after {
    display: none !important;
  }

  .fhwy-b2b-tab-content {
    font-size: 14px !important;
    line-height: 1.7 !important;
  }

  .fhwy-b2b-tab-content img,
  .fhwy-b2b-tab-section img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* spec tables must scroll, not overflow the viewport */
  .fhwy-b2b-tab-content table,
  .fhwy-b2b-tab-section table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    font-size: 13px !important;
  }

  .fhwy-b2b-tab-content ul,
  .fhwy-b2b-tab-content ol,
  .fhwy-b2b-tab-section ul,
  .fhwy-b2b-tab-section ol {
    padding-left: 18px !important;
  }

  .fhwy-b2b-tab-section h2,
  .fhwy-b2b-tab-section h3,
  .fhwy-b2b-tab-content h2,
  .fhwy-b2b-tab-content h3 {
    font-size: 17px !important;
    line-height: 1.35 !important;
  }

  /* related products reuse the grid rules above (2 cols) */
  .fhwy-b2b-related-products {
    margin-top: 22px !important;
    padding: 0 !important;
  }

  /* ============ 8. GLOBAL: fixed bottom bar clearance ============ */
  body {
    padding-bottom: 56px !important;
  }

  .nbb2b-mobile-menu {
    height: 52px !important;
  }

  /* language switcher used to sit underneath the bottom bar */
  .trp-floating-switcher {
    bottom: 60px !important;
    left: 10px !important;
    right: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 132px !important;
    padding: 3px 8px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.14) !important;
  }

  .trp-floating-switcher,
  .trp-floating-switcher * {
    font-size: 12px !important;
    line-height: 1.2 !important;
  }

  .trp-floating-switcher .trp-language-switcher-container,
  .trp-floating-switcher .trp-ls-shortcode-current-language {
    width: auto !important;
    min-width: 0 !important;
    padding: 4px 2px !important;
  }

  /* ============ 9. "Leave a message" modal ============ */
  .nbb2b-mm-message-modal {
    width: calc(100% - 20px) !important;
    max-width: 440px !important;
    max-height: 88vh !important;
    border-radius: 14px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .nbb2b-mm-message-modal .nbb2b-lm-panel-header {
    padding: 14px 16px !important;
    position: sticky !important;
    top: 0 !important;
    background: #fff !important;
    z-index: 2 !important;
  }

  .nbb2b-mm-message-modal input,
  .nbb2b-mm-message-modal textarea,
  .nbb2b-mm-message-modal select {
    font-size: 16px !important; /* stops iOS auto-zoom on focus */
  }
}

/* ---------- Very small phones ---------- */
@media (max-width: 380px) {
  .fhwy-b2b-products-grid,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-2,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-3,
  .fhwy-b2b-products-grid.fhwy-b2b-columns-4 {
    gap: 9px !important;
  }

  .fhwy-b2b-product-card {
    padding: 7px 7px 9px !important;
  }

  .fhwy-b2b-product-title {
    font-size: 12.5px !important;
  }

  .fhwy-b2b-add-to-quote-button,
  .fhwy-b2b-btn-label {
    font-size: 11.5px !important;
  }
}
