:root {
  --jd-color-text: #171717;
  --jd-color-surface: #ffffff;
  --jd-color-muted: #6b6b6b;
  --jd-color-border: #d4d4d4;
  --jd-color-overlay: rgb(0 0 0 / 58%);
  --jd-color-focus: #005fcc;
  --jd-color-error: #b42318;
  --jd-shadow: 0 18px 48px rgb(0 0 0 / 18%);
  --jd-space: 1rem;
  --jd-radius: 4px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

.jewelry-commerce-rail {
  align-items: center;
  background: var(--jd-color-surface);
  border-top: 1px solid var(--jd-color-border);
  bottom: env(safe-area-inset-bottom);
  color: var(--jd-color-text);
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  left: 50%;
  max-width: min(52rem, calc(100vw - 2rem));
  padding: 0.25rem;
  position: fixed;
  transform: translateX(-50%);
  width: 100%;
  z-index: 90;
}

.jewelry-commerce-rail :is(a, button) {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  text-align: center;
  text-decoration: none;
}

.jewelry-commerce-rail :is(a, button):hover {
  text-decoration: underline;
}

.jd-skip-link {
  align-items: center;
  background: var(--jd-color-surface);
  color: var(--jd-color-text);
  display: inline-flex;
  left: var(--jd-space);
  min-height: 44px;
  padding: 0.75rem 1rem;
  position: fixed;
  top: 0;
  transform: translateY(-120%);
  z-index: 1000;
}

.jd-skip-link:focus-visible {
  transform: translateY(0);
}

.jd-icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem;
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--jd-color-focus);
  outline-offset: 3px;
}

.jd-backdrop,
.jd-mobile-panel,
.jd-drawer,
.jd-dialog {
  inset: 0;
  position: fixed;
  z-index: 100;
}

.jd-backdrop {
  background: var(--jd-color-overlay);
}

.jd-mobile-panel,
.jd-drawer,
.jd-dialog {
  background: var(--jd-color-overlay);
  display: grid;
}

.jd-mobile-panel {
  justify-items: start;
}

.jd-mobile-panel > * {
  background: var(--jd-color-surface);
  color: var(--jd-color-text);
  height: 100%;
  max-width: min(24rem, 88vw);
  overflow-y: auto;
  padding: max(var(--jd-space), env(safe-area-inset-top))
    max(var(--jd-space), env(safe-area-inset-right))
    max(var(--jd-space), env(safe-area-inset-bottom))
    max(var(--jd-space), env(safe-area-inset-left));
  width: 100%;
}

.jd-drawer {
  justify-items: end;
}

.jd-drawer > * {
  background: var(--jd-color-surface);
  color: var(--jd-color-text);
  height: 100%;
  max-width: min(30rem, 100vw);
  overflow-y: auto;
  padding: max(var(--jd-space), env(safe-area-inset-top))
    max(var(--jd-space), env(safe-area-inset-right))
    max(var(--jd-space), env(safe-area-inset-bottom))
    max(var(--jd-space), env(safe-area-inset-left));
  width: 100%;
}

.jd-dialog {
  align-items: center;
  justify-items: center;
  overflow-y: auto;
  padding: max(var(--jd-space), env(safe-area-inset-top))
    max(var(--jd-space), env(safe-area-inset-right))
    max(var(--jd-space), env(safe-area-inset-bottom))
    max(var(--jd-space), env(safe-area-inset-left));
}

.jd-dialog > * {
  background: var(--jd-color-surface);
  color: var(--jd-color-text);
  max-height: min(44rem, 100%);
  max-width: min(42rem, 100%);
  overflow-y: auto;
  padding: clamp(1rem, 3vw, 2rem);
  width: min(100%, 42rem);
}

.jd-dialog[hidden],
.jd-drawer[hidden],
.jd-mobile-panel[hidden],
.jd-backdrop[hidden] {
  display: none;
}

.jd-product-detail {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.jd-product-detail img {
  height: auto;
  max-width: 100%;
}

.jd-form-field {
  display: grid;
  gap: 0.4rem;
  margin-block: 1rem;
}

.jd-form-field :is(input, select, textarea) {
  border: 1px solid var(--jd-color-border);
  border-radius: var(--jd-radius);
  color: var(--jd-color-text);
  font: inherit;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
}

.jd-form-field textarea {
  min-height: 8rem;
  resize: vertical;
}

[data-jd-quantity],
[data-jd-remove] {
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
}

.jd-field-error {
  color: var(--jd-color-error);
  font-size: 0.875rem;
  min-height: 1.25rem;
}

.jd-toast {
  background: var(--jd-color-text);
  bottom: max(var(--jd-space), env(safe-area-inset-bottom));
  color: var(--jd-color-surface);
  left: 50%;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.875rem 1rem;
  position: fixed;
  transform: translateX(-50%);
  z-index: 200;
}

.jd-empty {
  color: var(--jd-color-muted);
  padding: 2rem 0;
  text-align: center;
}

.jd-filter-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: clamp(1.25rem, 3vw, 2.5rem);
}

.jd-filter-bar button {
  align-items: center;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
}

.jd-filter-bar button[aria-pressed="true"] {
  background: var(--jd-color-text);
  border-color: var(--jd-color-text);
  color: var(--jd-color-surface);
}

.jd-filter-bar [data-jd-filter-status] {
  color: var(--jd-color-muted);
  flex-basis: 100%;
  margin: 0.25rem 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.footer-links a {
  align-items: center;
  color: inherit;
  display: inline-flex;
  min-height: 44px;
  min-width: 44px;
}

.jd-sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (min-width: 48rem) {
  .jd-product-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 30rem) {
  body {
    padding-bottom: calc(7rem + env(safe-area-inset-bottom));
  }

  .jewelry-commerce-rail {
    flex-wrap: wrap;
    padding-left: calc(52px + env(safe-area-inset-left, 0px));
  }

  .jewelry-commerce-rail :is(a, button) {
    flex: 1 1 40%;
    padding-inline: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
