/* ============================================================
   prices.css — PricesController#index (undervognsbehandling-pris)
   ------------------------------------------------------------
   Everything is scoped under .pricing so it cannot collide with
   the legacy `.prices` rules in app.css (which style admin price
   tables and the old .prices__calculator).

   Do NOT add the `prices` class to the wrapper any more — this
   file replaces it. See _NOTES.md.
   ============================================================ */

.pricing {
  /* --- ink & surfaces (warm neutrals, matching confirmation_card.css) --- */
  --pp-ink: #1a1a18;
  --pp-body: #3d3c38;
  --pp-muted: #6b6a65;
  --pp-faint: #a8a69f;
  --pp-line: rgba(0, 0, 0, 0.11);
  --pp-line-soft: rgba(0, 0, 0, 0.06);
  --pp-surface: #ffffff;
  --pp-wash: #f7f6f3;

  /* --- brand --- */
  --pp-red: #bf1e2e;
  --pp-red-deep: #991825;
  --pp-green: #007f4e;
  --pp-green-deep: #0f6e56;
  --pp-green-wash: #e1f5ee;

  /* --- shape & rhythm --- */
  --pp-radius: 10px;
  --pp-radius-sm: 6px;
  --pp-gap: 1rem;
  --pp-measure: 68ch;

  color: var(--pp-body);
  text-align: left;
  padding: 1.5rem 1rem 3rem;
  max-width: 78rem;
  margin: 0 auto;
}

@media print, screen and (min-width: 40em) {
  .pricing {
    padding: 2.5rem 2rem 4rem;
  }
}

/* ------------------------------------------------------------
   1. Prose
   ------------------------------------------------------------ */

/* --- inline emphasis ---
   app.css sets `strong, b { font-weight: 900 }` sitewide, which is
   Raleway Black — far heavier than the emphasis used on the front page
   ("...din bil til rustbeskyttelse i din lokale synshal...").

   Only Raleway 100/400/500/900 are loaded, so 600 and 700 have no
   matching face and CSS font-matching rounds them *up* to 900 as well.
   500 (Medium) is the only genuinely lighter step available, so the
   emphasis comes from a small weight bump plus slightly darker ink
   rather than from sheer weight. */
.pricing strong,
.pricing b {
  font-weight: 500;
  color: var(--pp-ink);
}

/* Where the surrounding text is not body ink (the green summary band,
   the tier rows), keep the inherited colour and let weight alone carry
   the emphasis. */
.pp-summary strong,
.pp-summary b,
.pp-tier strong,
.pp-tier b {
  color: inherit;
}

.pricing__lead,
.pricing > p,
.pricing__prose p {
  max-width: var(--pp-measure);
  line-height: 1.65;
}

.pricing__lead {
  font-size: 1.0625rem;
  color: var(--pp-body);
}

.pricing h1 {
  font-size: clamp(1.55rem, calc(1.15rem + 1.7vw), 2.25rem);
  line-height: 1.2;
  color: var(--pp-ink);
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.pricing h2 {
  font-size: clamp(1.2rem, calc(1.02rem + 0.8vw), 1.5rem);
  line-height: 1.25;
  color: var(--pp-ink);
  margin: 2.5rem 0 0.6rem;
  text-wrap: balance;
}

.pricing h3 {
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--pp-ink);
  margin: 0;
}

/* Sections own the vertical rhythm between blocks. A heading that
   opens a section drops its own top margin so the two don't stack. */
.pricing > section,
.pricing > .pricing__prose {
  margin-top: 2.75rem;
}

.pricing > section > :first-child,
.pricing > .pricing__prose > :first-child {
  margin-top: 0;
}

.pricing > :first-child {
  margin-top: 0;
}

/* The summary band sits tight under its own h2. */
.pricing > .pp-summary {
  margin-top: 1.25rem;
}

/* ------------------------------------------------------------
   2. Breadcrumbs
   ------------------------------------------------------------ */

.pp-crumbs {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  color: var(--pp-muted);
}

.pp-crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.5rem;
}

.pp-crumbs li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.pp-crumbs li + li::before {
  content: "/";
  color: var(--pp-faint);
}

.pp-crumbs a {
  color: var(--pp-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--pp-line);
}

.pp-crumbs a:hover,
.pp-crumbs a:focus-visible {
  color: var(--pp-green-deep);
  border-bottom-color: currentColor;
}

.pp-crumbs [aria-current="page"] {
  color: var(--pp-ink);
  font-weight: 600;
}

