/* Mobile quality fixes. Desktop composition remains governed by page styles. */
@media (max-width:760px) {
  body :is(a,button,summary,[role="button"],[role="tab"],input,select,textarea) {
    -webkit-tap-highlight-color:transparent;
  }
  body summary:active { opacity:.8; }
  /* Let the browser anchor the tapped summary, rather than a section below it. */
  body #yc-techniques .ct-collection,
  body #yc-techniques .ct-book-details { overflow-anchor:auto; }
  body #yc-techniques .ct-book-track { overflow-anchor:none; }
  body :is(a,button,summary,[role="button"],[role="tab"]):focus-visible {
    outline:2px solid #174cff; outline-offset:4px;
  }
  /* The !important is limited to input sizing: independent article styles load in body. */
  body :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),select,textarea) {
    font-size:max(16px,1rem)!important;
  }
  body.page #main-content :is(#ct-title,#yff-title,#pm-title,#yr-title,#ds-title,#yc-title,#yct-page-title,#ych-hero-title,#yccs-page-title,#ycs-page-title,#faq-page-title),
  body.page #main-content :is(#yc-private-label,#yc-factory,#yc-tshirt-case,#yc-streetwear-case,#yc-hoodie-case) h1 {
    font-size:clamp(36px,10.5vw,44px); line-height:1.1; letter-spacing:-.04em;
    text-align:center; width:100%; max-width:none; margin-inline:auto;
    text-wrap:balance;
  }
  body .ycp-catalog .ycp-intro { margin-inline:auto; text-align:center; }
  body .ycp-catalog .ycp-intro h1 { font-size:clamp(36px,10.5vw,44px); line-height:1.1; text-wrap:balance; }
  body .ycp-catalog .ycp-intro>p { margin-inline:auto; }
  body #yc-tshirts .yct-form-grid { grid-template-columns:minmax(0,1fr); }
  body #yc-tshirts .yct-form-grid>* { grid-column:1 / -1; min-width:0; }
  body #main-content :is(.yff-crumb,.ct-crumb,.yct-breadcrumb,.ych-breadcrumb,.ycp-breadcrumb),
  body #yc-factory nav a { font-size:12px; }
  body #main-content :is(.yff-crumb,.ct-crumb,.yct-breadcrumb,.ych-breadcrumb,.ycp-breadcrumb) a,
  body #yc-factory nav a { display:inline-flex; align-items:center; min-height:36px; }
  /* One image row, regardless of the number of thumbnails. */
  body .ycp-product-layout { gap:22px; }
  body .ycp-product-layout .ycp-main-image { aspect-ratio:1; max-height:52svh; }
  body .ycp-product-layout .ycp-thumbnails {
    display:flex; flex-wrap:nowrap; gap:10px; overflow-x:auto; padding:4px;
    margin:10px -4px 0; scrollbar-width:thin; overscroll-behavior-x:contain;
  }
  body .ycp-product-layout .ycp-thumb { flex:0 0 60px; width:60px; height:60px; }
  body .ycp-product-layout .ycp-image-note { margin-top:10px!important; }
  body .ycp-product-info { display:flex; flex-direction:column; }
  body .ycp-product-info>.ycp-eyebrow { order:-3; }
  body .ycp-product-info>h1 { order:-2; margin:12px 0 16px; font-size:32px; line-height:1.12; text-wrap:balance; }
  body .ycp-product-info>.ycp-inquiry { order:-1; margin:0 0 22px; padding:16px 0; }
  body .ycp-product-info .ycp-inquiry .ycp-button { max-width:none; }
  body #yc-whatsapp-float { bottom:calc(20px + env(safe-area-inset-bottom,0px)); }
  body:has(.ycf-mobile-quote) #yc-whatsapp-float { bottom:calc(88px + env(safe-area-inset-bottom,0px)); }
  body .ycf-mobile-quote { padding-bottom:calc(14px + env(safe-area-inset-bottom,0px)); }
  body #yc-whatsapp-float.yc-mobile-obstructed,
  body:has(.is-menu-open) #yc-whatsapp-float,
  body:has(.is-menu-open) #yc-back-to-top { visibility:hidden; pointer-events:none; }
  #yc-back-to-top {
    position:fixed; left:16px; bottom:calc(22px + env(safe-area-inset-bottom,0px));
    z-index:900; width:44px; height:44px; display:grid; place-items:center;
    border:1px solid #d9dde2; border-radius:50%; background:#fff; color:#111318;
    box-shadow:0 2px 8px #11131815; cursor:pointer;
  }
  #yc-back-to-top[hidden] { display:none; }
}
@media (min-width:761px) { #yc-back-to-top { display:none; } }

/* Mobile chapter navigation: custom disclosure with a complete section index. */
#yc-fabrics-fit .yc-section-picker { display:none; }
@media(max-width:760px) {
  body #yc-fabrics-fit .yff-nav { top:var(--yc-fabrics-header,73px); z-index:30; background:#fff; border-color:#e5e8ee; box-shadow:0 3px 12px #17223a05; }
  body #yc-fabrics-fit .yff-nav.yc-section-enhanced>.yff-wrap { display:none; }
  body #yc-fabrics-fit .yc-section-picker { display:block; position:relative; margin:0; padding:0 20px; }
  body #yc-fabrics-fit .yc-chapter-trigger { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; min-height:72px; padding:12px 0; border:0; background:#fff; text-align:left; color:#151b27; font-family:Arial,Helvetica,sans-serif; cursor:pointer; }
  body #yc-fabrics-fit .yc-chapter-copy { display:flex; flex-direction:column; gap:5px; min-width:0; }
  body #yc-fabrics-fit .yc-chapter-kicker { color:#6d7787; font-size:10px; line-height:1.2; letter-spacing:.12em; font-weight:600; }
  body #yc-fabrics-fit .yc-chapter-title { font-size:15px; line-height:1.35; font-weight:600; letter-spacing:-.015em; }
  body #yc-fabrics-fit .yc-chapter-chevron { display:grid; place-items:center; flex:0 0 32px; height:32px; border-radius:50%; background:#f0f3f8; color:#174cff; }
  body #yc-fabrics-fit .yc-chapter-chevron svg { width:16px; height:16px; transition:transform .16s ease; }
  body #yc-fabrics-fit .yc-chapter-trigger[aria-expanded="true"] .yc-chapter-chevron svg { transform:rotate(180deg); }
  body #yc-fabrics-fit .yc-chapter-panel { position:absolute; top:100%; left:12px; right:12px; padding:8px; border:1px solid #e2e7ef; border-radius:12px; background:#fff; box-shadow:0 16px 40px #15244324; max-height:calc(100dvh - var(--yc-fabrics-stack,147px) - 12px); overflow-y:auto; overscroll-behavior:contain; }
  body #yc-fabrics-fit .yc-chapter-panel[hidden] { display:none; }
  body #yc-fabrics-fit .yc-chapter-panel a { display:grid; grid-template-columns:24px minmax(0,1fr) 18px; align-items:center; gap:10px; min-height:52px; padding:12px; box-sizing:border-box; border-radius:7px; color:#283243; font:14px/1.4 Arial,Helvetica,sans-serif; text-decoration:none; white-space:normal; }
  body #yc-fabrics-fit .yc-chapter-number { font-size:10px; letter-spacing:.04em; color:#8a94a3; }
  body #yc-fabrics-fit .yc-chapter-arrow { opacity:0; color:#174cff; font-size:16px; text-align:right; }
  body #yc-fabrics-fit .yc-chapter-panel a[aria-current="location"] { background:#edf3ff; color:#1544cc; font-weight:600; }
  body #yc-fabrics-fit .yc-chapter-panel a[aria-current="location"] :is(.yc-chapter-number,.yc-chapter-arrow) { opacity:1; color:#174cff; }
  body #yc-fabrics-fit .yc-chapter-panel a:active { background:#f0f3f8; }
  body #yc-fabrics-fit :is(.yc-chapter-trigger,.yc-chapter-panel a):focus-visible { outline:2px solid #174cff; outline-offset:-2px; }
  html:has(#yc-fabrics-fit) { scroll-padding-top:var(--yc-fabrics-stack,147px); }
  body #yc-fabrics-fit [id] { scroll-margin-top:0; }
}
@media(prefers-reduced-motion:reduce) { #yc-fabrics-fit .yc-chapter-chevron svg { transition:none; } }

/* Two products per row on phones, including category and related-style grids. */
@media(max-width:760px) {
  body .ycp-catalog .ycp-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px 12px; }
  body .ycp-catalog .ycp-card { min-width:0; }
  body .ycp-catalog .ycp-card-meta { flex-direction:column; align-items:flex-start; gap:3px; margin:12px 0 7px; font-size:11px; }
  body .ycp-catalog .ycp-card h2 { font-size:clamp(15px,4vw,18px); line-height:1.35; letter-spacing:-.02em; }
  body .ycp-catalog .ycp-card-link { font-size:12px; gap:8px; min-height:44px; margin-top:4px; }
}

/* Keep the How It Works hero actions separate and easy to tap. */
@media(max-width:760px) {
  body #main-content .ych-hero-aside { display:flex; flex-direction:column; align-items:stretch; gap:12px; min-width:0; width:100%; max-width:none; margin-inline:0; }
  body #main-content .ych-hero-aside>p { margin:0 0 8px; }
  body #main-content .ych-hero-aside>a {
    display:flex; align-items:center; justify-content:space-between;
    box-sizing:border-box; width:100%; min-height:52px; margin:0; padding:14px 20px; gap:16px;
  }
  body #main-content .ych-hero-aside>.ych-text-link { margin:0; border:1px solid #d9dde2; background:#fff; text-decoration:none; }
}

/* Equipment selection: spaced cards with quiet, distinct selected states. */
#yc-factory .yc-equipment-icon { display:none; }
@media(max-width:760px) {
  body #yc-factory .ycf-equipment-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; overflow:visible; padding:0; margin:0 0 18px; border:0; background:transparent; }
  body #yc-factory .ycf-equipment-tabs button { position:relative; display:flex; align-items:center; gap:10px; min-width:0; width:100%; min-height:66px; padding:14px; border:1px solid #dfe4ec; border-radius:10px; background:#fff; color:#454f60; white-space:normal; text-align:left; font:500 13px/1.4 Arial,Helvetica,sans-serif; box-shadow:0 2px 4px #18243b03; }
  body #yc-factory .ycf-equipment-tabs .yc-equipment-icon { display:grid; place-items:center; flex:0 0 24px; color:#7b8798; }
  body #yc-factory .yc-equipment-icon svg { width:23px; height:23px; }
  body #yc-factory .ycf-equipment-tabs button[aria-selected="true"] { border-color:#174cff; background:#edf3ff; color:#123db9; box-shadow:inset 0 0 0 .5px #174cff; font-weight:600; }
  body #yc-factory .ycf-equipment-tabs button[aria-selected="true"] .yc-equipment-icon { color:#174cff; }
  body #yc-factory .ycf-equipment-tabs button[aria-selected="true"]:after { content:""; position:absolute; right:8px; top:8px; width:4px; height:4px; border-radius:50%; background:#174cff; }
  body #yc-factory .ycf-equipment-tabs button:last-child:nth-child(odd) { grid-column:1 / -1; justify-content:center; min-height:54px; border:1px solid #dfe4ec; }
  body #yc-factory .ycf-equipment-tabs button:last-child[aria-selected="true"] { border-color:#174cff; }
  body #yc-factory .ycf-equipment-tabs button:focus-visible { outline:2px solid #174cff; outline-offset:3px; }
  body #yc-factory .ycf-equipment-panel { border-radius:12px; overflow:hidden; border:1px solid #e3e7ed; background:#fff; }
}
