.lzfc {
  --calculator-accent: #ff6500;
  --calculator-text: #eeeeee;
  --calculator-muted: #b8bcba;
  --calculator-line: #424746;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 48px);
  background: #35383a;
  color: var(--calculator-text);
  border-top: 3px solid var(--calculator-accent);
  scroll-margin-top: 110px;
}

.lzfc,
.lzfc * {
  box-sizing: border-box;
}

.lzfc [hidden] {
  display: none !important;
}

.lzfc__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.lzfc .lzfc__title {
  margin: 0;
  color: var(--calculator-text);
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.15;
}

.lzfc__intro {
  max-width: 650px;
  margin: 14px 0 0;
  color: #e1e4e2;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.55;
}

.lzfc button,
.lzfc__button {
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
  cursor: pointer;
  transition:
    background-color 150ms,
    border-color 150ms;
}

.lzfc .lzfc__toggle,
.lzfc .lzfc__button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  min-height: 50px;
  padding: 14px 24px;
  color: #fff;
  background: var(--calculator-accent);
  border: 1px solid var(--calculator-accent);
  text-decoration: none;
}

.lzfc .lzfc__toggle[aria-expanded="true"],
.lzfc .lzfc__back {
  padding: 12px 0;
  min-height: 44px;
  color: var(--calculator-muted);
  background: transparent;
  border: 0;
}

.lzfc__toggle[aria-expanded="true"] > span:last-child {
  display: none;
}

.lzfc .lzfc__button:hover,
.lzfc .lzfc__toggle[aria-expanded="false"]:hover {
  background: #ff8536;
  border-color: #ff8536;
}

.lzfc .lzfc__back:hover,
.lzfc .lzfc__toggle[aria-expanded="true"]:hover {
  color: var(--calculator-text);
}

.lzfc :is(button, a, summary):focus-visible {
  outline: 2px solid var(--calculator-accent);
  outline-offset: 4px;
}

.lzfc button:disabled {
  opacity: 0.45;
  cursor: default;
}

.lzfc__content {
  margin-top: 32px;
}

.lzfc__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.lzfc .lzfc__steps button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 0;
  text-align: left;
  color: var(--calculator-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--calculator-line);
}

.lzfc .lzfc__steps button span {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.lzfc .lzfc__steps button[aria-current="step"] {
  color: var(--calculator-text);
  border-bottom-color: var(--calculator-accent);
}

.lzfc .lzfc__steps button:not(:disabled):hover {
  color: var(--calculator-text);
  background: transparent;
}

.lzfc__form,
.lzfc__result {
  margin: 0;
  padding: 0;
  border: 0;
}

.lzfc__step {
  display: flow-root;
}

.lzfc :is(.lzfc__step, .lzfc__result) h3 {
  margin: 0 0 24px;
  color: var(--calculator-text);
  font-size: 28px;
  line-height: 1.2;
  text-transform: none;
}

.lzfc h3:focus,
.lzfc__step:focus {
  outline: none;
}

.lzfc__group {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.lzfc__group > legend,
.lzfc__field > span {
  display: block;
  width: auto;
  padding: 0;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--calculator-text);
  text-align: left;
}

.lzfc__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

[data-lz-field="post_type"] .lzfc__cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lzfc__cards--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lzfc__card,
.lzfc__choice {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.lzfc__card > input,
.lzfc__choice > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.lzfc__card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--calculator-line);
  background: #272d2b;
}

.lzfc__card strong {
  display: block;
  padding: 12px 14px;
  color: var(--calculator-text);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
}

.lzfc__card-image {
  display: block;
  position: relative;
  height: 108px;
  overflow: hidden;
}

.lzfc__card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-lz-field="post_type"] .lzfc__card-content {
  flex-direction: row;
  align-items: center;
}

[data-lz-field="post_type"] .lzfc__card-image {
  width: 88px;
  height: 72px;
  flex: 0 0 auto;
}

.lzfc__card-image--empty {
  background: #272d2b;
}

.lzfc__card-image--empty::after {
  content: "—";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--calculator-muted);
  font-size: 32px;
}

.lzfc__card--plain .lzfc__card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
}

.lzfc__none-icon {
  position: relative;
  display: block;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  color: var(--calculator-muted);
  border: 3px solid currentColor;
  border-radius: 50%;
}

.lzfc__none-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 3px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.lzfc__card--plain strong {
  padding: 0;
  font-size: 15px;
  text-align: center;
}

