:root{
  --bbsb-bg:#fffaf6;
  --bbsb-card:#fff;
  --bbsb-text:#49372e;
  --bbsb-muted:#816e64;
  --bbsb-accent:#ad6c52;
  --bbsb-accent-dark:#8e513c;
  --bbsb-soft:#f5e7df;
  --bbsb-line:#eadbd2;
  --bbsb-green:#5f7c59;
  --bbsb-green-dark:#496346;
}

body.bb-sb-modal-open{overflow:hidden}

.bb-sb-modal{
  position:fixed;
  inset:0;
  z-index:999999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:.22s ease;
}

.bb-sb-modal.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.bb-sb-modal__overlay{
  position:absolute;
  inset:0;
  background:rgba(42,31,26,.56);
  backdrop-filter:blur(5px);
}

.bb-sb-modal__dialog{
  position:relative;
  z-index:2;
  width:min(760px,100%);
  max-height:min(88vh,900px);
  overflow:auto;
  padding:38px;
  border-radius:26px;
  background:var(--bbsb-bg);
  box-shadow:0 30px 90px rgba(44,25,17,.28);
  transform:translateY(12px) scale(.98);
  transition:.25s ease;
}

.bb-sb-modal.is-open .bb-sb-modal__dialog{
  transform:translateY(0) scale(1);
}

.bb-sb-modal__close{
  position:absolute;
  top:12px;
  right:15px;
  width:40px;
  height:40px;
  border:0;
  border-radius:50%;
  background:transparent;
  color:#8b7569;
  font-size:29px;
  cursor:pointer;
}

