/* ==========================================================================
   SNUSLAB — Cart Drawer
   ========================================================================== */

.sl-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.sl-cart-overlay.open { opacity: 1; pointer-events: auto; }

.sl-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1400;
  width: min(400px, 92vw);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
  box-shadow: -8px 0 32px rgba(0,0,0,.08);
}
.sl-cart-drawer.open { transform: translateX(0); }

/* ---------- head ---------- */
.sl-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #e4e6e8;
  flex-shrink: 0;
}
.sl-cart-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #0a0a0a;
  margin: 0;
}

/* ---------- progress ---------- */
.sl-cart-progress {
  padding: 14px 18px 16px;
  border-bottom: 1px solid #e4e6e8;
  flex-shrink: 0;
}
.sl-cart-msg {
  display: block;
  font-size: 12.5px;
  color: #6b7280;
  margin-bottom: 8px;
}
.sl-cart-msg b { color: #0a0a0a; font-weight: 700; }
.sl-cart-msg.is-done b { color: #16a34a; }
.sl-cart-track {
  position: relative;
  height: 6px;
  border-radius: 6px;
  background: #e4e6e8;
}
.sl-cart-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: #0a0a0a;
  transition: width .45s cubic-bezier(.4,0,.2,1);
}
.sl-cart-tick {
  position: absolute;
  top: -1px;
  width: 2px;
  height: 8px;
  background: #ffffff;
  transform: translateX(-1px);
}

/* tier chips: upcoming ones are compact, the next one expands */
.sl-cart-tiers {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 10px;
}
.sl-tier {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 9px;
  border: 1px solid #e4e6e8;
  border-radius: 9px;
  background: #ffffff;
  min-width: 0;
  transition: flex-grow .35s ease, background .25s, border-color .25s;
}
.sl-tier b {
  font-size: 11.5px;
  font-weight: 700;
  color: #9aa0a6;
  line-height: 1.2;
  white-space: nowrap;
}
.sl-tier small {
  font-size: 10px;
  line-height: 1.2;
  color: #c7cbd0;
  white-space: nowrap;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition: max-width .35s ease, opacity .25s ease;
}
/* the tier you are working towards */
.sl-tier.is-next {
  flex-grow: 1;
  border-color: #0a0a0a;
}
.sl-tier.is-next b { color: #0a0a0a; }
.sl-tier.is-next small { max-width: 120px; opacity: 1; color: #6b7280; }
/* already unlocked */
.sl-tier.is-reached {
  background: #0a0a0a;
  border-color: #0a0a0a;
}
.sl-tier.is-reached b { color: #ffffff; }
.sl-tier.is-reached small { max-width: 120px; opacity: 1; color: rgba(255,255,255,.75); }

/* ---------- items ---------- */
.sl-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 6px 18px;
}
.sl-ci {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f1f2;
}
.sl-ci.is-busy { opacity: .5; pointer-events: none; }
.sl-ci-media {
  width: 66px;
  height: 66px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f4f5f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.sl-ci-media img { width: 100%; height: 100%; object-fit: contain; }
.sl-ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sl-ci-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: #0a0a0a;
  text-decoration: none;
}
.sl-ci-price { font-size: 13px; font-weight: 700; color: #0a0a0a; }
.sl-ci-price del { color: #9aa0a6; font-weight: 400; margin-right: 4px; }
.sl-ci-price ins { text-decoration: none; }
.sl-ci-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.sl-ci-qty {
  display: flex;
  align-items: center;
  border: 1px solid #e4e6e8;
  border-radius: 8px;
  overflow: hidden;
}
.sl-ci-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.sl-ci-num {
  min-width: 22px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #0a0a0a;
}
.sl-ci-remove {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  cursor: pointer;
}
.sl-ci-remove .sl-ic { width: 15px; height: 15px; }

/* ---------- empty ---------- */
.sl-cart-empty[hidden], .sl-cart-foot[hidden] { display: none !important; }
.sl-cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
}
.sl-cart-empty p { font-size: 14px; color: #6b7280; margin: 0; }
.sl-cart-empty-icon { width: 28px; height: 28px; color: #c7cbd0; }

/* ---------- foot ---------- */
.sl-cart-foot {
  border-top: 1px solid #e4e6e8;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}
.sl-cart-sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.sl-cart-sub span { font-size: 13px; color: #6b7280; }
.sl-cart-sub strong { font-size: 20px; font-weight: 800; color: #0a0a0a; }
.sl-cart-note { font-size: 11px; color: #9aa0a6; margin: 0 0 12px; }
.sl-cart-actions { display: flex; flex-direction: column; gap: 8px; }
.sl-cart-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 999px;
  background: #0a0a0a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .4px;
  text-decoration: none;
}
.sl-cart-viewcart {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #e4e6e8;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.sl-cart-code {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  font-size: 11.5px;
  color: #9aa0a6;
  line-height: 1.4;
}
.sl-cart-code .sl-ic { width: 14px; height: 14px; flex-shrink: 0; }
