/**
 * Shared configurator design.
 *
 * Values here are taken from the live Uni CPO configurator so Tradeprint and
 * stickers products are visually indistinguishable from the products that were
 * already on the site: same grey field panel, same purple selects, same
 * toggle buttons.
 *
 * Uni CPO products keep their own markup and are unaffected by this file.
 */

/* Several blocks here are toggled with the hidden attribute while also setting
   a display, which would otherwise win and leave them on screen. */
.bek-configurator [hidden] {
  display: none !important;
}

.bek-configurator {
  --bek-cfg-purple: #500c75;   /* selects, labels, button borders */
  --bek-cfg-magenta: #ed1e79;  /* required marker, price, submit */
  --bek-cfg-panel: #f2f2f2;    /* field panel background */
  --bek-cfg-muted: #707070;

  width: 100%;
  font-family: Lato, inherit;
}

/* ── Field panel ────────────────────────── */

.bek-configurator__group-title {
  margin: 24px 0 12px;
  font-size: 18px;
  font-weight: 400;
  color: var(--bek-cfg-purple);
}

/* Matches .uni-row: the grey rounded block each option sits in. */
.bek-configurator__field {
  background: var(--bek-cfg-panel);
  border-radius: 10px;
  padding: 8px 12px 12px;
  margin-bottom: 16px;
}

.bek-configurator__label {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.3;
  color: var(--bek-cfg-purple);
}

.bek-configurator__required {
  color: var(--bek-cfg-magenta);
  margin-left: 2px;
}

.bek-configurator__help {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--bek-cfg-muted);
}

/* ── Select / text / number ─────────────── */

/* Controls sit on the same five-column grid as the buttons and never fill the
   row. --bek-span is set per field from the length of its longest value. */
.bek-configurator__select,
.bek-configurator__input,
.bek-configurator__file {
  width: calc(
    (100% - 4 * 8px) / 5 * var(--bek-span, 1) + (var(--bek-span, 1) - 1) * 8px
  );
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--bek-cfg-purple);
  border-radius: 8px;
  background-color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: var(--bek-cfg-purple);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.bek-configurator__select {
  padding: 0 30px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23500c75' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.bek-configurator__file {
  height: auto;
  padding: 6px 12px;
}

.bek-configurator__select:focus,
.bek-configurator__input:focus,
.bek-configurator__file:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(80, 12, 117, 0.15);
}

/* ── Toggle buttons (<= 5 options) ──────── */

/* Always a five-column grid, the way Uni CPO lays these out: a field with two
   options gets two fifths of the row, not two halves. Buttons never stretch. */
.bek-configurator__choices {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.bek-configurator__choice {
  margin: 0;
  min-width: 0;
  cursor: pointer;
}

.bek-configurator__choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Matches .uni-cpo-option-label__text-content in its unselected state.
   Fixed columns mean long values like "450gsm Art Board Silk Finish" cannot
   fit on one line, and truncating them would hide the spec the shopper is
   choosing by — so the label wraps and the button grows instead. */
.bek-configurator__choice-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  height: 100%;
  padding: 5px 8px;
  border: 1px solid var(--bek-cfg-purple);
  border-radius: 8px;
  background-color: #fff;
  color: var(--bek-cfg-purple);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

/* Uni CPO gives hover and checked the identical fill, so hovering previews
   exactly what selecting will look like. */
.bek-configurator__choice:hover .bek-configurator__choice-label,
.bek-configurator__choice input:checked + .bek-configurator__choice-label {
  background-color: var(--bek-cfg-purple);
  border-color: var(--bek-cfg-purple);
  color: #fff;
}

/* The input is visually hidden, so focus has to show on the label. */
.bek-configurator__choice input:focus-visible + .bek-configurator__choice-label {
  box-shadow: 0 0 0 3px rgba(80, 12, 117, 0.25);
}

/* A note sits under its value, so that button stacks rather than centres. */
.bek-configurator__choice-label:has(.bek-configurator__choice-note) {
  flex-direction: column;
  gap: 2px;
}

.bek-configurator__choice-note {
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.8;
}

/* ── Price table ────────────────────────── */

.bek-pricing {
  margin: 20px 0 16px;
}

.bek-pricing__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 400;
  color: var(--bek-cfg-purple);
}

.bek-pricing__wrap {
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
}

.bek-pricing__table {
  width: 100%;
  border-collapse: collapse;
  font-family: inherit;
  font-size: 15px;
}

