/* Local Shop mobile master V1. All existing desktop/category styles remain intact. */
.s1688-sm, .s1688-sm-card-cta, .s1688-sm-help, .s1688-sm-pagination { display: none; }
@media (max-width: 767px) {
  body.s1688-shop-mobile-v1 { --sm-gold: #c8a55c; --sm-ink: #f3f1eb; --sm-muted: #aaa9a4; }
  body.woocommerce-shop.s1688-shop-mobile-v1 #main .s1688-sm { display: block; margin: 0 0 10px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  body.s1688-shop-mobile-v1 .s1688-shop-intro,
  body.s1688-shop-mobile-v1 .s1688-shop-directory,
  body.s1688-shop-mobile-v1 .woocommerce-products-header,
  body.s1688-shop-mobile-v1 .steam1688-series-wall,
  body.s1688-shop-mobile-v1 .s1688-mobile-shop-nav,
  body.s1688-shop-mobile-v1 .s1688-archive-toolbar,
  body.s1688-shop-mobile-v1 #s1688-category-products { display: none; }
  /* Shop only: outrank the legacy category-v2 directory and <=640px CTA rules.
     Keep original DOM/data for desktop; never target the new mobile UI. */
  body.woocommerce-shop.s1688-shop-mobile-v1 #main .s1688-mobile-collection-jump,
  body.woocommerce-shop.s1688-shop-mobile-v1 #main #s1688-category-links,
  body.woocommerce-shop.s1688-shop-mobile-v1 #main #s1688-brand-classification,
  body.woocommerce-shop.s1688-shop-mobile-v1 #main .s1688-brand-toggle,
  body.woocommerce-shop.s1688-shop-mobile-v1 #main .s1688-shop-directory__main,
  body.woocommerce-shop.s1688-shop-mobile-v1 #main .s1688-shop-directory__types { display: none; }
  /* Override the existing archive !important padding/background only on mobile Shop.
     Header dimensions, horizontal content inset and bottom Dock reserve stay intact. */
  body.woocommerce-shop.s1688-shop-mobile-v1 #main { padding-top: 12px !important; background: #101313 !important; }
  /* Local V1.1 density candidate: reserve the existing Dock + safe area,
     without changing Dock/body rules or adding space after every grid row. */
  body.woocommerce-shop.s1688-shop-mobile-v1 #main { padding-bottom: calc(16px + var(--s1688-dock-offset, calc(62px + env(safe-area-inset-bottom, 0px)))); }
  body.woocommerce-shop.s1688-shop-mobile-v1 #main .s1688-sm__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; padding: 0; border: 0; background: transparent; box-shadow: none; }
  body.woocommerce-shop.s1688-shop-mobile-v1 #main .s1688-sm__heading :is(h1, h2) { margin: 0; padding: 0; font-size: 27px; line-height: 30px; font-weight: 700; letter-spacing: -.025em; color: var(--sm-ink); }
  body.woocommerce-shop.s1688-shop-mobile-v1 #main .s1688-sm__heading p { flex: 0 0 auto; margin: 0; font-size: 12px; line-height: 18px; color: var(--sm-muted); white-space: nowrap; }
  body.s1688-shop-mobile-v1 .s1688-sm__tabs { display: flex; gap: 18px; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border-bottom: 1px solid #ffffff13; }
  body.s1688-shop-mobile-v1 .s1688-sm__tabs::-webkit-scrollbar { display: none; }
  body.s1688-shop-mobile-v1 .s1688-sm__tabs a { flex: 0 0 auto; display: flex; align-items: center; min-height: 38px; padding: 0; border-bottom: 2px solid transparent; color: #c7c7c2; font-size: 13px; line-height: 18px; font-weight: 550; text-decoration: none; white-space: nowrap; }
  body.s1688-shop-mobile-v1 .s1688-sm__tabs a.is-active { color: var(--sm-gold); border-color: var(--sm-gold); }
  body.s1688-shop-mobile-v1 .s1688-sm__filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
  body.s1688-shop-mobile-v1 .s1688-sm__filters button { min-width: 0; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 3px; border: 1px solid #ffffff0f; border-radius: 7px; background: #171a19; color: var(--sm-ink); font: inherit; font-size: 12px; line-height: 18px; box-shadow: none; }
  body.s1688-shop-mobile-v1 .s1688-sm__filters button.is-selected { color: var(--sm-gold); border-color: #c8a55c70; }
  body.s1688-shop-mobile-v1 .s1688-sm__feedback { color: var(--sm-muted); font-size: 12px; line-height: 1.5; }
  body.s1688-shop-mobile-v1 .s1688-sm__feedback:not(:empty) { padding-top: 8px; }
  body.s1688-shop-mobile-v1 #main ul.products { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px 10px !important; width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 0 0 12px; }
  body.s1688-shop-mobile-v1 #main ul.products::before,
  body.s1688-shop-mobile-v1 #main ul.products::after { display: none; }
  /* Product visuals/actions now live in the reusable Compact Product Card V2 CSS. */
  body.s1688-shop-mobile-v1 #main ul.products li.product > .screen-reader-text { position: absolute; left: 0; top: 0; right: auto; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0; transform: none; }
  body.s1688-shop-mobile-v1 #main ul.products .s1688-sm-help { grid-column: 1 / -1; display: block; margin: 2px 0; padding: 16px; border: 1px solid #c8a55c24; border-radius: 12px; background: #20211c; }
  body.s1688-shop-mobile-v1 .s1688-sm-help h2 { margin: 0 0 5px; font-size: 17px; line-height: 1.35; color: var(--sm-ink); }
  body.s1688-shop-mobile-v1 .s1688-sm-help p { margin: 0 0 10px; color: #c7c7bf; font-size: 12px; line-height: 1.6; }
  body.s1688-shop-mobile-v1 .s1688-sm-help div { display: flex; gap: 10px; }
  body.s1688-shop-mobile-v1 .s1688-sm-help a { display: flex; align-items: center; min-height: 44px; color: var(--sm-gold); font-size: 13px; text-decoration: none; }
  body.s1688-shop-mobile-v1 .s1688-sm-help small { color: var(--sm-muted); font-size: 11px; }
  body.s1688-shop-mobile-v1 #main .woocommerce-pagination { display: none; }
  body.s1688-shop-mobile-v1 #main .s1688-sm-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 16px; padding-bottom: 12px; color: var(--sm-muted); font-size: 13px; }
  body.s1688-shop-mobile-v1 #main .s1688-sm-pagination a,
  body.s1688-shop-mobile-v1 #main .s1688-sm-pagination > span:first-child,
  body.s1688-shop-mobile-v1 #main .s1688-sm-pagination > span:last-child { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid #ffffff18; border-radius: 9px; color: var(--sm-ink); text-decoration: none; }
  body.s1688-shop-mobile-v1 #main .s1688-sm-pagination [aria-disabled="true"] { opacity: .4; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet { width: calc(100% - 16px); max-width: 480px; max-height: min(75dvh, 650px); margin: auto auto 8px; padding: 0; border: 1px solid #c8a55c28; border-radius: 18px; background: #191c19; color: var(--sm-ink); box-shadow: 0 -12px 50px #0007; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet::backdrop { background: #0009; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #ffffff12; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__head h2 { margin: 0; font-size: 18px; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet button { min-height: 44px; font: inherit; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__close { width: 44px; border: 0; background: none; color: var(--sm-ink); font-size: 24px; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__options { padding: 8px 16px; max-height: 47dvh; overflow-y: auto; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__options label { display: flex; align-items: center; gap: 12px; min-height: 46px; font-size: 15px; border-bottom: 1px solid #ffffff08; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__options input { accent-color: var(--sm-gold); width: 18px; height: 18px; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__options p { font-size: 14px; line-height: 1.7; color: #cccac1; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__options a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 12px; color: var(--sm-gold); }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet__apply { width: 100%; border: 0; border-radius: 10px; background: var(--sm-gold); color: #171811; font-weight: 650; }
  body.s1688-shop-mobile-v1.s1688-sm-sheet-open { overflow-y: hidden; }
  body.s1688-shop-mobile-v1 .s1688-sm-sheet a:focus-visible,
  body.s1688-shop-mobile-v1 .s1688-sm-sheet button:focus-visible,
  body.s1688-shop-mobile-v1 .s1688-sm button:focus-visible,
  body.s1688-shop-mobile-v1 .s1688-sm a:focus-visible,
  body.s1688-shop-mobile-v1 .s1688-sm-card-cta:focus-visible { outline: 2px solid var(--sm-gold); outline-offset: 3px; }
}
