/* ── SAEBA CART DRAWER ── */
.sb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 43, 58, 0.42);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 900;
}
.sb-overlay.sb-open { opacity: 1; }

.sb-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  background: #f2f5f7;
  color: #1c2b3a;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 901;
  box-shadow: -14px 0 44px rgba(28, 43, 58, 0.12);
}
.sb-drawer.sb-open { transform: none; }
.sb-drawer.sb-busy { pointer-events: none; }
.sb-drawer.sb-busy .sb-body { opacity: 0.5; }

/* HEAD */
.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 0.5px solid rgba(28, 43, 58, 0.12);
  flex-shrink: 0;
}
.sb-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 28px;
  letter-spacing: 0.02em;
  color: #1c2b3a;
  margin: 0;
}
.sb-close {
  background: transparent;
  border: none;
  color: rgba(28, 43, 58, 0.45);
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color 0.2s, transform 0.2s;
}
.sb-close:hover { color: #1c2b3a; transform: rotate(90deg); }

/* BODY */
.sb-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 24px;
  transition: opacity 0.2s;
}

/* PROGRESS */
.sb-progress-block {
  padding: 20px 0 22px;
  border-bottom: 0.5px solid rgba(28, 43, 58, 0.08);
}
.sb-progress-msg {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(28, 43, 58, 0.6);
  text-align: center;
  margin: 0 0 14px;
}
.sb-progress-msg strong { color: #1c2b3a; font-weight: 500; }
.sb-progress-msg .woocommerce-Price-amount { color: #1c2b3a; font-weight: 500; }

.sb-progress-track {
  position: relative;
  height: 3px;
  background: rgba(28, 43, 58, 0.1);
  border-radius: 2px;
  margin-bottom: 12px;
}
.sb-progress-fill {
  display: block;
  height: 100%;
  background: #a8c8d8;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.sb-progress-marker {
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f2f5f7;
  border: 0.5px solid rgba(28, 43, 58, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(28, 43, 58, 0.3);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.sb-progress-marker.sb-reached {
  background: #1c2b3a;
  border-color: #1c2b3a;
  color: #f2f5f7;
}
.sb-progress-goal {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(28, 43, 58, 0.4);
  text-align: right;
  margin: 0;
}
.sb-progress-goal .woocommerce-Price-amount { color: rgba(28, 43, 58, 0.55); }

/* ITEMS */
.sb-items { list-style: none; margin: 0; padding: 0; }
.sb-item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 0.5px solid rgba(28, 43, 58, 0.08);
  transition: opacity 0.25s, transform 0.25s;
}
.sb-item.sb-removing { opacity: 0.35; transform: translateX(8px); }

.sb-item-img {
  width: 84px;
  height: 84px;
  border: 0.5px solid rgba(28, 43, 58, 0.1);
  background: #fff;
  overflow: hidden;
}
.sb-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sb-item-main { min-width: 0; }
.sb-item-name {
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: #1c2b3a;
  margin: 0 0 5px;
}
.sb-item-name a { color: inherit; text-decoration: none; transition: color 0.2s; }
.sb-item-name a:hover { color: rgba(28, 43, 58, 0.6); }

.sb-item-meta {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(28, 43, 58, 0.45);
  margin-bottom: 10px;
}
.sb-item-meta p { margin: 0; }
.sb-item-meta dl, .sb-item-meta dt, .sb-item-meta dd { display: inline; margin: 0; font-weight: 300; }
.sb-item-meta dd + dt::before { content: ' / '; }

.sb-qty {
  display: inline-flex;
  align-items: center;
  border: 0.5px solid rgba(28, 43, 58, 0.2);
  border-radius: 1px;
  background: #fff;
  margin-bottom: 8px;
}
.sb-qty-btn {
  width: 30px;
  height: 32px;
  background: transparent;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: rgba(28, 43, 58, 0.5);
  cursor: pointer;
  transition: color 0.15s;
}
.sb-qty-btn:hover { color: #1c2b3a; }
.sb-qty-val {
  min-width: 30px;
  text-align: center;
  font-size: 13px;
  color: #1c2b3a;
  font-variant-numeric: tabular-nums;
}

.sb-remove {
  display: block;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(28, 43, 58, 0.4);
  cursor: pointer;
  border-bottom: 0.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.sb-remove:hover { color: #8a3a3a; border-color: rgba(138, 58, 58, 0.4); }

.sb-item-price {
  font-size: 13px;
  color: #1c2b3a;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* EMPTY */
.sb-empty { text-align: center; padding: 56px 12px; }
.sb-empty svg { stroke: rgba(28, 43, 58, 0.2); margin-bottom: 18px; }
.sb-empty-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 300;
  color: #1c2b3a;
  margin: 0 0 8px;
}
.sb-empty-text {
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(28, 43, 58, 0.5);
  margin: 0 auto 22px;
  max-width: 30ch;
}
.sb-empty-cta {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 28px;
  background: #1c2b3a;
  color: #f2f5f7;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 1px;
  transition: background 0.2s, color 0.2s;
}
.sb-empty-cta:hover { background: #a8c8d8; color: #1c2b3a; }

/* UPSELL */
.sb-upsell {
  padding: 22px 0 26px;
  border-top: 0.5px solid rgba(28, 43, 58, 0.08);
}
.sb-upsell-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sb-upsell-title {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(28, 43, 58, 0.55);
  margin: 0;
}
.sb-upsell-all {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(28, 43, 58, 0.45);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.sb-upsell-all:hover { color: #1c2b3a; }

.sb-upsell-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.sb-upsell-row::-webkit-scrollbar { height: 3px; }
.sb-upsell-row::-webkit-scrollbar-thumb { background: rgba(28, 43, 58, 0.18); border-radius: 2px; }

.sb-upsell-card { flex: 0 0 122px; width: 122px; }
.sb-upsell-img {
  display: block;
  aspect-ratio: 1 / 1;
  border: 0.5px solid rgba(28, 43, 58, 0.1);
  background: #fff;
  overflow: hidden;
  margin-bottom: 8px;
}
.sb-upsell-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
.sb-upsell-card:hover .sb-upsell-img img { transform: scale(1.05); }
.sb-upsell-name {
  font-size: 11px;
  line-height: 1.4;
  color: #1c2b3a;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sb-upsell-price { font-size: 11px; color: rgba(28, 43, 58, 0.55); margin: 0 0 8px; }
.sb-upsell-price ins { text-decoration: none; color: #1c2b3a; }
.sb-upsell-price del { margin-right: 4px; opacity: 0.6; }

.sb-upsell-add {
  display: block;
  width: 100%;
  height: 32px;
  background: transparent;
  border: 0.5px solid rgba(28, 43, 58, 0.25);
  border-radius: 1px;
  font-family: 'Jost', sans-serif;
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1c2b3a;
  text-align: center;
  line-height: 31px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sb-upsell-add:hover { background: #1c2b3a; color: #f2f5f7; border-color: #1c2b3a; }

/* FOOT */
.sb-foot {
  flex-shrink: 0;
  padding: 18px 24px 22px;
  border-top: 0.5px solid rgba(28, 43, 58, 0.12);
  background: #f2f5f7;
}
.sb-foot.sb-foot-hidden { display: none; }
.sb-subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.sb-subtotal > span:first-child {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(28, 43, 58, 0.5);
}
.sb-subtotal-val {
  font-size: 20px;
  color: #1c2b3a;
  font-variant-numeric: tabular-nums;
}
.sb-foot-note {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(28, 43, 58, 0.4);
  margin: 0 0 14px;
}
.sb-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 54px;
  background: #1c2b3a;
  color: #f2f5f7;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 1px;
  transition: background 0.22s, color 0.22s;
  margin-bottom: 10px;
}
.sb-checkout:hover { background: #a8c8d8; color: #1c2b3a; }
.sb-checkout svg { stroke: currentColor; }
.sb-viewcart {
  display: block;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(28, 43, 58, 0.45);
  text-decoration: none;
  transition: color 0.2s;
}
.sb-viewcart:hover { color: #1c2b3a; }

/* NAV BADGE */
.hm-nav-btn { position: relative; }
.sb-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 100px;
  background: #a8c8d8;
  color: #1c2b3a;
  font-family: 'Jost', sans-serif;
  font-size: 9px;
  font-weight: 500;
  line-height: 15px;
  text-align: center;
  animation: sbPop 0.3s ease;
}
@keyframes sbPop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* LOADING STATE */
.sb-loading { opacity: 0.55; pointer-events: none; }

/* TOAST */
.sb-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 14px);
  background: #1c2b3a;
  color: #f2f5f7;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 13px 22px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.28s, transform 0.28s;
  z-index: 950;
  box-shadow: 0 8px 28px rgba(28, 43, 58, 0.22);
}
.sb-toast.sb-show { opacity: 1; transform: translate(-50%, 0); }

/* MOBILE */
@media (max-width: 520px) {
  .sb-drawer { width: 100vw; }
  .sb-head { padding: 18px 18px 14px; }
  .sb-title { font-size: 24px; }
  .sb-body { padding: 0 18px; }
  .sb-foot { padding: 16px 18px 20px; }
  .sb-item { grid-template-columns: 68px 1fr auto; gap: 12px; }
  .sb-item-img { width: 68px; height: 68px; }
}

/* WooCommerce emits visually-hidden a11y labels. These templates bypass the
   theme stylesheet, so without this rule they render as stray visible text
   ('Remove item', 'Thumbnail image', duplicated product names...). */
.screen-reader-text,
.woocommerce-form__label-for-checkbox .screen-reader-text{
  position:absolute !important;
  width:1px;height:1px;
  margin:-1px;padding:0;border:0;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  white-space:nowrap;
}

/* Logged-in users get the fixed WP admin bar; keep the panel clear of it. */
body.admin-bar .sb-drawer{top:32px;}
@media screen and (max-width:782px){ body.admin-bar .sb-drawer{top:46px;} }

/* The active theme styles bare <button>; reset ours so the close X and the
   quantity steppers do not inherit a solid background. */
.sb-drawer button.sb-close,
.sb-drawer button.sb-qty-btn,
.sb-drawer button.sb-remove{
  background:transparent !important;
  border-radius:0 !important;
  box-shadow:none !important;
}
.sb-drawer button.sb-close{color:rgba(28,43,58,.5) !important;}
.sb-drawer button.sb-close:hover{color:#1c2b3a !important;}
.sb-drawer button.sb-qty-btn{color:rgba(28,43,58,.5) !important;}
.sb-drawer button.sb-qty-btn:hover{color:#1c2b3a !important;}
.sb-drawer button.sb-remove{color:rgba(28,43,58,.4) !important;padding:0 !important;height:auto !important;}
.sb-drawer button.sb-remove:hover{color:#8a3a3a !important;}
.sb-drawer button.sb-upsell-add{border-radius:1px !important;}

/* ── SMOOTH OPEN ────────────────────────────────────────────────────────
   backdrop-filter on a full-screen overlay stutters while the panel slides,
   so the dim is a plain colour fade now. The panel gets its own layer only
   while it is moving.                                                     */
.sb-overlay{
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  background:rgba(28,43,58,.38);
  transition:opacity .32s cubic-bezier(.22,1,.36,1);
}
.sb-drawer{
  transition:transform .42s cubic-bezier(.22,1,.36,1) !important;
  will-change:transform;
  contain:paint;
}
.sb-drawer.sb-busy .sb-body{opacity:1;}

/* content fades in once the cart responds */
.sb-body-in{animation:sbBodyIn .3s cubic-bezier(.22,1,.36,1) both;}
@keyframes sbBodyIn{
  from{opacity:0;transform:translateY(6px);}
  to  {opacity:1;transform:none;}
}

/* ── SKELETON shown immediately on open ─────────────────────────────── */
.sb-skel{padding:26px 0 8px;}
.sb-skel-bar{
  height:3px;border-radius:2px;margin-bottom:28px;
  background:rgba(28,43,58,.08);
  position:relative;overflow:hidden;
}
.sb-skel-row{display:grid;grid-template-columns:84px 1fr;gap:16px;padding:16px 0;}
.sb-skel-img{
  width:84px;height:84px;border-radius:2px;
  background:rgba(28,43,58,.07);
}
.sb-skel-lines{display:flex;flex-direction:column;gap:10px;padding-top:6px;}
.sb-skel-lines span{
  height:11px;border-radius:2px;
  background:rgba(28,43,58,.07);
}
.sb-skel-lines span:nth-child(1){width:82%;}
.sb-skel-lines span:nth-child(2){width:46%;}
.sb-skel-lines span:nth-child(3){width:30%;}

.sb-skel-bar::after,
.sb-skel-img::after,
.sb-skel-lines span::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent);
  transform:translateX(-100%);
  animation:sbShimmer 1.15s ease-in-out infinite;
}
.sb-skel-img,.sb-skel-lines span,.sb-skel-bar{position:relative;overflow:hidden;}

@keyframes sbShimmer{
  100%{transform:translateX(100%);}
}
@media(prefers-reduced-motion:reduce){
  .sb-skel-bar::after,.sb-skel-img::after,.sb-skel-lines span::after{animation:none;}
  .sb-body-in{animation:none;}
}
