/* WatchGearLab cart + order lookup (live-ready UI). Namespace: .wgl-cart-* / .wgl-order-lookup*
   Does not restyle frozen .wgl-pdp / .wgl-header layout beyond the cart trigger badge. */
:root {
  --wgl-cart-drawer-width: 420px;
  --wgl-cart-z: 999999;
  --wgl-cart-bg: #ffffff;
  --wgl-cart-fg: #0e1116;
  --wgl-cart-muted: #6b7280;
  --wgl-cart-border: #e5e7eb;
  --wgl-cart-accent: #0e1116;
}

.wgl-cart-drawer {
  position: fixed; top: 0; right: 0;
  width: var(--wgl-cart-drawer-width); max-width: 100vw; height: 100vh;
  background: var(--wgl-cart-bg); color: var(--wgl-cart-fg);
  z-index: var(--wgl-cart-z);
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgba(0,0,0,0.08);
}
.wgl-cart-drawer.is-open { transform: translateX(0); }

.wgl-cart-backdrop {
  position: fixed; inset: 0;
  background: rgba(14, 17, 22, 0.45);
  z-index: calc(var(--wgl-cart-z) - 1);
  opacity: 0; pointer-events: none;
  transition: opacity 240ms ease;
}
.wgl-cart-backdrop.is-open { opacity: 1; pointer-events: auto; }

.wgl-cart-header {
  padding: 18px 20px; border-bottom: 1px solid var(--wgl-cart-border);
  display: flex; justify-content: space-between; align-items: center;
}
.wgl-cart-title { font-size: 16px; font-weight: 700; margin: 0; }
.wgl-cart-close { background: none; border: 0; cursor: pointer; font-size: 22px; line-height: 1; padding: 4px 8px; }

