/* Product page artwork field, "order without artwork?" dialog, price tiers
   and the quote request dialog. Colours inherit from the theme wherever
   possible; the few fixed ones only need to hold contrast on white. */

.gdfw-artwork {
  margin: 0 0 1em;
}

.gdfw-artwork__label {
  display: block;
  font-weight: 600;
  margin: 0 0 0.35em;
}

/* "Upload your design": a theme .button wrapping the real file input, which
   stays focusable and announced but is never drawn — the native control
   matches no theme. */
.gdfw-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  max-width: 100%;
  cursor: pointer;
}

.gdfw-upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
}

.gdfw-upload:focus-within {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.gdfw-upload__icon {
  flex: none;
}

/* Upload-mode field: a column, so its children stack even where a theme
   inlines paragraphs or labels inside form.cart (flex items are always
   blockified). */
.gdfw-artwork .gdfw-artwork__field {
  --gdfw-accent: #e5197d;
  --gdfw-accent-soft: rgba(229, 25, 125, 0.08);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6em;
  width: 100%;
  margin: 0 0 1em;
}

.gdfw-artwork .gdfw-artwork__field > * {
  margin: 0;
}

/* Many themes style only button.button / a.button, which leaves this label
   as bare text; draw it as an outlined pill in the shop accent instead. */
.gdfw-artwork .gdfw-artwork__field .gdfw-upload {
  padding: 0.7em 1.4em;
  border: 2px solid var(--gdfw-accent);
  border-radius: 999px;
  background: #fff;
  color: var(--gdfw-accent);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.gdfw-artwork .gdfw-artwork__field .gdfw-upload:hover {
  background: var(--gdfw-accent);
  color: #fff;
}

.gdfw-artwork .gdfw-artwork__field .gdfw-upload:focus-within {
  outline-color: var(--gdfw-accent);
}

/* Explicitly block: some themes inline the paragraphs inside form.cart,
   which pulled the hint up beside the upload button. */
.gdfw-artwork__hint {
  display: block;
  width: 100%;
  margin: 0.35em 0 0;
  font-size: 0.875em;
  opacity: 0.8;
}

.gdfw-artwork__attached {
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin-top: 0.75em;
}

.gdfw-artwork__attached[hidden] {
  display: none;
}

.gdfw-artwork__preview {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background: #fff;
}

.gdfw-artwork__name {
  overflow-wrap: anywhere;
  font-size: 0.9375em;
}

.gdfw-artwork__remove {
  margin-left: auto;
  padding: 0.3em 0.75em;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 0.875em;
  cursor: pointer;
}

.gdfw-artwork__remove:hover,
.gdfw-artwork__remove:focus-visible {
  border-color: #c82333;
  color: #c82333;
}

.gdfw-artwork__status {
  margin: 0.5em 0 0;
  font-size: 0.875em;
  min-height: 1.2em;
}

.gdfw-artwork__status:empty {
  display: none;
}

.gdfw-artwork__status--error {
  color: #b32d2e;
}

/* Dialogs */

.gdfw-dialog {
  width: min(32rem, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 1.5em;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
  background: #fff;
  color: #1e1e1e;
  box-sizing: border-box;
}

.gdfw-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.gdfw-dialog__title {
  margin: 0 0 0.5em;
  font-size: 1.25em;
  line-height: 1.3;
}

.gdfw-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5em;
  margin-top: 1.25em;
}

/* Price tiers and print option picker.
   Soft rounded cards, small spaced-out caps for labels and pill choices, to
   sit with shop themes in that style; a theme can retune them through the
   custom properties below. The doubled class outranks most theme table
   rules; cell backgrounds and borders also need !important (see below). */

.gdfw-tiers,
.gdfw-print-option {
  --gdfw-accent: #e5197d;
  --gdfw-accent-soft: rgba(229, 25, 125, 0.08);
  --gdfw-surface: #f5f5f7;
  --gdfw-ink: #15151a;
  --gdfw-muted: #7c7f88;
  --gdfw-line: rgba(21, 21, 26, 0.07);
  --gdfw-radius: 18px;
}

.gdfw-tiers.gdfw-tiers {
  width: 100%;
  max-width: 30rem;
  margin: 0 0 1.75em;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375em;
  font-variant-numeric: tabular-nums;
  color: var(--gdfw-ink);
}

.gdfw-tiers.gdfw-tiers caption,
.gdfw-print-option .gdfw-print-option__label {
  padding: 0 0 0.7em;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gdfw-muted);
}

/* Background and borders are !important: themes stripe rows with selectors
   like table:not(.has-background) tbody tr:nth-child(2n) td, which outrank
   any sane class selector. */
.gdfw-tiers.gdfw-tiers th,
.gdfw-tiers.gdfw-tiers td {
  padding: 0.8em 1.25em;
  border: 0 !important;
  background: var(--gdfw-surface) !important;
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
}

/* Rounded corners on the first and last cells, since a separated table
   cannot clip its own background. */
.gdfw-tiers.gdfw-tiers thead th:first-child {
  border-top-left-radius: var(--gdfw-radius);
}

.gdfw-tiers.gdfw-tiers thead th:last-child {
  border-top-right-radius: var(--gdfw-radius);
}

.gdfw-tiers.gdfw-tiers tbody:last-child tr:last-child > :first-child {
  border-bottom-left-radius: var(--gdfw-radius);
}

.gdfw-tiers.gdfw-tiers tbody:last-child tr:last-child > :last-child {
  border-bottom-right-radius: var(--gdfw-radius);
}

.gdfw-tiers.gdfw-tiers thead th {
  padding-top: 1.1em;
  padding-bottom: 0.6em;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gdfw-muted);
}

