/* Bestelwizard: voortgang, stappen, keuzes, plattegrond en kasten. Bouwt op frontend.css. */

.zwfc-progress {
    margin: 20px 0 0;
    overflow-x: auto;
}

.zwfc-progress ol {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.zwfc-progress li {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}

.zwfc-progress button {
    display: flex;
    width: 100%;
    min-height: 48px;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--zwfc-border);
    border-radius: 12px;
    background: #fff;
    color: var(--zwfc-ink);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
}

.zwfc-progress button span {
    display: grid;
    width: 26px;
    height: 26px;
    flex: none;
    place-items: center;
    border-radius: 50%;
    background: var(--zwfc-beige);
    color: var(--zwfc-wine);
    font-size: 13px;
}

.zwfc-progress button[disabled] {
    cursor: default;
    color: var(--zwfc-muted);
    opacity: .6;
}

.zwfc-progress .is-done button span {
    background: var(--zwfc-gold);
    color: #fff;
}

.zwfc-progress button[aria-current="step"] {
    border-color: var(--zwfc-wine);
    background: var(--zwfc-wine);
    color: #fff;
}

.zwfc-progress button[aria-current="step"] span {
    background: #fff;
    color: var(--zwfc-wine);
}

.zwfc-wizard-step {
    margin-top: 20px;
}

.zwfc-wizard-step > .zwfc-card + .zwfc-card {
    margin-top: 20px;
}

.zwfc-step-title {
    margin: 0 0 8px;
    color: var(--zwfc-wine);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(24px, 2.6vw, 30px);
    font-weight: 500;
}

.zwfc-step-title:focus {
    outline: none;
}

.zwfc-step-intro {
    max-width: 70ch;
    margin: 0 0 18px;
    color: var(--zwfc-muted);
    line-height: 1.55;
}

.zwfc-step-nav {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 16px;
}

.zwfc-step-error {
    margin: 12px 0 0;
    color: var(--zwfc-error);
    font-weight: 700;
}

.zwfc-wizard-noscript {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    background: var(--zwfc-error-bg);
    color: var(--zwfc-error);
}

/* Bij de keukenstappen gaat het om wandmaten; de meetinstructie voor onderdelen komt terug bij het controleren. */
.zwfc-wizard[data-current-step="layout"] .zwfc-hero .zwfc-steps,
.zwfc-wizard[data-current-step="layout"] .zwfc-hero .zwfc-chips,
.zwfc-wizard[data-current-step="plan"] .zwfc-hero .zwfc-steps,
.zwfc-wizard[data-current-step="plan"] .zwfc-hero .zwfc-chips,
.zwfc-wizard[data-current-step="cabinets"] .zwfc-hero .zwfc-steps,
.zwfc-wizard[data-current-step="cabinets"] .zwfc-hero .zwfc-chips {
    display: none;
}

.zwfc-wizard[data-current-step="layout"] .zwfc-hero h2,
.zwfc-wizard[data-current-step="plan"] .zwfc-hero h2,
.zwfc-wizard[data-current-step="cabinets"] .zwfc-hero h2 {
    margin-bottom: 0;
}

/* ---------- Passend in het scherm ----------
   Op een groot scherm zet order-wizard.js de klasse is-fit en de hoogte die
   overblijft onder de wizard. Kop en stappenbalk staan dan vast; alleen de
   inhoud van de stap scrolt, bij de foliekeuze alleen het raster met folies. */

.zwfc-wizard.is-fit {
    display: flex;
    height: var(--zwfc-fit-height);
    flex-direction: column;
    margin-top: 8px;
    margin-bottom: 0;
}

.zwfc-wizard.is-fit > .zwfc-hero,
.zwfc-wizard.is-fit > .zwfc-progress {
    flex: none;
}

.zwfc-wizard.is-fit > .zwfc-progress {
    margin-top: 12px;
}

.zwfc-wizard.is-fit > .zwfc-wizard-step {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    margin-top: 12px;
}

.zwfc-wizard.is-fit > .zwfc-wizard-step > .zwfc-card {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
}

.zwfc-wizard.is-fit .zwfc-step-nav {
    flex: none;
    margin-top: 12px;
}

/* Controleren: de bestelkolom staat helemaal in beeld; past de lijst niet, dan scrolt alleen de lijst. */
.zwfc-wizard.is-fit .zwfc-workspace {
    min-height: 0;
    flex: 1 1 auto;
    grid-template-rows: minmax(0, 1fr);
    margin-top: 0;
}

.zwfc-wizard.is-fit .zwfc-main {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-self: stretch;
    gap: 12px;
}

.zwfc-wizard.is-fit .zwfc-workspace .zwfc-card {
    padding: 18px 24px;
}

.zwfc-wizard.is-fit .zwfc-workspace .zwfc-card__heading {
    margin-bottom: 10px;
}