/* ------------------------------------------------------------
   3. Price summary band
   The "from X to Y" answer, stated once, up top.
   ------------------------------------------------------------ */

.pp-summary {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  margin: 1.25rem 0;
  padding: 1.15rem 1.35rem;
  max-width: 46rem;
  background: var(--pp-green-wash);
  border-radius: var(--pp-radius);
}

.pp-summary__label {
  margin: 0;
  max-width: 60ch;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--pp-green-deep);
  opacity: 0.9;
}

/* An amount must never be split from its currency across a line break.
   dkk() emits an ordinary space, so "9.990,00" and "DKK" can land on
   separate lines at narrow widths — which is the ambiguity the DKK
   suffix exists to prevent in the first place. */
.pp-nowrap,
.pp-price__value,
.pp-price__was,
.pp-price__save {
  white-space: nowrap;
}

.pp-summary__range {
  margin: 0;
  font-size: clamp(1.25rem, calc(1.05rem + 0.9vw), 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--pp-green-deep);
  font-variant-numeric: tabular-nums;
}

.pp-summary__note {
  margin: 0.1rem 0 0;
  font-size: 0.8125rem;
  color: var(--pp-green-deep);
  opacity: 0.85;
}

/* ------------------------------------------------------------
   4. Treatment tiers — the main event
   A ladder, not a card grid: rows survive wildly uneven
   description lengths, and the left rail darkens as the
   treatment gets more thorough.
   ------------------------------------------------------------ */

.pp-tiers {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  counter-reset: pp-tier;
}

.pp-tier {
  margin: 0;
  background: var(--pp-surface);
  border: 1px solid var(--pp-line);
  border-left: 4px solid var(--pp-green);
  border-radius: var(--pp-radius);
  /* Ladder: each rung reads a little heavier than the last. */
  border-left-color: #8cc5af;
}

.pp-tier:nth-child(2) {
  border-left-color: #59ac8c;
}

.pp-tier:nth-child(3) {
  border-left-color: #269269;
}

.pp-tier:nth-child(n + 4) {
  border-left-color: var(--pp-green);
}

/* Optional: mark one treatment as the house recommendation by
   adding `pp-tier--pick` in the view. Not applied automatically. */
.pp-tier--pick {
  border-color: var(--pp-green);
  box-shadow: 0 0 0 1px var(--pp-green) inset;
}

.pp-tier__inner {
  display: grid;
  gap: 0.5rem 1.75rem;
  padding: 1.15rem 1.25rem;
}

@media print, screen and (min-width: 48em) {
  .pp-tier__inner {
    grid-template-columns: minmax(0, 1fr) 15.5rem;
    align-items: start;
    padding: 1.4rem 1.5rem;
  }
}

.pp-tier__name {
  counter-increment: pp-tier;
  margin: 0 0 0.35rem;
}

.pp-tier__desc {
  margin: 0;
  max-width: 60ch;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--pp-muted);
}

.pp-tier__desc:empty {
  display: none;
}

/* --- price block --- */

.pp-tier__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding-top: 0.25rem;
}

@media print, screen and (min-width: 48em) {
  .pp-tier__aside {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-items: flex-end;
    text-align: right;
    padding-top: 0;
  }
}

.pp-price {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

@media print, screen and (min-width: 48em) {
  .pp-price {
    align-items: flex-end;
  }
}

.pp-price__label {
  font-size: 0.75rem;
  color: var(--pp-muted);
  line-height: 1.2;
}

.pp-price__value {
  font-size: clamp(1.35rem, calc(1.15rem + 0.8vw), 1.7rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--pp-green-deep);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Normalpris and the saving share one line — stacking them made the
   price column taller than a short description, which left a hole in
   the row on two-product departments. */
.pp-price__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}

@media print, screen and (min-width: 48em) {
  .pp-price__meta {
    justify-content: flex-end;
  }
}

.pp-price__was {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--pp-faint);
  font-variant-numeric: tabular-nums;
}

.pp-price__was s {
  text-decoration-thickness: 1px;
}

.pp-price__save {
  margin: 0;
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #f9e9ea;
  color: var(--pp-red-deep);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --- CTA --- */

.pp-btn {
  display: inline-block;
  width: 100%;
  padding: 0.62rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--pp-radius-sm);
  background: var(--pp-green);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease-out;
}

.pp-btn:hover,
.pp-btn:focus-visible {
  background: var(--pp-green-deep);
  color: #fff;
}

.pp-tier__cta {
  width: 100%;
  margin-top: 0.15rem;
}

