/* ===== Button ===== */
.sc-po-wrap{ margin-top:6px; display:flex; align-items:center; }
.sc-po-btn{
  --c-leaf:#AFEA80; --c-forest:#1C3A2A; --c-gold:#FFD600; --c-ink:#111827;
  display:inline-flex; align-items:center; gap:8px;
  border-radius:999px; padding:6px 10px;
  border:1px solid rgba(28,58,42,.18);
  background: rgba(175,234,128,.12);
  color: var(--c-forest);
  font-weight:900; font-size:12px; line-height:1;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.sc-po-btn svg{ width:16px; height:16px; fill: currentColor; display:block; }
.sc-po-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,214,0,.16);
  border-color: rgba(255,214,0,.55);
  box-shadow: 0 10px 20px rgba(0,0,0,.10);
}
.sc-po-btn:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(255,214,0,.28), 0 10px 20px rgba(0,0,0,.10);
}

/* =========================================================
   SCOPE FIX:
   - DO NOT touch generic .product / li.product / .woocommerce
   - Only touch cards that actually host Quick Buy (JS adds .sc-po-host)
   ========================================================= */
.sc-po-host{ position: relative; isolation: isolate; }
.sc-po-host.sc-po-open{ z-index: 999 !important; }

/* Kill Woo “View cart” links inside this overlay/card */
.sc-po-open a.added_to_cart.wc-forward,
.sc-po-panel a.added_to_cart.wc-forward{ display:none !important; }

/* ===== Overlay panel ===== */
.sc-po-panel{
  position:absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  display:none;
  z-index: 999 !important;
}
.sc-po-open .sc-po-panel{ display:block; }

.sc-po-panel__backdrop{
  position:absolute; inset:0;
  backdrop-filter: blur(8px);
}

.sc-po-panel__sheet{
  --c-leaf:#AFEA80; --c-forest:#1C3A2A; --c-gold:#FFD600; --c-ink:#111827;
  position:absolute;
  inset: 6px;
  border-radius: 13px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(28,58,42,.16);
  box-shadow: 0 22px 54px rgba(0,0,0,.22);
  transform: translateY(8px) scale(.99);
  opacity: 0;
  animation: scpoIn .14s ease forwards;
  display:flex;
  flex-direction:column;
  overflow: hidden;
}
.sc-po-panel__scrollwrap::before,
.sc-po-panel__scrollwrap::after{ border-radius: inherit; }

@keyframes scpoIn{ to{ opacity:1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce){
  .sc-po-panel__sheet{ animation:none; opacity:1; transform:none; }
}

/* Header */
.sc-po-panel__head{
  padding: 5px 9px 5px;
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  border-bottom: 1px solid rgba(28,58,42,.10);
}
.sc-po-panel__title{
  margin:0;
  font-size:13px !important;
  font-weight:950;
  color: rgba(17,24,39,.92);
  line-height:1.05;
  min-width:0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Close (perfectly centred X) */
.sc-po-panel__close{
  border:1px solid rgba(28,58,42,.18);
  background: rgba(175,234,128,.10);
  color: var(--c-forest);
  border-radius: 9px;
  width: 22px;
  height: 22px;
  display:grid;
  place-items:center;
  cursor:pointer;
  padding:0;
  font-weight:950;
  font-size: 16px;
  line-height: 1;
}
.sc-po-panel__x{
  display:block;
  line-height:1;
  transform: translateY(-1px);
}

/* ===== Fixed top/bottom fades ===== */
.sc-po-panel__scrollwrap{
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}
.sc-po-panel__scrollwrap::before,
.sc-po-panel__scrollwrap::after{
  content:"";
  position:absolute;
  left: 1px;
  right: 1px;
  height: 20px;
  pointer-events:none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 5;
}
.sc-po-panel__scrollwrap::before{
  top: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,.98), rgba(255,255,255,0));
}
.sc-po-panel__scrollwrap::after{
  bottom: 0;
  background: linear-gradient(to top, rgba(255,255,255,.98), rgba(255,255,255,0));
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}
.sc-po-panel__scrollwrap.sc-po-can-up::before{ opacity: 1; }
.sc-po-panel__scrollwrap.sc-po-can-down::after{ opacity: 1; }