.zwfc-wizard.is-fit .zwfc-foil-card {
    flex: none;
}

.zwfc-wizard.is-fit .zwfc-parts-card {
    /* Eerst krimpt de lijst; is die op zijn minimum, dan scrolt de kaart, zodat de knoppen er nooit uit lopen. */
    display: flex;
    min-height: 0;
    flex: 0 1 auto;
    overflow-y: auto;
    flex-direction: column;
}

.zwfc-wizard.is-fit :where(.zwfc-parts-card > *) {
    flex: none;
}

.zwfc-wizard.is-fit .zwfc-parts-card > .zwfc-list {
    min-height: 96px;
    flex: 0 1 auto;
    margin-top: 0;
    overflow-y: auto;
}

.zwfc-wizard.is-fit .zwfc-list-head {
    position: sticky;
    z-index: 1;
    top: 0;
    background: var(--zwfc-white);
}

.zwfc-wizard.is-fit .zwfc-review-notice {
    flex: none;
    margin-bottom: 12px;
}

.zwfc-wizard.is-fit .zwfc-result {
    position: static;
    max-height: 100%;
    overflow-y: auto;
}

.zwfc-wizard.is-fit [data-step="foil"] > .zwfc-card,
.zwfc-wizard.is-fit [data-zwfc-foil],
.zwfc-wizard.is-fit .zwfc-foil-browser {
    display: flex;
    flex-direction: column;
}

/* Lage specificiteit, zodat de regel hieronder het folieraster laat groeien. */
.zwfc-wizard.is-fit :where([data-step="foil"] > .zwfc-card > *, .zwfc-foil-browser > *) {
    flex: none;
}

.zwfc-wizard.is-fit [data-zwfc-foil],
.zwfc-wizard.is-fit .zwfc-foil-browser,
.zwfc-wizard.is-fit .zwfc-foil-browser > .zwfc-foil-tiles,
.zwfc-wizard.is-fit .zwfc-foil-browser > .zwfc-foil-grid {
    flex: 1 1 0;
}

.zwfc-wizard.is-fit .zwfc-foil-tiles,
.zwfc-wizard.is-fit .zwfc-foil-grid {
    max-height: none;
    /* Op een laag scherm scrolt de kaart verder; het raster blijft bruikbaar. */
    min-height: 260px;
    grid-auto-rows: max-content;
    align-content: start;
    overflow-y: auto;
    padding: 2px;
}

.zwfc-wizard.is-fit > .zwfc-wizard-step > .zwfc-card {
    padding: 20px 28px;
}

.zwfc-wizard.is-fit .zwfc-step-intro {
    max-width: none;
    margin-bottom: 12px;
}

.zwfc-wizard.is-fit .zwfc-foil-toolbar {
    margin-bottom: 10px;
}

.zwfc-wizard.is-fit .zwfc-foil-heading {
    margin-bottom: 8px;
}

/* ---------- Keuze route en opstelling ---------- */

.zwfc-resume {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--zwfc-beige);
}

.zwfc-resume p {
    margin: 0;
}

