/* Brightbay 0.3.4 mobile-only PDP adapt — appended file, desktop storefront.css untouched.
 * All rules live inside @media (max-width: 767px).
 * Adapted from 0.3.10 mobile block for 0.3.4 sticky-buy markup:
 *   .bb-sticky-buy__price + Add to cart + Buy now (no __cart element).
 * Missing-class rules are intentional no-ops.
 */
@media (max-width: 767px) {
  /* --- PDP chrome: Temu-like slim header, Brightbay brand --- */
  body.single-product .bb-promo,
  body.bb-pdp-structure .bb-promo {
    display: none !important;
  }

  body.single-product .bb-chrome,
  body.bb-pdp-structure .bb-chrome {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  body.single-product .bb-header,
  body.single-product .bb-header.bb-header--65,
  body.single-product .bb-header.bb-header--temu-like.bb-header--65,
  body.bb-pdp-structure .bb-header,
  body.bb-pdp-structure .bb-header.bb-header--65 {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    grid-template-areas: "logo search tools" !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 6px 10px !important;
    gap: 8px !important;
    row-gap: 0 !important;
    align-items: center !important;
  }

  body.single-product .bb-header .bb-logo,
  body.single-product .bb-header--65 .bb-logo,
  body.bb-pdp-structure .bb-header .bb-logo,
  body.bb-pdp-structure .bb-header--65 .bb-logo {
    grid-area: logo !important;
    font-size: 22px !important;
    line-height: 1 !important;
  }

  body.single-product .bb-header .bb-search,
  body.single-product .bb-header--65 .bb-search,
  body.bb-pdp-structure .bb-header .bb-search,
  body.bb-pdp-structure .bb-header--65 .bb-search {
    grid-area: search !important;
    max-width: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.single-product .bb-header .bb-search input,
  body.single-product .bb-header--65 .bb-search input,
  body.bb-pdp-structure .bb-header .bb-search input,
  body.bb-pdp-structure .bb-header--65 .bb-search input {
    min-height: 34px !important;
    height: 34px !important;
    font-size: 13px !important;
    border-radius: 18px !important;
  }

  body.single-product .bb-header .bb-search button,
  body.single-product .bb-header--65 .bb-search button,
  body.bb-pdp-structure .bb-header .bb-search button,
  body.bb-pdp-structure .bb-header--65 .bb-search button {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
  }

  body.single-product .bb-header .bb-tools,
  body.single-product .bb-header--65 .bb-tools,
  body.bb-pdp-structure .bb-header .bb-tools,
  body.bb-pdp-structure .bb-header--65 .bb-tools {
    grid-area: tools !important;
    display: flex !important;
    gap: 0 !important;
  }

  body.single-product .bb-header .bb-cats,
  body.single-product .bb-header--65 .bb-cats,
  body.single-product .bb-header--65 .bb-cats.bb-cats--inline,
  body.single-product .bb-cats,
  body.single-product .bb-cats--row,
  body.bb-pdp-structure .bb-cats--row,
  body.single-product .bb-header .bb-tool-account,
  body.single-product .bb-header .bb-tool-orders,
  body.single-product .bb-header .bb-tool-support,
  body.single-product .bb-header .bb-locale,
  body.single-product .bb-header--65 .bb-tool-account,
  body.single-product .bb-header--65 .bb-tool-orders,
  body.single-product .bb-header--65 .bb-tool-support,
  body.single-product .bb-header--65 .bb-locale {
    display: none !important;
  }

  body.single-product .bb-header .bb-tool-cart .bb-tool__label,
  body.single-product .bb-header--65 .bb-tool-cart .bb-tool__label {
    display: none !important;
  }

  body.single-product .bb-pdp-crumb {
    display: none !important;
  }

  /* --- Page padding for sticky buy only (no tabbar on PDP) --- */
  body.single-product.bb-store {
    padding-bottom: 64px !important;
  }

  body.single-product .bb-tabbar {
    display: none !important;
  }

  body.single-product .bb-float-rail,
  body.single-product .bb-float-rail.bb-float-rail--icons {
    display: none !important;
  }

  /* --- Gallery: full-bleed stage first, thumbs as bottom strip --- */
  body.single-product div.product.bb-pdp {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
  }

  body.single-product .bb-pdp-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  body.single-product .bb-pdp-main {
    display: contents !important;
  }

  body.single-product .bb-pdp-hero {
    order: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    width: 100% !important;
    background: #f5f5f5;
  }

  body.single-product .bb-pdp-stage {
    order: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    border-radius: 0 !important;
    overflow: hidden;
  }

  body.single-product .bb-pdp-stage img,
  body.single-product .bb-pdp-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
  }

  body.single-product .bb-pdp-thumbs {
    order: 2 !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 8px 12px !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    background: #fff;
  }

  body.single-product .bb-pdp-thumbs::-webkit-scrollbar { display: none; }

  body.single-product .bb-pdp-thumb {
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 6px !important;
    border: 1px solid #e5e5e5 !important;
    overflow: hidden;
    padding: 0 !important;
  }

  body.single-product .bb-pdp-thumb.is-active {
    border-color: #fb7701 !important;
    box-shadow: inset 0 0 0 1px #fb7701;
  }

  body.single-product .bb-pdp-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Lift summary sits between gallery & buy on desktop flow — hide on mobile (rating is in buy meta) */
  body.single-product .bb-pdp-review-summary,
  body.single-product .bb-pdp-review-summary--lift {
    display: none !important;
  }

  /* --- Buy column: compact Temu-like stack --- */
  body.single-product .bb-pdp-buy {
    order: 2 !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 10px 12px 12px !important;
    box-sizing: border-box !important;
    background: #fff;
  }

  body.single-product .bb-pdp-salebar {
    margin: 0 0 8px !important;
    padding: 8px 10px !important;
    border-radius: 6px !important;
    min-height: 0 !important;
  }

  body.single-product .bb-pdp-salebar__main {
    gap: 6px !important;
  }

  body.single-product .bb-pdp-salebar__text {
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  body.single-product .bb-pdp-salebar__credit {
    font-size: 11px !important;
    margin-top: 4px !important;
  }

  body.single-product .bb-pdp-title {
    margin: 0 0 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.single-product .bb-pdp-meta,
  body.single-product .bb-pdp-meta--tight {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px 8px !important;
    margin: 0 0 8px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }

  body.single-product .bb-pdp-warehouse {
    color: #00a81c !important;
    font-weight: 600 !important;
  }

  body.single-product .bb-pdp-priceband {
    margin: 0 0 8px !important;
  }

  body.single-product .bb-pdp-price {
    margin: 0 !important;
  }

  body.single-product .bb-pdp-price__whole,
  body.single-product .bb-pdp-price .amount,
  body.single-product .bb-pdp-price bdi {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: #fb7701 !important;
    letter-spacing: -0.02em;
  }

  body.single-product .bb-pdp-afterpay {
    margin: 2px 0 8px !important;
    font-size: 12px !important;
    color: #666 !important;
  }

  body.single-product .bb-pdp-capacity {
    margin: 0 0 8px !important;
    gap: 8px !important;
  }

  body.single-product .bb-pdp-capacity__label {
    font-size: 13px !important;
  }

  body.single-product .bb-pdp-capacity__chip {
    height: 30px !important;
    min-width: 56px !important;
    font-size: 12px !important;
  }

  /* Keep qty; hide inline ATC/Buy (sticky bar owns CTAs) */
  body.single-product .bb-pdp .ct-cart-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 0 10px !important;
  }

  body.single-product .bb-pdp .ct-cart-actions .quantity {
    width: 100% !important;
    max-width: 140px !important;
    margin: 0 !important;
  }

  body.single-product .bb-pdp .ct-cart-actions .single_add_to_cart_button,
  body.single-product .bb-pdp .ct-cart-actions .bb-buy-now {
    display: none !important;
  }

  body.single-product .bb-pdp-purchase .quantity .qty,
  body.single-product .bb-pdp .quantity .qty {
    min-height: 36px !important;
  }

  body.single-product .bb-pdp-specs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin: 4px 0 10px !important;
    padding: 0 !important;
    list-style: none !important;
  }

  body.single-product .bb-pdp-specs li {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 2px !important;
    margin: 0 !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  body.single-product .bb-pdp-specs__icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff7ef !important;
    font-size: 14px !important;
  }

  body.single-product .bb-pdp-ship {
    margin: 8px 0 !important;
    padding: 10px 0 !important;
    border-top: 1px solid #f0f0f0;
  }

  body.single-product .bb-pdp-ship__head {
    padding: 0 !important;
    min-height: 0 !important;
  }

  body.single-product .bb-pdp-ship__rate,
  body.single-product .bb-pdp-ship__eta {
    font-size: 12px !important;
    line-height: 1.4 !important;
    margin: 6px 0 0 !important;
  }

  body.single-product .bb-pdp-trustrow {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin: 8px 0 !important;
  }

  body.single-product .bb-pdp-trustrow__item {
    padding: 8px !important;
    font-size: 11px !important;
  }

  body.single-product .bb-pdp-assure {
    margin: 0 0 4px !important;
    padding: 0 !important;
    list-style: none !important;
  }

  body.single-product .bb-pdp-assure li {
    font-size: 12px !important;
    margin: 0 0 6px !important;
  }

  /* --- Reviews denser --- */
  body.single-product .bb-pdp-reviews {
    order: 4 !important;
    margin: 0 !important;
    padding: 12px !important;
    border-top: 8px solid #f5f5f5;
    background: #fff;
  }

  body.single-product .bb-pdp-reviews__head h2 {
    font-size: 16px !important;
    margin: 0 0 8px !important;
  }

  body.single-product .bb-pdp-sort {
    margin: 0 0 8px !important;
    gap: 6px !important;
  }

  body.single-product .bb-review-pill,
  body.single-product .bb-pdp-sort a,
  body.single-product .bb-pdp-sort button {
    font-size: 12px !important;
    min-height: 28px !important;
    padding: 0 10px !important;
  }

  body.single-product .bb-pdp .commentlist,
  body.single-product .bb-pdp .woocommerce-Reviews {
    margin: 0 !important;
  }

  body.single-product .bb-pdp .comment_container,
  body.single-product .bb-pdp .review {
    padding: 10px 0 !important;
  }

  /* --- Seller --- */
  body.single-product .bb-pdp-seller {
    order: 5 !important;
    margin: 0 !important;
    padding: 12px !important;
    border: none !important;
    border-top: 8px solid #f5f5f5;
    border-radius: 0 !important;
  }

  body.single-product .bb-pdp-seller__actions {
    width: 100%;
  }

  body.single-product .bb-pdp-seller__visit,
  body.single-product .bb-pdp-seller__follow {
    flex: 1 1 0 !important;
    border-radius: 999px !important;
    min-height: 32px !important;
  }

  /* --- Details + rails --- */
  body.single-product .bb-pdp-details {
    order: 6 !important;
    margin: 0 !important;
    padding: 12px !important;
    border-top: 8px solid #f5f5f5;
  }

  body.single-product .bb-pdp-more,
  body.single-product .bb-pdp-related,
  body.single-product .bb-pdp-rail {
    order: 7 !important;
    margin: 0 !important;
    padding: 12px !important;
    border-top: 8px solid #f5f5f5;
  }

  body.single-product .bb-pdp-rail ul.products,
  body.single-product .bb-pdp-more ul.products,
  body.single-product .bb-pdp-related ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.single-product .bb-pdp-rail .bb-section__head h2 {
    font-size: 16px !important;
  }

  body.single-product .bb-footer {
    padding: 16px 12px 80px !important;
  }

  /* --- Sticky buy bar (0.3.4: price + ATC + Buy now; desktop base stays display:none) --- */
  body.single-product .bb-sticky-buy {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important; /* override storefront 720px bottom:56px (tabbar hidden on PDP) */
    z-index: 60 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 56px !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    background: #fff !important;
    border-top: 1px solid #eee !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
  }

  /* 0.3.4 sticky keeps price (no __cart). Override storefront 720px hide. */
  body.single-product .bb-sticky-buy__price {
    display: block !important;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 36%;
    overflow: hidden;
    color: #fb7701 !important;
    font-weight: 800 !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  body.single-product .bb-sticky-buy__price .amount,
  body.single-product .bb-sticky-buy__price bdi,
  body.single-product .bb-sticky-buy__price .woocommerce-Price-amount {
    color: #fb7701 !important;
    font-weight: 800 !important;
    font-size: 16px !important;
  }

  /* no-ops on 0.3.4 (element absent); kept for forward-compat */
  body.single-product .bb-sticky-buy__cart {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    color: #222;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
  }

  body.single-product .bb-sticky-buy__cart-ico {
    position: relative;
    display: inline-flex;
    width: 22px;
    height: 22px;
  }

  body.single-product .bb-sticky-buy__cart-ico svg {
    width: 22px;
    height: 22px;
  }

  body.single-product .bb-sticky-buy__cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #fb7701;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
  }

  body.single-product .bb-sticky-buy__button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    border: 1px solid #222 !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #222 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  body.single-product .bb-sticky-buy__now {
    flex: 1.15 1 0 !important;
    min-height: 40px !important;
    border: none !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, #ff9a2e, #fb7701) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
  }

  /* Ensure PDP does not keep storefront tabbar + double bottom padding */
  body.single-product.bb-store {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

