/* Exterior Door step-by-step configurator. Builds on the Pergola tokens and
   .rup-pg__pill / .rup-pg__swatch components (pergola-frontend.css); the
   wrapper also carries .rup-pg-equivalent tokens so it works standalone. */
.rup-ed {
  --ed-ink: var(--rankup-front-text, #111827);
  --ed-muted: var(--rankup-front-muted, #667085);
  --ed-line: var(--rankup-front-border, #dbe2ec);
  --ed-soft: var(--rankup-front-soft, #f7f9fc);
  --ed-bg: var(--rankup-front-bg, #fff);
  --ed-accent: var(--rankup-front-blue, #245fd2);
  --ed-success: #1f7a3a;
  --pg-ink: var(--ed-ink);
  --pg-muted: var(--ed-muted);
  --pg-line: var(--ed-line);
  --pg-line-strong: var(--rankup-front-border-strong, #9eb8e7);
  --pg-soft-2: var(--rankup-front-soft-2, #eef4ff);
  --pg-bg: var(--ed-bg);
  --pg-accent: var(--ed-accent);
  --pg-radius: var(--rankup-radius, 0px);
  --pg-space-xs: 8px;
  --pg-space-sm: 12px;
  --pg-space-md: 16px;
  margin: 20px 0 16px;
  padding: 12px 16px 16px;
  border: 1px solid var(--ed-line);
  background: var(--ed-bg);
  color: var(--ed-ink);
}

.rup-ed *,
.rup-ed *::before,
.rup-ed *::after {
  box-sizing: border-box;
}

.rup-ed button {
  font: inherit;
}

/* Clear Configurator */
.rup-ed__toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 4px;
}

.rup-ed__clear {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ed-muted);
  font-size: 12px !important;
  text-decoration: underline;
  cursor: pointer;
}

.rup-ed__clear:hover {
  color: var(--ed-ink);
}

/* Step rows */
.rup-ed__step {
  border-bottom: 1px solid var(--ed-line);
}

.rup-ed__step.is-locked {
  display: none;
}

.rup-ed__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.3;
}

.rup-ed__title {
  color: var(--ed-ink);
  font-weight: 700;
}

.rup-ed__title .required {
  color: var(--rankup-front-danger, #c1121f);
}

.rup-ed__value {
  color: var(--ed-success);
  font-weight: 700;
}

.rup-ed__edit {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid var(--ed-line);
  background: var(--ed-soft);
  color: var(--ed-muted);
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}

.rup-ed__edit:hover {
  border-color: var(--ed-ink);
  color: var(--ed-ink);
}

.rup-ed__body {
  display: none;
  padding: 8px 0 16px;
}

.rup-ed__step.is-open .rup-ed__body {
  display: block;
}

/* Size grid: "30"x96" = $449" buttons, two per row like the reference */
.rup-ed .rup-ed__sizes {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.rup-ed .rup-ed__size {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* Single / Double door cards with outline icon */
.rup-ed .rup-ed__configurations {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.rup-ed .rup-ed__configuration {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 110px;
  padding: 12px 14px 10px;
  font-weight: 500;
  font-size: 14px;
}

.rup-ed__configuration-icon {
  display: block;
  height: 80px;
  width: auto;
  fill: none;
  stroke: #8c8f94;
  stroke-width: 3;
}

.rup-ed__configuration-icon rect + rect {
  fill: var(--ed-soft);
  stroke-width: 2;
}

.rup-ed__configuration.is-active .rup-ed__configuration-icon {
  stroke: var(--ed-accent);
}

/* Color swatches: show the name under each swatch inside the wizard */
.rup-ed .rup-ed__swatches {
  gap: 14px 12px;
}

.rup-ed .rup-ed__swatch {
  width: auto;
  min-width: 56px;
  height: auto;
  gap: 4px;
}

.rup-ed .rup-ed__swatch em {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  color: var(--ed-muted);
  font-size: 12px;
  font-style: normal;
}

/* Finished state */
.rup-ed__done {
  padding-top: 14px;
}

.rup-ed__done-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
}

/* Woo qty + Add to Cart stay hidden until every step is done. */
form.cart.rup-ed-incomplete .quantity,
form.cart.rup-ed-incomplete .single_add_to_cart_button {
  display: none !important;
}

@media (max-width: 480px) {
  .rup-ed {
    padding: 8px 12px 12px;
  }

  .rup-ed .rup-ed__sizes {
    grid-template-columns: 1fr 1fr;
  }

  .rup-ed .rup-ed__size {
    font-size: 13px;
    white-space: normal;
  }
}
