[data-nd-bag-add][hidden], .nd-bag-dialog [hidden] { display: none !important; }
.nd-bag-trigger, .nd-bag-close, [data-nd-bag-add], .nd-bag-submit {
  border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.nd-bag-trigger, .nd-bag-close {
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; gap: 5px; padding: 0 4px;
}
.nd-bag-trigger svg { width: 19px; height: 19px; flex: none; }
.nd-bag-trigger span {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px;
  border-radius: 50%; background: var(--ink, #171713); color: var(--bg, #f1efe9);
  font: 11px/1 ui-monospace, monospace;
}
.nd-bag-trigger span[hidden] { display: none; }
[data-nd-bag-add] {
  min-height: 46px; padding: 10px 12px; margin: 8px 0 0; width: 100%;
  border: 1px solid currentColor; font-weight: 650; text-align: center;
}
[data-nd-bag-add]:hover { background: color-mix(in srgb, currentColor 6%, transparent); }
.shop-header .nd-bag-trigger { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); }
.shop-header:has(.nd-bag-trigger) { position: relative; padding-right: 64px; }
.nd-bag-dialog {
  --bag-paper: #f1efe9; --bag-ink: #171713; --bag-line: #d5d0c6; --bag-muted: #625f57;
  position: fixed; inset: 0 0 0 auto; margin: 0; border: 0; padding: 0;
  width: min(440px, 100%); max-width: none; height: 100%; height: 100dvh; max-height: none;
  overflow: hidden; color: var(--bag-ink); background: var(--bag-paper);
  font: 14px/1.45 var(--display, Arial, sans-serif);
}
.nd-bag-dialog[open] { animation: nd-bag-in 200ms ease-out; }
.nd-bag-dialog::backdrop { background: #17171365; }
html:has(.nd-bag-dialog[open]) { overflow: hidden; }
@keyframes nd-bag-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.nd-bag-dialog *, .nd-bag-dialog *::before { box-sizing: border-box; }
.nd-bag-panel { display: flex; flex-direction: column; height: 100%; padding: 16px 24px max(16px, env(safe-area-inset-bottom)); }
.nd-bag-heading, .nd-bag-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nd-bag-heading h2 { font-size: 26px; letter-spacing: -.05em; margin: 0; }
.nd-bag-close { margin-right: -8px; font-size: 25px; }
.nd-bag-items { flex: 1; overflow: auto; overscroll-behavior: contain; list-style: none; padding: 0; margin: 8px 0; min-height: 0; }
.nd-bag-item { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--bag-line); }
.nd-bag-item img, .nd-bag-image { display: block; width: 58px; aspect-ratio: 4/5; object-fit: cover; background: #e4e0d6; }
.nd-bag-item strong { display: block; line-height: 1.3; overflow-wrap: anywhere; }
.nd-bag-price { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nd-bag-item del, .nd-bag-item small, .nd-bag-status { color: var(--bag-muted); }
.nd-bag-item small { display: block; margin-top: 4px; }
.nd-bag-remove { min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.nd-bag-footer { border-top: 1px solid var(--bag-line); padding-top: 12px; }
.nd-bag-row + .nd-bag-row { margin-top: 8px; }
.nd-bag-shipping { min-width: 0; padding: 0; border: 0; margin: 14px 0; }
.nd-bag-rates { display: grid; gap: 8px; }
.nd-bag-rate {
  display: grid; grid-template-columns: 17px 58px minmax(0, 1fr) max-content;
  align-items: center; gap: 10px; padding: 12px; min-height: 70px;
  border: 1px solid var(--bag-line); background: #f7f5ef; cursor: pointer;
}
.nd-bag-rate:hover, .nd-bag-rate:has(input:checked) { border-color: var(--bag-ink); }
.nd-bag-rate:has(input:checked) { box-shadow: inset 0 0 0 1px var(--bag-ink); }
.nd-bag-rate input { width: 16px; height: 16px; margin: 0; accent-color: var(--bag-ink); }
.nd-bag-rate-logo { display: block; width: 100%; max-height: 26px; object-fit: contain; }
.nd-bag-rate-copy { grid-column: 3; }
.nd-bag-rate-copy strong, .nd-bag-rate-copy small { display: block; }
.nd-bag-rate-copy small { margin-top: 3px; color: var(--bag-muted); line-height: 1.3; }
.nd-bag-rate-price { white-space: nowrap; }
.nd-bag-back { display: block; width: 100%; min-height: 44px; border: 0; background: transparent; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.nd-bag-grand { border-top: 1px solid var(--bag-line); padding-top: 9px; font-size: 18px; font-weight: 750; }
.nd-bag-submit { background: var(--bag-ink); color: var(--bag-paper); width: 100%; min-height: 48px; margin-top: 12px; font-weight: 750; }
.nd-bag-submit:disabled { opacity: .5; cursor: default; }
.nd-bag-status { margin: 6px 0; min-height: 1.45em; }
@media (max-width: 600px) {
  .nd-bag-dialog { width: 100%; }
  .nd-bag-panel { padding-right: 16px; padding-left: 16px; }
  .header-nav:has(.nd-bag-trigger) { column-gap: 8px; }
}
@media (max-width: 360px) {
  .nd-bag-rate { grid-template-columns: 15px 44px minmax(0, 1fr) max-content; gap: 6px; padding: 9px; }
}
@media (prefers-reduced-motion: reduce) { .nd-bag-dialog[open] { animation: none; } }

.nd-bag-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.product-image > .nd-bag-quick-add {
  position: absolute; z-index: 3; inset-block-end: 8px; inset-inline-start: 8px;
  display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px;
  margin: 0; padding: 0; border: 1px solid #17171330;
  background: #f1efe9; color: #171713;
}
.product-image > .nd-bag-quick-add:hover,
.product-image > .nd-bag-quick-add[data-in-bag="true"] { background: #171713; color: #f1efe9; }
.nd-bag-quick-add svg { width: 19px; height: 19px; }
.nd-bag-quick-add .nd-bag-added-icon, .nd-bag-quick-add[data-in-bag="true"] svg { display: none; }
.nd-bag-quick-add[data-in-bag="true"] .nd-bag-added-icon { display: block; }

/* 2 dec 2026: plaggfönstret (#product-dialog) sorterar delarna med flex-order – lägg "Add to bag" direkt under Buy-raden (samma order som .buy-row, kommer efter den i koden). */
.product-info > [data-nd-bag-add] { order: 4; }