.bek-pricing__table th,
.bek-pricing__table td {
  padding: 9px 12px;
  text-align: center;
  border: 1px solid #ececec;
  vertical-align: middle;
}

.bek-pricing__table th {
  background: var(--bek-cfg-panel);
  color: var(--bek-cfg-purple);
  font-weight: 700;
  font-size: 14px;
}

.bek-pricing__speed-name {
  display: block;
}

.bek-pricing__speed-days {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 400;
  color: var(--bek-cfg-muted);
}

.bek-pricing__qty,
.bek-pricing__qty-head {
  background: var(--bek-cfg-panel);
  color: var(--bek-cfg-purple);
  font-weight: 700;
  white-space: nowrap;
}

.bek-pricing__cell {
  cursor: pointer;
  color: var(--bek-cfg-purple);
  /* Digits line up column to column when comparing prices. */
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s, color 0.15s;
}

.bek-pricing__cell:hover:not(.is-na):not(.is-selected) {
  background: rgba(80, 12, 117, 0.07);
}

.bek-pricing__cell:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--bek-cfg-lilac, #a062c1);
}

.bek-pricing__cell.is-selected {
  background: var(--bek-cfg-purple);
  color: #fff;
  font-weight: 700;
}

.bek-pricing__cell.is-na {
  background: #fafafa;
  color: #bdbdbd;
  cursor: not-allowed;
}

.bek-pricing__empty {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px dashed #d5d5d5;
  border-radius: 10px;
  color: var(--bek-cfg-muted);
  font-size: 14px;
}

.bek-configurator.is-loading .bek-pricing__wrap {
  opacity: 0.45;
}

/* ── Artwork ────────────────────────────── */

/* Presented as one more field: same grey panel, same label, and the tabs use
   the option-button treatment so the block reads as part of the configurator
   rather than a component borrowed from elsewhere. */
.bek-artwork {
  margin-bottom: 16px;
  padding: 8px 12px 12px;
  background: var(--bek-cfg-panel);
  border-radius: 10px;
}

.bek-artwork__label {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.3;
  color: var(--bek-cfg-purple);
}

/* Two of the five columns each, so the pair never spans the whole row —
   the same rule the option buttons follow. */
.bek-artwork__tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.bek-artwork__tab {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--bek-cfg-purple);
  border-radius: 8px;
  background: #fff;
  color: var(--bek-cfg-purple);
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

/* Same fill on hover as when active, matching the option buttons. */
.bek-artwork__tab:hover,
.bek-artwork__tab.is-active {
  background: var(--bek-cfg-purple);
  border-color: var(--bek-cfg-purple);
  color: #fff;
}

.bek-artwork__tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(80, 12, 117, 0.25);
}

.bek-artwork__panel[hidden] {
  display: none;
}

/* Dropzone */

.bek-artwork__drop {
  display: block;
  padding: 24px 16px;
  /* Dashed and purple rather than grey: it reads as an empty slot waiting for
     a file while still belonging to the same palette as the controls above. */
  border: 1px dashed var(--bek-cfg-lilac, #a062c1);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.bek-artwork__drop:hover,
.bek-artwork__drop.is-dragover {
  border-color: var(--bek-cfg-purple);
  background: rgba(80, 12, 117, 0.04);
}

/* Visually hidden rather than display:none so the label still labels it and
   keyboard focus can reach the control. */
.bek-artwork__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bek-artwork__input:focus-visible + .bek-artwork__icon {
  outline: 2px solid var(--bek-cfg-lilac, #a062c1);
  outline-offset: 4px;
  border-radius: 4px;
}

.bek-artwork__icon {
  color: var(--bek-cfg-lilac, #a062c1);
}

.bek-artwork__title {
  margin: 8px 0 2px;
  font-size: 16px;
  font-weight: 400;
  color: var(--bek-cfg-purple);
}

.bek-artwork__required {
  color: var(--bek-cfg-magenta);
}

.bek-artwork__hint {
  margin: 0;
  font-size: 13px;
  color: var(--bek-cfg-muted);
}

/* Chosen file */

.bek-artwork__file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: var(--bek-cfg-purple);
  font-size: 14px;
}

.bek-artwork__filename {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bek-artwork__remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--bek-cfg-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.bek-artwork__remove:hover {
  background: rgba(237, 30, 121, 0.1);
  color: var(--bek-cfg-magenta);
}

.bek-artwork__error {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(237, 30, 121, 0.08);
  color: var(--bek-cfg-magenta);
  font-size: 13px;
}

/* Requirements */

.bek-artwork__guide {
  margin-top: 10px;
  font-size: 13px;
  color: var(--bek-cfg-muted);
}

.bek-artwork__guide summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--bek-cfg-purple);
}

.bek-artwork__guide p {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  line-height: 1.5;
}

/* Design service */

.bek-artwork__intro {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--bek-cfg-muted);
}

.bek-artwork__designs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.bek-artwork__design {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 10px;
  border: 1px solid var(--bek-cfg-purple);
  border-radius: 8px;
  background: #fff;
  color: var(--bek-cfg-purple);
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.bek-artwork__design:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(80, 12, 117, 0.25);
}

.bek-artwork__design:hover,
.bek-artwork__design.is-selected {
  background: var(--bek-cfg-purple);
  border-color: var(--bek-cfg-purple);
  color: #fff;
}

.bek-artwork__design-label {
  font-size: 15px;
  font-weight: 300;
}

.bek-artwork__design-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--bek-cfg-magenta);
}