@media print, screen and (min-width: 48em) {
  .pp-tier__cta {
    max-width: 15.5rem;
  }
}

/* ------------------------------------------------------------
   5. Step selector
   A genuine 3–4 step sequence, so the numbering earns its place.
   ------------------------------------------------------------ */

.pp-steps {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  counter-reset: pp-step;
}

@media print, screen and (min-width: 48em) {
  .pp-steps {
    grid-template-columns: repeat(var(--pp-step-count, 3), minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.pp-step {
  margin: 0;
  min-width: 0;
  position: relative;
}

.pp-step__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  min-height: 2rem;
}

.pp-step__num {
  counter-increment: pp-step;
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pp-surface);
  border: 1.5px solid var(--pp-line);
  color: var(--pp-faint);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pp-step__num::before {
  content: counter(pp-step);
}

/* Done: this choice has been made. */
.pp-step--done .pp-step__num {
  background: var(--pp-green);
  border-color: var(--pp-green);
  color: #fff;
}

.pp-step--done .pp-step__num::before {
  content: "\2713";
  font-size: 0.95rem;
}

/* Current: this is what we need next. */
.pp-step--current .pp-step__num {
  background: var(--pp-red);
  border-color: var(--pp-red);
  color: #fff;
}

.pp-step__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pp-ink);
}

.pp-step--todo .pp-step__title {
  color: var(--pp-muted);
}

/* --- the control itself --- */

.pp-select {
  display: block;
  width: 100%;
  height: auto;
  min-height: 2.9rem;
  margin: 0;
  padding: 0.75rem 2.75rem 0.75rem 0.9rem;
  border: 1px solid var(--pp-line);
  border-radius: var(--pp-radius-sm);
  background-color: var(--pp-surface);
  /* Chevron rather than a solid triangle: lighter, and it matches the
     weight of the surrounding text instead of shouting over it. */
  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 d='M1 1.75L6 6.25L11 1.75' fill='none' stroke='%236b6a65' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-size: 12px 8px;
  background-repeat: no-repeat;
  color: var(--pp-ink);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.4;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.15s ease-out;
}

.pp-select:hover:not(:disabled) {
  border-color: var(--pp-faint);
}

.pp-select:disabled {
  background-color: var(--pp-wash);
  color: var(--pp-faint);
  cursor: not-allowed;
}

.pp-select:focus {
  border-color: var(--pp-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 127, 78, 0.22);
}

/* --- crawlable link list behind a disclosure --- */

.pp-options {
  margin-top: 0.7rem;
  font-size: 0.8125rem;
}

.pp-options > summary {
  color: var(--pp-muted);
  cursor: pointer;
  list-style: revert;
  padding: 0.25rem 0;
}

.pp-options > summary:hover,
.pp-options > summary:focus-visible {
  color: var(--pp-green-deep);
}

.pp-options ul {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.25rem;
  max-height: 15rem;
  overflow-y: auto;
  border: 1px solid var(--pp-line-soft);
  border-radius: var(--pp-radius-sm);
  background: var(--pp-wash);
}

.pp-options li {
  margin: 0;
}

.pp-options a {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  color: var(--pp-body);
  text-decoration: none;
}

.pp-options a:hover,
.pp-options a:focus-visible {
  background: var(--pp-surface);
  color: var(--pp-green-deep);
}

.pp-options [aria-current="page"] {
  font-weight: 700;
  color: var(--pp-green-deep);
}

/* ------------------------------------------------------------
   6. Reasons list
   ------------------------------------------------------------ */

.pp-reasons {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
  max-width: var(--pp-measure);
}

.pp-reasons li {
  position: relative;
  margin: 0;
  padding-left: 1.75rem;
  line-height: 1.55;
}

.pp-reasons li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--pp-green);
  font-weight: 700;
}

/* ------------------------------------------------------------
   7. Accessibility, motion, print
   ------------------------------------------------------------ */

.pricing :focus-visible {
  outline: 2px solid var(--pp-green-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

.pp-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .pricing * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .pp-tier,
  .pp-select,
  .pp-btn {
    border: 1px solid CanvasText;
  }
}

@media print {
  .pricing {
    padding: 0;
  }

  .pp-crumbs,
  .pp-tier__cta,
  .pp-options,
  .pp-steps {
    display: none;
  }

  .pp-tier {
    border: 1px solid #999;
    break-inside: avoid;
  }

  .pp-summary {
    background: none;
    border: 1px solid #999;
  }
}

