/* StrapsCo BOGO panel
   Tokens lifted from mockup v5. Layout deliberately differs from the mockup:
   mobile is a fixed bottom sheet so the panel cannot push page content and
   add to the site's existing layout-shift problem. */

.sbg {
  --sbg-line: #b4d98a;
  --sbg-line-on: #9fce6a;
  --sbg-offer: #eef5df;
  --sbg-offer-on: #e9f4d6;
  --sbg-ink: #1a1a14;
  --sbg-muted: #8b8b84;
  --sbg-lime: #8bc34a;
  --sbg-good: #5f9e26;
  --sbg-good-line: #d5e6b0;
  --sbg-check: #75b13d;
  --sbg-cta: #1a1a1a;
  --sbg-hl: #b7db81;

  /* DESKTOP: inline, but height reserved so nothing reflows on populate. */
  max-width: 620px;
  margin: 24px auto 12px;
  min-height: 300px;
  contain: layout paint;
}
:focus-visible{
	outline: none; 
}
.sbg__card--desk { display: none; }

.sbg__card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--sbg-line);
  border-radius: 16px;
  padding: 24px 26px 22px;
  box-shadow: 0 12px 28px -18px rgba(20, 20, 10, .5);
  font-family: inherit;
  color: var(--sbg-ink);
  text-align: left;
}
.sbg[data-unlocked="true"] .sbg__card { border-color: var(--sbg-line-on); }

