/**
 * [cottage_preisrechner] – price calculator (hair removal, EMSCULPT NEO)
 *
 * Design direction A "Clinic Editorial": flat tinted panels, hairlines,
 * uppercase tracked eyebrows, brand lead #495f76. The widget sits inside Divi
 * content, so button/link colours carry !important (Divi 5 prints
 * `a, .et-db #et-boc .et-l a { color }` at specificity 1,3,1).
 *
 * Contrast (WCAG AA): --wa-muted 5.5:1 on white / 5.0:1 on the tint result
 * panel, --wa-success 5.4:1 on white, --wa-warn 5.3:1 on --wa-warn-bg; the
 * focus ring (white gap + lead) is 6.6:1 on white and 6.0:1 on tint. The popup
 * maps the same variables to the V3 tokens (v3/assets/css/steps-catalogue.css).
 */
.wa-calc-shell {
    --wa-lead: #495f76;
    --wa-lead-600: #3d4f63;
    --wa-secondary: #769cc1;
    --wa-tint: #f1f4f7;
    --wa-line: #e5eaee;
    --wa-text: #2f3a47;
    --wa-muted: #5c6a7b;
    --wa-success: #56705f;
    --wa-warn: #8a5f00;
    --wa-warn-bg: #fff7e0;
    --wa-focus: 0 0 0 2px #fff, 0 0 0 4px var(--wa-lead);
    --wa-r-card: 12px;
    --wa-r-ctrl: 10px;
    --wa-tap: 44px;
    color: var(--wa-text);
    max-width: 100%;
    margin: 0 0 32px;
}

.wa-calc-shell * { box-sizing: border-box; }

.wa-calc-shell .wa-calc__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--wa-lead);
    line-height: 1.25;
}

.wa-calc-shell .wa-calc__intro {
    margin: 0 0 24px;
    color: var(--wa-muted);
    line-height: 1.6;
    padding-bottom: 0;
}

/* ---------------------------------------------------------------- layout */
.wa-calc {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

/* calculator.js toggles result parts with [hidden]; the part classes set display */
.wa-calc [hidden] { display: none !important; }

/* the status node (role=status) that announces each new total */
.wa-calc .wa-calc__sr {
    position: absolute;
    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 (min-width: 981px) {
    .wa-calc--page {
        grid-template-columns: minmax(0, 1fr) 340px;
        align-items: start;
    }
    .wa-calc--page .wa-calc__result {
        position: sticky;
        top: 24px;
    }
    .wa-calc--page .wa-calc__notes {
        grid-column: 1 / -1;
    }
}

/* ---------------------------------------------------------------- chips */
.wa-calc__groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wa-calc__group {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.wa-calc__legend {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--wa-muted);
}

.wa-calc__legend-price {
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--wa-lead);
}

.wa-calc__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wa-calc__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--wa-tap);
    padding: 0 14px;
    border: 1px solid var(--wa-line);
    border-radius: 999px;
    background: #fff;
    color: var(--wa-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
    margin: 0;
}

.wa-calc__chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.wa-calc__chip:hover { border-color: var(--wa-secondary); }

/* Keyboard focus on the hidden checkbox/radio: ring on the chip or plan card. Browsers without :has()
   fall back to :focus-within (also shown after a click). */
.wa-calc__chip:has(input:focus-visible),
.wa-calc__plan:has(input:focus-visible) {
    outline: none;
    box-shadow: var(--wa-focus);
}

@supports not selector(:has(*)) {
    .wa-calc__chip:focus-within,
    .wa-calc__plan:focus-within {
        outline: none;
        box-shadow: var(--wa-focus);
    }
}

.wa-calc__chip.is-selected {
    background: var(--wa-lead);
    border-color: var(--wa-lead);
    color: #fff;
}

.wa-calc__chip.is-selected::before {
    content: "";
    width: 8px;
    height: 13px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -2px);
    flex-shrink: 0;
}

.wa-calc__chip.is-disabled {
    border-style: dashed;
    color: var(--wa-muted);
    opacity: 0.75;
    cursor: not-allowed;
    background: transparent;
}

.wa-calc__chip-meta {
    font-size: 13px;
    font-weight: 500;
    color: var(--wa-muted);
}

.wa-calc__chip.is-selected .wa-calc__chip-meta { color: rgba(255, 255, 255, 0.85); }

/* ---------------------------------------------------------------- result */
.wa-calc__result {
    background: var(--wa-tint);
    border-radius: var(--wa-r-card);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wa-calc__result p { margin: 0; padding: 0; line-height: 1.5; }

.wa-calc__eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--wa-muted);
    margin-bottom: 4px;
}

.wa-calc__empty { color: var(--wa-muted); }

.wa-calc__selection { font-size: 14px; }

.wa-calc__amount { white-space: nowrap; font-variant-numeric: tabular-nums; }

.wa-calc__formula {
    font-size: 14px;
    color: var(--wa-muted);
    font-variant-numeric: tabular-nums;
}

.wa-calc__formula strong { color: var(--wa-text); }

