.product-type-calculator form.cart.spcalc-form-shell {
  display: grid;
  gap: 18px;
  margin-bottom: 1.618em;
  min-width: 0;
  padding: 0;
}

.spcalc-product-calculator {
  display: grid;
  gap: 20px;
  margin: 0;
  min-width: 0;
}

.spcalc-product-loading {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 120px;
}

.spcalc-product-loading[hidden] {
  display: none !important;
}

.spcalc-product-loading-spinner {
  animation: spcalc-spin 0.8s linear infinite;
  border: 3px solid #d8dee6;
  border-radius: 50%;
  border-top-color: #1f2933;
  box-sizing: border-box;
  display: inline-block;
  height: 34px;
  width: 34px;
}

@keyframes spcalc-spin {
  to {
    transform: rotate(360deg);
  }
}

.spcalc-section[hidden],
.spcalc-field[hidden],
.spcalc-content[hidden] {
  display: none !important;
}

.spcalc-group {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spcalc-section {
  display: grid;
  gap: 18px;
  grid-column: 1 / -1;
}

.spcalc-section__title {
  color: #1f2933;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.spcalc-section__body {
  display: grid;
  gap: 24px 4%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spcalc-section--design .spcalc-section__body {
  grid-template-columns: minmax(0, 1fr);
}

.spcalc-section--postprint {
  border: 1px solid #4e4e4e;
  border-radius: 5px;
  gap: 14px;
  overflow: hidden;
  padding: 8px 15px 18px;
}

.spcalc-section--postprint.spcalc-section--collapsed {
  padding-bottom: 8px;
}

.spcalc-section--postprint.spcalc-section--collapsed .spcalc-section__body {
  display: none;
}

.spcalc-section__toggle {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: #1f2933;
  cursor: pointer;
  display: flex;
  font-size: 18px;
  font-weight: 700;
  justify-content: space-between;
  line-height: 1.25;
  padding: 0;
  text-align: left;
  width: 100%;
}

.spcalc-section__toggle:hover,
.spcalc-section__toggle:focus {
  background: transparent;
  box-shadow: none;
  color: #1f2933;
  outline: none;
}

.spcalc-section__toggle-text > * {
  margin: 0;
}

.spcalc-section__toggle-icon {
  border-bottom: 2px solid #1f2933;
  border-right: 2px solid #1f2933;
  display: inline-block;
  flex: 0 0 auto;
  height: 10px;
  margin-left: 16px;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  width: 10px;
}

.spcalc-section--postprint:not(.spcalc-section--collapsed) .spcalc-section__toggle-icon {
  transform: rotate(-135deg);
}

.spcalc-field,
.spcalc-content {
  align-content: start;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.spcalc-field--wide,
.spcalc-content {
  grid-column: 1 / -1;
}

.spcalc-field__label,
.spcalc-field-label {
  color: #1f2933;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.spcalc-field-label {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.spcalc-field__label {
  display: grid;
  gap: 2px;
}

.spcalc-field-required-mark {
  color: #b42318;
  font-weight: 700;
  line-height: 1;
}

.spcalc-field__input {
  min-width: 0;
}

.spcalc-form-shell .spcalc-input {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  border: 1px solid #c8d0d8;
  border-radius: 5px;
  box-sizing: border-box;
  color: #111827;
  font-size: 15px;
  line-height: 1.35;
  min-height: 42px;
  outline: none;
  padding: 8px 42px 8px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.spcalc-form-shell .spcalc-input:focus {
  border-color: #1f2933;
  box-shadow: 0 0 0 1px rgba(31, 41, 51, 0.08);
}

.spcalc-form-shell .spcalc-input:disabled {
  background: #f3f5f7;
  color: #6b7280;
  cursor: not-allowed;
}

.spcalc-form-shell select.spcalc-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%231f2933' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
  cursor: pointer;
}

.spcalc-field--checkable {
  gap: 8px;
}

.spcalc-field__control--checkable {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  position: relative;
}

.spcalc-checkable {
  align-items: center;
  color: #1f2933;
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  line-height: 1.35;
  min-width: 0;
}

.spcalc-checkable__input {
  display: inline-flex;
  flex: 0 0 auto;
}

.spcalc-checkable__label {
  align-items: center;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 4px;
}

.spcalc-checkable--label-first {
  gap: 20px;
}

.spcalc-checkable__price {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.spcalc-field-help {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  line-height: 1;
  position: relative;
}

.spcalc-field-help__icon {
  align-items: center;
  background: #ff3b3b;
  border-radius: 50%;
  color: #fff;
  cursor: help;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  height: 15px;
  justify-content: center;
  line-height: 1;
  width: 15px;
}

.spcalc-field-help .sp-tooltip {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.16);
  box-sizing: border-box;
  color: #1f2933;
  display: none;
  font-size: 13px;
  left: 50%;
  line-height: 1.45;
  margin-top: 0;
  max-width: calc(100vw - 32px);
  opacity: 1;
  padding: 12px 14px;
  pointer-events: auto;
  position: absolute;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  width: 340px;
  z-index: 50;
}

.spcalc-field-help .sp-tooltip::before {
  color: #fff;
  content: "▲";
  filter: drop-shadow(0 -1px 0 rgba(17, 24, 39, 0.08));
  font-size: 18px;
  left: 50%;
  line-height: 1;
  position: absolute;
  top: -13px;
  transform: translateX(-50%);
}

.spcalc-field-help:hover .sp-tooltip,
.spcalc-field-help:focus .sp-tooltip,
.spcalc-field-help:focus-within .sp-tooltip {
  display: block;
}

.spcalc-field-help .sp-tooltip ul {
  margin: 8px 0;
  padding-left: 18px;
}

.spcalc-field-help .sp-tooltip li + li {
  margin-top: 6px;
}

.spcalc-checkable .spcalc-input {
  -webkit-appearance: checkbox;
  appearance: auto;
  accent-color: #ff3b3b;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 20px;
  min-height: 20px;
  padding: 0;
  width: 20px;
}

.spcalc-input--file {
  height: 1px;
  left: -9999px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.spcalc-upload-dropzone {
  align-items: center;
  background: #fff;
  border: 2px dashed #4e4e4e;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  gap: 16px;
  min-height: 112px;
  padding: 20px 24px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.spcalc-upload-dropzone--active {
  background: #fafafa;
  border-color: #111827;
}

.spcalc-upload-dropzone--disabled {
  background: #f3f5f7;
  border-color: #c8d0d8;
  cursor: not-allowed;
}

.spcalc-upload-dropzone__icon {
  align-items: center;
  border: 2px solid #1f2933;
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 400;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.spcalc-upload-dropzone__text {
  display: grid;
  gap: 6px;
}

.spcalc-upload-dropzone__text strong {
  color: #1f2933;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}

.spcalc-upload-dropzone__text span {
  color: #1f2933;
  font-size: 15px;
  line-height: 1.35;
}

.spcalc-upload-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.spcalc-upload-list:empty,
.spcalc-product-upload-list:empty,
.spcalc-product-errors:empty,
.spcalc-product-breakdown:empty,
.spcalc-product-price:empty {
  display: none;
}

.spcalc-upload-item {
  align-items: center;
  border-left: 3px solid #2271b1;
  color: #1f2933;
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  line-height: 1.35;
  padding: 4px 0 4px 10px;
}

.spcalc-upload-remove {
  appearance: none;
  background: transparent;
  border: 0;
  color: #b42318;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
}

.spcalc-field-description {
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.spcalc-field-has-error .spcalc-input,
.spcalc-field-has-error .spcalc-upload-dropzone {
  border-color: #c92a2a;
}

.spcalc-field-error,
.spcalc-product-errors {
  color: #b42318;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
}

.spcalc-product-price {
  border-top: 1px solid #e5e7eb;
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 18px;
}

.spcalc-total-row,
.spcalc-breakdown-item {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.spcalc-total-row span {
  color: #111827;
  font-size: 16px;
  font-weight: 700;
}

.spcalc-total-row strong {
  color: #111827;
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
}

.spcalc-breakdown-title {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.spcalc-breakdown-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.spcalc-breakdown-item {
  color: #4b5563;
  font-size: 13px;
}

.spcalc-breakdown-item strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.spcalc-cart-breakdown {
  margin-top: 10px;
  max-width: 420px;
}

.spcalc-cart-breakdown .spcalc-breakdown-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.woocommerce-cart .product-name .spcalc-cart-breakdown .spcalc-breakdown-item,
.woocommerce-checkout .product-name .spcalc-cart-breakdown .spcalc-breakdown-item {
  font-size: 13px;
  gap: 10px;
  line-height: 1.4;
}

.spcalc-is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.product-type-calculator form.cart.spcalc-form-shell .single_add_to_cart_button,
.product-type-calculator form.cart.spcalc-form-shell input.single_add_to_cart_button {
  display: inline-flex;
  justify-content: center;
  margin-top: 6px;
  max-width: 160px;
}

.product-type-calculator .wapf-wrapper,
.product-type-calculator .wapf-product-totals,
.product-type-calculator .wapf-grand-total {
  display: none !important;
}

@media (min-width: 768px) and (max-width: 1092px) {
  .product-type-calculator .product-slider,
  .product-type-calculator .slider-wrapper,
  .product-type-calculator .slider-for {
    box-sizing: border-box;
    max-width: 100%;
  }

  .product-type-calculator .slider-wrapper,
  .product-type-calculator .slider-for {
    width: 100%;
  }

  .product-type-calculator .slider-for .slick-slide {
    max-width: 100%;
  }

  .product-type-calculator .first-image img,
  .product-type-calculator .slider-for li img {
    height: auto;
    max-width: 100%;
  }
}

@media (min-width: 850px) and (max-width: 1092px) {
  .spcalc-group {
    gap: 18px;
  }

  .spcalc-section__body {
    gap: 20px 3%;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .spcalc-form-shell .spcalc-input {
    font-size: 14px;
    padding-left: 10px;
    padding-right: 34px;
  }

  .spcalc-form-shell select.spcalc-input {
    background-position: right 10px center;
  }

  .spcalc-field__label,
  .spcalc-field-label,
  .spcalc-checkable__label,
  .spcalc-checkable__price {
    font-size: 13px;
  }
}

@media (min-width: 768px) and (max-width: 849px) {
  .spcalc-group,
  .spcalc-section__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .spcalc-field--wide,
  .spcalc-content {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .spcalc-group,
  .spcalc-section__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .spcalc-field--wide,
  .spcalc-content {
    grid-column: auto;
  }

  .spcalc-upload-dropzone {
    align-items: flex-start;
    padding: 18px;
  }

  .spcalc-upload-dropzone__text strong,
  .spcalc-upload-dropzone__text span {
    font-size: 14px;
  }

  .spcalc-total-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .spcalc-field-help .sp-tooltip {
    left: auto;
    right: 0;
    transform: none;
    width: min(340px, calc(100vw - 32px));
  }

  .spcalc-field-help .sp-tooltip::before {
    left: auto;
    right: 0;
    transform: translateX(-1px);
  }

  .product-type-calculator form.cart.spcalc-form-shell .single_add_to_cart_button,
  .product-type-calculator form.cart.spcalc-form-shell input.single_add_to_cart_button {
    max-width: 100%;
    width: 100%;
  }
}
