/* styles/widgets/shopping.css
 *
 * Extracted from styles/main.css during T4#20 (the May-2026
 * CSS-split refactor). Originally lived at lines 1967-2085
 * of main.css. Cascade order is preserved: main.css loads first
 * (themes + base + modal/tab/layout infra), then per-widget
 * files in alphabetical order via <link> tags in index.html.
 */

/* ── SHOPPING LIST ───────────────────────────── */
.shop-tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.shop-tab {
    font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
    border: 1.5px solid var(--border); background: transparent; color: var(--muted);
    cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.shop-tab:hover { color: var(--text); border-color: var(--text); }
.shop-tab.active { color: #0f1117 !important; border-color: transparent !important; }
.shop-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.shop-list { overflow-y: auto; }
.shop-item {
    display: flex; align-items: center; gap: 7px;
    padding: 5px 8px; border-radius: 8px; margin-bottom: 2px;
    transition: background 0.12s;
}
.shop-item:hover { background: var(--surface2); }
.shop-check {
    width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid var(--border); flex-shrink: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.shop-check:hover { border-color: var(--green); }
.shop-item.done .shop-check { background: var(--green); border-color: var(--green); }
.shop-item.done .shop-check::after { content: '✓'; font-size: 8px; color: #0f1117; font-weight: 800; }
.shop-text { flex: 1; font-size: 12px; line-height: 1.4; }
.shop-item.done .shop-text { text-decoration: line-through; color: var(--muted); }
/* Slice C-fast (C.8): up/down reorder buttons. Sit between the
 * text and the delete × on every pending item. Vertical stack
 * keeps the row height consistent regardless of text length. */
.shop-reorder {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}
.shop-reorder-btn {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    padding: 1px 4px;
    border-radius: 3px;
}
.shop-reorder-btn:hover:not(:disabled) {
    color: var(--accent);
    background: color-mix(in oklab, var(--accent) 10%, transparent);
}
.shop-reorder-btn:disabled {
    opacity: 0.25;
    cursor: default;
}
/* Pencil-icon edit button next to each shopping row. No surrounding
   box - just the emoji glyph with a subtle on-hover ring so it
   reads as interactive. Without this rule the button falls back to
   browser default styling (white fill + grey border) which shows up
   as an ugly light rectangle on dark themes. Matches the
   .habit-edit-btn / .add-sub-btn pattern used elsewhere. */
.shop-edit-btn {
    flex: 0 0 auto;
    width: 22px; height: 22px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.shop-edit-btn:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface2);
}

.shop-clear-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 0 2px;
}
.shop-clear {
    display: none;
    background: none;
    border: none;
    font-size: 10px;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    text-align: left;
    flex: 1;
}
.shop-clear.visible { display: block; }
.shop-clear:hover { color: var(--red); }
.shop-uncheck {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 10px;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 8px;
    margin-left: auto;
    white-space: nowrap;
}
.shop-uncheck:hover {
    color: var(--text);
    border-color: var(--accent);
    background: color-mix(in oklab, var(--accent) 8%, transparent);
}