.bb-sb-modal__close:hover{background:#f2e6df}

.bb-sb-modal__success{
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  margin-bottom:17px;
  border-radius:50%;
  background:#e5efe2;
  color:var(--bbsb-green);
  font-size:24px;
  font-weight:800;
}

.bb-sb-modal__eyebrow,
.bb-sb-cart__kicker,
.bb-sb-modal__upsell-kicker{
  display:block;
  color:var(--bbsb-accent);
  text-transform:uppercase;
  letter-spacing:.09em;
  font-size:11px;
  font-weight:800;
}

.bb-sb-modal__title{
  margin:5px 0 8px;
  color:var(--bbsb-text);
  font-size:30px;
  line-height:1.15;
}

.bb-sb-modal__desc{
  margin:0 0 20px;
  color:var(--bbsb-muted);
  line-height:1.65;
}

.bb-sb-modal__summary{
  margin:0 0 26px;
  padding:18px;
  border:1px solid #e3d0c6;
  border-radius:22px;
  background:linear-gradient(180deg,#fffdfb 0%,#fff 100%);
  box-shadow:0 14px 34px rgba(82,49,35,.08);
}

.bb-sb-modal__summary-head{
  margin:0 0 12px;
  padding:0 2px 10px;
  border-bottom:1px solid #efe0d8;
}

.bb-sb-modal__summary-kicker{
  display:inline-block;
  color:var(--bbsb-accent-dark);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.bb-sb-modal__course{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-start;
  padding:18px 18px;
  margin-bottom:16px;
  border:1px solid var(--bbsb-line);
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 20px rgba(73,55,46,.05);
}

.bb-sb-modal__course span,
.bb-sb-modal__cart-total span{
  display:block;
  color:var(--bbsb-muted);
  font-size:11px;
  margin-bottom:3px;
}

.bb-sb-modal__course strong,
.bb-sb-modal__cart-total strong{
  color:var(--bbsb-text);
}

.bb-sb-modal__cart-total{
  flex:0 0 132px;
  text-align:right;
  align-self:stretch;
  padding:10px 12px;
  border-radius:14px;
  background:#fcf7f3;
  border:1px solid #f0e1d8;
}

.bb-sb-modal__upsell{
  margin:0 0 24px;
  padding:22px;
  border:1px solid #edd9ce;
  border-radius:22px;
  background:linear-gradient(135deg,#f6e8e0,#fbf3ee);
}

.bb-sb-modal__upsell-head h4{
  margin:5px 0 4px;
  color:var(--bbsb-text);
  font-size:20px;
}

.bb-sb-modal__upsell-head p{
  margin:0 0 15px;
  color:var(--bbsb-muted);
  font-size:13px;
}

.bb-sb-modal__offers{
  display:grid;
  gap:10px;
}

.bb-sb-offer{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:14px;
  align-items:center;
  padding:15px;
  border:1px solid rgba(171,106,81,.16);
  border-radius:15px;
  background:rgba(255,255,255,.78);
}

.bb-sb-offer__badge,
.bb-sb-offer-card__badge{
  position:absolute;
  top:-9px;
  left:14px;
  padding:4px 8px;
  border-radius:999px;
  background:var(--bbsb-accent);
  color:#fff;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.bb-sb-offer h5{
  margin:0 0 3px;
  color:var(--bbsb-text);
  font-size:15px;
}

.bb-sb-offer__count{
  color:var(--bbsb-muted);
  font-size:11px;
}

.bb-sb-offer__price{
  text-align:right;
  white-space:nowrap;
}

.bb-sb-offer__price del{
  display:block;
  color:#a29188;
  font-size:11px;
}

.bb-sb-offer__price strong{
  display:block;
  color:var(--bbsb-text);
  font-size:15px;
}

.bb-sb-offer__saving{
  display:block;
  margin-top:2px;
  color:var(--bbsb-green);
  font-size:10px;
  font-weight:800;
}

.bb-sb-replace-btn,
.bb-sb-btn{
  min-height:42px;
  padding:10px 14px;
  border:0;
  border-radius:11px;
  font-weight:750;
  cursor:pointer;
  transition:.2s ease;
}

.bb-sb-replace-btn,
.bb-sb-btn--primary,
.bb-sb-btn--checkout{
  background:var(--bbsb-accent);
  color:#fff!important;
  text-decoration:none!important;
}

.bb-sb-btn--checkout{
  background:var(--bbsb-green);
  color:#fff!important;
}

.bb-sb-replace-btn:hover,
.bb-sb-btn--primary:hover{
  background:var(--bbsb-accent-dark);
}

.bb-sb-btn--checkout:hover{
  background:var(--bbsb-green-dark);
}

.bb-sb-replace-btn:disabled{
  opacity:.6;
  cursor:wait;
}

.bb-sb-modal__actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin:0;
  padding:14px;
  border:1px solid #efe0d8;
  border-radius:18px;
  background:#fcf7f3;
}

.bb-sb-btn{
  flex:1;
  display:inline-flex;
  justify-content:center;
  align-items:center;
}

.bb-sb-btn--ghost,
.bb-sb-btn--undo{
  border:1px solid var(--bbsb-line);
  background:#fff;
  color:var(--bbsb-text);
}

.bb-sb-btn--undo{
  grid-column:1/-1;
  min-height:40px;
}

/* KOSZYK */
.bb-sb-cart{
  clear:both;
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  overflow:hidden;
  margin:28px 0 34px;
  padding:26px;
  border:1px solid var(--bbsb-line);
  border-radius:22px;
  background:linear-gradient(135deg,#fffaf7,#f8eee8);
}

.bb-sb-cart__head h3{
  margin:6px 0 6px;
  color:var(--bbsb-text);
  font-size:24px;
}

.bb-sb-cart__head p{
  margin:0 0 20px;
  color:var(--bbsb-muted);
}

.bb-sb-cart__grid{
  display:grid;
  width:100%;
  max-width:100%;
  min-width:0;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.bb-sb-offer-card{
  position:relative;
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
  overflow:hidden;
  padding:18px;
  border:1px solid var(--bbsb-line);
  border-radius:16px;
  background:#fff;
}

.bb-sb-offer-card h4{
  margin:0 0 5px;
  overflow-wrap:anywhere;
  color:var(--bbsb-text);
  font-size:17px;
}

.bb-sb-offer-card__meta{
  color:var(--bbsb-muted);
  font-size:12px;
  margin-bottom:13px;
}

.bb-sb-offer-card__prices{
  min-height:43px;
  margin-bottom:4px;
}

.bb-sb-offer-card__prices del{
  display:block;
  color:#a18d83;
  font-size:12px;
}

.bb-sb-offer-card__prices strong{
  display:block;
  color:var(--bbsb-text);
  font-size:19px;
}

.bb-sb-offer-card__saving{
  margin-bottom:13px;
  color:var(--bbsb-green);
  font-size:12px;
  font-weight:800;
}

.bb-sb-offer-card .bb-sb-replace-btn{
  width:100%;
  max-width:100%;
  white-space:normal;
  box-sizing:border-box;
}

@media(max-width:800px){
  .bb-sb-modal{
    align-items:center;
    padding:10px;
  }

  .bb-sb-modal__dialog{
    width:100%;
    max-height:calc(100vh - 20px);
    padding:26px 16px 18px;
    border-radius:20px;
  }

  .bb-sb-modal__summary{
    padding:14px;
    border-radius:18px;
  }

  .bb-sb-modal__upsell{
    padding:16px;
    border-radius:18px;
  }

  .bb-sb-modal__actions{
    grid-template-columns:1fr 1fr;
  }

  .bb-sb-btn--ghost{
    grid-column:1/-1;
  }

  .bb-sb-offer{
    grid-template-columns:1fr auto;
  }

  .bb-sb-offer .bb-sb-replace-btn{
    grid-column:1/-1;
    width:100%;
  }

  .bb-sb-cart__grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:520px){
  .bb-sb-modal__course{
    align-items:flex-start;
    flex-direction:column;
  }

  .bb-sb-modal__cart-total{
    width:100%;
    flex:0 0 auto;
    text-align:left;
  }

  .bb-sb-modal__actions{
    grid-template-columns:1fr;
  }

  .bb-sb-btn--ghost,
  .bb-sb-btn--undo{
    grid-column:auto;
  }

  .bb-sb-offer{
    grid-template-columns:1fr;
  }

  .bb-sb-offer__price{text-align:left}
}


/* Dodatkowe zabezpieczenie przed poziomym przewijaniem koszyka */
.woocommerce-cart .woocommerce,
.woocommerce-cart .woocommerce-cart-form,
.woocommerce-cart .cart-collaterals{
  max-width:100%;
}

@media(max-width:800px){
  .bb-sb-cart{
    margin:22px 0 28px;
    padding:18px 14px;
    border-radius:18px;
  }

  .bb-sb-cart__head h3{
    font-size:22px;
    line-height:1.2;
  }

  .bb-sb-offer-card{
    width:100%;
  }
}


/* ZAWARTOŚĆ KOSZYKA W POPUPIE */
.bb-sb-modal__cart-wrap{
  min-width:0;
  flex:1 1 auto;
}

.bb-sb-modal__cart-label{
  display:block;
  margin-bottom:8px!important;
  color:var(--bbsb-muted);
  font-size:11px;
}

.bb-sb-modal__cart-items{
  display:grid;
  gap:10px;
}

.bb-sb-modal__cart-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
}

.bb-sb-modal__cart-item + .bb-sb-modal__cart-item{
  border-top:1px solid #f2e7e1;
}

.bb-sb-modal__cart-item-name{
  min-width:0;
  color:var(--bbsb-text);
  font-weight:700;
  line-height:1.35;
}

.bb-sb-modal__cart-qty{
  display:inline!important;
  margin:0 0 0 6px!important;
  color:var(--bbsb-muted)!important;
  font-size:11px!important;
  font-weight:600;
}

.bb-sb-modal__remove-item{
  flex:0 0 auto;
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:50%;
  background:#f8eee8;
  color:var(--bbsb-accent-dark);
  font-size:20px;
  line-height:1;
  cursor:pointer;
  transition:.18s ease;
}

.bb-sb-modal__remove-item:hover{
  background:#eedbd1;
  transform:scale(1.05);
}

.bb-sb-modal__remove-item:disabled{
  opacity:.45;
  cursor:wait;
}

.bb-sb-modal__cart-empty{
  color:var(--bbsb-muted);
  font-size:14px;
}

@media (max-width: 640px){
  .bb-sb-modal__course{
    align-items:flex-start;
  }

  .bb-sb-modal__cart-total{
    min-width:92px;
  }
}


/* =========================================================
   WooCommerce cart UX: brak "Zaktualizuj koszyk" + czytelne usuwanie
   ========================================================= */

/* Każdy kurs/pakiet jest sprzedawany pojedynczo, więc przycisk aktualizacji
   ilości nie ma zastosowania. */
.woocommerce-cart-form button[name="update_cart"],
.woocommerce-cart-form input[name="update_cart"] {
  display:none !important;
}

/* Link usuwania w koszyku */
.woocommerce-cart-form a.bb-sb-cart-remove {
  width:auto !important;
  min-width:0 !important;
  height:auto !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:7px !important;
  padding:6px 9px !important;
  border:0 !important;
  border-radius:8px !important;
  background:transparent !important;
  color:#9a4f39 !important;
  font-size:12px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  text-decoration:none !important;
  white-space:nowrap !important;
}

.woocommerce-cart-form a.bb-sb-cart-remove:hover {
  background:#f8ece7 !important;
  color:#743b2b !important;
}

.woocommerce-cart-form .bb-sb-cart-remove__icon {
  display:inline-grid !important;
  place-items:center !important;
  width:20px !important;
  height:20px !important;
  margin:0 !important;
  border-radius:50% !important;
  background:#f7e8e1 !important;
  color:currentColor !important;
  font-size:17px !important;
  font-weight:500 !important;
  line-height:1 !important;
}

.woocommerce-cart-form .bb-sb-cart-remove__text {
  display:inline !important;
}

@media(max-width:520px){
  .woocommerce-cart-form a.bb-sb-cart-remove {
    padding:5px 7px !important;
    font-size:11px !important;
  }
}