.sc-po-panel__body{
  height: 100%;
  padding: 8px 8px 10px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: auto;
  touch-action: pan-y;
  position: relative;
  min-height: 170px;
}
.sc-po-panel__body::-webkit-scrollbar{ width:0; height:0; display:none; }

/* click+drag vertical scrolling UX */
.sc-po-panel__scrollwrap.sc-po-vdragging .sc-po-panel__body{ cursor: grabbing; }
.sc-po-panel__scrollwrap.sc-po-vdragging{ user-select: none; }

.sc-po-empty{
  padding: 10px 10px;
  border-radius: 16px;
  border:1px dashed rgba(28,58,42,.22);
  background: rgba(255,255,255,.7);
  font-weight:900;
  color: rgba(17,24,39,.72);
}

/* ===== Smooth loader cross-fade (no skeleton) ===== */
.sc-po-spinner{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(28,58,42,.18);
  border-top-color: rgba(255,214,0,.95);
  animation: scpoSpin .75s linear infinite;
  flex: 0 0 auto;
}
.sc-po-loader{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease;
  background: linear-gradient(to bottom, rgba(255,255,255,.55), rgba(255,255,255,0));
}
.sc-po-loader__inner{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(28,58,42,.10);
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
}
.sc-po-loader__txt{
  font-weight: 950;
  font-size: 12px;
  color: rgba(17,24,39,.72);
  line-height: 1;
}
.sc-po-panel__content{
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.sc-po-panel.sc-po-loading .sc-po-loader{
  opacity: 1;
  transform: translateY(0);
}
.sc-po-panel.sc-po-ready .sc-po-loader{
  opacity: 0;
  transform: translateY(-2px);
}
.sc-po-panel.sc-po-ready .sc-po-panel__content{
  opacity: 1;
  transform: translateY(0);
}
@keyframes scpoSpin{ to{ transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce){
  .sc-po-spinner{ animation: none !important; }
}

/* ===== Pack cards ===== */
.sc-po-item{
  border-radius: 14px;
  border: 1px solid rgba(28,58,42,.22);
  background: rgba(175,234,128,.10);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  padding: 8px 10px;
  margin-bottom: 7px;
}
.sc-po-item:last-child{ margin-bottom:0; }

.sc-po-item--reg{
  background: rgba(243,233,215,.92) !important;
  border-color: rgba(214,221,227,1) !important;
}
.sc-po-item--disabled{
  background: #F3F4F6 !important;
  border-color: rgba(17,24,39,.18) !important;
}

.sc-po-item__row1{
  display:flex; align-items:center; justify-content:space-between;
  gap: 8px; margin-bottom: 7px; min-width:0;
}
.sc-po-item__topline{ display:inline-flex; align-items:center; gap:8px; min-width:0; overflow:hidden; }
.sc-po-item__name{
  font-weight: 950; color: rgba(17,24,39,.92);
  font-size: 13px; line-height: 1.05;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 120px;
}
.sc-po-item__slash{ font-weight:950; color: rgba(17,24,39,.55); font-size:12px; flex:0 0 auto; }

.sc-po-badge{
  display:inline-flex; align-items:center;
  font-size:10px; font-weight:950; letter-spacing:.08em; text-transform:uppercase;
  padding:3px 7px; border-radius:999px;
  border:1px solid rgba(28,58,42,.22);
  background: rgba(28,58,42,.06);
  color: #1C3A2A; white-space:nowrap; flex:0 0 auto;
}
.sc-po-badge--reg{ background: rgba(243,233,215,.92); border-color: rgba(214,221,227,1); }

.sc-po-item--disabled .sc-po-badge,
.sc-po-item--disabled .sc-po-badge--reg{
  background: rgba(107,114,128,.12) !important;
  border-color: rgba(107,114,128,.25) !important;
  color: rgba(107,114,128,.95) !important;
}

.sc-po-pill{
  display:inline-flex; align-items:center;
  font-size:10px; font-weight:900;
  padding:3px 7px; border-radius:999px;
  white-space:nowrap; border:1px solid rgba(28,58,42,.18);
  background: rgba(255,214,0,.18);
  color: rgba(17,24,39,.78);
  flex:0 0 auto;
}
.sc-po-pill--unavail{
  background: rgba(107,114,128,.12);
  border-color: rgba(107,114,128,.25);
  color: rgba(107,114,128,.95);
}
.sc-po-pill--stock{
  background: rgba(255,214,0,.14);
  border-color: rgba(255,214,0,.32);
  color: rgba(17,24,39,.86);
}
.sc-po-pill--instock{
  background: rgba(175,234,128,.22);
  border-color: rgba(28,58,42,.18);
  color: rgba(28,58,42,.92);
}

.sc-po-item__row2{ display:flex; align-items:center; justify-content:space-between; gap:10px; }

/* Stack del above ins */
.sc-po-price{ min-width:0; display:inline-flex; align-items:flex-start; white-space:nowrap; }
.sc-po-price .price{
  display:inline-flex;
  flex-direction: column-reverse !important;
  align-items:flex-start;
  gap: 2px;
  line-height:1.05;
  white-space:nowrap;
}
.sc-po-price del{ opacity:.9; color: rgba(17,24,39,.55); font-weight:850; font-size:11px; }
.sc-po-price ins{ text-decoration:none; font-weight:950; color:#1C3A2A; font-size:13px; }
.sc-po-price .vsp-save{ display:none !important; }

.sc-po-item__actions{ display:inline-flex; align-items:center; gap:8px; flex:0 0 auto; }

/* DEFAULT controls (keep exactly as before when NOT under limits) */
.sc-po-qty{
  display:inline-flex; align-items:center; gap:0;
  border-radius: 12px;
  border: 1px solid rgba(28,58,42,.18);
  overflow: hidden;
  background: rgba(175,234,128,.08);
}
.sc-po-qty__btn{
  width: 28px; height: 30px;
  border: 0;
  background: rgba(255,214,0,.14);
  color: rgba(17,24,39,.85);
  font-weight: 950;
  cursor: pointer;
  display:inline-flex; align-items:center; justify-content:center;
}
.sc-po-qty__btn:disabled{ opacity:.55; cursor:not-allowed; }
.sc-po-qty__input{
  width: 42px; height: 30px;
  border: 0; background: transparent;
  text-align: center;
  font-weight: 950; font-size: 12px;
  color: rgba(17,24,39,.88);
  outline: none;
  -moz-appearance: textfield;
}
.sc-po-qty__input::-webkit-outer-spin-button,
.sc-po-qty__input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }

.sc-po-add{
  width: 34px; height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(28,58,42,.22);
  background: linear-gradient(90deg, rgba(175,234,128,.38), rgba(255,214,0,.35));
  color: #1C3A2A;
  cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}
.sc-po-add:hover{ transform: translateY(-1px); box-shadow: 0 12px 18px rgba(0,0,0,.10); }
.sc-po-add:disabled{ opacity:.65; cursor:not-allowed; transform:none; box-shadow:none; }
.sc-po-add--disabled{
  background: rgba(107,114,128,.12);
  border-color: rgba(107,114,128,.25);
  color: rgba(107,114,128,.95);
}

.sc-po-err{
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(220,38,38,.22);
  background: rgba(220,38,38,.08);
  color: rgba(127,29,29,.95);
  font-weight: 850;
  font-size: 11px;
  line-height: 1.25;
}
.sc-po-err *{ font-size: inherit; }

/* =========================================================
   LATEST SEEDS price sizing:
   - default 15px (when "Unavailable" is showing)
   - 12px only in OUT MODE (<250px sheet width)
   ========================================================= */
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price > .woocommerce-Price-amount,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price > .woocommerce-Price-amount bdi,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price > .woocommerce-Price-amount bdi *,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price ins,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price ins .woocommerce-Price-amount,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price ins .woocommerce-Price-amount bdi,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price ins .woocommerce-Price-amount bdi *,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price del,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price del .woocommerce-Price-amount,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price del .woocommerce-Price-amount bdi,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel .sc-po-price .price del .woocommerce-Price-amount bdi *{
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: inherit !important;
  color: inherit !important;
}
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price > .woocommerce-Price-amount,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price > .woocommerce-Price-amount bdi,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price > .woocommerce-Price-amount bdi *,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price ins,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price ins .woocommerce-Price-amount,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price ins .woocommerce-Price-amount bdi,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price ins .woocommerce-Price-amount bdi *,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price del,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price del .woocommerce-Price-amount,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price del .woocommerce-Price-amount bdi,
body.sc-latest-seeds-page ul.products li.product .sc-po-panel.sc-po-out .sc-po-price .price del .woocommerce-Price-amount bdi *{
  font-size: 12px !important;
}

/* =========================================================
   TIGHT MODE (<260px sheet width)
   - Shrink qty + add controls (only under the limit)
   ========================================================= */
.sc-po-panel.sc-po-tight .sc-po-item__row2{ gap: 8px; }
.sc-po-panel.sc-po-tight .sc-po-item__actions{ gap: 6px; }

.sc-po-panel.sc-po-tight .sc-po-qty__btn{ width: 24px; height: 28px; }
.sc-po-panel.sc-po-tight .sc-po-qty__input{ width: 32px; height: 28px; font-size: 11px; }

.sc-po-panel.sc-po-tight .sc-po-add{
  width: 30px; height: 30px;
  border-radius: 10px; /* same “shape”, just smaller */
}
.sc-po-panel.sc-po-tight .sc-po-item__name{ max-width: 105px; }

/* =========================================================
   EXTRA TIGHT MODE (<230px sheet width)
   - Claw back ~15px so price never gets stomped
   - Add button can shrink but keeps same rounded-square shape
   ========================================================= */
.sc-po-panel.sc-po-tight2 .sc-po-item__row2{ gap: 7px; }
.sc-po-panel.sc-po-tight2 .sc-po-item__actions{ gap: 5px; }

.sc-po-panel.sc-po-tight2 .sc-po-qty__btn{ width: 22px; height: 28px; }
.sc-po-panel.sc-po-tight2 .sc-po-qty__input{ width: 24px; height: 28px; font-size: 11px; }

.sc-po-panel.sc-po-tight2 .sc-po-add{
  width: 28px; height: 30px;
  border-radius: 10px; /* keep the same feel */
}

/* =========================================================
   NARROW OVERLAY (<250px sheet width)
   - DO NOT force 2-line layouts
   - Only tighten spacing/sizes (applies ONLY when overflowing)
   ========================================================= */
.sc-po-panel.sc-po-narrow .sc-po-panel__body{ padding: 7px 7px 9px; }
.sc-po-panel.sc-po-narrow .sc-po-item{ padding: 7px 8px; }
.sc-po-panel.sc-po-narrow .sc-po-item__row1{ gap: 6px; }
.sc-po-panel.sc-po-narrow .sc-po-item__row2{ gap: 8px; }

.sc-po-panel.sc-po-narrow .sc-po-price{ flex: 1 1 auto; min-width: 0; }
.sc-po-panel.sc-po-narrow .sc-po-item__actions{ flex: 0 0 auto; gap: 6px; }

.sc-po-panel.sc-po-narrow .sc-po-badge{ font-size: 9px; padding: 3px 6px; }
.sc-po-panel.sc-po-narrow .sc-po-pill{ font-size: 9px; padding: 3px 6px; }
.sc-po-panel.sc-po-narrow .sc-po-item__name{ max-width: 95px; }

/* If narrow + extra tight, extra tight should win (explicit) */
.sc-po-panel.sc-po-narrow.sc-po-tight2 .sc-po-item__actions{ gap: 5px; }
.sc-po-panel.sc-po-narrow.sc-po-tight2 .sc-po-qty__btn{ width: 22px; height: 28px; }
.sc-po-panel.sc-po-narrow.sc-po-tight2 .sc-po-qty__input{ width: 24px; height: 28px; font-size: 11px; }
.sc-po-panel.sc-po-narrow.sc-po-tight2 .sc-po-add{ width: 28px; height: 30px; border-radius: 10px; }
