/* Day-Dot Kitchen Labels: shopping surfaces. Tokens and fonts come from scan.css; shared components (ink buttons, tape label,
   day dot, label paper, chips, action sheet, captions, empty states) come from
   kitchen.css (DESIGN.md). */

/* ---------- /shopping: the docket ---------- */
.shop { max-width: 560px; margin: 0; color: var(--dd-ink); }
.shop-head { margin: 4px 0 18px; }
.shop-title { margin: 0 0 6px; }
.shop-summary { margin: 0; font-size: 1.12rem; color: var(--dd-ink-2); }

/* The docket: one tall printed sheet (label surface, see scan.css). */
.shop-paper { padding: 16px 20px 20px; color: var(--dd-ink); }
.shop .lst-cap { color: var(--dd-ink-2); }

/* Quick add */
.shop-add { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1.5px solid var(--dd-rule); }
.shop-add-main { display: flex; align-items: end; gap: 10px; }
.shop-add-more { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
.shop-add-more .shop-input { min-height: 44px; }
.shop-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-field--name { flex: 1; }
.shop .shop-input {
    width: 100%; min-height: 50px; padding: 0 12px; border: 1.5px solid var(--dd-ink); border-radius: 8px;
    background: var(--dd-field); color: var(--dd-ink); box-shadow: none; font-family: var(--dd-sans); font-size: 1rem; font-weight: 500;
}
.shop .shop-input::placeholder { color: var(--dd-placeholder); opacity: 1; }
.shop .shop-input:focus-visible { outline: 3px solid var(--dd-ink); outline-offset: 2px; }
.shop .shop-qty-input { font-family: var(--dd-cond); font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.shop select.shop-input { appearance: auto; }
.shop .shop-add-btn { flex: none; min-height: 50px; text-decoration: none; cursor: pointer; }
.shop .bag-btn { cursor: pointer; text-decoration: none; }
.shop .bag-btn:disabled { opacity: 0.5; }

/* Groups and rows */
.shop-group { padding-top: 14px; }
.shop-group-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 2px; }
.shopping-items { list-style: none; margin: 0; padding: 0; }
#shopping-list-container > .shopping-items { padding-top: 6px; }
.shopping-item { position: relative; display: flex; align-items: center; gap: 4px; min-height: 60px; border-bottom: 1px solid rgba(29, 29, 29, 0.18); }
.shopping-items > .shopping-item:last-child { border-bottom: 0; }
.shopping-item-label { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 0; cursor: pointer; }
.shopping-item-check { position: absolute; left: 0; top: 50%; width: 48px; height: 48px; margin: -24px 0 0; opacity: 0; cursor: pointer; }
.shopping-item-box {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px;
    border: 2px solid var(--dd-ink); border-radius: 5px; background: var(--dd-field); color: var(--dd-on-ink);
    transition: background-color 0.15s;
}
.shopping-item-box .dd-ico { width: 26px; height: 26px; stroke-width: 2.5; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset 0.26s var(--dd-ease); }
.shopping-item-check:checked ~ .shopping-item-box { background: var(--dd-ink); }
.shopping-item-check:checked ~ .shopping-item-box .dd-ico { stroke-dashoffset: 0; }
.shopping-item-check:focus-visible ~ .shopping-item-box { outline: 3px solid var(--dd-ink); outline-offset: 2px; }
.shopping-item-name { flex: 1; min-width: 0; font-weight: 700; font-size: 1.08rem; line-height: 1.25; overflow-wrap: anywhere; }
.shopping-item-qty { flex: none; font-family: var(--dd-cond); font-weight: 600; font-size: 1rem; color: var(--dd-ink-2); white-space: nowrap; }
.shopping-item-qty b { font-weight: 800; font-size: 1.25rem; color: var(--dd-ink); font-variant-numeric: tabular-nums; }
.shop-del {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px;
    background: transparent; color: var(--dd-ink-2); cursor: pointer;
}
.shop-del .dd-ico { width: 20px; height: 20px; }
.shop-del:hover { background: var(--dd-hover); color: var(--dd-ink); }
.shop-del:focus-visible { outline: 3px solid var(--dd-ink); outline-offset: 2px; }

/* Ticked: a marker line struck through, as on the dashboard. */
.shopping-item.checked::after {
    content: ''; position: absolute; left: 56px; right: 52px; top: 50%; height: 3px; border-radius: 2px;
    background: var(--dd-ink); transform: rotate(-1deg); pointer-events: none;
}
.shopping-item.checked .shopping-item-name, .shopping-item.checked .shopping-item-qty { opacity: 0.5; }
.shop-group--ticked { margin-top: 6px; border-top: 1.5px solid var(--dd-rule); }
.shopping-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.shopping-actions .bag-btn-ink { flex: 1 1 auto; }
.shop-done { margin: 12px 0 0; color: var(--dd-ink-2); }
.shop .shop-empty { padding: 20px 0 4px; }

/* Someone else's change arrives as a quiet fade, never a jump. */
.shopping-item.is-new { animation: shop-new 2.4s ease-out; }
@keyframes shop-new { from { background-color: rgba(29, 29, 29, 0.14); } to { background-color: transparent; } }

@media (max-width: 760px) {
    .shop-title { font-size: 2.15rem; }
    .shop-paper { padding: 14px 14px 18px; margin: 0 -2px; }
}
@media (prefers-reduced-motion: reduce) {
    .shopping-item-box, .shopping-item-box .dd-ico { transition: none; }
    .shopping-item.is-new { animation: none; }
}