.gdfw-tiers.gdfw-tiers tbody tr + tr > *,
.gdfw-tiers.gdfw-tiers tbody + tbody tr:first-child > * {
  border-top: 1px solid var(--gdfw-line) !important;
}

.gdfw-tiers.gdfw-tiers thead th:last-child {
  text-align: right;
}

.gdfw-tiers.gdfw-tiers td:last-child {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
}

/* Print option heading inside the table: a small accent dot, bold name. */
.gdfw-tiers.gdfw-tiers .gdfw-tiers__option th {
  padding-top: 1.15em;
  padding-bottom: 0.45em;
  font-weight: 700;
}

.gdfw-tiers.gdfw-tiers .gdfw-tiers__option th::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.6em;
  border-radius: 50%;
  background: var(--gdfw-accent);
  vertical-align: 0.1em;
}

.gdfw-tiers.gdfw-tiers tbody tr.gdfw-tiers__option + tr > * {
  border-top: 0 !important;
}

.gdfw-tiers.gdfw-tiers .gdfw-tiers__quote td {
  color: var(--gdfw-muted);
}

.gdfw-tiers.gdfw-tiers .gdfw-tiers__quote td:last-child {
  color: var(--gdfw-accent);
}

.gdfw-tiers.gdfw-tiers .gdfw-tiers__blank td {
  background: var(--gdfw-accent-soft) !important;
}

.gdfw-tiers.gdfw-tiers .gdfw-tiers__blank td:first-child {
  color: var(--gdfw-muted);
}

/* Themes dress up fieldsets (tinted box, legend pulled out with a negative
   margin); this one is only a grouping for the radios. */
.gdfw-print-option.gdfw-print-option {
  min-width: 0;
  margin: 0 0 1.25em;
  padding: 0;
  border: 0;
  background: none;
}

.gdfw-print-option.gdfw-print-option .gdfw-print-option__label {
  float: none;
  width: auto;
  margin: 0;
  border: 0;
  background: none;
}

.gdfw-print-option__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.gdfw-print-option__choice {
  position: relative;
  margin: 0;
  cursor: pointer;
}

/* The radio stays in the accessibility tree and keyboard order; only its
   pill is drawn. */
.gdfw-print-option__choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.gdfw-print-option__choice span {
  display: inline-block;
  padding: 0.6em 1.25em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(21, 21, 26, 0.06), 0 0 0 1px var(--gdfw-line);
  color: var(--gdfw-ink);
  font-size: 0.9375em;
  line-height: 1.3;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.gdfw-print-option__choice:hover span {
  box-shadow: 0 1px 2px rgba(21, 21, 26, 0.06), 0 0 0 1px var(--gdfw-accent);
}

.gdfw-print-option__choice input:checked + span {
  background: var(--gdfw-accent);
  box-shadow: 0 6px 16px rgba(229, 25, 125, 0.28);
  color: #fff;
  font-weight: 600;
}

.gdfw-print-option__choice input:focus-visible + span {
  outline: 2px solid var(--gdfw-accent);
  outline-offset: 2px;
}

/* Quote request */

.gdfw-quote-open {
  margin: 0 0 1em;
}

.gdfw-quote-form label:not(.gdfw-upload),
.gdfw-quote-form .gdfw-quote-form__label {
  display: block;
  margin: 0.75em 0 0.25em;
  font-weight: 600;
}

.gdfw-quote-form__file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em 0.75em;
}

.gdfw-quote-form input[type="text"],
.gdfw-quote-form input[type="email"],
.gdfw-quote-form input[type="tel"],
.gdfw-quote-form input[type="number"],
.gdfw-quote-form textarea {
  width: 100%;
  box-sizing: border-box;
}

.gdfw-quote-form label.gdfw-quote-form__check {
  display: flex;
  gap: 0.5em;
  align-items: flex-start;
  font-weight: normal;
}

.gdfw-quote-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1em;
}

@media (max-width: 480px) {
  .gdfw-quote-form__row {
    grid-template-columns: 1fr;
  }
}

.gdfw-quote-form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gdfw-quote-form__optional {
  font-weight: normal;
  opacity: 0.75;
}