.lzfc__card input:checked + .lzfc__card-content,
.lzfc__choice input:checked + span {
  border-color: var(--calculator-accent);
  box-shadow: none;
}

.lzfc__card input:checked + .lzfc__card-content strong,
.lzfc__choice input:checked + span {
  color: #ff9a57;
}

.lzfc__card:hover .lzfc__card-content,
.lzfc__choice:hover span {
  border-color: #929994;
}

.lzfc__card:hover input:checked + .lzfc__card-content,
.lzfc__choice:hover input:checked + span {
  border-color: var(--calculator-accent);
}

.lzfc__card input:focus-visible + .lzfc__card-content,
.lzfc__choice input:focus-visible + span {
  outline: 2px solid var(--calculator-accent);
  outline-offset: 4px;
}

.lzfc__gate-options,
.lzfc__project-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

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

.lzfc__step > .lzfc__group:last-child,
.lzfc__gate-options > .lzfc__group,
.lzfc__project-fields > .lzfc__group {
  margin-bottom: 0;
}

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

.lzfc__choice span {
  display: block;
  padding: 14px 8px;
  height: 50px;
  text-align: center;
  line-height: 20px;
  color: var(--calculator-text);
  background: #272d2b;
  border: 1px solid var(--calculator-line);
  font-size: 16px;
}

.lzfc__field {
  display: block;
  margin: 0;
}

.lzfc .lzfc__field input[type="text"] {
  display: block;
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 12px 14px;
  background: #191e1c;
  border: 1px solid #626a65;
  border-radius: 0;
  box-shadow: none;
  color: var(--calculator-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  transition: border-color 150ms;
}

.lzfc__field input::placeholder {
  color: #9fa6a1;
  opacity: 1;
}

.lzfc .lzfc__field input[type="text"]:focus {
  border-color: var(--calculator-accent);
  outline: 1px solid var(--calculator-accent);
  outline-offset: 0;
  box-shadow: none;
}

.lzfc__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--calculator-line);
}

.lzfc__actions > .lzfc__button {
  margin-left: auto;
  min-width: 180px;
}

.lzfc__field-error,
.lzfc__form-message {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #ffae92;
}

.lzfc__field-error:empty,
.lzfc__form-message:empty {
  display: none;
}

.lzfc .is-invalid :is(.lzfc__card-content, .lzfc__choice span, input) {
  border-color: #ffae92;
}

