/* DigiTensil shop cart (display catalogue + order on WhatsApp). Pairs with shop-cart.js.
   Styled with the site's own tokens/fonts so it matches the existing cart cards (product-style.css .cart-item-card). */

/* The old per-page cart drawers (checkout flow) stay in the markup for later but are never shown. */
#cartDrawer, #cartDrawerBackdrop { display: none !important; }

.dgc-root {
  --dgc-ink: var(--text-main, #1d1d1f);
  --dgc-muted: var(--text-muted, #86868b);
  --dgc-line: var(--border-divider, rgba(0, 0, 0, 0.08));
  --dgc-card: var(--border-card, rgba(0, 0, 0, 0.07));
  --dgc-bg: var(--bg-surface, #ffffff);
  --dgc-soft: var(--bg-studio, #f5f5f7);
  --dgc-head: var(--font-heading, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  --dgc-wa: #108548;
  --dgc-wa-hover: #0c6b3a;
  position: fixed; inset: 0; z-index: 100000; visibility: hidden; pointer-events: none;
  color: var(--dgc-ink);
}
.dgc-root.is-open { visibility: visible; pointer-events: auto; }
.dgc-backdrop {
  position: absolute; inset: 0; background: rgba(8, 11, 20, 0.45);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease;
}
.dgc-root.is-open .dgc-backdrop { opacity: 1; }
.dgc-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--dgc-bg); display: flex; flex-direction: column; outline: none;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.12);
  transform: translateX(104%); transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
}
.dgc-root.is-open .dgc-panel { transform: none; }
@media (prefers-reduced-motion: reduce) { .dgc-panel, .dgc-backdrop { transition: none; } }

.dgc-head {
  display: flex; align-items: center; gap: 0.6rem; padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--dgc-line); flex-shrink: 0;
}
.dgc-head h2 { margin: 0; font-family: var(--dgc-head); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.015em; }
.dgc-count {
  min-width: 22px; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--dgc-soft); color: var(--dgc-ink);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08)); font-family: var(--dgc-head); font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.dgc-x {
  margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08)); background: var(--dgc-soft);
  color: var(--dgc-ink); font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s ease;
}
.dgc-x:hover { background: #000; color: #fff; }

.dgc-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1.5rem; background: #e6e7ec; display: flex; flex-direction: column; gap: 0.85rem; }

.dgc-group { background: #fff; border: 1px solid var(--dgc-card); border-radius: 14px; padding: 0.95rem; box-shadow: var(--shadow-subtle, 0 2px 10px rgba(0, 0, 0, 0.03)); }
.dgc-seller { display: flex; align-items: center; gap: 0.65rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--dgc-line); }
.dgc-av { width: 32px; height: 32px; border-radius: 10px; color: #fff; font-family: var(--dgc-head); font-weight: 700; font-size: 0.875rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.dgc-sname { font-family: var(--dgc-head); font-size: 0.875rem; font-weight: 700; line-height: 1.2; }
.dgc-ssub { font-size: 0.75rem; color: var(--dgc-muted); margin-top: 1px; }
.dgc-sub { margin-left: auto; font-family: var(--dgc-head); font-size: 0.9375rem; font-weight: 700; white-space: nowrap; }

/* Location: first thing in each seller's card so it is not missed */
.dgc-loc { display: block; margin: 0.8rem 0 0.2rem; }
.dgc-loc-lbl { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8125rem; font-weight: 600; color: var(--dgc-ink); margin: 0 0 0.35rem; }
.dgc-loc-lbl svg { color: var(--dgc-wa); flex-shrink: 0; }
.dgc-loc-lbl em { font-style: normal; font-weight: 400; color: var(--dgc-muted); }
.dgc-loc-input {
  width: 100%; box-sizing: border-box; height: 42px; padding: 0 0.9rem; border-radius: 10px; border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  background: var(--dgc-soft); font: inherit; font-size: 0.875rem; color: var(--dgc-ink); outline: none; transition: border-color .2s, background .2s;
}
.dgc-loc-input:focus { background: #fff; border-color: rgba(0, 0, 0, 0.3); }

.dgc-items { list-style: none; margin: 0; padding: 0; }
.dgc-item { display: flex; gap: 0.85rem; padding: 0.85rem 0; border-bottom: 1px solid var(--dgc-line); }
.dgc-item:last-child { border-bottom: 0; }
.dgc-thumb { width: 58px; height: 58px; border-radius: 10px; background: var(--dgc-soft); overflow: hidden; flex-shrink: 0; border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08)); }
.dgc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dgc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.dgc-row1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.dgc-title { flex: 1; font-family: var(--dgc-head); font-size: 0.875rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.dgc-rm { border: 0; background: transparent; color: var(--dgc-muted); width: 36px; height: 36px; margin: -6px -8px 0 0; border-radius: 10px; justify-content: center; padding: 0; cursor: pointer; display: flex; align-items: center; flex-shrink: 0; transition: color .2s; }
.dgc-rm svg { width: 20px; height: 20px; }
.dgc-rm:hover { color: #dc2626; }
.dgc-opt { font-size: 0.75rem; color: var(--dgc-muted); }
.dgc-row2 { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.25rem; }
.dgc-price { display: flex; align-items: baseline; gap: 0.35rem; flex-wrap: wrap; white-space: nowrap; }
.dgc-price b { font-family: var(--dgc-head); font-size: 0.9375rem; font-weight: 700; }
.dgc-price s { font-family: var(--dgc-head); font-size: 0.75rem; font-weight: 400; color: var(--text-strikethrough, #a1a1a6); }
.dgc-qty { display: inline-flex; align-items: center; background: var(--dgc-soft); border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08)); border-radius: 999px; padding: 3px; height: 40px; box-sizing: border-box; }
.dgc-qty button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; font-size: 1.15rem; font-weight: 600; line-height: 1; cursor: pointer; color: var(--dgc-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); padding: 0; transition: background-color .2s; }
.dgc-qty button:hover { background: var(--dgc-ink); color: #fff; }
.dgc-qty span { font-family: var(--dgc-head); font-size: 0.9375rem; font-weight: 700; min-width: 30px; text-align: center; }

.dgc-wa {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem; width: 100%; box-sizing: border-box; height: 40px;
  margin-top: 0.6rem; padding: 0 1rem; border-radius: 999px; border: 0; background: var(--dgc-wa); color: #fff; text-decoration: none;
  font-family: var(--dgc-head); font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .2s ease;
}
.dgc-wa:hover { background: var(--dgc-wa-hover); transform: translateY(-1px); }
.dgc-wa.is-disabled { background: #d2d2d7; color: #6e6e73; cursor: not-allowed; transform: none; }
.dgc-hint { margin: 0.5rem 0 0; text-align: center; font-size: 0.75rem; color: var(--dgc-muted); }

.dgc-sent { margin-top: 0.7rem; padding: 0.7rem 0.85rem; border-radius: 10px; background: rgba(16, 185, 129, 0.08); color: #108548; font-size: 0.8125rem; font-weight: 500; }
.dgc-sent > span { display: flex; align-items: center; gap: 0.5rem; }
.dgc-sent-actions { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin-top: 0.4rem; }
.dgc-link { border: 0; background: transparent; padding: 0.2rem 0; font: inherit; font-size: 0.8125rem; font-weight: 600; color: #108548; text-decoration: underline; cursor: pointer; }

.dgc-empty { text-align: center; padding: 3rem 2rem; color: var(--dgc-muted); }
.dgc-empty svg { color: #c7c7cc; }
.dgc-empty h3 { margin: 1rem 0 0.4rem; font-family: var(--dgc-head); font-size: 1.125rem; font-weight: 700; color: var(--dgc-ink); letter-spacing: -0.015em; }
.dgc-empty p { margin: 0 auto 1.75rem; max-width: 280px; font-size: 0.84375rem; line-height: 1.5; }
.dgc-browse { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.75rem; border-radius: 999px; background: var(--dgc-ink); color: #fff; font-family: var(--dgc-head); font-weight: 600; font-size: 0.875rem; text-decoration: none; }

@media (max-width: 520px) {
  .dgc-panel { width: 100vw; }
  .dgc-head, .dgc-body { padding-left: 1rem; padding-right: 1rem; }
}

.dgc-gtotal { display: flex; justify-content: space-between; align-items: baseline; padding: 0.7rem 0 0.1rem; border-top: 1px solid var(--dgc-line); font-size: 0.8125rem; color: var(--dgc-muted); }
.dgc-gtotal b { font-family: var(--dgc-head); font-size: 1rem; color: var(--dgc-ink); }
.dgc-loc { margin: 0.6rem 0 0; }
.dgc-summary { background: #fff; border: 1px solid var(--dgc-card); border-radius: 14px; padding: 0.95rem; }
.dgc-summary h3 { margin: 0 0 0.6rem; font-family: var(--dgc-head); font-size: 0.9375rem; font-weight: 700; }
.dgc-srow { padding: 0.6rem 0; border-top: 1px solid var(--dgc-line); }
.dgc-srow-h { display: flex; justify-content: space-between; gap: 0.5rem; font-family: var(--dgc-head); font-size: 0.8125rem; }
.dgc-srow ul { list-style: none; margin: 0.35rem 0 0; padding: 0; font-size: 0.78125rem; color: var(--dgc-muted); line-height: 1.5; }
.dgc-srow em { font-style: normal; }
.dgc-sgrand { display: flex; justify-content: space-between; align-items: baseline; padding-top: 0.7rem; border-top: 1px solid var(--dgc-line); font-size: 0.8125rem; }
.dgc-sgrand b { font-family: var(--dgc-head); font-size: 1.125rem; }