.wgl-cart-items { flex: 1; overflow-y: auto; padding: 8px 20px; }
.wgl-cart-empty { padding: 60px 20px; text-align: center; color: var(--wgl-cart-muted); }
.wgl-cart-item {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--wgl-cart-border);
}
.wgl-cart-item-img {
  width: 64px; height: 64px; background: #f6f7f8; border-radius: 8px;
  flex-shrink: 0; overflow: hidden;
}
.wgl-cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.wgl-cart-item-body { flex: 1; min-width: 0; }
.wgl-cart-item-name {
  font-size: 13px; font-weight: 600; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wgl-cart-item-variant { font-size: 11px; color: var(--wgl-cart-muted); margin: 0 0 6px; }
.wgl-cart-item-price { font-size: 13px; font-weight: 700; }
.wgl-cart-qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.wgl-cart-qty button {
  width: 26px; height: 26px; border: 1px solid var(--wgl-cart-border);
  background: #fff; cursor: pointer; font-size: 14px; line-height: 1;
}
.wgl-cart-qty input {
  width: 36px; height: 26px; text-align: center;
  border: 1px solid var(--wgl-cart-border); font-size: 12px;
}
.wgl-cart-item-remove {
  font-size: 11px; color: var(--wgl-cart-muted);
  background: none; border: 0; cursor: pointer; text-decoration: underline;
  padding: 0; margin-top: 6px;
}

.wgl-cart-footer {
  padding: 16px 20px 24px; border-top: 1px solid var(--wgl-cart-border); background: #fafafa;
}
.wgl-cart-subtotal {
  display: flex; justify-content: space-between;
  font-size: 14px; font-weight: 700; margin-bottom: 8px;
}
.wgl-cart-note {
  font-size: 12px; color: var(--wgl-cart-muted); margin: 0 0 12px; min-height: 1.2em;
}
.wgl-cart-note.is-warn { color: #92400e; }
.wgl-cart-checkout-btn {
  width: 100%; padding: 14px; background: var(--wgl-cart-accent); color: #fff;
  border: 0; font-size: 14px; font-weight: 700; cursor: pointer; border-radius: 4px;
}
.wgl-cart-checkout-btn:disabled {
  background: #cbd5e1; cursor: not-allowed;
}

.wgl-cart-trigger {
  position: relative; background: none; border: 0; cursor: pointer; padding: 0;
  color: inherit; display: inline-flex; align-items: center;
}
.wgl-cart-trigger-count {
  position: absolute; top: -6px; right: -8px;
  background: var(--wgl-cart-accent); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px;
  min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.wgl-cart-trigger-count.is-empty { display: none; }

.wgl-pdp__noscript, .wgl-pdp__cart-hint {
  font-size: 12px; color: var(--wgl-cart-muted); margin: 8px 0 0;
}
.wgl-pdp__cta-primary[disabled] { cursor: not-allowed; opacity: 0.65; }

.wgl-cart-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--wgl-cart-fg); color: #fff; padding: 12px 20px;
  border-radius: 4px; font-size: 13px;
  z-index: calc(var(--wgl-cart-z) + 1);
  opacity: 0; transition: opacity 200ms ease; pointer-events: none;
  max-width: min(90vw, 420px); text-align: center;
}
.wgl-cart-toast.is-visible { opacity: 1; }

@media (max-width: 480px) {
  :root { --wgl-cart-drawer-width: 100vw; }
}

/* Order lookup */
.wgl-order-lookup { max-width: 640px; margin: 32px auto; padding: 0 16px; }
.wgl-order-lookup__banner {
  display: inline-block; background: #f3f4f6; color: #0e1116;
  padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; margin: 0 0 16px;
}
.wgl-order-lookup__lede { color: #6b7280; margin: 0 0 24px; }
.wgl-order-lookup__form {
  display: flex; flex-direction: column; gap: 16px; padding: 20px;
  border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; margin-bottom: 20px;
}
.wgl-order-lookup__field { display: flex; flex-direction: column; gap: 6px; }
.wgl-order-lookup__field label { font-size: 13px; font-weight: 600; }
.wgl-order-lookup__optional { font-weight: 400; color: #6b7280; }
.wgl-order-lookup__field input {
  font: inherit; padding: 12px 14px; border: 1.5px solid #e5e7eb;
  border-radius: 8px; background: #fff; color: #0e1116;
}
.wgl-order-lookup__field input:focus {
  outline: 2px solid #0e1116; outline-offset: 1px; border-color: #0e1116;
}
.wgl-order-lookup__hint { font-size: 12px; color: #6b7280; }
.wgl-order-lookup__alert {
  padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px;
}
.wgl-order-lookup__alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.wgl-order-lookup__alert--warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.wgl-order-lookup__result {
  padding: 20px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fafafa; margin-bottom: 24px;
}
.wgl-order-lookup__result-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.wgl-order-lookup__result-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: 0.02em; }
.wgl-order-lookup__badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: #0e1116; color: #fff; font-size: 12px; font-weight: 600; text-transform: capitalize;
}
.wgl-order-lookup__badge[data-status="paid"] { background: #065f46; }
.wgl-order-lookup__badge[data-status="refunded"],
.wgl-order-lookup__badge[data-status="partially_refunded"] { background: #9a3412; }
.wgl-order-lookup__badge[data-status="payment_failed"],
.wgl-order-lookup__badge[data-status="expired"] { background: #6b7280; }
.wgl-order-lookup__meta {
  display: flex; flex-wrap: wrap; gap: 12px 20px; color: #6b7280; font-size: 13px; margin: 0 0 16px;
}
.wgl-order-lookup__amounts {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px;
  padding: 12px 0; border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px; font-size: 14px;
}
.wgl-order-lookup__amounts > div { display: contents; }
.wgl-order-lookup__amounts span { color: #6b7280; }
.wgl-order-lookup__total span, .wgl-order-lookup__total strong { font-weight: 700; color: #0e1116; }
.wgl-order-lookup__shipping { font-size: 14px; margin: 0 0 16px; }
.wgl-order-lookup__items { list-style: none; padding: 0; margin: 0; }
.wgl-order-lookup__items li { padding: 12px 0; border-bottom: 1px solid #e5e7eb; }
.wgl-order-lookup__items li:last-child { border-bottom: 0; }
.wgl-order-lookup__item-name { font-weight: 600; font-size: 14px; }
.wgl-order-lookup__item-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.wgl-order-lookup__help { font-size: 13px; color: #6b7280; }
.wgl-order-lookup__help code { font-size: 12px; }

.wgl-checkout-page {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 640px; margin: 4rem auto; padding: 0 1rem; color: #0e1116;
}
.wgl-checkout-page a { color: #0e1116; }
