/* Boodschappenlijst — mobielvriendelijke tap-first UI. */

.zm-shoplist {
    max-width: 620px;
    margin: 1.5rem auto;
    font-family: var(--zm-body, inherit);
    position: relative;
}

/* ── Search + autocomplete ───────────────────────────────────── */

.zm-shoplist__add {
    position: relative;
    margin-bottom: 1.25rem;
}
.zm-shoplist__add input[type="search"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--zm-border, #E6D9B2);
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    font-family: inherit;
}
.zm-shoplist__add input[type="search"]:focus {
    outline: 2px solid var(--zm-blue, #0077AC);
    outline-offset: 1px;
}
.zm-shoplist__suggest {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--zm-border, #E6D9B2);
    border-radius: 10px;
    margin-top: 0.25rem;
    z-index: 20;
    box-shadow: 0 6px 18px rgba(0, 68, 100, 0.10);
    max-height: 60vh;
    overflow-y: auto;
}
.zm-shoplist__hit {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 1rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--zm-border, #E6D9B2);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--zm-text, #333);
}
.zm-shoplist__hit:last-child { border-bottom: 0; }
.zm-shoplist__hit:hover { background: var(--zm-cream, #FBF8F1); }
.zm-shoplist__hit small { color: var(--zm-text-light, #556); }
.zm-shoplist__hit--free { color: var(--zm-blue, #0077AC); font-style: italic; }

/* ── Secties ─────────────────────────────────────────────────── */

.zm-shoplist__section {
    margin-bottom: 1.5rem;
}
.zm-shoplist__section h3 {
    font-family: var(--zm-heading, inherit);
    color: var(--zm-navy, #004464);
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}
.zm-shoplist__section--empty p {
    color: var(--zm-text-light, #556);
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
    background: var(--zm-cream, #FBF8F1);
    border-radius: 12px;
    border: 1px dashed var(--zm-border, #E6D9B2);
}

/* ── Item-lijst ──────────────────────────────────────────────── */

.zm-shoplist__items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.zm-shoplist__item {
    display: grid;
    grid-template-columns: 44px 1fr auto auto auto;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid var(--zm-border, #E6D9B2);
    border-left: 4px solid var(--zm-blue, #0077AC);
    border-radius: 10px;
    padding: 0.5rem 0.6rem 0.5rem 0.15rem;
}
.zm-shoplist__item.is-picked {
    opacity: 0.6;
    border-left-color: var(--zm-success, #359138);
}
.zm-shoplist__item.is-picked .zm-shoplist__name {
    text-decoration: line-through;
}

.zm-shoplist__check {
    background: transparent;
    border: 0;
    width: 44px; height: 44px;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--zm-navy, #004464);
}

.zm-shoplist__body {
    min-width: 0; /* zodat ellipsis werkt */
}
.zm-shoplist__name {
    font-weight: 600;
    color: var(--zm-navy, #004464);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zm-shoplist__meta {
    font-size: 0.78rem;
    color: var(--zm-text-light, #556);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.1rem;
}
.zm-shoplist__plu,
.zm-shoplist__planned {
    background: var(--zm-cream, #FBF8F1);
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
}
.zm-shoplist__weight {
    background: var(--zm-blue-tint, #DDEFF7);
    color: var(--zm-navy, #004464);
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-weight: 700;
}

.zm-shoplist__act {
    background: var(--zm-cream, #FBF8F1);
    border: 1px solid var(--zm-border, #E6D9B2);
    border-radius: 8px;
    width: 40px; height: 40px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--zm-navy, #004464);
    padding: 0;
}
.zm-shoplist__act:hover { background: #fff; }
.zm-shoplist__act--danger { color: #A00; }
.zm-shoplist__act--danger:hover { background: #FEE; }

/* ── Suggesties ──────────────────────────────────────────────── */

.zm-shoplist__suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.zm-shoplist__suggestions-empty {
    color: var(--zm-text-light, #556);
    font-style: italic;
    font-size: 0.9rem;
}
.zm-shoplist__suggestion {
    list-style: none;
}
.zm-shoplist__suggestion-btn {
    background: var(--zm-cream, #FBF8F1);
    border: 1px solid var(--zm-border, #E6D9B2);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--zm-text, #333);
}
.zm-shoplist__suggestion-btn:hover {
    background: #fff;
    border-color: var(--zm-blue, #0077AC);
}
.zm-shoplist__suggestion.is-on-list .zm-shoplist__suggestion-btn {
    opacity: 0.4;
}
.zm-shoplist__suggestion-count {
    background: var(--zm-blue, #0077AC);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-weight: 700;
}

/* ── Footer ─────────────────────────────────────────────────── */

.zm-shoplist__footer {
    margin-top: 2rem;
    text-align: center;
}
.zm-shoplist__clear {
    background: var(--zm-blue, #0077AC);
    color: #fff;
    border: 0;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    font-family: var(--zm-heading, inherit);
    font-size: 1rem;
    cursor: pointer;
}
.zm-shoplist__clear:hover { background: var(--zm-navy, #004464); }

/* ── Modals (weeg + barcode) ────────────────────────────────── */

.zm-shoplist__modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 68, 100, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
/* display: flex overrult standaard-hidden. Expliciet verbergen wanneer
   het hidden-attribuut aan staat — anders is de modal bij page-load al
   zichtbaar bovenop de lijst. */
.zm-shoplist__modal[hidden] {
    display: none !important;
}
.zm-shoplist__modal-inner {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.zm-shoplist__modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: 0;
    width: 40px; height: 40px;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: var(--zm-text-light, #556);
}
.zm-shoplist__modal-inner h3 {
    font-family: var(--zm-heading, inherit);
    color: var(--zm-navy, #004464);
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    padding-right: 2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Weeg-modal */
.zm-shoplist__weigh-value {
    background: var(--zm-blue-tint, #DDEFF7);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    font-family: var(--zm-heading, inherit);
    color: var(--zm-navy, #004464);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
}
.zm-shoplist__pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.zm-shoplist__pad button {
    background: var(--zm-cream, #FBF8F1);
    border: 1px solid var(--zm-border, #E6D9B2);
    border-radius: 10px;
    padding: 0.85rem 0;
    font-size: 1.5rem;
    font-family: var(--zm-heading, inherit);
    color: var(--zm-navy, #004464);
    cursor: pointer;
}
.zm-shoplist__pad button:active { background: var(--zm-blue-tint, #DDEFF7); }
.zm-shoplist__pad-wide { grid-column: span 2; }
.zm-shoplist__pad-back {
    color: #A00;
}
.zm-shoplist__weigh-save {
    background: var(--zm-blue, #0077AC);
    color: #fff;
    border: 0;
    padding: 0.75rem;
    border-radius: 10px;
    font-family: var(--zm-heading, inherit);
    font-size: 1.05rem;
    cursor: pointer;
    width: 100%;
}
.zm-shoplist__weigh-save:hover { background: var(--zm-navy, #004464); }

/* Barcode-modal */
.zm-shoplist__modal--barcode .zm-shoplist__modal-inner {
    max-width: 520px;
}
.zm-shoplist__barcode-svg {
    display: block;
    max-width: 100%;
    margin: 0 auto 0.5rem;
    background: #fff;
}
.zm-shoplist__barcode-plu {
    text-align: center;
    font-family: var(--zm-heading, inherit);
    color: var(--zm-navy, #004464);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}
.zm-shoplist__barcode-hint {
    text-align: center;
    color: var(--zm-text-light, #556);
    font-size: 0.9rem;
    margin: 0.75rem 0 0;
    line-height: 1.45;
    text-wrap: balance;
}
.zm-shoplist__barcode-hint p {
    /* Expliciet resetten — de PWA laadt zm-door-app.css met
       ".zm-state p { max-width: 300px }" die deze p's ook trof en ze
       op 300px liet zitten binnen de bredere modal. */
    margin: 0 0 0.5rem;
    padding: 0;
    max-width: none;
    text-align: center;
    text-indent: 0;
}
.zm-shoplist__barcode-hint p:last-child { margin-bottom: 0; }
.zm-shoplist__barcode-hint strong { color: var(--zm-navy, #004464); }
.zm-shoplist__hint-title { color: var(--zm-navy, #004464); font-size: 1rem; }
.zm-shoplist__hint-main  { color: var(--zm-text, #333); }
.zm-shoplist__hint-alt {
    font-size: 0.8rem;
    color: var(--zm-text-light, #556);
    margin-top: 0.75rem !important;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--zm-border, #E6D9B2);
}

/* PLU-variant — bulk-product met Code-128 barcode. Vereist een extra
   handeling in de kassa (artikel-zoek-scherm openen). Gele accent-strip
   maakt visueel duidelijk dat 't andere afhandeling is dan een normale
   EAN. */
.zm-shoplist__modal--plu .zm-shoplist__modal-inner {
    border-top: 6px solid var(--zm-yellow, #FBBA06);
}
.zm-shoplist__modal--plu .zm-shoplist__barcode-hint {
    background: var(--zm-yellow-tint, #FEF3D3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: left;
    color: var(--zm-text, #333);
}
.zm-shoplist__modal--plu .zm-shoplist__barcode-hint strong {
    color: var(--zm-yellow-ink, #8A6600);
}