.lzfc__selection,
.lzfc__price-note,
.lzfc__disclaimer {
  color: var(--calculator-muted);
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.lzfc__selection {
  max-width: 760px;
  margin: 0 0 28px;
}

.lzfc__total {
  margin: 0;
  color: var(--calculator-text);
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.lzfc__price-note {
  margin: 10px 0 24px;
}

.lzfc__details {
  border-top: 1px solid var(--calculator-line);
  border-bottom: 1px solid var(--calculator-line);
}

.lzfc__details summary {
  padding: 18px 0;
  color: var(--calculator-text);
  font-size: 16px;
  cursor: pointer;
}

.lzfc__breakdown {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 20px;
  padding: 0 0 24px;
  margin: 0;
  font-size: 15px;
}

.lzfc__breakdown :is(dt, dd) {
  margin: 0;
  color: var(--calculator-text);
}

.lzfc__breakdown dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lzfc__breakdown :is(dt, dd):nth-last-child(-n + 2) {
  padding-top: 12px;
  border-top: 1px solid var(--calculator-line);
  font-weight: 700;
}

.lzfc__disclaimer {
  margin: 20px 0 0;
}

@media (max-width: 600px) {
  .lzfc {
    padding: 24px 18px;
    scroll-margin-top: 84px;
  }
  .lzfc__header {
    align-items: center;
    gap: 16px;
  }
  .lzfc__header > div {
    min-width: 0;
  }
  .lzfc .lzfc__title {
    font-size: 28px;
  }
  .lzfc .lzfc__toggle[aria-expanded="false"] {
    padding-inline: 14px;
    gap: 10px;
  }
  .lzfc__content {
    margin-top: 20px;
  }
  .lzfc__steps {
    gap: 12px;
    margin-bottom: 24px;
  }
  .lzfc .lzfc__steps button {
    font-size: 14px;
    gap: 6px;
  }
  .lzfc__cards,
  [data-lz-field="post_type"] .lzfc__cards,
  .lzfc__cards--four {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .lzfc__card-content {
    flex-direction: row;
    align-items: center;
  }
  .lzfc__card-image,
  [data-lz-field="post_type"] .lzfc__card-image {
    width: 80px;
    height: 60px;
    flex: 0 0 auto;
  }
  .lzfc__gate-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }
  .lzfc__project-fields {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .lzfc__actions {
    gap: 16px;
  }
  .lzfc__actions > .lzfc__button {
    min-width: 0;
    padding-inline: 18px;
  }
  .lzfc__result .lzfc__actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .lzfc__result .lzfc__button {
    margin-left: 0;
  }
  .lzfc__selection {
    margin-bottom: 20px;
  }
}

/* The full-width calculator section. */
.elementor-71 .elementor-element.elementor-element-48505e0 {
  background: #35383a;
}
/* Keep the calculator box distinct from the gray surrounding section. */
.lzfc {
  background: #191d1c;
}
/* Center the calculator box within its gray full-width section. */
.elementor-71 .elementor-element.elementor-element-48505e0 {
  padding-block: clamp(72px, 7vw, 112px) !important;
}
/* Reset Elementor's inherited section padding, then apply equal spacing. */
.elementor-71 .elementor-element.elementor-element-48505e0 {
  --padding-top: 0px !important;
  --padding-bottom: 0px !important;
  min-height: 0 !important;
  padding-top: clamp(72px, 7vw, 112px) !important;
  padding-bottom: clamp(72px, 7vw, 112px) !important;
}
/* Keep the main visual option cards the same height on tablet and desktop. */
@media (min-width: 601px) {
  [data-lz-field="post_type"] .lzfc__card-content {
    flex-direction: column;
    align-items: stretch;
  }
  [data-lz-field="fence_type"] .lzfc__card-image,
  [data-lz-field="panel_height"] .lzfc__card-image,
  [data-lz-field="large_gate"] .lzfc__card-image,
  [data-lz-field="post_type"] .lzfc__card-image {
    width: 100%;
    height: clamp(140px, 12vw, 190px);
    flex: 0 0 auto;
  }
  [data-lz-field="fence_type"] .lzfc__card-image img,
  [data-lz-field="post_type"] .lzfc__card-image img {
    object-position: center 68%;
  }
  [data-lz-field="post_type"] input[data-post-kind="metal"] + .lzfc__card-content .lzfc__card-image img {
    object-position: center 42%;
  }
}
/* Match the previous-step control to the open calculator's Aizvērt control. */
.lzfc button.lzfc__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 0 !important;
  color: var(--calculator-muted);
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-decoration: none;
}
.lzfc button.lzfc__back:hover { color: var(--calculator-text); }

/* Give the full calculation label its own row on narrow phones. */
@media (max-width: 380px) {
  .lzfc__form > .lzfc__actions { flex-wrap: wrap; }
  .lzfc__form > .lzfc__actions > .lzfc__button { flex: 0 0 100%; margin-left: 0; }
}

/* Keep the no-gate option consistent with gate cards on tablet. */
@media (min-width: 601px) and (max-width: 1024px) {
  [data-lz-field="large_gate"] .lzfc__card--plain .lzfc__card-content { align-items: stretch; justify-content: flex-start; gap: 0; padding: 0; }
  [data-lz-field="large_gate"] .lzfc__card--plain .lzfc__none-icon { width: 100%; height: clamp(140px, 12vw, 190px); border: 0; border-radius: 0; }
  [data-lz-field="large_gate"] .lzfc__card--plain .lzfc__none-icon::before { position: absolute; top: 50%; left: 50%; width: 50px; height: 50px; border: 3px solid currentColor; border-radius: 50%; content: ""; transform: translate(-50%, -50%); }
  [data-lz-field="large_gate"] .lzfc__card--plain strong { padding: 12px 14px; text-align: left; }
}
/* On phones, match the horizontal thumbnail-and-label gate card layout. */
@media (max-width: 600px) {
  [data-lz-field="large_gate"] .lzfc__card--plain .lzfc__card-content { flex-direction: row; align-items: center; justify-content: flex-start; gap: 0; padding: 0; }
  [data-lz-field="large_gate"] .lzfc__card--plain .lzfc__none-icon { width: 80px; height: 60px; border: 0; border-radius: 0; }
  [data-lz-field="large_gate"] .lzfc__card--plain .lzfc__none-icon::before { position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; border: 3px solid currentColor; border-radius: 50%; content: ""; transform: translate(-50%, -50%); }
  [data-lz-field="large_gate"] .lzfc__card--plain .lzfc__none-icon::after { width: 36px; }
  [data-lz-field="large_gate"] .lzfc__card--plain strong { padding: 12px 14px; text-align: left; }
}
