/* ProMetal - weights (Misc.FormulaPrice). Logical properties only: the store is also RTL (Arabic). */

/* the display rules below would otherwise override the hidden attribute (e.g. the fields of the other shapes) */
.fw-weight[hidden],
.fw-weight [hidden],
.fw-calc [hidden] {
  display: none !important;
}

/* under the price in the Nova buy box (the price column is end-aligned) */
.fw-weight {
  display: grid;
  justify-items: end;
  gap: 2px;
  margin-block-start: 6px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--nv-text, #334155);
  text-align: end;
}

.fw-weight__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0 6px;
}

.fw-weight__label {
  color: var(--nv-muted, #64748b);
  font-weight: 500;
}

.fw-weight__value {
  color: var(--nv-ink, #0f172a);
  font-weight: 700;
}

.fw-weight__note {
  color: var(--nv-muted, #64748b);
  font-size: 12.5px;
}

.fw-weight__row--perkg {
  color: var(--nv-muted, #64748b);
  font-size: 12.5px;
}

.fw-weight__link {
  font-size: 12.5px;
  color: var(--nv-accent, #1885c3);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* quick view and other places that are not end-aligned */
.nv-qv .fw-weight,
.nv-qv .fw-weight__row {
  justify-items: start;
  justify-content: flex-start;
  text-align: start;
}

/* cart, drawer and order lines */
.fw-line {
  margin-block-start: 4px;
  font-size: 13px;
  color: var(--nv-muted, #64748b);
}

.fw-line strong {
  color: var(--nv-ink, #0f172a);
  font-weight: 600;
}

.fw-line--compact {
  margin-block-start: 2px;
  font-size: 12px;
}

/* cart / checkout / order totals */
.fw-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-block-end: 10px;
  padding: 10px 14px;
  border: 1px solid var(--nv-line, #e4e9f2);
  border-radius: var(--nv-radius-sm, 8px);
  background: var(--nv-bg-soft, #f4f7fc);
  font-size: 14px;
}

.fw-total strong {
  color: var(--nv-ink, #0f172a);
}

.fw-total__note {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--nv-muted, #64748b);
}

/* ---------- public weight calculator ---------- */

.fw-calc {
  display: grid;
  gap: 24px;
  max-width: 1100px;
  margin-inline: auto;
  /* the theme centres page text on small screens */
  text-align: start;
}

/* page header: aligned to the calculator's start edge (not centred over a left-aligned form), a small section
   label, a strong title and the intro as a muted lead line, closed by a hairline */
.fw-calc-head {
  max-width: 1100px;
  margin: 12px auto 28px;
  padding-block-end: 24px;
  border-block-end: 1px solid var(--nv-line, #e4e9f2);
  text-align: start;
}

.fw-calc-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nv-primary, #1f8ac0);
}

.fw-calc-head__eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

/* Arabic letters must stay joined */
[dir="rtl"] .fw-calc-head__eyebrow {
  font-size: 13.5px;
  letter-spacing: 0;
}

.fw-calc-head__title {
  margin: 0;
  font-size: clamp(26px, 1.6vw + 18px, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--nv-ink, #0f172a);
  text-wrap: balance;
}

[dir="rtl"] .fw-calc-head__title {
  letter-spacing: 0;
  line-height: 1.3;
}

.fw-calc-head__lead {
  max-width: 62ch;
  margin: 12px 0 0;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--nv-muted, #64748b);
}

@media (max-width: 600px) {
  .fw-calc-head {
    margin-block: 20px;
    padding-block-end: 18px;
  }

  .fw-calc-head__lead {
    font-size: 15.5px;
  }
}

.fw-calc__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .fw-calc__layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.fw-calc__panel {
  padding: 20px;
  border: 1px solid var(--nv-line, #e4e9f2);
  border-radius: var(--nv-radius, 14px);
  background: var(--nv-bg, #fff);
  box-shadow: var(--nv-shadow, none);
}

.fw-calc__step {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--nv-ink, #0f172a);
}

.fw-calc__shapes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.fw-calc__shape {
  position: relative;
}

.fw-calc__shape input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fw-calc__shape label {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid var(--nv-line, #e4e9f2);
  border-radius: var(--nv-radius-sm, 8px);
  background: var(--nv-bg-soft, #f4f7fc);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--nv-text, #334155);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}

.fw-calc__shape svg {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.fw-calc__shape input:checked + label {
  border-color: var(--nv-primary, #1885c3);
  background: var(--nv-primary-soft, #e6f2fa);
  color: var(--nv-primary-dark, #116a9e);
}

.fw-calc__shape input:focus-visible + label {
  outline: 2px solid var(--nv-primary, #1885c3);
  outline-offset: 2px;
}

.fw-calc__fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.fw-calc__field {
  display: grid;
  gap: 6px;
}

.fw-calc__field > label,
.fw-calc__field > .fw-calc__field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--nv-ink, #0f172a);
}

.fw-calc__input {
  display: flex;
  min-width: 0;
}

.fw-calc__input input,
.fw-calc__input select,
.fw-calc__field > select,
.fw-calc__field > input {
  min-width: 0;
  height: 42px;
  padding-inline: 12px;
  border: 1px solid var(--nv-line, #e4e9f2);
  background: #fff;
  font: inherit;
  color: var(--nv-ink, #0f172a);
}

.fw-calc__field > select,
.fw-calc__field > input {
  width: 100%;
  border-radius: var(--nv-radius-sm, 8px);
}

.fw-calc__input input {
  flex: 1 1 auto;
  width: 100%;
  border-start-start-radius: var(--nv-radius-sm, 8px);
  border-end-start-radius: var(--nv-radius-sm, 8px);
}

.fw-calc__input select {
  flex: 0 0 auto;
  border-inline-start: 0;
  border-start-end-radius: var(--nv-radius-sm, 8px);
  border-end-end-radius: var(--nv-radius-sm, 8px);
  background: var(--nv-bg-soft, #f4f7fc);
}

.fw-calc__field.is-invalid input {
  border-color: var(--nv-sale, #e11d48);
}

.fw-calc__material {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-block-start: 20px;
}

/* stays in view below the sticky Nova header (about 135px high) */
.fw-calc__result {
  position: sticky;
  inset-block-start: 150px;
  display: grid;
  gap: 14px;
  background: var(--nv-bg-soft, #f4f7fc);
}

/* phones and tablets: one column; the result becomes a compact bar that stays at the bottom of the screen
   while the form scrolls (sticky inside the column, so it settles in place at the end and never covers the footer) */
@media (max-width: 900px) {
  .fw-calc__result {
    inset-block-start: auto;
    inset-block-end: 0;
    z-index: 5;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
    /* the floating chat button (Widgets.WhatsAppChat) sits over the empty end of the bar */
    padding-block: 12px;
    padding-inline: 16px 84px;
    border-color: var(--nv-primary, #1885c3);
    border-end-start-radius: 0;
    border-end-end-radius: 0;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .12);
  }

  .fw-calc__figure strong {
    font-size: 22px;
  }

  .fw-calc__message {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .fw-calc__message:empty {
    display: none;
  }
}

@media (max-width: 600px) {
  .fw-calc {
    gap: 16px;
  }

  .fw-calc__panel {
    padding: 14px;
  }

  .fw-calc__shapes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-block-end: 18px;
  }

  .fw-calc__shape label {
    gap: 4px;
    padding: 8px 4px;
    font-size: 11.5px;
    line-height: 1.25;
  }

  .fw-calc__shape svg {
    width: 34px;
    height: 34px;
  }

  .fw-calc__fields,
  .fw-calc__material {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  /* 16px inputs: iOS Safari zooms into smaller ones */
  .fw-calc__input input,
  .fw-calc__input select,
  .fw-calc__field > select,
  .fw-calc__field > input {
    font-size: 16px;
  }
}

.fw-calc__figure {
  display: grid;
  gap: 2px;
}

.fw-calc__figure span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--nv-muted, #64748b);
}

.fw-calc__figure strong {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  color: var(--nv-ink, #0f172a);
}

.fw-calc__figure small {
  color: var(--nv-muted, #64748b);
}

.fw-calc__message {
  margin: 0;
  min-height: 1.4em;
  font-size: 13px;
  color: var(--nv-sale, #e11d48);
}

.fw-calc__disclaimer {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--nv-muted, #64748b);
}
