/* ============================================================================
   REPO CART — unified cart across /command-centers/ + /repo/
   Storage is the SAME localStorage key the storefront uses ("elyndor.cart.v1")
   so items in the cart persist across pages.
   ============================================================================ */

:root {
  --repo-cart-promise-tier: 0;
  --repo-cart-promise-color: #14b8a6;
}

.lab-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(13, 7, 18, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #b9b0a4;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
              color 160ms cubic-bezier(0.16, 1, 0.3, 1);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.lab-cart-btn:hover {
  color: #fafafa;
  border-color: rgba(20, 184, 166, 0.5);
  background: rgba(20, 184, 166, 0.08);
}
.lab-cart-btn svg { display: block; }
.lab-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  color: #1a1a1a;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  margin-left: 2px;
}

.repo-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #0d0710 0%, #14081a 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9998;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.4);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.repo-cart-drawer.open { transform: translateX(0); }
@media (max-width: 600px) { .repo-cart-drawer { max-width: 100%; } }

.repo-cart-head {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.repo-cart-title { font-size: 18px; font-weight: 700; color: #fafafa; }
.repo-cart-close {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #b9b0a4;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: color 160ms, border-color 160ms;
}
.repo-cart-close:hover { color: #fafafa; border-color: rgba(255, 255, 255, 0.2); }

.repo-cart-promise {
  margin: 16px 24px 0;
  padding: 16px;
  background: rgba(20, 184, 166, 0.06);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 12px;
}
.repo-cart-promise-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px;
}
.repo-cart-promise-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #14b8a6;
}
.repo-cart-promise-current {
  font-size: 13px; font-weight: 700; color: #fafafa; font-feature-settings: "tnum" 1;
}
.repo-cart-promise-tiers {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 10px;
}
.repo-cart-promise-tier {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #75655a; font-feature-settings: "tnum" 1;
  transition: all 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.repo-cart-promise-tier.is-active {
  background: rgba(20, 184, 166, 0.15); border-color: #14b8a6; color: #fafafa;
}
.repo-cart-promise-tier.is-achieved {
  background: rgba(20, 184, 166, 0.25); border-color: rgba(20, 184, 166, 0.6); color: #14b8a6;
}
.repo-cart-promise-tier-n { font-size: 11px; font-weight: 600; }
.repo-cart-promise-tier-pct { font-size: 13px; font-weight: 800; }

.repo-cart-promise-bar {
  height: 4px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; overflow: hidden;
}
.repo-cart-promise-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #14b8a6, #fb923c);
  transition: width 360ms cubic-bezier(0.16, 1, 0.3, 1);
}
.repo-cart-promise-hint {
  margin: 8px 0 0; font-size: 11px; text-align: center; color: #75655a; letter-spacing: 0.04em;
}

.repo-cart-items {
  flex: 1; overflow-y: auto; padding: 16px 24px 8px; list-style: none; margin: 0;
}
.repo-cart-empty { text-align: center; padding: 40px 0; color: #75655a; font-size: 13px; list-style: none; }
.repo-cart-empty-msg { margin: 0 0 12px; }
.repo-cart-empty-link {
  display: inline-block; padding: 8px 16px;
  background: rgba(20, 184, 166, 0.1); border: 1px solid rgba(20, 184, 166, 0.4); border-radius: 999px;
  color: #14b8a6; font-size: 12px; font-weight: 600; text-decoration: none;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.repo-cart-empty-link:hover { background: rgba(20, 184, 166, 0.18); }

.repo-cart-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.repo-cart-item:last-child { border-bottom: none; }
.repo-cart-item-thumb {
  width: 56px; height: 36px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #75655a; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; overflow: hidden;
}
.repo-cart-item-meta { min-width: 0; }
.repo-cart-item-name {
  font-size: 14px; font-weight: 600; color: #fafafa; margin: 0 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.repo-cart-item-origin {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin: 0;
  color: #75655a;
}
.repo-cart-item-origin[data-origin="repo"] { color: #14b8a6; }
.repo-cart-item-origin[data-origin="storefront"] { color: #fb923c; }
.repo-cart-item-controls {
  display: flex; align-items: center; gap: 8px;
}
.repo-cart-item-price {
  font-size: 13px; font-weight: 700; color: #fafafa;
  font-feature-settings: "tnum" 1; min-width: 56px; text-align: right;
}
.repo-cart-item-remove {
  background: transparent; border: 0; color: #75655a;
  cursor: pointer; font-size: 16px; line-height: 1;
  padding: 4px 6px; border-radius: 4px;
}
.repo-cart-item-remove:hover { color: #f43f5e; background: rgba(244, 63, 94, 0.08); }

.repo-cart-foot {
  padding: 20px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
}
.repo-cart-totals {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-feature-settings: "tnum" 1;
}
.repo-cart-subtotal, .repo-cart-discount, .repo-cart-total {
  display: flex; justify-content: space-between; font-size: 13px;
}
.repo-cart-subtotal span:first-child { color: #b9b0a4; }
.repo-cart-discount { color: #14b8a6; }
.repo-cart-total {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px; margin-top: 4px;
  font-size: 17px; font-weight: 700; color: #fafafa;
}
.repo-cart-checkout-btn {
  display: block; width: 100%;
  padding: 14px 18px;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fafafa; border: 0; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer;
  transition: filter 160ms, transform 160ms, box-shadow 160ms;
  box-shadow: 0 6px 18px rgba(20, 184, 166, 0.4);
}
.repo-cart-checkout-btn:hover:not(:disabled) {
  filter: brightness(1.1); transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(20, 184, 166, 0.55);
}
.repo-cart-checkout-btn:disabled {
  background: rgba(255, 255, 255, 0.06); color: #75655a;
  cursor: not-allowed; box-shadow: none;
}
.repo-cart-checkout-btn.is-loading { pointer-events: none; opacity: 0.7; }
.repo-cart-note {
  margin: 10px 0 0; font-size: 11px; text-align: center;
  color: #75655a; letter-spacing: 0.04em;
}

.repo-cart-fab {
  position: fixed; bottom: 18px; right: 18px;
  width: 56px; height: 56px;
  border-radius: 999px;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fafafa; border: 0; cursor: pointer;
  z-index: 9990;
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.repo-cart-fab-count {
  position: absolute; top: -2px; right: -2px;
  min-width: 22px; height: 22px; padding: 0 7px;
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  color: #1a1a1a; border-radius: 999px;
  font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #0d0710;
}
@media (min-width: 769px) {
  .repo-cart-fab { display: none; }
}
