dialog.sr-shop-dialog,
.sr-shop-popup {
  --sr-dialog-radius: 16px;
  --sr-dialog-space: clamp(16px, 3vw, 28px);
  --sr-dialog-text: #262626;
  --sr-dialog-border: #dedbd6;
  --sr-dialog-accent: #f8b546;
}

dialog.sr-shop-dialog {
  border: 1px solid var(--sr-dialog-border);
  border-radius: var(--sr-dialog-radius);
  color: var(--sr-dialog-text);
  background: #fff;
}

dialog.sr-shop-dialog::backdrop,
.sr-shop-popup.mfp-bg {
  background: rgba(24, 24, 24, .52);
}

.sr-shop-popup.mfp-bg {
  opacity: 1;
}

.sr-shop-popup .mfp-container {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 10px;
}

.sr-shop-popup .mfp-container::before {
  display: none;
}

.sr-shop-popup .mfp-content {
  width: 100%;
  min-width: 0;
  pointer-events: none;
}

.sr-shop-popup .modal,
.sr-shop-popup #thanks-modal {
  box-sizing: border-box;
  position: relative;
  inset: auto;
  transform: none;
  width: min(100%, 480px);
  max-width: 100%;
  margin: auto;
  overflow: visible;
  color: var(--sr-dialog-text);
  pointer-events: auto;
}

.sr-shop-popup :is(#in-cart-modal, #choose-offer-modal) {
  width: min(100%, 610px);
}

.sr-shop-popup .modal__dialog {
  position: relative;
  width: 100%;
  min-width: 0;
}

.sr-shop-popup .modal__content,
.sr-shop-popup #thanks-modal {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  margin: 0;
  padding: var(--sr-dialog-space);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--sr-dialog-border);
  border-radius: var(--sr-dialog-radius);
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  overflow-wrap: anywhere;
}

.sr-shop-popup #thanks-modal {
  width: min(100%, 480px);
  margin-inline: auto;
}

.sr-shop-popup .modal__content-title {
  display: block;
  margin: 0 44px 16px 0;
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sr-shop-popup .modal__content-title + .modal__content-desc {
  margin: -6px 0 16px;
  color: #555;
}

.sr-shop-popup .modal__dialog > button.modal__close.mfp-close,
.sr-shop-popup #thanks-modal > .mfp-close,
dialog.sr-shop-dialog .sr-shop-dialog__close {
  box-sizing: border-box;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid var(--sr-dialog-border);
  border-radius: 50%;
  background: #fff;
  color: var(--sr-dialog-text);
  line-height: 1;
  cursor: pointer;
  opacity: 1;
}

.sr-shop-popup .modal__dialog > button.modal__close.mfp-close,
.sr-shop-popup #thanks-modal > .mfp-close {
  top: 7px;
  right: 7px;
  width: 44px;
  height: 44px;
}

.sr-shop-popup .modal__close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  pointer-events: none;
}

.sr-shop-popup .modal__dialog > button.modal__close:hover,
.sr-shop-popup #thanks-modal > .mfp-close:hover,
dialog.sr-shop-dialog .sr-shop-dialog__close:hover {
  background: #fff3dc;
}

.sr-shop-popup :is(.button, .choose-offer-modal__chip) {
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--sr-dialog-text);
  line-height: 1.3;
  text-align: center;
}

.sr-shop-popup .button:not(.button--white) {
  background: var(--sr-dialog-accent);
  color: var(--sr-dialog-text);
}

.sr-shop-popup .button--white {
  border: 1px solid #9c9892;
  background: #fff;
  color: var(--sr-dialog-text);
}

.sr-shop-popup .button:not(:disabled):hover {
  background: #eda538;
  color: var(--sr-dialog-text);
}

.sr-shop-popup .form__block--buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.sr-shop-popup .form__block--buttons .button {
  flex: 1 1 auto;
  margin: 0;
  font-size: 16px;
}

.sr-shop-popup .modal__content .form__block--buttons .button:not(:last-child) {
  margin: 0;
}

.sr-shop-popup :is(input, select):not([type="hidden"]) {
  border-radius: 8px;
  font-size: 16px;
}

.sr-shop-popup :is(button, a, input, select, textarea, [tabindex]):focus-visible,
dialog.sr-shop-dialog .sr-shop-dialog__close:focus-visible {
  outline: 2px solid var(--sr-dialog-text);
  outline-offset: 2px;
}

.sr-shop-popup .modal__content-title:focus {
  outline: none;
}

.sr-shop-popup #ask-price-modal .form__block:not(.form__block--buttons) {
  flex-direction: column;
  gap: 4px;
  margin: 0 0 10px;
}

.sr-shop-popup #ask-price-modal label {
  font-size: 14px;
  color: var(--sr-dialog-text);
}

.sr-shop-popup #ask-price-modal :is(input, select):not([type="hidden"]) {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #989591;
  background-color: white;
  color: var(--sr-dialog-text);
  font: inherit;
}

.sr-shop-popup #ask-price-modal select {
  appearance: auto;
}

/* The storefront audit sets form borders with !important, including focused inputs. */
.sr-shop-popup #ask-price-modal .form .form__block input[aria-invalid="true"]:not([type="hidden"]) {
  border-color: #a52421 !important;
}

.sr-shop-popup .sr-field-error {
  font-size: 14px;
  line-height: 1.3;
  color: #96201c;
}

.sr-shop-popup .form__consent {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #555;
}

.sr-shop-popup .form__consent a {
  color: inherit;
  text-decoration: underline;
}

.sr-shop-popup .product-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 16px;
  align-items: start;
  margin: 0;
}

.sr-shop-popup .product-row__image {
  grid-row: 1 / 3;
  width: clamp(54px, 13vw, 100px);
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  object-fit: contain;
}

.sr-shop-popup .product-row__main,
.sr-shop-popup .product-row__price {
  position: static;
  grid-column: 2;
  align-self: start;
  min-width: 0;
  width: auto;
  margin: 0;
  text-align: left;
}

.sr-shop-popup .product-row__price {
  font-size: 22px;
  white-space: normal;
}

.sr-shop-popup .product-row__quantity {
  align-self: start;
}

.sr-shop-popup .product-row__sku {
  margin-bottom: 8px;
  color: #585550;
}

.sr-shop-popup .product-row__quantity-btns {
  width: auto;
  align-items: stretch;
  gap: 2px;
}

.sr-shop-popup .product-row__quantity-button,
.sr-shop-popup .product-row input.product-row__quantity-input {
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  max-height: none;
  margin: 0;
  padding: 4px;
  border-radius: 6px;
}

.sr-shop-popup .choose-offer-modal__details-link {
  color: #595650 !important;
  text-decoration: underline !important;
}

.sr-shop-popup .lead-result__header {
  margin-right: 40px;
}

@media (max-width: 480px) {
  .sr-shop-popup .form__block--buttons {
    flex-direction: column;
  }

  .sr-shop-popup .form__block--buttons .button {
    width: 100%;
  }
}