/* The price is magenta at rest; on the filled state it has to go white or it
   disappears into the purple. */
.bek-artwork__design:hover .bek-artwork__design-price,
.bek-artwork__design:hover .bek-artwork__design-price *,
.bek-artwork__design.is-selected .bek-artwork__design-price,
.bek-artwork__design.is-selected .bek-artwork__design-price * {
  color: #fff;
}

@media (max-width: 768px) {
  /* Matching the option buttons: two columns, so each tab or card takes one. */
  .bek-artwork__tabs,
  .bek-artwork__designs {
    grid-template-columns: repeat(2, 1fr);
  }

  .bek-artwork__tab,
  .bek-artwork__design {
    grid-column: span 1;
  }
}

/* ── Price summary ──────────────────────── */

/* ── Specifics ──────────────────────────── */

/* Lives in the left column's Specifics box, so it is scoped by that rather
   than by .bek-configurator. Values reuse the bullet treatment the other
   products' specifics already use — square markers, grey — with a heading
   above each group.

   One left edge runs down the whole block: the headings and the markers start
   at the same x, and only the value text is indented past its marker. The
   markers are drawn rather than left to list-style, because a native marker
   sits outside the content box at a position the browser picks, which is what
   pushed them to the right of the headings. */
.inside-specifics-box .bek-specs {
  margin: 0;
  padding-left: 20px;
}

.inside-specifics-box .bek-specs__group + .bek-specs__group {
  margin-top: 14px;
}

.inside-specifics-box .bek-specs__label {
  margin: 0 0 4px 0;
  padding: 0;
  color: #500c75;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.inside-specifics-box .bek-specs__values {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A short option set runs on one line, but it is still one of the options
   rather than a note about them, so it takes a marker like any other row. */
/* list-style is cleared on the item, not just on the list: product-style.css
   sets it on `.inside-specifics-box li` directly, which beats anything the ul
   passes down, and the native marker rode along next to the drawn one. */
.inside-specifics-box .bek-specs__values li,
.inside-specifics-box .bek-specs__inline {
  position: relative;
  margin: 0 0 5px;
  padding: 0 0 0 18px;
  color: #707070;
  font-size: 16px;
  line-height: 1.3;
  list-style: none;
}

.inside-specifics-box .bek-specs__values li::before,
.inside-specifics-box .bek-specs__inline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.46em;
  width: 6px;
  height: 6px;
  background: currentColor;
}

.inside-specifics-box .bek-specs__values li:last-child,
.inside-specifics-box .bek-specs__inline {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .inside-specifics-box .bek-specs {
    padding-left: 8px;
  }
}

/* ── Lead time ──────────────────────────── */

.bek-configurator__leadtime {
  margin-bottom: 16px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bek-cfg-panel);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--bek-cfg-purple);
}

.bek-configurator__leadtime-label {
  display: block;
}

/* ── Quantity, costs, basket ────────────── */

.bek-configurator__summary {
  margin-bottom: 16px;
  padding: 10px 12px 12px;
  border-radius: 10px;
  background: var(--bek-cfg-panel);
}

/* Three narrow fields on the left, the button pushed to the right edge. */
.bek-configurator__summary-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: end;
}