/* ---- tooltip ---- */
.sbg__help { position: absolute; top: 13px; right: 13px; z-index: 6; }
.sbg__info {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.6px solid #9aa77e; background: #fff; color: #5f7233;
  font-size: 12px; font-weight: 700; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.sbg__info:focus-visible { outline: 2px solid var(--sbg-good); outline-offset: 2px; }
.sbg__tip {
  position: absolute; top: calc(100% + 9px); right: 0; width: 236px;
  background: #1f2417; color: #f2f3ea; font-size: 12px; font-weight: 500;
  line-height: 1.45; padding: 11px 13px; border-radius: 10px;
  box-shadow: 0 8px 26px -10px rgba(0, 0, 0, .55); z-index: 30; display: block;
}
.sbg__tip[hidden] { display: none; }

/* ---- added item ---- */
.sbg__added { display: flex; gap: 11px; align-items: flex-start; padding: 2px 40px 15px 2px; }
.sbg__thumb {
  width: 46px; height: 46px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: #f4f4ef; border: 1px solid #e7e7e2;
  overflow: hidden;
}
.sbg__thumb--sm { width: 44px; height: 44px; }
.sbg__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sbg__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sbg__nm { font-weight: 700; font-size: 15px; line-height: 1.25; }
.sbg__sb { font-size: 13px; color: var(--sbg-muted); }
.sbg__ok { font-size: 13.5px; font-weight: 700; color: var(--sbg-check); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.sbg__tick { width: 15px; height: 15px; border-radius: 50%; background: var(--sbg-check); display: inline-grid; place-items: center; flex: none; }
.sbg__tick svg { width: 9px; height: 9px; stroke: #fff; stroke-width: 2.4; fill: none; }

/* ---- offer block ---- */
.sbg__offer { background: var(--sbg-offer); border-radius: 14px; padding: 26px 24px 20px; text-align: center; margin: 0 0 15px; }
.sbg__offer.is-done { background: var(--sbg-offer-on); }
.sbg__head { font-weight: 800; font-size: 33px; line-height: 1.08; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.sbg__head .hl {
  background-image: linear-gradient(var(--sbg-hl), var(--sbg-hl));
  background-repeat: no-repeat; background-size: 100% .62em; background-position: 0 82%;
  padding: 0 .1em; border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.sbg__sub { font-weight: 600; font-size: 17px; color: #33342a; margin: 9px 0 0; }
.sbg__saved { font-weight: 700; font-size: 20px; margin: 5px 0 0; }
.sbg__cap { font-size: 13px; color: #5c5c50; margin: 13px 0 0; font-weight: 500; }
.sbg__applied { font-size: 12.5px; color: #4a5a2e; font-weight: 600; margin: 12px 0 0; }

/* savings variant switch — both render, one shows */
.sbg__saved--money, .sbg__saved--generic { display: none; }
.sbg__saved[data-saving-mode="money"] .sbg__saved--money { display: inline; }
.sbg__saved[data-saving-mode="generic"] .sbg__saved--generic { display: inline; }

/* ---- free item row ---- */
.sbg__free {
  display: flex; gap: 11px; align-items: center; text-align: left;
  background: #fff; border: 1px solid var(--sbg-good-line);
  border-radius: 11px; padding: 9px 11px; margin: 13px 0 2px;
}
.sbg__fmeta { flex: 1; min-width: 0; }
.sbg__fnm { display: block; font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.sbg__fsb { display: block; font-size: 12px; color: var(--sbg-muted); margin-top: 1px; }
.sbg__fpr { display: block; font-size: 13px; margin-top: 3px; }
.sbg__fpr s { color: #9a9a90; }
.sbg__fpr b { color: var(--sbg-good); font-weight: 800; margin-left: 6px; }

/* ---- progress ---- */
.sbg__prog { height: 10px; background: #dcdccf; border-radius: 8px; overflow: hidden; margin-top: 12px; }
.sbg__prog i { display: block; height: 100%; background: var(--sbg-lime); border-radius: 8px; transition: width .45s ease; }
.sbg[data-unlocked="true"] .sbg__prog i { background: var(--sbg-good); }
@media (prefers-reduced-motion: reduce) { .sbg__prog i { transition: none; } }

/* ---- actions ---- */
.sbg__cta {
  display: block; width: 100%; box-sizing: border-box; text-align: center;
  border: 0; border-radius: 44px; background: var(--sbg-cta); color: #fff;
  font-weight: 700; font-size: 19px; padding: 19px; cursor: pointer;
  text-decoration: none; transition: transform .12s ease;
  box-shadow: 0 13px 24px -10px rgba(0, 0, 0, .55);
}
.sbg__cta:hover { transform: translateY(-1px); color: #fff; }
.sbg__cta:focus-visible { outline: 3px solid var(--sbg-lime); outline-offset: 2px; }
.sbg__arw { margin-left: 8px; }
.sbg__subacts { display: flex; justify-content: center; gap: 26px; margin-top: 13px; }
.sbg__subacts a { color: #4a4a42; font-size: 13.5px; font-weight: 600; text-decoration: none; padding: 4px 2px; }
.sbg__subacts a:hover { color: #1e1e1a; text-decoration: underline; }

/* ---- notice wrapper reset (class form, for browsers without :has()) ---- */
.woocommerce-message.sbg-host {
  padding: 0; margin: 0; border: 0; background: none; text-align: left;
}
.woocommerce-message.sbg-host::before { display: none; }
.woocommerce-message.sbg-host--emptied { display: none; }

/* ---- cart page additions ---- */
.strapsco-bogo-freeflag {
  display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 4px;
  background: var(--sbg-offer-on, #e9f4d6); color: #5f9e26;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; vertical-align: middle;
}
.strapsco-bogo-discount { font-weight: 600; }

/* =======================================================================
   MOBILE: fixed bottom sheet.
   Overlays content instead of inserting into flow, so it cannot contribute
   to layout shift — and it does not push Add to Cart further off screen.
   ==================================================================== */
@media (max-width: 782px) {
  .sbg {
    position: fixed; inset: auto 0 0 0; z-index: 9990;
    max-width: none; margin: 0; min-height: 0;
    transform: translateY(100%); transition: transform .22s ease;
    will-change: transform;
  }
  .sbg[data-open="true"] { transform: translateY(0); }
  @media (prefers-reduced-motion: reduce) { .sbg { transition: none; } }

  .sbg__card {
    border-radius: 18px 18px 0 0; border-bottom: 0;
    padding: 16px 15px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -14px 34px -18px rgba(20, 20, 10, .55);
    max-height: 88vh; overflow-y: auto;
  }
  /* The scroll container above clips the tooltip, which is why the "?" appeared
     to do nothing on a phone. Release the clip only while it is open. */
  .sbg--tip-open .sbg__card { overflow: visible; }
  .sbg--tip-open { z-index: 9999; }
  .sbg__offer { padding: 20px 16px 16px; }
  .sbg__head { font-size: 27px; }
  .sbg__sub { font-size: 15px; }
  .sbg__saved { font-size: 18px; }
  .sbg__cta { font-size: 17px; padding: 17px; }
  .sbg__added { padding: 2px 36px 13px 2px; }
  .sbg__tip { position: absolute; top: auto; bottom: calc(100% + 9px); }
}

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* =======================================================================
   CART PAGE ROW
   Wide horizontal band above the line-items table. Server-rendered on page
   load, so it is in the initial HTML and causes no layout shift.
   ==================================================================== */
.sbg--row {
  max-width: none;
  margin: 0 0 22px;
  min-height: 0;
  position: static;
  transform: none;
}

.sbg--row .sbg__card {
  border-radius: 12px;
  padding: 16px 20px;
  background: var(--sbg-offer);
  border: 1.5px solid var(--sbg-line);
  box-shadow: none;
}
.sbg--row[data-unlocked="true"] .sbg__card {
  background: var(--sbg-offer-on);
  border-color: var(--sbg-line-on);
}

.sbg--row .sbg__rowbody {
  display: flex;
  align-items: center;
  gap: 22px;
}

.sbg--row .sbg__rowmain { flex: 1 1 auto; min-width: 0; }

.sbg--row .sbg__head {
  font-size: 20px;
  line-height: 1.18;
  text-align: left;
  text-wrap: pretty;
}
.sbg--row .sbg__sub,
.sbg--row .sbg__saved {
  font-size: 14px;
  margin: 4px 0 0;
  text-align: left;
}
.sbg--row .sbg__saved { font-weight: 700; }

.sbg--row .sbg__progwrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.sbg--row .sbg__prog { flex: 1 1 auto; margin-top: 0; max-width: 420px; }
.sbg--row .sbg__cap { margin: 0; white-space: nowrap; font-size: 12.5px; }

/* free item sits inline rather than stacked */
.sbg--row .sbg__rowfree {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sbg--row .sbg__free { margin: 0; min-width: 230px; }

/* compact CTA, not the full-width pill */
.sbg--row .sbg__cta--row {
  flex: 0 0 auto;
  width: auto;
  padding: 13px 24px;
  font-size: 15px;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .5);
}

.sbg--row .sbg__help { top: 10px; right: 12px; }

/* stack on narrow screens — still in flow, never fixed */
@media (max-width: 782px) {
  .sbg--row {
    position: static;
    inset: auto;
    transform: none;
    margin: 0 0 18px;
  }
  .sbg--row .sbg__card {
    border-radius: 12px;
    border-bottom-width: 1.5px;
    padding: 15px 16px;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }
  .sbg--row .sbg__rowbody {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .sbg--row .sbg__head { font-size: 18px; padding-right: 30px; }
  .sbg--row .sbg__prog { max-width: none; }
  .sbg--row .sbg__progwrap { flex-direction: column; align-items: stretch; gap: 7px; }
  .sbg--row .sbg__cap { white-space: normal; }
  .sbg--row .sbg__free { min-width: 0; }
  .sbg--row .sbg__cta--row { width: 100%; text-align: center; }
}




/* =======================================================================
   DESKTOP  (783px and up)
   Approved design: product on the left on white, offer and next action
   together on the right on green.
   Nothing in this block applies at mobile widths.
   ==================================================================== */
@media (min-width: 783px) {

  .sbg {
    max-width: 1120px;
    margin: 22px auto 16px;
    min-height: 0;
    position: static;
    transform: none;
  }

  .sbg__card--mob  { display: none; }
  .sbg__card--desk { display: grid; }

  .sbg__card--desk {
    grid-template-columns: minmax(280px, .78fr) minmax(420px, 1fr);
    align-items: stretch;
    position: relative;
    /* the base card carries padding for the mobile sheet; the split layout
       needs the two halves flush to the border */
    padding: 0;
    background: #fff;
    border: 1.5px solid var(--sbg-line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 28px -20px rgba(20, 20, 10, .45);
    text-align: left;
  }
  .sbg[data-unlocked="true"] .sbg__card--desk { border-color: var(--sbg-line-on); }

  /* ---- left: the product ---- */
  .sbg__dleft {
    background: #fff;
    padding: 30px 28px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .sbg__dimg {
    display: block;
    width: 100%;
    max-width: 210px;
    aspect-ratio: 1 / 1;
    margin-bottom: 16px;
  }
  .sbg__dimg img { width: 100%; height: 100%; object-fit: contain; display: block; }
  .sbg__dtitle {
    margin: 0;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    text-wrap: balance;
  }
  .sbg__dvar {
    margin: 6px 0 0;
    font-size: 13.5px;
    color: var(--sbg-muted);
  }
  .sbg__dleft .sbg__ok {
    justify-content: center;
    margin-top: 12px;
    font-size: 13.5px;
  }

  /* ---- right: the offer ---- */
  .sbg__dright {
    position: relative;
    background: var(--sbg-offer);
    padding: 30px 34px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
  .sbg[data-unlocked="true"] .sbg__dright { background: var(--sbg-offer-on); }

  .sbg__dhead {
    margin: 0;
    font-weight: 800;
    font-size: 29px;
    line-height: 1.14;
    letter-spacing: -.015em;
    text-wrap: balance;
  }
  .sbg__dsub {
    margin: 9px 0 0;
    font-weight: 600;
    font-size: 16px;
    color: #33342a;
  }
  .sbg__dsub.sbg__saved { font-weight: 700; font-size: 17px; }

  .sbg__card--desk .sbg__prog {
    height: 12px;
    border-radius: 9px;
    margin-top: 20px;
    background: #d3dcc2;
  }

  .sbg__dcap {
    margin: 13px 0 0;
    font-size: 14.5px;
    font-weight: 500;
    color: #4f5a3c;
  }

  .sbg__dfree { margin-top: 14px; }
  .sbg__dfree .sbg__free {
    margin: 0;
    background: transparent;
    border: 0;
    padding: 0;
    gap: 13px;
    text-align: left;
  }
  .sbg__dfree .sbg__free + .sbg__free { margin-top: 11px; }
  .sbg__dfree .sbg__thumb { background: #fff; border-color: #dbe7c4; }
  .sbg__dfree .sbg__fnm { font-size: 15px; line-height: 1.25; }
  .sbg__dfree .sbg__fsb { font-size: 13px; margin-top: 2px; }
  .sbg__dfree .sbg__fpr { font-size: 14.5px; margin-top: 4px; }

  .sbg__cta--desk {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 20px 26px;
    font-size: 19px;
    border-radius: 44px;
  }
  .sbg__card--desk .sbg__subacts { margin-top: 14px; gap: 40px; }

  .sbg__card--desk .sbg__help { top: 14px; right: 16px; }
  .sbg__card--desk .sbg__tip  { text-align: left; }

  /* narrower desktops */
  @media (max-width: 1050px) {
    .sbg__card--desk { grid-template-columns: minmax(230px, .7fr) minmax(340px, 1fr); }
    .sbg__dleft  { padding: 24px 20px; }
    .sbg__dright { padding: 24px 22px; }
    .sbg__dhead  { font-size: 24px; }
    .sbg__dimg   { max-width: 160px; }
    .sbg__cta--desk { font-size: 17px; padding: 17px 20px; }
    .sbg__card--desk .sbg__subacts { gap: 24px; }
  }
}
