.awcf-hm-account {
    max-width: 860px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--hm-color-line);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    color: var(--hm-color-navy);

    & .awcf-hm-account__greeting {
        margin: 0 0 1rem;
        font-size: 1.5rem;
        color: var(--hm-color-navy);
    }

    & .awcf-hm-account__message {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-radius: 4px;
        font-size: 0.9rem;
        line-height: 1.4;

        &.awcf-hm-account__message--error {
            background: #fdecea;
            color: #b3261e;
            border: 1px solid #f5c6c3;
        }

        &.awcf-hm-account__message--success {
            background: #e8f5e9;
            color: #1b5e20;
            border: 1px solid #b9dfbb;
        }
    }

    & .awcf-hm-account__tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        margin-bottom: 1.5rem;
        border-bottom: 2px solid var(--hm-color-line);

        & .awcf-hm-account__tab {
            padding: 0.65rem 1.1rem;
            font-size: 0.95rem;
            font-weight: 600;
            color: #555;
            text-decoration: none;
            border-bottom: 3px solid transparent;
            margin-bottom: -2px;
            transition: color 0.15s ease, border-color 0.15s ease;

            &:hover {
                color: var(--hm-color-navy);
            }

            &.is-active {
                color: var(--hm-color-gold);
                border-bottom-color: var(--hm-color-gold);
            }
        }
    }

    & .awcf-hm-account__section {
        display: none;
        padding: 0.25rem 0 1rem;

        &.is-active {
            display: block;
        }

        & h3 {
            margin: 0 0 1rem;
            font-size: 1.2rem;
            color: var(--hm-color-navy);
        }

        & h4 {
            margin: 1.25rem 0 0.75rem;
            font-size: 1rem;
            color: var(--hm-color-navy);
        }
    }

    & .awcf-hm-account__intro {
        margin: 0 0 1rem;
        font-size: 0.9rem;
        color: #555;
        line-height: 1.5;
    }

    & .awcf-hm-account__kvk-block {
        padding: 1rem 1.2rem;
        background: #f5f7fb;
        border: 1px solid var(--hm-color-line);
        border-radius: 6px;
        margin-bottom: 1.5rem;

        & h4 {
            margin-top: 0;
        }
    }

    & .awcf-hm-account__kvk-list {
        display: grid;
        grid-template-columns: 180px 1fr;
        gap: 0.35rem 1rem;
        margin: 0;

        & dt {
            font-weight: 600;
            color: #555;
        }

        & dd {
            margin: 0;
            color: var(--hm-color-navy);
        }
    }

    & .awcf-hm-account__kvk-note {
        margin: 1rem 0 0;
        font-size: 0.8rem;
        color: #777;

        & a {
            color: var(--hm-color-navy);
            text-decoration: underline;
        }
    }

    & .awcf-hm-account__form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    & .awcf-hm-account__form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;

        @media (max-width: 620px) {
            grid-template-columns: 1fr;
        }
    }

    & .awcf-hm-account__form-group {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;

        & label,
        & legend {
            font-size: 0.85rem;
            font-weight: 600;
            color: #333;
        }

        & input[type="text"],
        & input[type="email"],
        & input[type="tel"],
        & input[type="password"] {
            width: 100%;
            padding: 0.65rem 0.85rem;
            font-size: 1rem;
            border: 1px solid var(--hm-color-line);
            border-radius: 4px;
            background: #fcfcfd;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;

            &:focus {
                border-color: var(--hm-color-gold);
                box-shadow: 0 0 0 3px rgba(157, 129, 0, 0.18);
                outline: none;
            }
        }

        &.awcf-hm-account__form-group--radios {
            border: none;
            padding: 0;
            display: flex;
            /* De basisregel hierboven zet flex-direction: column; zonder deze
               regel betekent align-items: center dat elke optie horizontaal
               gecentreerd wordt en de rondjes dus niet onder elkaar uitlijnen. */
            flex-direction: row;
            flex-wrap: wrap;
            gap: 0.85rem 1.25rem;
            align-items: center;

            & legend {
                width: 100%;
            }
        }

        &.awcf-hm-account__form-group--checkbox {
            flex-direction: row;
            align-items: center;
            gap: 0.5rem;

            & label {
                display: flex;
                gap: 0.5rem;
                align-items: center;
                font-weight: 500;
                cursor: pointer;
            }
        }
    }

    & .awcf-hm-account__radio {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.9rem;
        color: #444;
        cursor: pointer;
    }

    & .awcf-hm-account__password {
        padding: 0.85rem 1rem;
        border: 1px dashed var(--hm-color-line);
        border-radius: 6px;
        background: #fafbfd;

        & summary {
            cursor: pointer;
            font-weight: 600;
            color: var(--hm-color-navy);
        }

        & .awcf-hm-account__form-group {
            margin-top: 0.75rem;
        }
    }

    & .awcf-hm-account__submit {
        align-self: flex-start;
        padding: 0.75rem 1.25rem;
        background: var(--hm-color-gold);
        color: #fff;
        border: none;
        border-radius: 4px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        text-decoration: none;
        transition: background-color 0.15s ease;

        &:hover {
            background: var(--hm-color-navy);
        }

        &:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        &.awcf-hm-account__submit--secondary {
            background: var(--hm-color-navy);

            &:hover {
                background: var(--hm-color-gold);
            }
        }
    }

    & .awcf-hm-account__chips {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    & .awcf-hm-account__chip-wrap {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.85rem;
        border: 1px solid var(--hm-color-line);
        border-radius: 8px;
        background: #fafbfd;
        min-width: 220px;
        flex: 1 1 220px;
        transition: border-color 0.15s ease, background 0.15s ease;

        & .awcf-hm-account__chip {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.5rem 0.9rem;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--hm-color-navy);
            background: var(--hm-color-line);
            border: 1px solid var(--hm-color-line);
            border-radius: 999px;
            cursor: pointer;
            transition: background 0.15s ease, color 0.15s ease;
        }

        &.is-selected {
            border-color: var(--hm-color-gold);
            background: #fff6f1;

            & .awcf-hm-account__chip {
                background: var(--hm-color-gold);
                color: #fff;
                border-color: var(--hm-color-gold);
            }
        }
    }

    & .awcf-hm-account__chip-details {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;

        & label {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            font-size: 0.8rem;
            color: #555;

            & input {
                padding: 0.45rem 0.6rem;
                font-size: 0.9rem;
                border: 1px solid var(--hm-color-line);
                border-radius: 4px;
                background: #fff;
            }
        }

        &[hidden] {
            display: none;
        }
    }

    & .awcf-hm-account__wholesaler-request {
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid var(--hm-color-line);

        & textarea {
            width: 100%;
            padding: 0.65rem 0.85rem;
            font-size: 0.95rem;
            border: 1px solid var(--hm-color-line);
            border-radius: 4px;
            background: #fcfcfd;
            min-height: 90px;
            margin-bottom: 0.75rem;

            &:focus {
                border-color: var(--hm-color-gold);
                outline: none;
                box-shadow: 0 0 0 3px rgba(157, 129, 0, 0.18);
            }
        }
    }

    & .awcf-hm-account__entries {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.9rem;

        & thead th {
            text-align: left;
            padding: 0.65rem 0.6rem;
            background: #f5f7fb;
            border-bottom: 2px solid var(--hm-color-line);
            color: #555;
            font-weight: 600;
        }

        & tbody td {
            padding: 0.7rem 0.6rem;
            border-bottom: 1px solid #eef0f4;
            vertical-align: middle;
        }
    }

    & .awcf-hm-account__badge {
        display: inline-block;
        padding: 0.2rem 0.55rem;
        font-size: 0.75rem;
        font-weight: 600;
        border-radius: 999px;

        &.awcf-hm-account__badge--new {
            background: #e8f5e9;
            color: #1b5e20;
        }

        &.awcf-hm-account__badge--resent {
            background: #fff6f1;
            color: var(--hm-color-gold);
        }

        &.awcf-hm-account__badge--ordered   { background: #fef4e6; color: #a05a00; }
        &.awcf-hm-account__badge--in_review { background: #fff3cd; color: #8a6d3b; }
        &.awcf-hm-account__badge--approved  { background: #e6f7e8; color: #1e6b26; }
        &.awcf-hm-account__badge--paid      { background: #dcedc8; color: #33691e; }
        &.awcf-hm-account__badge--rejected  { background: #fce4e4; color: #a01414; }
    }

    & .awcf-hm-account__upload-btn {
        display: inline-block;
        padding: 0.45rem 0.8rem;
        font-size: 0.82rem;
        font-weight: 700;
        color: #fff;
        background: var(--hm-color-navy);
        border: 2px solid var(--hm-color-navy);
        border-radius: var(--hm-radius, 8px);
        text-decoration: none;
        line-height: 1.1;
        white-space: nowrap;
        transition: background 0.15s ease, border-color 0.15s ease;

        &:hover, &:focus {
            background: var(--hm-color-gold);
            border-color: var(--hm-color-gold);
            color: #fff;
        }
    }

    & .awcf-hm-account__aanvraag-cell {
        line-height: 1.35;

        & .awcf-hm-account__aanvraag-title {
            font-weight: 600;
            color: var(--hm-color-navy);
        }

        & .awcf-hm-account__aanvraag-sub {
            font-size: 0.82rem;
            color: #6b7280;
            margin-top: 0.15rem;

            & a { color: inherit; text-decoration: underline; }
            & a:hover { color: var(--hm-color-gold); }
        }
    }

    & .awcf-hm-account__file-link {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        color: var(--hm-color-navy);
        text-decoration: underline;
        font-size: 0.85rem;

        &:hover { color: var(--hm-color-gold); }
    }

    & .awcf-hm-account__files {
        font-size: 0.85rem;

        & > summary {
            cursor: pointer;
            color: var(--hm-color-navy);
            font-weight: 600;
            list-style: none;

            &::-webkit-details-marker { display: none; }
            &:hover { color: var(--hm-color-gold); }
        }

        & .awcf-hm-account__files-list {
            margin: 0.4rem 0 0 1rem;
            padding: 0;
            list-style: disc;

            & li { margin: 0.2rem 0; }
            & a { color: var(--hm-color-navy); }
            & a:hover { color: var(--hm-color-gold); }
        }
    }

    & .awcf-hm-account__resend-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--hm-color-navy);
        background: #fff;
        border: 1px solid var(--hm-color-line);
        border-radius: 4px;
        cursor: pointer;

        &:hover {
            color: var(--hm-color-gold);
            border-color: var(--hm-color-gold);
        }

        &:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
    }

    & .awcf-hm-account__dash {
        color: #aaa;
    }

    & .awcf-hm-account__logout-link {
        display: inline-block;
    }

    &.awcf-hm-account--logged-out {
        padding: 1.5rem;
        text-align: center;

        & a {
            color: var(--hm-color-gold);
            font-weight: 600;
        }
    }
}

@media (max-width: 620px) {
    .awcf-hm-account {
        padding: 1.25rem;
        margin: 1rem 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;

        & .awcf-hm-account__kvk-list {
            grid-template-columns: 1fr;

            & dt {
                margin-top: 0.5rem;
            }
        }

        & .awcf-hm-account__entries {
            display: block;
            overflow-x: auto;
        }
    }
}

/* r17: groothandel-zoekfilter op mijn-account (alleen gekozen tonen, zoeken toont overige) */
.awcf-hm-account__ws-hint { margin: .25em 0 .5em; opacity: .8; font-size: .95rem; }
.awcf-hm-account__ws-search { width: 100%; max-width: 420px; padding: .6em .9em; margin: 0 0 1em; border: 1px solid var(--hm-color-lijn, #e7e3d4); border-radius: 8px; font: inherit; }
.awcf-hm-account__chips.is-searchable .awcf-hm-account__chip-wrap:not(.is-selected):not(.is-match) { display: none; }

/* Mijn groothandels: keuzelijst met regels per gekozen groothandel */
.awcf-hm-account__ws-add { margin: 0 0 1.25rem; }
.awcf-hm-account__ws-add label { display: block; margin-bottom: .35rem; font-weight: 700; color: var(--hm-color-navy); }
.awcf-hm-account__ws-picker { width: 100%; max-width: 460px; padding: .65rem .9rem; font: inherit; border: 1px solid var(--hm-color-lijn, #d9d4c3); border-radius: 8px; background: #fff; }
.awcf-hm-account__ws-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.awcf-hm-account__ws-row { display: grid; grid-template-columns: minmax(160px, 1.4fr) minmax(120px, 1fr) minmax(120px, 1fr) auto; gap: .75rem 1rem; align-items: end; padding: .9rem 1rem; background: #fff; border: 1px solid var(--hm-color-lijn, #e7e3d4); border-radius: 10px; box-shadow: 0 2px 8px rgba(16, 19, 63, .05); }
.awcf-hm-account__ws-name { align-self: center; color: var(--hm-color-navy); font-size: 1rem; }
.awcf-hm-account__ws-row label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: #585e6a; }
.awcf-hm-account__ws-row label input { padding: .5rem .65rem; font-size: .95rem; border: 1px solid var(--hm-color-lijn, #d9d4c3); border-radius: 6px; background: #fff; }
.awcf-hm-account__ws-remove { align-self: center; width: 34px; height: 34px; padding: 0; border: 1px solid #cfcfd6; border-radius: 50%; background: #fff; color: #585e6a; font-size: 1.3rem; line-height: 1; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.awcf-hm-account__ws-remove:hover, .awcf-hm-account__ws-remove:focus-visible { background: var(--hm-color-navy); border-color: var(--hm-color-navy); color: #fff; }
.awcf-hm-account__ws-empty { margin: 0 0 1.25rem; color: #585e6a; font-style: italic; }
.awcf-hm-account__ws-empty[hidden] { display: none; }
@media (max-width: 720px) {
    .awcf-hm-account__ws-row { grid-template-columns: 1fr auto; }
    .awcf-hm-account__ws-name { grid-column: 1; }
    .awcf-hm-account__ws-remove { grid-column: 2; grid-row: 1; }
    .awcf-hm-account__ws-row label { grid-column: 1 / -1; }
}

/* Zoekveld voor groothandels */
.awcf-hm-account__ws-combo { position: relative; max-width: 460px; }
.awcf-hm-account__ws-combo-input { width: 100%; font-size: 16px; }
.awcf-hm-account__ws-combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--hm-color-lijn, #d9d4c3); border-radius: 8px; box-shadow: 0 10px 24px rgba(16, 19, 63, .15); }
.awcf-hm-account__ws-combo-list[hidden] { display: none; }
.awcf-hm-account__ws-combo-list li { margin: 0; padding: .65rem .9rem; cursor: pointer; color: var(--hm-color-navy); }
.awcf-hm-account__ws-combo-list li.is-active, .awcf-hm-account__ws-combo-list li[data-id]:hover { background: #f3efe3; }
.awcf-hm-account__ws-combo-list li.is-none { cursor: default; color: #585e6a; font-size: .9rem; }