.zwfc-route-choices,
.zwfc-layout-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.zwfc-layout-tiles {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.zwfc-route,
.zwfc-layout-tile {
    display: grid;
    gap: 6px;
    align-content: start;
    margin: 0;
    padding: 18px;
    border: 2px solid var(--zwfc-border);
    border-radius: 14px;
    background: #fff;
    color: var(--zwfc-ink);
    cursor: pointer;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    transition: border-color .15s, box-shadow .15s;
}

.zwfc-route:hover,
.zwfc-layout-tile:hover,
.zwfc-layout-tile.is-active {
    border-color: var(--zwfc-wine);
    box-shadow: 0 8px 20px rgba(61, 0, 10, .08);
}

.zwfc-layout-tile.is-active {
    background: #fcf5f6;
}

.zwfc-route svg,
.zwfc-layout-tile svg {
    width: 48px;
    height: 48px;
    fill: var(--zwfc-beige);
    stroke: var(--zwfc-wine);
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.zwfc-route strong {
    font-size: 18px;
}

.zwfc-route small {
    color: var(--zwfc-muted);
    font-size: 14px;
}

.zwfc-layout-variant {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
    margin-top: 16px;
    color: var(--zwfc-ink);
}

.zwfc-layout-variant label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 0;
    font-weight: 700;
}

/* ---------- Plattegrond ---------- */

.zwfc-plan {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.zwfc-plan__drawing {
    padding: 12px;
    border: 1px solid var(--zwfc-border);
    border-radius: 14px;
    background:
        linear-gradient(rgba(90,0,16,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90,0,16,.035) 1px, transparent 1px),
        #fffdfb;
    background-size: 20px 20px;
}

.zwfc-plan__drawing svg {
    display: block;
    width: 100%;
    max-height: 420px;
}

.zwfc-plan__wall {
    cursor: pointer;
    outline: none;
}

.zwfc-plan__counter {
    fill: #f2dfe3;
    stroke: var(--zwfc-wine);
    stroke-width: 2;
}

.zwfc-plan__line {
    stroke: var(--zwfc-ink);
    stroke-width: 8;
    stroke-linecap: square;
}

.zwfc-plan__island-shape .zwfc-plan__counter {
    fill: #efe6da;
    stroke: var(--zwfc-gold);
}

.zwfc-plan__wall text {
    fill: var(--zwfc-wine);
    font-weight: 700;
}

.zwfc-plan__wall.is-empty text {
    fill: var(--zwfc-muted);
}

.zwfc-plan__wall:hover .zwfc-plan__counter,
.zwfc-plan__wall:focus-visible .zwfc-plan__counter {
    fill: #e8c3cb;
    stroke-width: 4;
}

.zwfc-plan__fields fieldset,
.zwfc-cabinet-wall {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    padding: 14px 16px 16px;
    border: 1px solid var(--zwfc-border);
    border-radius: 14px;
}

.zwfc-plan__fields legend,
.zwfc-cabinet-wall legend {
    padding: 0 6px;
    color: var(--zwfc-wine);
    font-weight: 800;
}

.zwfc-cabinet-wall legend span {
    color: var(--zwfc-muted);
    font-weight: 500;
}

/* ---------- Kasten ---------- */

.zwfc-cabinets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0 16px;
}

.zwfc-cabinet-summary {
    margin: 0;
    color: var(--zwfc-ink);
    font-size: 14px;
    font-weight: 700;
}

.zwfc-cabinet-summary.is-warning {
    color: var(--zwfc-error);
}

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

.zwfc-field--small input,
.zwfc-select-label select {
    min-height: 44px;
}

.zwfc-cabinet-upper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: end;
}

.zwfc-check-label,
.zwfc-select-label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.zwfc-select-label select {
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--zwfc-border);
    border-radius: 10px;
    background: #fcfaf8;
}

.zwfc-cabinet-note {
    margin: 0;
    color: var(--zwfc-muted);
    font-size: 13px;
}

/* ---------- Controleren ---------- */

.zwfc-review-notice {
    margin-bottom: 4px;
    padding: 14px 16px;
    border: 1px solid #e7d4a6;
    border-radius: 12px;
    background: #fbf5e6;
    color: #5b4410;
    line-height: 1.5;
}

.zwfc-review-notice p {
    margin: 0 0 10px;
}

.zwfc-review-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zwfc-wizard .zwfc-workspace {
    margin-top: 16px;
}

/* De wizard toont lengte, aantal en rolbreedte al elders; de bestelkolom blijft zo kort genoeg om in beeld te passen. */
.zwfc-wizard .zwfc-facts {
    display: none;
}

.zwfc-wizard .zwfc-result {
    gap: 10px;
    padding: 20px;
}

.zwfc-wizard .zwfc-result__number strong {
    font-size: 56px;
}

.zwfc-wizard .zwfc-order {
    gap: 10px;
}

.zwfc-wizard .zwfc-order__toolkits {
    gap: 4px;
    padding: 8px 10px 10px;
}

.zwfc-wizard .zwfc-order__toolkits label {
    font-size: 13px;
}

/* Thema's geven een legend vaak een eigen breedte, rand en marge. */
.zwfc-wizard .zwfc-order__toolkits legend {
    float: none;
    width: auto;
    margin: 0;
    border: 0;
}

/* Op een laag scherm wijkt bij het bestellen de meetinstructie in de kop voor de bestelkolom. */
@media (max-height: 960px) {
    .zwfc-wizard.is-fit[data-current-step="review"] .zwfc-hero .zwfc-steps {
        display: none;
    }
}

.zwfc-wizard .zwfc-main > .zwfc-step-nav {
    margin-top: 0;
}

@media (min-width: 981px) {
    .zwfc-wizard .zwfc-workspace {
        grid-template-columns: minmax(0, 1fr) 400px;
    }
}

.zwfc-foil-selected--empty {
    grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 760px) {
    .zwfc-progress button {
        justify-content: center;
        padding: 8px;
        font-size: 0;
    }

    .zwfc-progress button span {
        font-size: 13px;
    }

    .zwfc-progress button[aria-current="step"] {
        font-size: 13px;
    }

    .zwfc-progress li:has(button[aria-current="step"]) {
        flex: 3 1 0;
    }

    .zwfc-plan {
        grid-template-columns: minmax(0, 1fr);
    }

    .zwfc-cabinets {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .zwfc-cabinet-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .zwfc-step-nav .zwfc-button {
        flex: 1 1 0;
    }

    .zwfc-foil-selected--empty {
        grid-template-columns: minmax(0, 1fr);
    }
}
