/* Mobile reading rhythm: scoped to the storefront; desktop keeps its native layout. */
.mibang-mobile-tab-toggle,
.mibang-mobile-highlights-toggle { display: none; }
@media (max-width: 680px) {
  body.mibang-commerce-v2 { font-size: 15px; line-height: 1.6; }
  #main-content .bb-container { width: calc(100% - 32px); max-width: calc(100% - 32px); }
  body.single-product .bb-woocommerce-shell.bb-container { max-width: calc(100% - 32px) !important; width: calc(100% - 32px) !important; padding: 24px 0 96px; }
  .single-product .bb-woocommerce-shell > div.product > .product_title { grid-column: 1; grid-row: 1; }
  .single-product .bb-woocommerce-shell > div.product > div.woocommerce-product-gallery.images { grid-row: 2; }
  .single-product .bb-woocommerce-shell > div.product > .summary { grid-row: 3; }
  .single-product .bb-woocommerce-shell > div.product > .mibang-gallery-info { grid-row: 4; }
  .single-product div.product .product_title {
    margin: 0 0 22px; font-family: "Roboto", sans-serif; font-size: 23px;
    font-weight: 700; line-height: 1.3; letter-spacing: -.015em;
  }
  .single-product div.product div.images { margin-bottom: 24px; }
  .single-product .woocommerce-product-gallery__image > a {
    height: clamp(220px, 72vw, 310px); aspect-ratio: auto;
    background: #fff; border-radius: 8px;
  }
  body.single-product div.product div.images .woocommerce-product-gallery__image > a > img {
    width: 100% !important; height: 100% !important; object-fit: contain !important;
  }
  .single-product div.product .woocommerce-product-gallery .onsale {
    position: absolute; top: 10px; left: 10px; right: auto; z-index: 5;
    width: auto !important; max-width: max-content; min-width: 0; min-height: 0;
    padding: 5px 9px; margin: 0; font-size: 11px; font-weight: 700;
    line-height: 1.2; border-radius: 5px; box-shadow: none;
  }
  .single-product div.product div.images .flex-control-thumbs { margin-top: 14px; }
  .single-product .summary > p.price ins { text-decoration: none; }
  .single-product .summary > p.price { font-size: 24px; margin-bottom: 16px; }
  .single-product .mibang-review-summary { margin: 0 0 16px; font-size: 13px; }
  .single-product .mibang-sale-badge { padding: 5px 9px; border-radius: 5px; font-size: 11px; }
  .single-product .mibang-product-intro {
    margin: 0 0 20px; padding: 0; border: 0; border-radius: 0;
    font-size: 14px; line-height: 1.65; box-shadow: none; background: transparent;
  }
  .single-product .mibang-product-intro p { margin: 0; }
  .single-product .mibang-mobile-highlights-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    width: 100%; min-height: 48px; margin: 0 0 20px; padding: 12px 14px;
    border: 1px solid #e3e7eb; border-radius: 8px; background: #f7f9fa;
    color: #182127; font-size: 14px; line-height: 1.4; font-weight: 700; text-align: start;
  }
  .single-product .mibang-mobile-highlights-toggle[aria-expanded="true"] { margin-bottom: 0; border-radius: 8px 8px 0 0; }
  .single-product .mibang-product-highlights.mibang-mobile-highlights { display: none; }
  .single-product .mibang-product-highlights.mibang-mobile-highlights.is-mobile-open {
    display: block; margin-bottom: 24px; padding: 14px; border-radius: 0 0 8px 8px; background: #fff; box-shadow: none;
  }
  .single-product .mibang-mobile-highlights > strong { display: none; }
  .single-product .mibang-product-highlights li { font-size: 14px; line-height: 1.6; }
  .single-product .mibang-product-highlights ul { margin: 0; }
  .single-product .mibang-quantity-tiers { margin: 0 0 24px; }
  .single-product .mibang-quantity-tiers h2 { font-size: 13px; margin-bottom: 12px; }
  .single-product .mibang-quantity-tier-grid { gap: 8px; }
  .single-product .mibang-quantity-tier-grid button { min-height: 94px; padding: 12px 9px; border-radius: 8px; box-shadow: none; }
  .single-product .mibang-quantity-tier-grid strong { font-size: 12px; padding-right: 12px; }
  .single-product .mibang-tier-price { font-size: 15px; margin: 8px 0 4px; }
  .single-product .mibang-quantity-tier-grid small { font-size: 10px; }
  .single-product .mibang-tier-check { width: 12px; height: 12px; top: 10px; right: 7px; }
  .single-product .summary p.stock.in-stock { padding-top: 5px; padding-bottom: 5px; font-size: 12px; }
  .single-product div.product form.cart { margin-bottom: 12px; }
  .single-product div.product form.cart .quantity .qty,
  .single-product div.product form.cart .single_add_to_cart_button,
  .single-product .mibang-buy-now { min-height: 48px !important; height: 48px !important; border-radius: 7px !important; box-shadow: none; }
  .single-product .ppc-button-wrapper:not(:empty) { margin: 20px 0; }
  .single-product .mibang-payment-methods { padding: 14px; border-radius: 8px; box-shadow: none; }
  .single-product .summary .product_meta { margin-top: 24px; font-size: 12px; line-height: 1.7; }
  .single-product .woocommerce-tabs.mibang-mobile-details { margin: 32px 0; border-top: 0; min-width: 0; }
  body.single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs {
    display: flex !important; flex-wrap: nowrap; align-items: stretch; gap: 0;
    width: 100%; max-width: 100%; margin: 0 0 20px !important; padding: 0 !important;
    overflow-x: auto; overflow-y: hidden; white-space: nowrap;
    border-bottom: 1px solid #e3e7eb; scrollbar-width: thin; overscroll-behavior-x: contain;
  }
  .single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs::before,
  .single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs::after,
  .single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs > li::before,
  .single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs > li::after { display: none; }
  body.single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs > li {
    display: block; flex: 0 0 auto; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
  }
  body.single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs > li > a {
    display: flex; align-items: center; justify-content: center; min-height: 44px;
    padding: 10px 14px; margin: 0; border: 1px solid #e3e7eb; border-bottom: 2px solid transparent;
    border-radius: 5px 5px 0 0; background: #f6f7f8; color: #56616c;
    font-size: 13px; font-weight: 650; line-height: 1.4; white-space: nowrap; text-decoration: none;
  }
  body.single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs > li.active > a {
    background: #fff; color: #d90012; border-bottom-color: #d90012;
  }
  .single-product .woocommerce-tabs.mibang-mobile-details > ul.tabs a:focus-visible {
    outline: 2px solid #d90012; outline-offset: -3px;
  }
  .single-product .woocommerce-tabs.mibang-mobile-details > .wc-tab {
    padding: 0 0 28px; margin: 0; font-size: 15px; line-height: 1.7;
  }
  .single-product .woocommerce-tabs #tab-description img.mibang-detail-image {
    display: block; width: 100%; max-width: 100%; height: auto; margin: 16px 0; border-radius: 8px;
  }
  .single-product .woocommerce-tabs .wc-tab > h2:first-child { display: none; }
  .single-product .woocommerce-tabs .wc-tab h2 { margin: 24px 0 14px; font-size: 20px; line-height: 1.35; }
  .single-product .woocommerce-tabs .wc-tab section > h2:first-child { margin-top: 0; }
  .single-product .woocommerce-tabs table.shop_attributes { margin: 20px 0; border-collapse: collapse; }
  .single-product .woocommerce-tabs table.shop_attributes tr { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 60%); padding: 12px 0; border-bottom: 1px solid #e8edf0; }
  .single-product .woocommerce-tabs table.shop_attributes th,
  .single-product .woocommerce-tabs table.shop_attributes td {
    display: block; min-width: 0; width: auto; padding: 0 8px !important; border: 0;
    font-size: 14px; line-height: 1.6; font-style: normal; overflow-wrap: anywhere;
  }
  .single-product .woocommerce-tabs table.shop_attributes td p { padding: 0; margin: 0; }
  .single-product .woocommerce-tabs .mibang-mobile-media-panel p { margin: 0; }
  .single-product .woocommerce-tabs .mibang-mobile-media-panel a:has(> img) { display: block; margin-bottom: 18px; }
  .single-product .woocommerce-tabs .mibang-mobile-media-panel img { width: 100%; height: auto; display: block; border-radius: 8px; }
  .mibang-mobile-tab-toggle:focus-visible, .mibang-mobile-highlights-toggle:focus-visible { outline: 2px solid #d90012; outline-offset: 3px; }
  .single-product .related.products > h2 { font-size: 24px; margin: 0 0 24px; }
  .bb-mobile-dock {
    left: 12px; right: 12px; height: 56px; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 12px; box-shadow: 0 4px 18px rgba(10, 26, 45, .12);
  }
  .bb-mobile-dock svg { width: 22px; height: 22px; }
  body.mibang-commerce-v2 .wanstudio-ai-frontend[data-mode="floating"] {
    --waf-vertical-offset: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    --waf-horizontal-offset: 16px !important;
  }
  body.mibang-commerce-v2 .wanstudio-ai-frontend[data-mode="floating"] .waf-launcher { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 6px; }
  body.mibang-commerce-v2 .wanstudio-ai-frontend .waf-launcher__icon { width: 30px; height: 30px; }
  body.mibang-commerce-v2 .wanstudio-ai-frontend[data-open="true"] .waf-panel { max-height: calc(100dvh - 104px - env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 680px) {
  body.single-product .bb-woocommerce-shell > div.product > .summary > .mibang-sale-badge { width: max-content !important; max-width: 100% !important; display: inline-flex !important; }
  body.mibang-commerce-v2 .wanstudio-ai-frontend .waf-launcher__icon { flex-basis: 30px; border-radius: 50%; }
  .single-product .mibang-gallery-video-stage { height: clamp(220px, 72vw, 310px); aspect-ratio: auto; border-radius: 8px; }
  .single-product .mibang-gallery-video-stage video { object-fit: contain; }
}

/* Consistent vector tools in the desktop header. */
.bb-desktop-header .bb-header-tools { gap: 8px; align-items: center; }
.bb-desktop-header .bb-header-tools .bb-icon-button {
  width: 40px; height: 40px; padding: 8px; border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: #d90012; line-height: 1; text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.bb-desktop-header .bb-header-tools .bb-icon-button svg {
  display: block; width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.bb-desktop-header .bb-header-tools .bb-icon-button:hover {
  background: #fff3f4; border-color: #f4d8dc;
}
.bb-desktop-header .bb-header-tools .bb-icon-button:focus-visible { outline: 2px solid #d90012; outline-offset: 2px; }
.bb-desktop-header .bb-header-tools .bb-cart-icon b {
  display: grid; place-items: center; top: -2px; right: -1px; min-width: 18px; height: 18px;
  padding: 0 4px; border: 2px solid #fff; border-radius: 999px; background: #d90012;
  font-size: 10px; font-weight: 700; line-height: 1;
}

/* Remove the redundant product-only wholesale CTA; global contacts stay available. */
.single-product .summary .mibang-product-whatsapp { display: none !important; }

/* Image category sheet; the mobile dock remains an operable part of navigation. */
.bb-products-sheet { display:none; }
@media (max-width:980px) {
  .bb-products-sheet { position:fixed; z-index:1002; left:0; right:0; bottom:0; max-height:calc(100dvh - 70px); padding:0 16px calc(88px + env(safe-area-inset-bottom,0px)); border-radius:22px 22px 0 0; background:#fff; box-shadow:0 -10px 40px #10213724; display:flex; flex-direction:column; transform:translateY(105%); visibility:hidden; transition:transform .2s ease,visibility .2s; }
  .bb-products-sheet.is-open { transform:none; visibility:visible; }
  .bb-products-handle { flex:0 0 4px; width:40px; border-radius:4px; background:#d6dce2; margin:10px auto 6px; }
  .bb-products-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0 16px; }
  .bb-products-head h2 { margin:0; color:#182127; font-size:24px; line-height:1.3; }
  .bb-products-head p { margin:3px 0 0; color:#68747d; font-size:13px; }
  .bb-products-head button { width:44px; height:44px; flex:0 0 44px; padding:0; border:0; border-radius:50%; background:#f0f3f5; color:#3a4b59; font-size:28px; line-height:1; }
  .bb-products-scroll { overflow-y:auto; overscroll-behavior:contain; min-height:0; padding-bottom:4px; }
  .bb-products-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .bb-products-category { display:flex; min-width:0; flex-direction:column; padding:10px; border:1px solid #e1e6ec; border-radius:14px; background:#f7f9fb; color:#182127; text-decoration:none; }
  .bb-products-picture { display:grid; place-items:center; aspect-ratio:1.35; overflow:hidden; background:#fff; border-radius:9px; margin-bottom:9px; }
  .bb-products-picture img { display:block; width:100%; height:100%; object-fit:contain; }
  .bb-products-picture svg { width:44px; height:44px; fill:none; stroke:#788a98; stroke-width:1.5; }
  .bb-products-category strong { display:flex; align-items:start; justify-content:space-between; gap:6px; font-size:14px; line-height:1.4; }
  .bb-products-category strong span { color:#68747d; font-size:20px; line-height:1; }
  .bb-products-category small { margin-top:4px; font-size:11px; line-height:1.4; color:#68747d; }
  .bb-products-all { display:flex; justify-content:space-between; align-items:center; min-height:48px; padding:12px 16px; margin-top:16px; border-radius:10px; background:#d90012; color:white; font-size:15px; font-weight:700; text-decoration:none; }
  body.bb-products-open .bb-mobile-dock { z-index:1004; }
  body.bb-products-open .bb-mobile-dock > .is-active:not([data-products-open]), body.bb-products-open .bb-mobile-dock > .is-active:not([data-products-open]) span { color:#5a6878; }
  .bb-products-sheet a:focus-visible,.bb-products-sheet button:focus-visible { outline:2px solid #176ef1; outline-offset:-2px; }
  .bb-drawer-market .bb-language-switcher { margin-top:0; align-self:start; }
  .bb-drawer-market .bb-language-switcher::before,.bb-drawer-market > label { font-size:10px; line-height:14px; font-weight:700; }
  .bb-drawer-market .bb-language-switcher summary,.bb-drawer-market select { height:40px; min-height:40px; box-sizing:border-box; margin-top:4px; }
  .bb-drawer-market .bb-language-switcher::before { margin-bottom:0; }
}
@media (max-width:680px) {
  body.mibang-commerce-v2 ul.products { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:12px !important; }
  body.mibang-commerce-v2 ul.products::before,body.mibang-commerce-v2 ul.products::after { display:none !important; }
  body.mibang-commerce-v2 ul.products li.product { width:auto !important; min-width:0; margin:0 !important; padding:10px !important; border-radius:12px; float:none !important; }
  body.mibang-commerce-v2 ul.products li.product a img { width:100%; aspect-ratio:1; height:auto; object-fit:contain; border-radius:7px; }
  body.mibang-commerce-v2 ul.products li.product .woocommerce-loop-product__title { font-size:13px !important; line-height:1.45 !important; margin:10px 0 8px; padding:0; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
  body.mibang-commerce-v2 ul.products li.product .price { font-size:14px !important; line-height:1.5; display:flex; flex-wrap:wrap; gap:2px 5px; }
  body.mibang-commerce-v2 ul.products li.product .price ins { text-decoration:none; }
  body.mibang-commerce-v2 ul.products li.product .button { min-height:44px; padding:10px 6px !important; font-size:11px !important; line-height:1.4; }
  body.mibang-commerce-v2 ul.products li.product .onsale { min-width:0; min-height:0; width:auto; max-width:calc(100% - 18px); padding:4px 7px; font-size:10px; line-height:1.3; }
}
@media (prefers-reduced-motion:reduce) { .bb-products-sheet { transition:none; } }

/* Mobile market controls share the existing currency switching behavior. */
@media (max-width: 980px) {
  .bb-mobile-header { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 10px; height: auto; min-height: 60px; padding: 8px 16px; }
  .bb-mobile-header .bb-mobile-brand { grid-column: 1; grid-row: 1; width: 100%; min-width: 0; max-width: 210px; }
  .bb-mobile-header .bb-mobile-brand img { display: block; width: 100%; height: 27px; object-fit: cover; object-position: center; }
  .bb-mobile-header .bb-mobile-actions { grid-column: 3; grid-row: 1; width: auto !important; min-width: 0; max-width: none !important; margin: 0; }
  .bb-mobile-header .bb-mobile-account,.bb-mobile-header .bb-mobile-menu-button { display: inline-flex !important; align-items: center; justify-content: center; width: 40px; height: 44px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: #d90012; flex: 0 0 40px; }
  .bb-mobile-header .bb-mobile-actions svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bb-mobile-market { grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
  .bb-mobile-header .bb-mobile-market .bb-language-switcher { display: block !important; width: 76px !important; min-width: 76px; flex: 0 0 76px; margin: 0; }
  .bb-mobile-header .bb-mobile-market .bb-language-switcher summary { display: flex; justify-content: center; align-items: center; box-sizing: border-box; width: 100%; height: 40px; min-height: 40px; padding: 0 8px; margin: 0; border: 1px solid #d5dbe1; border-radius: 6px; background: #fff; color: #173a58; font-size: 13px; }
  .bb-mobile-currency { display: block; width: 80px; flex: 0 0 80px; margin: 0; }
  .bb-mobile-header .bb-mobile-currency select { box-sizing: border-box; width: 100%; height: 40px; min-height: 40px; margin: 0; padding: 0 8px; border: 1px solid #d5dbe1; border-radius: 6px; background: #fff; color: #173a58; font-size: 13px; font-weight: 600; }
  .bb-mobile-market .bb-language-menu { z-index: 1100; }
}
@media (max-width: 599px) {
  .bb-mobile-header { grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; }
  .bb-mobile-header .bb-mobile-brand { grid-column: 1; grid-row: 1 / 3; }
  .bb-mobile-header .bb-mobile-actions { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .bb-mobile-header .bb-mobile-market { grid-column: 2; grid-row: 2; }
}
@media (max-width: 359px) {
  .bb-mobile-header .bb-mobile-brand { grid-row: 1; }
  .bb-mobile-header .bb-mobile-market { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 680px) {
  body.single-product .bb-woocommerce-shell > div.product > div.woocommerce-product-gallery.images {
    width: calc(100% + 32px) !important; max-width: calc(100% + 32px) !important; margin-inline: -16px !important;
  }
  body.single-product div.product div.images .woocommerce-product-gallery__image > a {
    height: auto; aspect-ratio: auto; border-radius: 0;
  }
  body.single-product div.product div.images .woocommerce-product-gallery__image > a > img {
    width: 100% !important; height: auto !important; max-height: none !important; object-fit: contain !important;
  }
}

/* Merchant-configured WhatsApp fills the mobile header's top-row space. */
@media (max-width: 980px) {
  .bb-mobile-header .bb-mobile-actions { gap: 4px; align-items: center; }
  .bb-mobile-header .bb-mobile-whatsapp {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px;
    box-sizing: border-box; width: 76px; height: 44px; min-height: 44px; flex: 0 0 76px;
    padding: 0 5px; border-radius: 6px; background: #087f43; color: #fff;
    font: 600 10.5px/1 Arial,sans-serif; text-decoration: none;
  }
  .bb-mobile-header .bb-mobile-actions .bb-mobile-whatsapp svg { width: 14px; height: 14px; flex: 0 0 14px; fill: currentColor; stroke: none; }
  .bb-mobile-header .bb-mobile-whatsapp:hover { background: #056535; }
  .bb-mobile-header .bb-mobile-whatsapp:focus-visible { outline: 2px solid #087f43; outline-offset: 2px; }
}
@media (max-width: 359px) {
  .bb-mobile-header .bb-mobile-whatsapp { width: 40px; flex-basis: 40px; padding: 0; }
  .bb-mobile-header .bb-mobile-whatsapp span { display: none; }
  .bb-mobile-header .bb-mobile-actions .bb-mobile-whatsapp svg { width: 20px; height: 20px; flex-basis: 20px; }
}
