/* Mobile product page (Stage 2; first-paint hiding since Stage 4): order, fold-out sections, fixed bottom bar.
   Layering, low to high: page < header 9 (theme) < bottom bar 20 < search overlay 30 < menu/cart drawers 102 (theme)
   < sales popup 9999 (plugin) < cookie bar 99999 (Complianz) < sheets/panels 100010 < reserved for age verification 100020.
   Nothing here applies at 768px and above: the two new elements are hidden by default
   and every other rule sits inside the max-width:767px query. */
.hv-m-brand,.hv-m-bar{display:none}

@media (max-width:767px){
  body.hv-m-pdp{--hv-r:14px;--hv-ink:#111;--hv-mute:#6b6b6b;--hv-soft:#f5f4f1;--hv-line:#e7e5e0;
    padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}

  /* While the first variation swap happens (colour preselected / default flavour cleared), hold the gallery at the
     height of its single-image state so the content below does not jump. The script drops the class once it has settled. */
  html.hv-m-js body.hv-m-galhold #commercegurus-pdp-gallery-wrapper{max-height:calc(100vw - 20px);overflow:hidden}

  /* ── 1. Order inside the summary: brand, title, price, points, selector + stock, trust, pairs-well ── */
  /* a wrapping row where every item takes a full line, except the price and its sale badge which share one */
  .hv-m-pdp div.product .summary{display:flex;flex-flow:row wrap;align-items:center}
  .hv-m-pdp div.product .summary > *{order:7;flex:0 0 100%;max-width:100%;box-sizing:border-box}
  .hv-m-pdp div.product .summary > .hv-m-brand{order:1}
  .hv-m-pdp div.product .summary > .product_title,
  .hv-m-pdp div.product .summary > .woocommerce-product-rating{order:2}
  .hv-m-pdp div.product .summary > .cgkit-as-variation-price,
  .hv-m-pdp div.product .summary > .price{order:3;flex:0 0 auto}
  .hv-m-pdp div.product .summary > .sale-item{order:4;flex:0 0 auto;position:static;margin:0 0 8px 10px}
  .hv-m-pdp div.product .summary > .onsale{display:none} /* the -N% badge beside the price already says it */
  .hv-m-pdp div.product .summary > .wpcpr-product-points{order:5}
  .hv-m-pdp div.product .summary > #shoptimizer-sticky-anchor,
  .hv-m-pdp div.product .summary > form.cart,
  .hv-m-pdp div.product .summary > .stock{order:6}
  .hv-m-pdp div.product .summary > .product-widget{order:8}
  .hv-m-pdp div.product .summary > .pdp-complementary-carousel{order:9}
  .hv-m-pdp div.product .summary > .woocommerce-product-details__short-description{order:10}

  /* ── type ── */
  .hv-m-pdp .summary > .hv-m-brand{display:block;font-size:12px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--hv-mute);margin:0 0 4px;line-height:1.3}
  .hv-m-pdp .summary > .product_title{font-size:23px;font-weight:600;line-height:1.25;color:var(--hv-ink);margin:0 0 8px}
  .hv-m-pdp .summary > .cgkit-as-variation-price{margin:0 0 8px}
  .hv-m-pdp .summary .cgkit-as-variation-price .price,
  .hv-m-pdp .summary > .price{float:none;display:block;font-size:20px;font-weight:600;line-height:1.3;color:var(--hv-ink);margin:0}
  .hv-m-pdp .summary .cgkit-as-variation-price .price del{font-size:15px;font-weight:400;color:var(--hv-mute);margin-right:6px}
  .hv-m-pdp .summary .cgkit-as-variation-price .price ins{text-decoration:none}

  /* points: the plugin's own element, restyled as one quiet line */
  .hv-m-pdp .summary > .wpcpr-product-points{background:none;border:0;border-radius:0;box-shadow:none;padding:0;margin:0 0 16px;font-size:14px;line-height:1.4;color:var(--hv-mute);font-weight:400}
  .hv-m-pdp .summary > .wpcpr-product-points::before{content:'\25C6';font-size:10px;margin-right:6px;color:var(--hv-ink);vertical-align:1px}
  .hv-m-pdp .summary > .wpcpr-product-points *{font-size:inherit;color:inherit}
  .hv-m-pdp .summary > .wpcpr-product-points strong{font-weight:600;color:var(--hv-ink)}
  .hv-m-pdp .summary > .wpcpr-product-points img.emoji{display:none!important}

  /* ── 2. No duplicate name/price/thumbnail card: keep the form, drop the card chrome ── */
  .hv-m-pdp .summary form.variations_form .hv-var-card{border:0;border-radius:0;background:transparent;padding:0;margin:0 0 8px;gap:0;display:block}
  .hv-m-pdp .summary form.variations_form .hv-var-img,
  .hv-m-pdp .summary form.variations_form .hv-var-name,
  .hv-m-pdp .summary form.variations_form .hv-var-price{display:none}
  .hv-m-pdp .summary form.variations_form .hv-var-body{padding:0}
  .hv-m-pdp .summary form.variations_form .hv-var-card table.variations{margin:0!important;width:100%}
  .hv-m-pdp .summary form.cart{margin:0 0 16px}
  .hv-m-pdp .summary > .commercekit-inventory{margin:0}
  .hv-m-pdp .summary > .commercekit-inventory > *{margin-bottom:16px}
  .hv-m-pdp div.product .product-details-wrapper{padding-bottom:8px}
  .hv-m-pdp .summary form.cart .woocommerce-variation-availability{font-size:14px;margin:8px 0 0}
  .hv-m-pdp .summary form.cart .woocommerce-variation-availability p{margin:0}

  /* in-page button + quantity give way to the bar. Keyed to html.hv-m-js, which the early inline script sets before
     first paint and removes again if the bar script never reports in, so there is no flash and always a fallback. */
  html.hv-m-js body.hv-m-pdp .summary form.cart:not(.commercekit_sticky-atc) .quantity,
  html.hv-m-js body.hv-m-pdp .summary form.cart:not(.commercekit_sticky-atc) button.single_add_to_cart_button{display:none!important}
  /* CommerceKit's own mobile bar and its slide-up clone of the form: never two bars */
  html.hv-m-js body.hv-m-pdp #cgkit-mobile-commercekit-sticky-atc,
  html.hv-m-js body.hv-m-pdp form.cart.commercekit_sticky-atc{display:none!important}

  /* ── trust widget, compact ── */
  .hv-m-pdp .summary > .product-widget{margin:0 0 16px;padding-top:0}
  .hv-m-pdp .hv-trust-widget > div{margin-top:0!important;border-radius:var(--hv-r)!important;border-color:var(--hv-line)!important}
  .hv-m-pdp .hv-trust-widget > div > div:first-child{padding:7px 8px!important;font-size:11px!important;letter-spacing:-.01em}
  .hv-m-pdp .hv-trust-widget > div > div:first-child > span:first-child{margin-right:5px!important}
  .hv-m-pdp .hv-trust-widget .hv-trust-track > div{padding:8px 12px!important}

  .hv-m-pdp .summary > .pdp-complementary-carousel{margin:0 0 16px}

  /* ── 3. Fold-out sections ── */
  body.hv-m-acc-on .commercekit-atc-sticky-tabs{display:none!important}
  .hv-m-acc{border-top:1px solid var(--hv-line)}
  .hv-m-acc:last-of-type{border-bottom:1px solid var(--hv-line)}
  .hv-m-acc > summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:0;
    font-size:16px;font-weight:600;line-height:1.3;color:var(--hv-ink);cursor:pointer;-webkit-tap-highlight-color:transparent}
  .hv-m-acc > summary::-webkit-details-marker{display:none}
  .hv-m-acc > summary::after{content:'';flex:0 0 auto;width:9px;height:9px;border-right:2px solid var(--hv-ink);border-bottom:2px solid var(--hv-ink);transform:rotate(45deg) translate(-2px,-2px);transition:transform .2s}
  .hv-m-acc[open] > summary::after{transform:rotate(225deg) translate(-2px,-2px)}
  .hv-m-acc > summary:focus-visible{outline:2px solid #098cde;outline-offset:-2px}
  .hv-m-acc > .woocommerce-Tabs-panel{padding-top:4px;padding-bottom:24px}
  .hv-m-acc .woocommerce-product-details__short-description{padding:0;margin:0 0 16px;font-size:15px;line-height:1.55}
  /* the summary row already names the section */
  .hv-m-acc .commercekit-Tabs-panel--additional_information > h2:first-child{display:none}

  /* ── 4. Fixed bottom bar ── */
  /* CommerceKit reserves 70px for its own bar with a :has() rule; ours is a little taller */
  html.hv-m-js body.hv-m-pdp{padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))!important}
  html.hv-m-js body.hv-m-pdp .hv-m-bar{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-rows:auto auto;row-gap:1px;align-items:center;align-content:center;
    position:fixed;left:0;right:0;bottom:0;z-index:20;box-sizing:border-box;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));
    padding-left:calc(12px + env(safe-area-inset-left,0px));padding-right:calc(12px + env(safe-area-inset-right,0px));
    background:rgba(255,255,255,.94);-webkit-backdrop-filter:saturate(1.6) blur(14px);backdrop-filter:saturate(1.6) blur(14px);
    border-top:1px solid rgba(17,17,17,.1);font-family:inherit}
  .hv-m-bar [hidden]{display:none!important}
  .hv-m-bar-info,.hv-m-bar-text{display:contents}
  .hv-m-bar-thumb{grid-column:1;grid-row:1 / span 2;width:40px;height:40px;margin-right:10px;border-radius:10px;background:var(--hv-soft) center/cover no-repeat}
  /* colour products: same device crop as the swatches (variables come from hv_swatch_crop) */
  .hv-m-bar-thumb.is-round{border-radius:50%;border:1px solid var(--hv-line)}
  /* flavour products: the whole variation image on white, no crop */
  .hv-m-bar-thumb.is-full{background-color:#fff;background-size:contain}
  .hv-m-bar-thumb.is-swatch{background-size:calc(var(--hv-sw-zoom,2.5)*100%);
    background-position:calc((var(--hv-sw-zoom,2.5)*var(--hv-sw-x,50%) - 50%)/(var(--hv-sw-zoom,2.5) - 1)) calc((var(--hv-sw-zoom,2.5)*var(--hv-sw-y,55%) - 50%)/(var(--hv-sw-zoom,2.5) - 1))}
  .hv-m-bar-name{grid-column:2 / span 2;grid-row:1;font-size:13px;line-height:1.3;color:var(--hv-mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .hv-m-bar-price{grid-column:2;grid-row:2;font-size:16px;font-weight:600;line-height:1.3;color:var(--hv-ink);white-space:nowrap}
  .hv-m-bar-price del{display:none}
  .hv-m-bar-price ins{text-decoration:none}
  .hv-m-bar-qty{grid-column:3;grid-row:2;justify-self:end;display:flex;align-items:center;height:34px;border:1px solid var(--hv-line);border-radius:999px;background:#fff}
  /* visual pill is 34px tall; the buttons themselves are 44px tall tap targets */
  .hv-m-bar-qty button{flex:1 1 44px;min-width:36px;width:44px;height:44px;margin:-5px 0;padding:0;border:0;background:none;color:var(--hv-ink);font:400 20px/1 inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;box-shadow:none;min-height:0}
  .hv-m-bar-qty button:disabled{color:#c9c7c2}
  .hv-m-bar-qty-n{min-width:14px;text-align:center;font-size:15px;font-weight:600;color:var(--hv-ink)}
  .hv-m-bar-btn{grid-column:4;grid-row:1 / span 2;min-height:52px;padding:0 20px;margin:0 0 0 10px;border:0;border-radius:999px;background:var(--hv-ink);color:#fff;
    font:600 15px/1 inherit;white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent;box-shadow:none;transition:background .15s}
  .hv-m-bar-btn:active{background:#333}
  .hv-m-bar button:focus{outline:0}
  .hv-m-bar button:focus-visible{outline:2px solid #098cde;outline-offset:2px}
  .hv-m-bar-btn:disabled{background:#e3e1dc;color:#6b6b6b;cursor:default}
  .hv-m-bar-btn.is-done{background:#1f7a3d}
  .hv-m-bar-msg{position:absolute;left:12px;right:12px;bottom:100%;margin-bottom:8px;padding:10px 14px;border-radius:var(--hv-r);background:var(--hv-ink);color:#fff;font-size:14px;line-height:1.4}

  /* the "someone just bought…" popup (WPC Smart Notification) must sit above the bar, not on top of it */
  html.hv-m-js body.hv-m-pdp .wpcsn-notification .wpcsn-notification-item{bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}

  /* "Choose a flavour": brief highlight on the row the button scrolled to */
  @keyframes hv-flash{0%,60%{box-shadow:0 0 0 3px rgba(17,17,17,.55)}100%{box-shadow:0 0 0 3px rgba(17,17,17,0)}}
  tr.hv-m-flash .hv-fl,tr.hv-m-flash .dd-select,tr.hv-m-flash .hv-sw-grid{animation:hv-flash 1.4s ease-out;border-radius:var(--hv-r)}
}