.bek-configurator__cost {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bek-configurator__cost-label {
  margin-bottom: 7px;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.2;
  color: var(--bek-cfg-purple);
  /* "Unit Cost" over a narrow column would otherwise break in two and push the
     boxes out of line with each other. */
  white-space: nowrap;
}

/* Read-only figures. Transparent rather than filled — the panel behind is what
   gives them their tint, which is how the live block does it. */
.bek-configurator__cost-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 36px;
  padding: 4px;
  border: 1px solid var(--bek-cfg-purple);
  border-radius: 8px;
  background: transparent;
  color: var(--bek-cfg-purple);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

/* A count rather than a sum, so it centres instead of aligning to the decimal. */
.bek-configurator__cost-box--qty {
  justify-content: center;
}

.bek-configurator__price-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--bek-cfg-muted);
}

.bek-configurator__feedback {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(80, 12, 117, 0.07);
  color: var(--bek-cfg-purple);
  font-size: 14px;
}

.bek-configurator__feedback.is-error {
  background: rgba(231, 55, 130, 0.09);
  color: #b5145c;
}

/* Once priced, the note carries the per-speed breakdown, so visibility is left
   to the script rather than forced closed here. */
.bek-configurator.is-priced .bek-configurator__price-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
  color: var(--bek-cfg-purple);
}

.bek-configurator.is-loading .bek-configurator__price-value {
  opacity: 0.4;
}

/* ── Submit ─────────────────────────────── */

/* Matches the existing add-to-cart button: 36px, 8px radius, #e73782.
   One column like the fields, in the last of the five so a gap separates it. */
.bek-configurator__submit {
  grid-column: 5;
  height: 36px;
  padding: 4px 14px;
  border: 1px solid #e73782;
  border-radius: 8px;
  background: #e73782;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: color 0.1s ease-in-out, background-color 0.1s ease-in-out;
}

.bek-configurator__submit:hover:not([disabled]) {
  background: #d0246f;
  border-color: #d0246f;
  color: #fff;
}

.bek-configurator__submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(231, 55, 130, 0.35);
}

.bek-configurator__submit[disabled] {
  background: #cfcfcf;
  border-color: #cfcfcf;
  color: #fff;
  cursor: not-allowed;
}

/* ── Empty / admin states ───────────────── */

.bek-configurator__empty {
  padding: 20px;
  border: 1px dashed #d5d5d5;
  border-radius: 10px;
  color: var(--bek-cfg-muted);
  font-size: 15px;
}

.bek-configurator__admin-note {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid #d5d5d5;
  font-size: 13px;
}

.bek-configurator__admin-note code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bek-cfg-panel);
}

/* ── Mobile ─────────────────────────────── */

@media (max-width: 768px) {
  /* Five columns is unreadable on a phone; two keeps the labels legible while
     still refusing to stretch a lone button across the row. */
  .bek-configurator__choices {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Same reasoning for controls: a fifth of a phone screen is unusable. */
  .bek-configurator__select,
  .bek-configurator__input,
  .bek-configurator__file {
    width: calc((100% - 8px) / 2 * min(var(--bek-span, 1), 2) + (min(var(--bek-span, 1), 2) - 1) * 8px);
  }
}

/* The cost bar gives up its single row before the fields around it do. Three
   figures and a button share five columns here, and "+ VAT" after each sum
   needs more width than a fifth of the row leaves — the boxes clip rather than
   wrap. Three across with the button on its own line beneath is the same shape
   the stickers take, at the same width. */
@media (max-width: 900px) {
  .bek-configurator__summary-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .bek-configurator__submit {
    grid-column: 1 / -1;
    margin-top: 4px;
  }
}

/* The three figures stay on one line however narrow it gets, so the bar is read
   across rather than down. A third of a phone is about 90px inside the box and a
   sum with "+ VAT" after it wants nearer a hundred, so the type comes down to
   meet it — the alternative is a label broken over two lines or a total missing
   its first character. */
@media (max-width: 520px) {
  .bek-configurator__cost-label {
    font-size: clamp(12px, 3.6vw, 14px);
  }

  /* Tied to the viewport rather than stepped at another breakpoint: the box is
     about 28% of the screen and the widest thing in it needs six times the type
     size, so anything under 4.6vw fits. Below that it is one continuous curve
     with no width at which the sum suddenly loses a character. */
  .bek-configurator__cost-box {
    padding: 4px 2px;
    font-size: clamp(12px, 3.5vw, 14px);
  }
}
