/* Mobile bottom sheets (Stage 3): flavour picker + "Added to your bag" panel.
   The sheet markup is only ever created below 768px, and every rule sits inside the query. */
@media (max-width:767px){
  /* page lock while a sheet is open */
  html.hv-sheet-lock,html.hv-sheet-lock body{overflow:hidden}
  html.hv-sheet-lock body{position:fixed;left:0;right:0;width:100%}

  .hv-sheet-wrap{position:fixed;inset:0;z-index:100010;display:flex;align-items:flex-end;justify-content:center;
    --hv-r:14px;--hv-ink:#111;--hv-mute:#6b6b6b;--hv-soft:#f5f4f1;--hv-line:#e7e5e0;font-family:inherit}
  .hv-sheet-wrap[hidden]{display:none}
  .hv-sheet-backdrop{position:absolute;inset:0;background:rgba(17,17,17,.5);opacity:0;transition:opacity .25s ease}
  .hv-sheet{position:relative;width:100%;max-height:85vh;max-height:85dvh;display:flex;flex-direction:column;background:#fff;
    border-radius:22px 22px 0 0;box-shadow:0 -8px 30px rgba(0,0,0,.18);outline:0;
    transform:translateY(100%);transition:transform .25s cubic-bezier(.2,.8,.2,1);
    padding-bottom:env(safe-area-inset-bottom,0px)}
  .hv-sheet-wrap.is-open .hv-sheet-backdrop{opacity:1}
  .hv-sheet-wrap.is-open .hv-sheet{transform:translateY(0)}

  .hv-sheet-handle{flex:0 0 auto;display:flex;justify-content:center;padding:8px 0 0;touch-action:none}
  .hv-sheet-handle span{width:40px;height:4px;border-radius:2px;background:#d6d4cf}
  .hv-sheet-head{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 8px 8px 20px;touch-action:none}
  .hv-sheet-title{display:flex;align-items:center;gap:8px;margin:0;padding:0;font-size:18px;font-weight:600;line-height:1.3;color:var(--hv-ink)}
  .hv-sheet-close{flex:0 0 44px;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;margin:0;border:0;border-radius:50%;
    background:none;color:var(--hv-ink);cursor:pointer;box-shadow:none;min-height:0;-webkit-tap-highlight-color:transparent}
  .hv-sheet-close:active{background:var(--hv-soft)}
  .hv-sheet button:focus{outline:0}
  .hv-sheet button:focus-visible,.hv-sheet a:focus-visible,.hv-sheet input:focus-visible{outline:2px solid #098cde;outline-offset:-2px}
  .hv-sheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:0 0 12px}

  /* ── flavour picker ── */
  .hv-fs-search-wrap{position:sticky;top:0;z-index:1;background:#fff;padding:0 16px 8px}
  .hv-sheet .hv-fs-search{display:block;width:100%;height:48px;margin:0;padding:0 16px!important;background-image:none!important;border:1px solid var(--hv-line);border-radius:var(--hv-r);background:var(--hv-soft);
    font:400 16px/1.2 inherit;color:var(--hv-ink);-webkit-appearance:none;appearance:none;box-shadow:none;box-sizing:border-box}
  .hv-fs-search::placeholder{color:var(--hv-mute)}
  .hv-fs-list{padding:0 8px}
  .hv-fs-list > div[hidden]{display:none}
  .hv-fs-row{display:flex;align-items:center;gap:12px;width:100%;min-height:72px;padding:4px 8px;margin:0;border:0;border-radius:var(--hv-r);background:none;
    text-align:left;font:400 16px/1.3 inherit;color:var(--hv-ink);cursor:pointer;box-shadow:none;-webkit-tap-highlight-color:transparent}
  .hv-fs-row:active{background:var(--hv-soft)}
  .hv-fs-row.is-sel{background:var(--hv-soft);font-weight:600}
  /* flavour thumbnails: the whole variation image, no crop */
  .hv-fs-thumb{flex:0 0 64px;width:64px;height:64px;box-sizing:border-box;border:1px solid var(--hv-line);border-radius:12px;overflow:hidden;background:#fff;display:block}
  .hv-fs-thumb img{display:block;width:100%;height:100%;max-width:none;object-fit:contain;border-radius:0;margin:0}
  /* colour products, Added panel: crop onto the device, same --hv-sw-zoom / --hv-sw-x / --hv-sw-y variables as the stage 1 swatches (square images) */
  .hv-ap-thumb.is-crop img{width:calc(var(--hv-sw-zoom,2.5)*100%);height:auto;object-fit:fill;
    margin-left:calc(50% - var(--hv-sw-zoom,2.5)*var(--hv-sw-x,50%));margin-top:calc(50% - var(--hv-sw-zoom,2.5)*var(--hv-sw-y,55%))}
  .hv-fs-name{flex:1 1 auto;min-width:0}
  .hv-fs-tick{flex:0 0 20px;display:none;color:var(--hv-ink)}
  .hv-fs-row.is-sel .hv-fs-tick{display:flex}
  .hv-fs-tag{flex:0 0 auto;font-size:12px;font-weight:600;line-height:1;color:var(--hv-mute);background:var(--hv-soft);border-radius:999px;padding:6px 10px}
  .hv-fs-row.is-sold{cursor:default;color:#a3a19c}
  .hv-fs-row.is-sold .hv-fs-thumb{opacity:.55;filter:grayscale(1)}
  .hv-fs-row.is-sold:active{background:none}
  .hv-fs-empty{margin:0;padding:28px 20px;text-align:center;font-size:15px;color:var(--hv-mute)}
  .hv-fs-empty[hidden]{display:none}

  /* the stage 1 flavour row becomes the sheet's opener once the sheet script is running */
  td.hv-fl-td.hv-sheet-on select{pointer-events:none!important}
  td.hv-fl-td.hv-sheet-on .hv-fl{cursor:pointer}
  td.hv-fl-td.hv-sheet-on .hv-fl:focus-visible{outline:2px solid #098cde;outline-offset:2px}

  /* ── "Added to your bag" / error panel ── */
  .hv-ap-ok{flex:0 0 28px;width:28px;height:28px;border-radius:50%;background:#1f7a3d;color:#fff;display:inline-flex;align-items:center;justify-content:center}
  .hv-ap-ok svg{width:16px;height:16px}
  .hv-ap-item{display:flex;align-items:center;gap:12px;margin:4px 20px 16px;padding:12px;border-radius:var(--hv-r);background:var(--hv-soft)}
  .hv-ap-thumb{flex:0 0 56px;width:56px;height:56px;border-radius:12px;overflow:hidden;background:#fff;display:block}
  .hv-ap-thumb.is-round{border-radius:50%}
  .hv-ap-thumb.is-full img{object-fit:contain}
  .hv-ap-thumb img{display:block;width:100%;height:100%;max-width:none;object-fit:cover;border-radius:0;margin:0}
  .hv-ap-text{flex:1 1 auto;min-width:0}
  .hv-ap-name{font-size:15px;font-weight:600;line-height:1.3;color:var(--hv-ink)}
  .hv-ap-variant{font-size:14px;line-height:1.4;color:var(--hv-mute);margin-top:2px}
  .hv-ap-meta{display:flex;justify-content:space-between;gap:12px;margin-top:4px;font-size:14px;line-height:1.4;color:var(--hv-mute)}
  .hv-ap-price{font-weight:600;color:var(--hv-ink)}
  .hv-ap-price del{display:none}
  .hv-ap-price ins{text-decoration:none}
  .hv-ap-actions{display:flex;flex-direction:column;gap:8px;padding:0 20px}
  .hv-ap-btn{display:flex;align-items:center;justify-content:center;min-height:52px;padding:0 20px;margin:0;border-radius:999px;box-sizing:border-box;
    font:600 16px/1 inherit;text-decoration:none;cursor:pointer;box-shadow:none;-webkit-tap-highlight-color:transparent}
  .hv-ap-primary,.hv-ap-primary:visited,.hv-ap-primary:hover{background:var(--hv-ink);color:#fff;border:1px solid var(--hv-ink)}
  .hv-ap-secondary,.hv-ap-secondary:visited,.hv-ap-secondary:hover{background:#fff;color:var(--hv-ink);border:1px solid #c9c7c2}
  .hv-ap-cross{display:flex;align-items:center;gap:4px;min-height:44px;margin:8px 20px 0;font-size:14px;line-height:1.4;color:var(--hv-ink);text-decoration:underline;text-underline-offset:3px}
  .hv-ap-cross span:first-child{color:var(--hv-mute);text-decoration:none;display:inline-block;margin-right:2px}
  .hv-ap-error{margin:4px 20px 16px;padding:14px 16px;border-radius:var(--hv-r);background:#fdf1f0;color:#8a1f17;font-size:15px;line-height:1.5}
  .hv-ap-error p{margin:0}
  .hv-ap-error p + p{margin-top:6px}

  /* WooCommerce adds a "View basket" link beside the (hidden) in-page button after an AJAX add; the panel replaces it */
  .hv-m-pdp .summary form.cart a.added_to_cart{display:none!important}
}

@media (max-width:767px) and (prefers-reduced-motion:reduce){
  .hv-sheet,.hv-sheet-backdrop{transition:none}
}
