/* オーナータグ（商品一覧・管理者プレビュー）。共通テーマの罫線レイアウト・暖色に合わせる。
   タグの付け外しはその場で完結する操作なので①金アウトライン、保存は②ティール。 */

.page-index .item-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 4px 0 2px;
}

.page-index .item-tags { display: contents; }

.page-index .item-tag,
.tag-option {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #d8c48c;
  border-radius: 999px;
  background: #faf5ea;
  color: #6b5524;
  font-size: 11px;
  line-height: 1.6;
}

html body .item-tag-button,
html body .tag-filter__manage,
html body .tag-filter__bulk {
  min-height: 0;
  padding: 1px 10px;
  border: 1px solid #d8c48c;
  border-radius: 999px !important;
  background: transparent;
  color: #8a6d2f;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* 一覧上部のタグ絞り込み */
.page-index .tag-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}

.page-index .tag-filter__label {
  margin-right: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.page-index .tag-filter__hint {
  flex-basis: 100%;
  color: var(--text-muted);
  font-size: 11px;
}

html body .tag-option {
  min-height: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px !important;
}

html body .tag-option[aria-pressed="true"] {
  border-color: #b99653;
  background: #e0c787;
  color: #15140f;
  font-weight: 700;
}

/* タグの編集・管理シート（common.css の margin リセットで中央寄せが外れるため margin: auto） */
.tag-dialog {
  width: min(520px, 94vw);
  max-height: 85vh;
  margin: auto;
  padding: 0;
  border: 1px solid #cbb684;
  border-radius: 2px;
  background: #fffdf8;
  color: var(--text);
  box-shadow: 0 18px 48px rgba(40, 34, 20, .24);
}

.tag-dialog::backdrop { background: rgba(21, 20, 15, .55); }

.tag-sheet { padding: 18px 18px 16px; }

.tag-sheet__title {
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-strong, #3d3428);
  font-size: 16px;
}

.tag-sheet__item { margin: 0 0 4px; font-weight: 700; }

.tag-sheet__hint {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  list-style: none;
}

.tag-sheet__message {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--danger, #b42318);
  font-size: 12px;
}

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-options .tag-option { padding: 6px 12px; font-size: 13px; }

.tag-new { display: flex; gap: 8px; }

html body .tag-new__add { flex: 0 0 auto; white-space: nowrap; }

html body .tag-new__input,
html body .tag-manager__name {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid #d9d3c6;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
}

html body .tag-new__add,
html body .tag-manager__rename,
html body .tag-manager__move,
html body .tag-manager__cancel,
html body .tag-sheet__cancel {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid #d8c48c;
  border-radius: 4px !important;
  background: transparent;
  color: #8a6d2f;
  font-weight: 700;
}

html body .tag-sheet__save {
  min-height: 40px;
  padding: 6px 18px;
  border: 0;
  border-radius: 4px !important;
  background: var(--teal, #1f5c56);
  color: #f3eee2;
  font-weight: 700;
}

html body .tag-manager__delete {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--danger, #b42318);
  border-radius: 4px !important;
  background: transparent;
  color: var(--danger, #b42318);
  font-weight: 700;
}

.tag-sheet__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.tag-manager { margin: 0; padding: 0; list-style: none; }

.tag-manager__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line, #e3dbca);
}

.tag-manager__count { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

.tag-manager__confirm { flex: 1 1 100%; font-size: 13px; }

html body .tag-manager__move { padding: 6px 10px; }

@media (max-width: 640px) {
  .tag-manager__name { flex-basis: 100%; }
}

/* まとめてタグ付け：カードの選択チェックと画面下の固定バー */
.page-index .item-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
  color: #6b5524;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.page-index .item-select input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal, #1f5c56); }

.page-index .item-card.is-selected { outline: 2px solid #b99653; outline-offset: -2px; }

html body .tag-filter__bulk[aria-pressed="true"] { background: #e0c787; color: #15140f; }

.tag-bulk-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #b99653;
  background: #15140f;
  color: #f3eee2;
}

.tag-bulk-bar.hidden { display: none; }

body.is-bulk-tagging { padding-bottom: 72px; }

.tag-bulk-bar__count { margin-right: auto; font-weight: 700; }

html body .tag-bulk-bar__select,
html body .tag-bulk-bar__quit {
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid #b99653;
  border-radius: 4px !important;
  background: transparent;
  color: #e0c787;
  font-weight: 700;
}

html body .tag-bulk-bar__edit {
  min-height: 38px;
  padding: 6px 16px;
  border: 0;
  border-radius: 4px !important;
  background: var(--teal, #1f5c56);
  color: #f3eee2;
  font-weight: 700;
}

html body .tag-bulk-bar button:disabled { opacity: .45; cursor: default; }

.tag-sheet__section {
  margin: 14px 0 8px;
  color: #6b5524;
  font-size: 13px;
}

html body .tag-option--remove[aria-pressed="true"] {
  border-color: var(--danger, #b42318);
  background: #fbe9e7;
  color: var(--danger, #b42318);
  text-decoration: line-through;
}

@media (max-width: 640px) {
  .tag-bulk-bar__count { flex-basis: 100%; text-align: center; margin-right: 0; }
  body.is-bulk-tagging { padding-bottom: 118px; }
}

/* 新規出品フォームのタグ欄（ラベルは common.css の label に揃える） */
.tag-field__label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.tag-field__help {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.tag-field .tag-picker {
  padding: 10px 12px;
  border: 1px solid #e3dbca;
  background: #fffdf8;
}

.bulk-preview .bulk-preview__tags { white-space: nowrap; }

.tag-options .tag-sheet__hint--full { flex-basis: 100%; margin: 0; }
