/* The product page's quantity and button, in the buy box, as buy mode lays them. */
.aqr-request {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin: 1rem 0;
}

/* Beside the button. Full width only on a row of its own, when both do not fit. */
.aqr-request__quantity {
  flex: 1 0 auto;
  display: flex;
  min-height: var(--gds-min-touch-target, 44px);
  border: 1px solid var(--gds-color-text, #000);
  border-radius: var(--gds-button-border-radius, 0.6rem);
  overflow: hidden;
}

.aqr-request__quantity button {
  min-width: 44px;
  border: 0;
  background: transparent;
  color: var(--gds-color-text, #000);
  font-size: var(--gds-heading-s-font-size, 1.25rem);
  font-weight: 600;
  cursor: pointer;
}

/* 16 px: anything smaller makes a phone zoom in on focus. */
.aqr-request__quantity input {
  flex: 1 1 40px;
  box-sizing: border-box;
  width: 40px;
  min-width: 40px;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-size: max(16px, var(--gds-text-m-font-size, 1rem));
  font-weight: 600;
  line-height: 1;
  text-align: center;
  appearance: textfield;
}

.aqr-request__quantity input::-webkit-inner-spin-button,
.aqr-request__quantity input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.aqr-request__quantity :focus-visible {
  outline: var(--gds-outline--focus, 2px solid currentcolor);
  outline-offset: -2px;
}

.aqr-cta.wp-element-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: var(--gds-min-touch-target, 44px);
  padding: 0 1.5rem;
  border-radius: var(--gds-button-border-radius, 0.6rem);
  background: var(--gds-color-accent, #3b79bd);
  color: var(--gds-color-on-accent, #fff);
  font-size: var(--gds-button-font-size, 15px);
  font-weight: var(--gds-button-font-weight, 600);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.aqr-cta.wp-element-button:hover {
  background-color: var(--gds-button-hover-background-color, #0f0f11);
}

.aqr-cta.wp-element-button:focus-visible {
  outline: var(--gds-outline--focus, 2px solid currentcolor);
  outline-offset: var(--gds-outline-offset, 2px);
}

.aqr-request__button.wp-element-button {
  flex: 999 1 auto;
}

/* Under a cart product's quantity and Add to cart: the quote button full width,
   with the cart's quantity in place of its own. */
.aqr-request__quantity[hidden] {
  display: none;
}

.aqr-request--with-cart .aqr-request__button.wp-element-button {
  flex-basis: 100%;
}

.aqr-float .aqr-request__quantity {
  flex: none;
}

.aqr-cta__icons,
.aqr-cta__labels {
  display: inline-flex;
}

.aqr-cta__icons {
  flex: none;
}

.aqr-cta__check,
.aqr-cta__added,
.aqr-cta.is-added .aqr-cta__icon,
.aqr-cta.is-added .aqr-cta__label {
  display: none;
}

.aqr-cta.is-added .aqr-cta__check,
.aqr-cta.is-added .aqr-cta__added {
  display: inline;
}

/* Who to ask, under the button, in place of the theme's questions box. */
.product-summary:has(.aqr-ask) .product-questions {
  display: none;
}

.aqr-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin: 1rem 0;
  padding: 0.5rem 0.625rem;
  border-radius: var(--gds-border-radius-card, 0.6rem);
  background: var(--gds-color-surface-alt, #f5f5f5);
}

.aqr-ask__photo {
  display: block;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
}

.aqr-ask__text {
  display: grid;
  flex: 1 1 9rem;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.25;
}

.aqr-ask__title {
  margin: 0;
  font-weight: 600;
}

.aqr-ask__phone {
  color: var(--gds-color-accent, #3b79bd);
  font-weight: 700;
  text-decoration: none;
}

.aqr-ask__phone:hover {
  text-decoration: underline;
}

.aqr-ask__buttons {
  display: flex;
  flex: 0 1 auto;
  gap: 0.375rem;
}

.aqr-ask__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  box-sizing: border-box;
  min-height: var(--gds-min-touch-target, 44px);
  padding: 0.25rem 0.75rem;
  border-radius: var(--gds-button-border-radius, 0.6rem);
  color: var(--gds-color-on-accent, #fff);
  font-size: 0.875rem;
  font-weight: var(--gds-button-font-weight, 700);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.aqr-ask__button:hover {
  filter: brightness(0.92);
}

.aqr-ask__phone:focus-visible,
.aqr-ask__button:focus-visible {
  outline: var(--gds-outline--focus, 2px solid currentcolor);
  outline-offset: var(--gds-outline-offset, 2px);
}

.aqr-ask__button svg {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

/* 5.05:1 with white text. */
.aqr-ask__button--whatsapp {
  background: #157f45;
}

/* The theme's outline, drawn inside so that it adds no height. White rather than
   transparent, to lift it off the box's grey. */
.aqr-ask__button--email {
  background: var(--gds-color-surface-raised, #fff);
  box-shadow: inset 0 0 0 1px currentcolor;
  color: var(--gds-color-accent, #3b79bd);
}

.aqr-ask__button--email:hover {
  background: var(--gds-color-accent, #3b79bd);
  box-shadow: none;
  color: var(--gds-color-on-accent, #fff);
  filter: none;
}

@media (width < 600px) {
  .aqr-ask__buttons {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  /* Equal width, unless a long word needs a row of its own. */
  .aqr-ask__button {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: min-content;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Phones: less padding, so that the quantity still fits beside the button. */
@media (width < 600px) {
  .aqr-request__button.wp-element-button {
    padding-inline: 1rem;
  }
}

/* The bar for when the button has scrolled away. Its foot is part of the box, so
   whatever measures the bar for room also clears the gap under the card. */
.aqr-float {
  --aqr-control: 2.0625rem;
  --aqr-field: var(--gds-color-field-border, #8a8a8a);
  --aqr-accent: var(--gds-color-accent, #3b79bd);
  --aqr-surface: var(--gds-color-surface-raised, #fff);

  position: fixed;
  inset: auto 0 0;
  z-index: var(--gds-z-sticky, 1000);
  box-sizing: border-box;
  padding: 0
    max(
      var(--block-gutter, 1rem),
      env(safe-area-inset-left, 0px),
      env(safe-area-inset-right, 0px)
    )
    max(1rem, env(safe-area-inset-bottom, 0px));
}

/* Both bars slide in from below the screen, clearing their shadows on the way. */
.aqr-float,
.aqr-bar {
  pointer-events: none;
  transform: translateY(calc(100% + 32px));
  visibility: hidden;
  transition:
    transform 0.3s ease-in-out,
    visibility 0s linear 0.3s;
}

.aqr-float.is-visible,
.aqr-bar.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 0.3s ease-in-out;
}

.aqr-bar.is-visible {
  pointer-events: auto;
}

/* A phone's bar to the form, while the form is ahead. */
.aqr-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: var(--gds-z-sticky, 1000);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
  padding: 0.5rem
    max(
      var(--block-gutter, 1rem),
      env(safe-area-inset-left, 0px),
      env(safe-area-inset-right, 0px)
    )
    calc(0.5rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--gds-color-rule, rgb(0 0 0 / 16%));
  background: var(--gds-color-surface, #fff);
  box-shadow: 0 -6px 24px
    color-mix(in srgb, var(--gds-color-text, #000) 12%, transparent);
  color: var(--gds-color-text, #000);
  font-weight: 600;
  text-decoration: none;
}

.aqr-bar:focus-visible {
  outline: var(--gds-outline--focus, 2px solid currentcolor);
  outline-offset: -4px;
}

.aqr-bar:hover .aqr-cta {
  background-color: var(--gds-button-hover-background-color, #0f0f11);
}

.aqr-float__card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--alignwide-width, 80rem);
  margin-inline: auto;
  padding: 0.625rem 0.75rem;
  border-radius: var(--gds-border-radius-card, 0.6rem);
  background: var(--gds-color-surface-raised, #fff);
  box-shadow: 0 6px 24px
    color-mix(in srgb, var(--gds-color-text, #000) 18%, transparent);
  pointer-events: auto;
}

.aqr-float__image {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.375rem;
  background: var(--gds-color-surface-alt, #f5f5f5);
  mix-blend-mode: multiply;
  object-fit: contain;
}

.aqr-float__text {
  flex: 1 0 auto;
  min-width: 0;
}

.aqr-float__name {
  margin: 0;
  overflow: hidden;
  text-transform: var(--gds-product-name-transform, none);
  font-family: var(--gds-display-font-family, inherit);
  font-size: 1.125rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aqr-float__sold-as,
.aqr-float__fits {
  margin: 0;
  overflow: hidden;
  color: var(--gds-color-text-muted, #404040);
  font-size: 0.8125rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aqr-float__choice {
  flex: 0 1 auto;
  min-width: 0;
}

.aqr-float__swatches {
  display: none;
  gap: 0.375rem;
}

.aqr-float__swatches .aqr-swatch {
  flex: none;
  min-height: var(--gds-min-touch-target, 44px);
  white-space: nowrap;
}

/* One line, however long the label: the open list still shows it in full. */
.aqr-float .aqr-float__select {
  field-sizing: content;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  max-width: 15rem;
  height: var(--gds-min-touch-target, 44px);
  min-height: 0;
  padding-block: 0;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--aqr-field);
  border-radius: var(--gds-button-border-radius, 0.6rem);
  background-color: var(--aqr-surface);
  color: inherit;

  /* 16 px: anything smaller makes a phone zoom in on focus. */
  font-size: 16px;
}

.aqr-float__action {
  flex: none;
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

/* Room for the swatches in a line. */
@media (width >= 1180px) {
  .aqr-float__choice {
    flex-basis: auto;
  }

  .aqr-float__swatches {
    display: flex;
  }

  .aqr-float .aqr-float__select {
    display: none;
  }
}

/* A phone: the name and the configuration over the quantity and the button. The
   name takes what it needs, and the dropdown fits its label in what is left. */
@media (width < 720px) {
  .aqr-float__card {
    display: grid;
    grid-template-columns: auto fit-content(60%) minmax(0, 1fr);
    gap: 0.5rem 0.75rem;
  }

  .aqr-float__card:not(:has(.aqr-float__choice)) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .aqr-float__choice {
    justify-self: start;
    max-width: 100%;
  }

  .aqr-float .aqr-float__select {
    max-width: 100%;
  }

  .aqr-float__action {
    grid-column: 1 / -1;
  }

  .aqr-float__button.wp-element-button {
    flex: 1 1 auto;
    padding-inline: 0.875rem;
  }
}

@media (width < 600px) {
  .aqr-float {
    padding: 0;
  }

  .aqr-float__card {
    padding-inline: max(
      0.75rem,
      env(safe-area-inset-left, 0px),
      env(safe-area-inset-right, 0px)
    );
    padding-bottom: calc(0.625rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--gds-color-rule, rgb(0 0 0 / 16%));
    border-radius: 0;
    box-shadow: 0 -6px 24px
      color-mix(in srgb, var(--gds-color-text, #000) 12%, transparent);
  }
}

/* The smallest phones: the button's words need the icon's room. */
@media (width < 360px) {
  .aqr-float__button .aqr-cta__icons {
    display: none;
  }
}

/* The picture goes before the configuration has to be cut short. */
@media (width < 480px) {
  .aqr-float__image {
    display: none;
  }

  .aqr-float__card {
    grid-template-columns: fit-content(60%) minmax(0, 1fr);
  }

  .aqr-float__card:not(:has(.aqr-float__choice)) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aqr-float,
  .aqr-float.is-visible,
  .aqr-bar,
  .aqr-bar.is-visible {
    transform: none;
    transition: none;
  }
}

/* Room at the end of the page while the bar shows, as the last thing in the
   footer. The theme's rule for its own bottom bar does not load in quote mode. */
html:has(body.has-floating-cart) {
  scroll-padding-bottom: var(--gds-sticky-cart-height, 5rem);
}

body.has-floating-cart footer:not(footer footer)::after {
  display: block;
  height: calc(var(--gds-sticky-cart-height, 5rem) + 1rem);
  content: '';
}

/* The block. */
.aqr {
  --aqr-radius: 1rem;
  --aqr-rule: var(--gds-color-rule, #ddd);
  --aqr-field: var(--gds-color-field-border, #8a8a8a);
  --aqr-accent: var(--gds-color-accent, #3b79bd);
  --aqr-on-accent: var(--gds-color-on-accent, #fff);
  --aqr-button-radius: var(--gds-button-border-radius, 0.6rem);
  --aqr-surface: var(--gds-color-surface-raised, #fff);
  --aqr-alt: var(--gds-color-surface-alt, #f5f5f5);
  --aqr-quiet: var(--gds-color-text-quiet, #666);

  container-type: inline-size;
  margin-block: 3rem;
  scroll-margin-top: 6rem;
}

.aqr [hidden] {
  display: none;
}

.aqr__header {
  margin-bottom: var(--block-gutter-pair-text-content, 2rem);
}

.aqr__title {
  margin: 0 0 0.25rem;
}

.aqr__intro {
  margin: 0;
  color: var(--gds-color-text-muted, #404040);
}

/* The sidebar stacks early: the line and its swatches need the width. */
.aqr__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22.5rem;
  align-items: start;
  gap: 2rem;
}

.aqr__main,
.aqr__section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.aqr__main {
  gap: 2.5rem;
}

.aqr__step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.aqr__number {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--aqr-accent);
  color: var(--aqr-on-accent);
  font-size: 0.875rem;
  font-weight: 700;
}

.aqr__step-title {
  flex: 1 1 auto;
  margin: 0;
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.aqr-done__again {
  min-height: 2.75rem;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  cursor: pointer;
}

/* The floating bar's configuration swatches. */
.aqr-swatch {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: max(var(--aqr-control), 2.4375rem);
  padding: 0.1875rem 0.45rem 0.1875rem 0.1875rem;
  border: 1px solid var(--aqr-field);
  border-radius: 0.5rem;
  background: var(--aqr-surface);
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.aqr-swatch[aria-pressed='true'] {
  border-color: var(--aqr-accent);
  box-shadow: inset 0 0 0 1px var(--aqr-accent);
}

.aqr-swatch__image {
  display: block;
  flex: none;
  width: 2.0625rem;
  height: 2.0625rem;
  object-fit: contain;
}

/* A quantity. */
.aqr-stepper {
  display: flex;
  align-items: stretch;
  width: calc(var(--aqr-control) * 3 + 2px);
  min-height: calc(var(--aqr-control) + 2px);
  border: 1px solid var(--aqr-rule);
  border-radius: 0.5rem;
  overflow: hidden;
}

.aqr-stepper button {
  flex: 0 0 var(--aqr-control);
  border: 0;
  background: var(--aqr-alt);
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
}

/* 16 px: anything smaller makes a phone zoom in on focus. */
.aqr-stepper input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  border-radius: 0;
  box-shadow: none;
  font-size: 16px;
  text-align: center;
  appearance: textfield;
}

.aqr-stepper input::-webkit-inner-spin-button,
.aqr-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

/* A closed row of products: a category, its picture and its name.
   The summary is the container, so that the row follows its own width beside the
   form and nothing inside the open row answers to it. Its colours are all here. */
.aqr__groups {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.aqr-group {
  --aqr-row-border: rgb(0 0 0 / 16%);
  --aqr-row-surface: var(--aqr-surface);
  --aqr-row-text: inherit;
  --aqr-row-muted: var(--gds-color-text-muted, #404040);

  border: 1px solid var(--aqr-row-border);
  border-radius: 0.875rem;
  background: var(--aqr-row-surface);
  color: var(--aqr-row-text);
  overflow: hidden;
}

.aqr-group__summary {
  display: block;
  container-type: inline-size;
  list-style: none;
  cursor: pointer;
}

.aqr-group__summary::-webkit-details-marker {
  display: none;
}

.aqr-group__row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 2.75rem;
  column-gap: 12px;
  align-items: center;
  box-sizing: border-box;
  min-height: 64px;
  padding: 0.25rem 0.875rem 0.25rem 1rem;
  isolation: isolate;
}

.aqr-group__image {
  display: block;
  grid-area: 1 / 1;
  width: 100%;
  height: 48px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.aqr-group__text {
  grid-area: 1 / 2;
  min-width: 0;
}

.aqr-group__title {
  display: block;
  font-family: var(--gds-display-font-family, inherit);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
}

.aqr-group__note {
  display: block;
  color: var(--aqr-row-muted);
  font-size: 0.8125rem;
}

/* For a closed row. On an open one its total says it, and this would move every
   quantity under the finger as it came and went. */
.aqr-group[open] .aqr-group__note,
.aqr-group__note:empty {
  display: none;
}

.aqr-group__chevron {
  display: flex;
  grid-area: 1 / 3;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
}

.aqr-group[open] .aqr-group__chevron {
  transform: rotate(180deg);
}

/* As the phone menu's category rows. */
@container (width <= 680px) {
  .aqr-group__row {
    grid-template-columns: 72px minmax(0, 1fr) 16px;
    min-height: 58px;
    padding: 4px 13px 4px 9px;
  }

  .aqr-group__title {
    font-size: 17px;
  }

  .aqr-group__chevron {
    height: auto;
  }

  .aqr-group__chevron svg {
    width: 16px;
    height: 16px;
  }
}

/* An open row: its products as an order form. Its own container, so that it
   follows its own width beside the form. */
.aqr-items {
  --aqr-item-rule: rgb(0 0 0 / 12%);
  --aqr-item-alt: #fafafa;
  --aqr-item-chosen: #eaf1f7;
  --aqr-option-height: 34px;
  --aqr-quantity-height: 40px;

  container-type: inline-size;
}

.aqr-items__head,
.aqr-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 80px 130px 80px 124px;
  column-gap: 12px;
  align-items: center;
  padding-inline: 1rem;
  border-top: 1px solid var(--aqr-item-rule);
}

.aqr-items__head {
  padding-block: 0.5rem;
  background: var(--aqr-alt);
  color: var(--aqr-row-muted);
  font-size: 13px;
  font-weight: 600;
}

.aqr-items__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aqr-item {
  min-height: 64px;
  margin: 0;
  padding-block: 0.25rem;
  background: var(--aqr-surface);
}

.aqr-item:nth-child(even) {
  background: var(--aqr-item-alt);
}

.aqr-item.is-added {
  background: var(--aqr-item-chosen);
}

.aqr-item:focus {
  outline: 0;
}

.aqr-item.is-current {
  box-shadow: inset 0 0 0 2px var(--aqr-accent);
}

/* The group's corners, so that a line around the last row follows them. Not with
   the total under it. */
.aqr-items__list:has(+ [hidden]) > .aqr-item:last-child {
  border-end-start-radius: calc(0.875rem - 1px);
  border-end-end-radius: calc(0.875rem - 1px);
}

.aqr-item__value {
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .aqr-item__added {
    transition: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .aqr-item.is-just-added {
    animation: aqr-item-tint 1s ease-out;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .aqr-item.is-arriving {
    animation: aqr-item-arrive 1.2s ease-out;
  }

  .aqr-summary__list .is-arriving {
    animation: aqr-summary-arrive 1.2s ease-out;
  }
}

@keyframes aqr-item-arrive {
  from {
    background-color: var(--aqr-surface);
    box-shadow: inset 0 0 0 2px var(--aqr-accent);
  }
}

@keyframes aqr-summary-arrive {
  from {
    background-color: color-mix(in srgb, var(--aqr-accent) 18%, transparent);
  }
}

@keyframes aqr-item-tint {
  from {
    background-color: color-mix(in srgb, var(--aqr-accent) 18%, transparent);
  }
}

.aqr-item__image {
  display: block;
  grid-area: 1 / 1 / span 2;
  width: 64px;
  height: 46px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.aqr-item__name {
  grid-area: 1 / 2 / span 2;
  min-width: 0;
}

.aqr-item__title {
  color: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.aqr-item__title:hover {
  text-decoration: underline;
}

.aqr-item__tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.0625rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--aqr-item-chosen);
  color: var(--gds-color-text, #0f0f11);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.aqr-item__tag[hidden] {
  display: none;
}

.aqr-item.is-added .aqr-item__tag {
  background: var(--aqr-surface);
}

/* An add from elsewhere: said beside the name for a moment. */
.aqr-item__added {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.0625rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--aqr-surface);
  color: var(--aqr-accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.3s;
}

.aqr .aqr-item__added[hidden] {
  display: none;
}

.aqr-item__added.is-leaving {
  opacity: 0;
}

.aqr-item__added svg {
  flex: none;
}

/* The configuration, once there is something to configure. */
.aqr-item .aqr-item__option[hidden] {
  display: none;
}

.aqr-item .aqr-item__option {
  display: block;
  grid-area: 2 / 2;
  box-sizing: border-box;
  width: 100%;
  max-width: 190px;
  height: var(--aqr-option-height);
  min-height: var(--aqr-option-height);
  margin-block: 0.25rem;
  padding-block: 0;
  padding-inline: 0.5rem 1.625rem;
  background: var(--aqr-surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4.5l4 4 4-4'/%3E%3C/svg%3E")
    no-repeat right 0.5rem center / 12px 12px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  appearance: none;
}

@media (pointer: coarse) {
  /* 16 px: anything smaller makes a phone zoom in on focus. */
  .aqr-item .aqr-item__option {
    font-size: 16px;
  }
}

.aqr-item__sold-as {
  margin: 0;
  color: var(--aqr-row-muted);
  font-size: 13px;
  line-height: 1.3;
}

.aqr-item__figures {
  display: contents;
}

.aqr-item__figure,
.aqr-item__fits {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.aqr-item__figure--load {
  grid-area: 1 / 3 / span 2;
}

.aqr-item__figure--reach {
  grid-area: 1 / 4 / span 2;
}

.aqr-item__figure--weight {
  grid-area: 1 / 5 / span 2;
}

.aqr-item__fits {
  grid-area: 1 / 3 / span 2 / span 3;
}

/* The column heads, or the line itself on a phone, say this to the eye. */
.aqr-item__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@container (width > 760px) {
  .aqr-item:has(.aqr-item__option:not([hidden])) .aqr-item__name {
    grid-area: 1 / 2;
  }

  /* Where it sits in a row of 64 px, however tall the options make the row. */
  .aqr-item__quantity {
    align-self: start;
    margin-top: calc((56px - var(--aqr-quantity-height)) / 2);
  }
}

.aqr-item__quantity {
  grid-area: 1 / 6 / span 2;
  box-sizing: border-box;
  width: 124px;
  min-height: 40px;
  border-color: rgb(0 0 0 / 30%);
  border-radius: 8px;
  background: var(--aqr-surface);
}

.aqr-item__quantity button {
  flex-basis: 40px;
  background: transparent;
  font-size: 18px;
}

.aqr-item__quantity button[aria-disabled='true'] {
  color: var(--aqr-quiet);
  cursor: default;
}

.aqr-item__quantity button:focus-visible,
.aqr-item__quantity input:focus-visible {
  outline: var(--gds-outline--focus, 2px solid currentcolor);
  outline-offset: -2px;
}

.aqr-item__quantity input {
  font-weight: 600;
}

.aqr-item.is-added .aqr-item__quantity {
  border-color: var(--aqr-accent);
}

@media (pointer: coarse) {
  .aqr-items {
    --aqr-option-height: 44px;
    --aqr-quantity-height: 46px;
  }

  .aqr-item__quantity {
    width: 134px;
    min-height: 46px;
  }

  .aqr-item__quantity button {
    flex-basis: 44px;
  }
}

.aqr-items__total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 52px;
  margin: 0;
  padding: 0.5rem 1rem;
  border-top: 2px solid var(--aqr-accent);
  font-size: 15px;
  font-weight: 600;
}

/* The table folded for a phone: picture, name over figures, quantity, on one line.
   The options come in under that, so that nothing above them moves. */
@container (width <= 760px) {
  .aqr-items__head {
    display: none;
  }

  .aqr-item,
  .aqr-item:nth-child(even) {
    --aqr-item-chosen: #f2f6fa;
    --aqr-option-height: 44px;

    grid-template-columns: 44px minmax(0, 1fr) 120px;
    column-gap: 10px;
    min-height: 0;
    padding: 10px 12px;
    background: var(--aqr-surface);
  }

  .aqr-item.is-added {
    background: var(--aqr-item-chosen);
  }

  .aqr-item__image {
    grid-area: 1 / 1 / span 2;
    width: 44px;
    height: 44px;
  }

  .aqr-item__name {
    position: relative;
    grid-area: 1 / 2;
    align-self: end;
    line-height: 1.25;
  }

  /* Nothing under the name: it has the height to itself. */
  .aqr-item:not(:has(.aqr-item__figure, .aqr-item__fits)) .aqr-item__name {
    grid-area: 1 / 2 / span 2;
    align-self: center;
  }

  .aqr-item__title {
    font-size: 15px;
  }

  .aqr-item__figures {
    display: block;
    grid-area: 2 / 2;
    align-self: start;
    color: var(--aqr-row-muted);
    font-size: 13px;
    line-height: 1.3;
  }

  .aqr-item__figure,
  .aqr-item__fits {
    display: inline;
    font-size: inherit;
    line-height: inherit;
  }

  /* A line breaks between figures, never inside one. */
  .aqr-item__figure {
    white-space: nowrap;
  }

  .aqr-item__value {
    font-weight: 400;
  }

  .aqr-item__figure:not(:last-child) .aqr-item__value::after {
    content: ', ';
  }

  .aqr-item__quantity,
  .aqr-item.is-added .aqr-item__quantity {
    grid-area: 1 / 3 / span 2;
    width: 120px;
    min-height: 44px;
    margin: 0;
  }

  .aqr-item__quantity button {
    flex-basis: 40px;
  }

  .aqr-item .aqr-item__option {
    grid-area: 3 / 1 / auto / -1;
    max-width: none;
    margin-block: 8px 0;
    font-size: 16px;
  }

  /* In the line of figures for its moment, where it moves nothing. */
  .aqr-item__added {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0;
    padding: 0;
    background: none;
  }

  .aqr-item:has([data-aqr-item-added]:not([hidden])) .aqr-item__figures {
    visibility: hidden;
  }

  /* This page's product: its tag on a line of its own under the figures, the same
     for any name. The name's box gives way, so that its parts can go round them. */
  .aqr-item.is-current .aqr-item__name {
    display: contents;
  }

  .aqr-item.is-current .aqr-item__title {
    grid-area: 1 / 2;
    align-self: end;
    line-height: 1.25;
  }

  .aqr-item.is-current .aqr-item__sold-as {
    grid-area: 2 / 2;
  }

  .aqr-item.is-current .aqr-item__figures {
    grid-area: 3 / 2;
  }

  .aqr-item.is-current .aqr-item__added {
    position: static;
    grid-area: 3 / 2;
  }

  .aqr-item.is-current .aqr-item__tag {
    grid-area: 4 / 2;
    justify-self: start;
    margin: 4px 0 0;
  }

  .aqr-item.is-current .aqr-item__image {
    grid-area: 1 / 1 / span 4;
  }

  .aqr-item.is-current .aqr-item__quantity {
    grid-area: 1 / 3 / span 4;
  }

  .aqr-item.is-current .aqr-item__option {
    grid-area: 5 / 1 / auto / -1;
  }
}

/* No room for a picture beside the figures. */
@media (width < 360px) {
  @container (width <= 760px) {
    .aqr-item,
    .aqr-item:nth-child(even) {
      grid-template-columns: minmax(0, 1fr) 120px;
    }

    .aqr-item__image {
      display: none;
    }

    .aqr-item__name {
      grid-area: 1 / 1;
    }

    .aqr-item:not(:has(.aqr-item__figure, .aqr-item__fits)) .aqr-item__name {
      grid-area: 1 / 1 / span 2;
    }

    .aqr-item__figures {
      grid-area: 2 / 1;
    }

    .aqr-item__quantity,
    .aqr-item.is-added .aqr-item__quantity {
      grid-area: 1 / 2 / span 2;
    }

    .aqr-item.is-current .aqr-item__title {
      grid-area: 1 / 1;
    }

    .aqr-item.is-current .aqr-item__sold-as {
      grid-area: 2 / 1;
    }

    .aqr-item.is-current .aqr-item__figures,
    .aqr-item.is-current .aqr-item__added {
      grid-area: 3 / 1;
    }

    .aqr-item.is-current .aqr-item__tag {
      grid-area: 4 / 1;
    }

    .aqr-item.is-current .aqr-item__quantity {
      grid-area: 1 / 2 / span 4;
    }
  }
}

/* The sidebar. */

/* Under the header, admin bar included. Taller than the screen, it scrolls on its
   own rather than going under the header. */
.aqr-panel {
  --aqr-panel-top: calc(
    var(--admin-bar-height, 0px) + var(--header-top-height, 5rem) + 1rem
  );

  position: sticky;
  top: var(--aqr-panel-top);
  box-sizing: border-box;
  max-height: calc(100dvh - var(--aqr-panel-top) - 1rem);
  overflow-y: auto;
  /* A field scrolled to in the box is shown whole, not cut by a fraction. */
  scroll-padding-block: 0.5rem;
  scrollbar-width: thin;
  padding: 1.125rem;
  border-radius: var(--aqr-radius);
  background: var(--aqr-surface);
  box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 14%);
}

.aqr-panel .aqr__step {
  margin-bottom: 0.75rem;
}

.aqr-panel .aqr__number {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.875rem;
}

.aqr-panel .aqr__step-title {
  font-size: 1.125rem;
}

.aqr-done {
  /* Brought to the top after sending, clear of the sticky header. */
  scroll-margin-top: 6rem;
  padding: 2rem;
  border: 2px solid var(--aqr-accent);
  border-radius: var(--aqr-radius);
}

.aqr-done__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 300;
}

.aqr-done p {
  margin: 0.5rem 0;
}

/* The form, and a theme's phone field in it as tall as the other inputs. */
.aqr-form {
  --phone-intl-height: 2.75rem;
}

.aqr-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
  gap: 0.5625rem;
}

.aqr-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
}

/* Email and phone: a long address, and a phone's country code before its number. */
.aqr-form__field--wide {
  grid-column: 1 / -1;
}

.aqr-form__field--note {
  margin-top: 0.5625rem;
}

.aqr-form__field label {
  font-size: 0.875rem;
  font-weight: 600;
}

.aqr-form__optional {
  color: var(--gds-color-text-quiet, #666);
  font-weight: 400;
}

/* The field's own control only: a theme's phone field brings its own. */
.aqr-form__field > input,
.aqr-form__field > select,
.aqr-form__field > textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--aqr-rule);
  border-radius: 0.5rem;
  background-color: var(--gds-color-surface-raised, #fff);
  color: inherit;
  font: inherit;
  font-size: 16px;
}

/* A long country name stops short of the theme's arrow, clipped. */
.aqr-form__field > select {
  padding-right: 2.25rem;
  text-overflow: ellipsis;
}

/* Three lines to start with, whatever the theme asks of a textarea. */
.aqr-form__field textarea {
  min-height: 5.25rem;
  height: 5.25rem;
  line-height: 1.4;
}

.aqr-form__field [aria-invalid='true'] {
  border-color: var(--gds-color-error, #bf4a39);
}

.aqr-form__error {
  color: var(--gds-color-error, #bf4a39);
  font-size: 0.8rem;
}

.aqr-form__error:empty {
  display: none;
}

p.aqr-form__error {
  margin: 0.75rem 0 0;
}

p.aqr__products-error {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  scroll-margin-top: 8rem;
}

.aqr-form__honeypot {
  position: absolute;
  left: -9999px;
}

.aqr-summary {
  margin-top: 0.75rem;
  padding: 0.5625rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--aqr-alt);
}

.aqr-summary__head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.aqr-summary__title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
}

/* What the whole quote holds, however much of it is listed. */
.aqr-summary__total {
  flex: none;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--aqr-accent);
  color: var(--aqr-on-accent);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25rem;
  white-space: nowrap;
}

.aqr-summary__list {
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  list-style: none;
  overflow-wrap: anywhere;
}

.aqr-summary__list li {
  margin: 0;
}

/* Opened, five lines and more scroll inside the box, so the form still fits. */
.aqr-summary__list {
  max-height: 6em;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.aqr-summary__list:focus {
  outline: none;
}

.aqr-summary__list:focus-visible {
  outline: 2px solid var(--aqr-accent);
  outline-offset: 2px;
}

/* The rest of the quote: how many, and their names as far as they fit. */
.aqr-summary__more {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.375rem;
  padding: 0.375rem 0.625rem;
  border: 0;
  border-radius: 6px;
  background: var(--aqr-surface);
  color: var(--aqr-accent);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
}

.aqr-summary__more-names {
  min-width: 0;
  overflow: hidden;
  color: var(--aqr-quiet);
  font-weight: 500;
  text-overflow: ellipsis;
}

.aqr-summary__empty {
  margin: 1rem 0 0;
  color: var(--gds-color-text-muted, #404040);
  font-size: 0.875rem;
}

.aqr-form__submit {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.75rem;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}

.aqr-form__submit[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* A laptop's screen: a tighter form beside the rest, for less of a scroll. */
@media (height < 900px) {
  @container (width > 1000px) {
    .aqr-panel {
      padding-block: var(--gds-spacing-xxs, 8px);
    }

    .aqr-form__grid {
      gap: var(--gds-spacing-xxxs, 4px) 0.5625rem;
    }

    .aqr-form__submit,
    .aqr-summary,
    .aqr-panel .aqr-form__consent,
    .aqr-form__field--note {
      margin-top: var(--gds-spacing-xxxs, 4px);
    }

    .aqr-form {
      --phone-intl-height: 2.5rem;
    }

    /* The code follows the country by itself: no room for the line saying so. */
    .aqr-form .phone-intl__help {
      display: none;
    }

    .aqr-form__field > input,
    .aqr-form__field > select {
      min-height: 2.5rem;
      height: 2.5rem;
    }

    .aqr-form__field textarea {
      min-height: 2.5rem;
      height: 2.5rem;
    }

    .aqr-panel .aqr__step {
      margin-bottom: var(--gds-spacing-xxxs, 4px);
    }
  }
}

/* Who a distributor page's request goes to. */
.aqr-form__to {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.aqr-form__consent {
  margin: 0.75rem 0 0;
  color: var(--gds-color-text-quiet, #666);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Talk to someone instead: under the whole block. The row itself is in
   quote-contact.css, shared with the contact block. */
.aqr .aqr-contact {
  margin-top: 2rem;
}

/* Stacked: the quote, the rows, then the details. Few rows are open here, so the
   open one takes the phone menu's thicker line, drawn outside so nothing moves. */
@container (width <= 1000px) {
  .aqr-group[open] {
    border-color: var(--aqr-accent);
    box-shadow: 0 0 0 1px var(--aqr-accent);
  }

  .aqr__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .aqr-panel {
    position: static;
    max-height: none;
    overflow-y: visible;
    scroll-margin-top: 6rem;
  }
}
