html.shopping-bag-open { overflow: hidden; }
dialog.shared-bag {
  position: fixed; inset: 0 0 0 auto; margin: 0 0 0 auto;
  width: min(440px, 100%); height: 100dvh; max-height: 100dvh; max-width: 100%;
  border: 0; padding: 0; overflow: hidden;
  background: #fff; color: #16110d; color-scheme: light;
}
.shared-bag .artwork-modal-toolbar { background: #fbf6ea; }
.shared-bag [data-close-bag] { background: #fff; }
.shared-bag::backdrop { background: rgb(10 9 8 / .7); }
dialog.shared-bag[open] { display: flex; flex-direction: column; }

@media (prefers-reduced-motion: no-preference) {
  dialog.shared-bag {
    translate: 100% 0;
    transition: translate 280ms cubic-bezier(.22, .61, .36, 1),
      display 280ms allow-discrete, overlay 280ms allow-discrete;
  }
  dialog.shared-bag[open] { translate: 0 0; }
  dialog.shared-bag::backdrop {
    opacity: 0;
    transition: opacity 280ms ease, display 280ms allow-discrete, overlay 280ms allow-discrete;
  }
  dialog.shared-bag[open]::backdrop { opacity: 1; }

  @starting-style {
    dialog.shared-bag[open] { translate: 100% 0; }
    dialog.shared-bag[open]::backdrop { opacity: 0; }
  }
}
.shared-bag > .artwork-modal-toolbar { flex-shrink: 0; }
.shared-bag-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 20px; }
.shared-bag-count { font-size: 13px; font-weight: 600; margin: 0 0 12px; }
.shared-bag-footer {
  flex-shrink: 0; padding: 8px 20px max(8px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e2d9ca; background: #fff;
}
.shared-bag .shared-bag-footer .cart-total { margin: 0; }
.shared-bag .shared-bag-footer .shop-policy { margin: 4px 0 0; }
.shared-bag-footer .shared-bag-status { margin: 6px 0; }
.shared-bag-footer .shared-bag-status:empty { display: none; }
.shared-bag .cart-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; padding: 16px; margin-bottom: 12px; border: 1px solid #e2d9ca; border-radius: 16px; background: #fff; }
.shared-bag .cart-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.shared-bag .cart-row h4 { font: 18px/1.25 var(--font-display, Georgia, serif); overflow-wrap: anywhere; margin: 0; }
.shared-bag .meta { color: #71675b; font-size: 11px; line-height: 1.5; margin-top: 6px; }
.shared-bag .cart-item-price { margin: 4px 0 0; color: #16110d; font-size: 14px; font-weight: 600; }
.shared-bag .cart-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shared-bag .cart-qty { display: flex; align-items: center; gap: 10px; }
.shared-bag .cart-qty button { width: 44px; height: 44px; min-width: 44px; padding: 0; border: 1px solid #ddd3c3; border-radius: 50%; background: #fff; color: #16110d; }
.shared-bag-footer > .btn, .shared-bag .jewelry-inquiries > .btn { display: flex; width: 100%; justify-content: center; align-items: center; min-height: 50px; padding: 12px 16px; margin-top: 12px; border: 1px solid #ddd3c3; border-radius: 12px; font: 12px/1.4 var(--font-body, sans-serif); letter-spacing: .08em; text-transform: uppercase; color: #16110d; background: #fff; text-decoration: none; }
.shared-bag #shared-checkout {
  min-height: 48px; margin-top: 8px; background: #16110d; color: #fff; border-color: #16110d;
  font-size: 14px; font-weight: 700;
}
.shared-bag #shared-checkout:not(:disabled):hover { background: #382c24; }
.shared-bag-status { font-size: 12px; line-height: 1.5; color: #71675b; margin: 16px 0; }
.shared-bag-footer .shared-bag-status.is-error {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid #b14a41;
  border-inline-start-width: 4px;
  border-radius: 8px;
  background: #fff1ef;
  color: #8c251e;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.shared-bag .shop-empty, .shared-bag .shop-policy { font-size: 13px; line-height: 1.6; color: #71675b; margin: 16px 0; }
.shared-bag .shared-remove { display: inline-block; min-height: 44px; padding: 0 10px; border: 0; background: none; color: #71675b; font-size: 12px; cursor: pointer; }
.shared-bag .cart-total { display: flex; justify-content: space-between; gap: 16px; margin: 20px 0; font-size: 18px; }
.shared-bag .jewelry-inquiries { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e2d9ca; }
.shared-bag .jewelry-inquiries > h4 { font: 22px/1.2 var(--font-display, Georgia, serif); }
.shared-bag :focus-visible { outline: 2px solid #775625; outline-offset: 3px; }
.shared-bag button:disabled { opacity: .45; cursor: not-allowed; }
.shared-bag [hidden] { display: none !important; }
@media (max-width: 720px) { dialog.shared-bag { width: 100%; } }

.shared-bag .bag-image-trigger {
  display: block; width: 64px; height: 64px; padding: 0;
  border: 0; border-radius: 8px; background: #fff; cursor: zoom-in;
}
.bag-image-trigger img { display: block; }
dialog.bag-image-preview {
  position: fixed; inset: 0; margin: auto; box-sizing: border-box;
  width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid #e2d9ca; border-radius: 16px;
  background: #fff; color: #16110d;
}
.bag-image-preview::backdrop { background: rgb(10 9 8 / .65); }
.bag-image-preview-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(12px, 3vw, 20px); background: #fbf6ea;
  border-bottom: 1px solid #e2d9ca;
}
.bag-image-preview-header h3 {
  margin: 0; font: 20px/1.2 var(--font-display, Georgia, serif); overflow-wrap: anywhere;
}
.bag-image-preview-header button {
  display: grid; place-items: center; flex-shrink: 0; padding: 0; background: #fff;
}
.bag-image-preview > img {
  display: block; width: 100%; box-sizing: border-box;
  max-height: 72dvh; padding: clamp(12px, 3vw, 20px); object-fit: contain;
}