.wa-calc__badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--wa-warn-bg);
    color: var(--wa-warn);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.wa-calc__plans {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wa-calc__plan {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    grid-template-areas: "mark name total" "mark per per";
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    padding: 12px 14px;
    border: 2px solid var(--wa-line);
    border-radius: var(--wa-r-card);
    background: #fff;
    cursor: pointer;
    margin: 0;
    transition: border-color 140ms ease;
}

.wa-calc__plan input {
    grid-area: mark;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--wa-lead);
}

.wa-calc__plan.is-selected { border-color: var(--wa-lead); }

.wa-calc__plan.is-disabled { opacity: 0.55; cursor: not-allowed; }

.wa-calc__plan-name { grid-area: name; font-weight: 700; font-size: 15px; }

.wa-calc__plan-name em {
    font-style: normal;
    font-weight: 600;
    font-size: 12px;
    color: var(--wa-success);
    margin-left: 6px;
}

.wa-calc__plan-total {
    grid-area: total;
    font-weight: 700;
    font-size: 18px;
    color: var(--wa-lead);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.wa-calc__plan-per { grid-area: per; font-size: 12px; color: var(--wa-muted); }

.wa-calc__hint {
    font-size: 13px;
    color: var(--wa-warn);
    background: var(--wa-warn-bg);
    border-radius: 8px;
    padding: 8px 10px;
}

.wa-calc__packages { font-size: 13px; color: var(--wa-muted); line-height: 1.5; }

.wa-calc .wa-calc__package-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    line-height: 1.5;
}

.wa-calc .wa-calc__package-list li { margin: 0; padding: 0; }

.wa-calc__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--wa-line);
    padding-top: 12px;
    font-size: 15px;
}

.wa-calc__total strong {
    font-size: 24px;
    color: var(--wa-lead);
    font-variant-numeric: tabular-nums;
}

.wa-calc__reset { margin: 0 0 -8px -4px; }

.wa-calc__reset-btn {
    display: inline-flex;
    align-items: center;
    min-height: var(--wa-tap);
    background: none;
    border: 0;
    padding: 0 4px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--wa-lead) !important;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.wa-calc__reset-btn:focus-visible {
    outline: 2px solid transparent; /* visible in forced-colors mode */
    box-shadow: var(--wa-focus);
    border-radius: 4px;
}

/* ---------------------------------------------------------------- actions (rendered by PHP, outside the mount) */
.wa-calc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.wa-calc-shell .wa-calc-book,
.wa-calc-shell .wa-calc-book:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--wa-tap);
    padding: 0 28px;
    border-radius: var(--wa-r-ctrl);
    background: var(--wa-lead) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    border: 0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.wa-calc-shell .wa-calc-book:hover,
.wa-calc-shell .wa-calc-book:focus-visible {
    background: var(--wa-lead-600) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.wa-calc-shell .wa-calc-book:focus-visible {
    outline: 2px solid transparent; /* visible in forced-colors mode */
    box-shadow: var(--wa-focus);
}

.wa-calc-shell .wa-calc-book.is-disabled,
.wa-calc-shell .wa-calc-book[disabled] {
    background: var(--wa-line) !important;
    color: var(--wa-muted) !important;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.wa-calc__actions-hint { font-size: 13px; color: var(--wa-muted); margin: 0; padding: 0; }

/* ---------------------------------------------------------------- notes */
.wa-calc__notes {
    border-top: 1px solid var(--wa-line);
    padding-top: 16px;
}

.wa-calc__notes ul {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 13px;
    color: var(--wa-muted);
    line-height: 1.55;
}

.wa-calc__notes li { margin: 0 0 4px; }

.wa-calc-shell noscript a { color: var(--wa-lead) !important; }

@media (prefers-reduced-motion: reduce) {
    .wa-calc__chip, .wa-calc__plan, .wa-calc-shell .wa-calc-book { transition: none; }
}

@media (max-width: 480px) {
    .wa-calc__result { padding: 16px; }
    .wa-calc__chip { font-size: 14px; padding: 0 12px; }
}

/* ---------------------------------------------------------------- forced colours */
/* Windows contrast themes drop box-shadows and author fills: the chip checkbox is hidden, so keyboard focus
   becomes a system outline on the chip or plan card and the selected chip gets the system Highlight fill. */
@media (forced-colors: active) {
    .wa-calc__chip:has(input:focus-visible),
    .wa-calc__plan:has(input:focus-visible) {
        outline: 2px solid Highlight;
        outline-offset: 2px;
    }

    .wa-calc__chip.is-selected {
        forced-color-adjust: none;
        background: Highlight;
        border-color: Highlight;
        color: HighlightText;
    }

    .wa-calc__chip.is-selected::before { border-color: HighlightText; }

    .wa-calc__chip.is-selected .wa-calc__chip-meta { color: HighlightText; }
}

@media (forced-colors: active) {
    @supports not selector(:has(*)) {
        .wa-calc__chip:focus-within,
        .wa-calc__plan:focus-within {
            outline: 2px solid Highlight;
            outline-offset: 2px;
        }
    }
}
