/* Mobile reflow only. Keep the original desktop layout and interactions. */
.cczy-mobile-spec-cards { display: none; }

@media (max-width: 767px), (max-width: 900px) and (pointer: coarse) {
  /* Closed native disclosure menus must not affect the page's width. */
  .cczy-mobile-menu:not([open]) > nav { display: none; }
  .cczy-mobile-menu[open] > nav {
    grid-template-columns: minmax(0, 1fr);
    box-sizing: border-box;
    overflow-wrap: anywhere;
  }

  .cczy-home .cczy-home-hero { grid-template-columns: minmax(0, 1fr); }
  .cczy-home .cczy-home-hero__copy { min-inline-size: 0; overflow-wrap: anywhere; }

  /* Use two cards per row in the three lens catalogs, including the Chinese routes. */
  :is(body.cczy-page-series, main.page-shell) .catalog-section .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    scroll-margin-block-start: 5rem;
  }
  :is(body.cczy-page-series, main.page-shell) .catalog-section .product-card {
    display: grid;
    grid-template-rows: auto 1fr;
    min-inline-size: 0;
  }
  :is(body.cczy-page-series, main.page-shell) .catalog-section .product-card__image-wrap {
    box-sizing: border-box;
    position: relative;
    aspect-ratio: 8 / 5;
    block-size: auto;
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    min-block-size: 0;
    padding: .5rem;
  }
  :is(body.cczy-page-series, main.page-shell) .catalog-section .product-card__image {
    display: block;
    position: absolute;
    inset: .5rem;
    inline-size: calc(100% - 1rem);
    block-size: calc(100% - 1rem);
    min-inline-size: 0;
    max-inline-size: 100%;
    object-fit: contain;
  }
  :is(body.cczy-page-series, main.page-shell) .catalog-section .product-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
    min-inline-size: 0;
    padding: .625rem;
    overflow-wrap: anywhere;
  }
  :is(body.cczy-page-series, main.page-shell) .catalog-section .product-card__meta {
    margin: 0;
    font-size: .6875rem;
    line-height: 1.35;
  }
  :is(body.cczy-page-series, main.page-shell) .catalog-section .product-card__body h3 {
    min-block-size: 0;
    margin: 0;
    font-size: .9375rem;
    line-height: 1.35;
  }
  :is(body.cczy-page-series, main.page-shell) .catalog-section .product-card__link {
    display: inline-flex;
    align-items: center;
    min-block-size: 44px;
    min-inline-size: 44px;
    margin-block-start: auto;
    max-inline-size: 100%;
    white-space: normal;
  }

  /* Chinese homepage calculator: reflow the existing controls without touching the script or DOM order. */
  body.page-id-2616:not(.cczy-en-site) .elementor-element-dc6b1cd .header-container {
    padding: .75rem;
    overflow-wrap: anywhere;
  }
  body.page-id-2616:not(.cczy-en-site) .elementor-element-dc6b1cd .header-container h1 {
    font-size: clamp(1.125rem, 4.5vw, 1.375rem);
    line-height: 1.35;
    margin-block: 0 .5rem;
  }
  body.page-id-2616:not(.cczy-en-site) .elementor-element-dc6b1cd .contact-row {
    gap: .25rem .75rem;
  }
  body.page-id-2616:not(.cczy-en-site) .elementor-element-dc6b1cd .contact-item {
    max-inline-size: 100%;
    min-inline-size: 0;
    white-space: normal;
  }
  body.page-id-2616:not(.cczy-en-site) .elementor-element-dc6b1cd .section {
    margin: .5rem 0;
    padding: .625rem;
  }
  body.page-id-2616:not(.cczy-en-site) .section .section-header {
    flex-wrap: wrap;
    gap: .375rem .5rem;
    margin-block-end: .5rem;
  }
  body.page-id-2616:not(.cczy-en-site) .section .section-title {
    flex: 1 1 9.75rem;
    min-inline-size: 0;
    max-inline-size: 100%;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 1.0625rem;
    line-height: 1.35;
  }
  body.page-id-2616:not(.cczy-en-site) .section .section-buttons .btn {
    min-block-size: 44px;
    min-inline-size: 44px;
  }
  body.page-id-2616:not(.cczy-en-site) .section :is(.input-grid, .single-row-grid, .diy-single-row-grid) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: .5rem;
    margin-block-start: 0;
  }
  body.page-id-2616:not(.cczy-en-site) .section .input-group {
    min-inline-size: 0;
  }
  body.page-id-2616:not(.cczy-en-site) .section .input-group label {
    overflow-wrap: anywhere;
    font-size: .875rem;
    line-height: 1.35;
    margin-block-end: .25rem;
  }
  body.page-id-2616:not(.cczy-en-site) .section .input-group input {
    box-sizing: border-box;
    inline-size: 100%;
    min-inline-size: 0;
    min-block-size: 44px;
    padding: .375rem .5rem;
    font-size: 1rem;
  }
  body.page-id-2616:not(.cczy-en-site) :is(.focal-group, .diy-zoom-group, .lens-section .input-grid > :first-child) {
    grid-column: 1 / -1;
  }
  body.page-id-2616:not(.cczy-en-site) .section .focal-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .25rem;
  }
  body.page-id-2616:not(.cczy-en-site) .section .focal-stepper {
    position: static;
    display: flex;
    flex-direction: row;
    transform: none;
    gap: .25rem;
  }
  body.page-id-2616:not(.cczy-en-site) .section .focal-stepper button {
    min-inline-size: 44px;
    min-block-size: 44px;
    font-size: .8125rem;
  }
  body.page-id-2616:not(.cczy-en-site) .section :is(.lens-input-rules, .limit-info) {
    margin-block: .5rem 0;
    overflow-wrap: anywhere;
  }
  body.page-id-2616:not(.cczy-en-site) .notice-content table {
    inline-size: 100%;
    table-layout: fixed;
    overflow-wrap: anywhere;
  }
  body.page-id-2616:not(.cczy-en-site) .notice-content td:first-child { width: 2rem; }
  body.page-id-2616:not(.cczy-en-site) .notice-content td:nth-child(2) { width: 33%; }
  body.page-id-2616:not(.cczy-en-site) .notice-content td {
    padding-inline: .375rem;
    white-space: normal;
  }
  .online-calculator-qr { box-sizing: border-box; max-inline-size: 100%; }
  .online-calculator-qr img { max-inline-size: 100%; height: auto; }

  nav.tool-nav { flex-wrap: wrap; overflow: visible; white-space: normal; }
  nav.tool-nav a { max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; }

  .cczy-video-center .cczy-video-filters {
    flex-wrap: wrap;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .cczy-video-center .cczy-video-filters > button {
    box-sizing: border-box;
    max-inline-size: 100%;
    min-block-size: 44px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .cczy-video-center :is(video, img) { max-inline-size: 100%; }
  .cczy-video-center video { inline-size: 100%; min-inline-size: 0; }
  .cczy-video-center :is(.cczy-video-grid, .cczy-video-workspace, .cczy-coaxial-demo) { min-inline-size: 0; }
  .cczy-video-center .cczy-video-choice { max-inline-size: 100%; white-space: normal; }
  .cczy-video-center .cczy-coaxial-demo {
    gap: .875rem;
    margin-block-end: 1.25rem;
    padding: .875rem;
  }

  #cczy-nir-drone .page-nav > .wrap,
  body.ccczy-zh-detail .page-nav > .wrap,
  body.cczy-mobile-legacy-dual .page nav.quick-nav {
    flex-wrap: wrap;
    overflow: visible;
  }
  #cczy-nir-drone .page-nav a,
  body.ccczy-zh-detail .page-nav a,
  body.cczy-mobile-legacy-dual .page nav.quick-nav a {
    min-block-size: 44px;
    max-inline-size: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #cczy-nir-drone .hero-grid,
  body.ccczy-zh-detail .hero-grid { grid-template-columns: minmax(0, 1fr); }
  #cczy-nir-drone .hero-grid > *,
  body.ccczy-zh-detail .hero-grid > * { min-inline-size: 0; }

  /* Three-column dual-sensor comparisons retain real table semantics. */
  .cczy-dual-specifications .cczy-dual-table-wrap,
  body.cczy-mobile-legacy-dual main.page .table-scroll {
    overflow: visible;
  }
  .cczy-dual-specifications .cczy-dual-table-wrap table,
  body.cczy-mobile-legacy-dual main.page .table-scroll table {
    inline-size: 100%;
    min-inline-size: 0;
    table-layout: fixed;
  }
  .cczy-dual-specifications .cczy-dual-table-wrap :is(th, td),
  body.cczy-mobile-legacy-dual main.page .table-scroll :is(th, td) {
    padding-inline: .5rem;
    font-size: .8125rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.cczy-mobile-legacy-dual main.page .table-scroll.light-table tr > :first-child { width: 38%; }

  /* Split the four-column 4K configuration matrix by model on phones. */
  .table-wrap[data-cczy-mobile-specs] { display: none; }
  .cczy-mobile-spec-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
    margin: 1rem 0 0;
  }
  .cczy-mobile-spec-card {
    min-inline-size: 0;
    border: 1px solid var(--line, #cbd8d2);
    background: var(--surface, #fff);
    overflow-wrap: anywhere;
  }
  .cczy-mobile-spec-card > h3 {
    margin: 0;
    padding: .625rem .75rem;
    background: #edf4f0;
    color: #14211d;
    font-size: 1.125rem;
    line-height: 1.35;
  }
  .cczy-mobile-spec-card > h3 small { display: block; font-size: .8125rem; }
  .cczy-mobile-spec-card > h3 .model-no small { display: inline; }
  .cczy-mobile-spec-card dl { margin: 0; }
  .cczy-mobile-spec-card dl > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: .75rem;
    padding: .5rem .75rem;
    border-block-start: 1px solid var(--line, #cbd8d2);
  }
  .cczy-mobile-spec-card dt { font-weight: 650; }
  .cczy-mobile-spec-card dd { margin: 0; }
  .cczy-mobile-spec-card dd small { display: block; }
}
