/* TASFUL市場 — 注文履歴 */
body.tasful-market-order-history-page {
  padding-top: calc(var(--tasful-market-header-total-h, 152px) + env(safe-area-inset-top, 0px)) !important;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  background: var(--tasful-market-bg);
}

.tasful-market-order-history-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

.tasful-market-order-history-main__title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 900;
}

.tasful-market-order-history-main__count {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tasful-market-muted);
}

.tasful-market-order-history-list {
  display: grid;
  gap: 12px;
}

.tasful-market-order-history-card {
  background: #fff;
  border: 1px solid var(--tasful-market-border);
  border-radius: 12px;
  overflow: hidden;
}

.tasful-market-order-history-card__toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.tasful-market-order-history-card__summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.tasful-market-order-history-card__img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.tasful-market-order-history-card__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tasful-market-order-history-card__body {
  min-width: 0;
}

.tasful-market-order-history-card__title {
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tasful-market-order-history-card__order-id {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #007185;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.tasful-market-order-history-card__meta {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tasful-market-muted);
  line-height: 1.5;
}

.tasful-market-order-history-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  margin-top: 8px;
}

.tasful-market-order-history-card__total {
  font-size: 0.9375rem;
  font-weight: 900;
  color: #b12704;
}

.tasful-market-order-history-card__status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.6875rem;
  font-weight: 800;
}

.tasful-market-order-history-card__status.is-shipping {
  background: #fef3c7;
  color: #b45309;
}

.tasful-market-order-history-card__status.is-shipped {
  background: #ecfdf5;
  color: #047857;
}

.tasful-market-order-history-card__status.is-delivered {
  background: #f3f4f6;
  color: #374151;
}

.tasful-market-order-history-card__chevron {
  display: block;
  padding: 0 16px 12px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--tasful-market-muted);
  text-align: center;
}

.tasful-market-order-history-card__detail {
  border-top: 1px solid var(--tasful-market-border);
  padding: 16px;
  background: #fafafa;
}

.tasful-market-order-history-card__detail[hidden] {
  display: none;
}

.tasful-market-order-history-detail__title {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 900;
}

.tasful-market-order-history-detail__list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.tasful-market-order-history-detail__row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.tasful-market-order-history-detail__row dt {
  margin: 0;
  font-weight: 700;
  color: var(--tasful-market-muted);
}

.tasful-market-order-history-detail__row dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.tasful-market-order-history-detail__connect {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #047857;
  font-weight: 800;
}

.tasful-market-order-history-empty {
  padding: 32px 16px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--tasful-market-border);
  border-radius: 12px;
}

.tasful-market-order-history-empty__icon {
  margin: 0 0 12px;
  font-size: 2.5rem;
  line-height: 1;
}

.tasful-market-order-history-empty__text {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tasful-market-text);
}

.tasful-market-order-history-empty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 160px;
  padding: 0 20px;
  border-radius: 999px;
  background: #ffd814;
  border: 1px solid #e6c200;
  color: #111;
  font-size: 0.875rem;
  font-weight: 800;
  text-decoration: none;
}

/* 検索・絞り込み（390px優先） */
.tasful-market-order-history-toolbar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}

.tasful-market-order-history-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border: 1px solid #aab7b8;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.tasful-market-order-history-search:focus-within {
  border-color: #e77600;
  box-shadow: 0 0 0 3px rgba(231, 118, 0, 0.18);
}

.tasful-market-order-history-search__icon {
  flex: 0 0 auto;
  padding-left: 10px;
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.55;
}

.tasful-market-order-history-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  border: 0;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tasful-market-text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

/* type=search のブラウザ標準クリア（×）を隠し、カスタム1つだけ表示 */
.tasful-market-order-history-search__input::-webkit-search-decoration,
.tasful-market-order-history-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.tasful-market-order-history-search__input::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

.tasful-market-order-history-search__input::placeholder {
  color: #9ca3af;
}

.tasful-market-order-history-search__clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  line-height: 0;
  cursor: pointer;
}

.tasful-market-order-history-search__clear-icon {
  display: block;
  flex: 0 0 auto;
}

.tasful-market-order-history-filter-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 56px;
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid #aab7b8;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tasful-market-order-history-filter-btn.is-active {
  border-color: #e77600;
  background: #fff7ed;
  color: #9a3412;
}

.tasful-market-order-history-filter-btn__icon {
  font-size: 0.875rem;
  line-height: 1;
}

.tasful-market-order-history-filter-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e77600;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.tasful-market-order-history-no-results {
  padding: 28px 16px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--tasful-market-border);
  border-radius: 12px;
}

.tasful-market-order-history-no-results__text {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--tasful-market-muted);
}

.tasful-market-order-history-no-results__btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #aab7b8;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 0.8125rem;
  font-weight: 800;
  cursor: pointer;
}

.tasful-market-order-history-card__status.is-cancelled {
  background: #fef2f2;
  color: #b91c1c;
}

/* 絞り込みボトムシート */
body.tasful-market-order-history-sheet-open {
  overflow: hidden;
}

.tasful-market-order-history-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  align-items: end;
  pointer-events: none;
}

.tasful-market-order-history-sheet[hidden] {
  display: none !important;
}

.tasful-market-order-history-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.45);
  pointer-events: auto;
  cursor: pointer;
}

.tasful-market-order-history-sheet__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 720px);
  width: 100%;
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  animation: tasful-order-history-sheet-in 0.22s ease-out;
}

@keyframes tasful-order-history-sheet-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.tasful-market-order-history-sheet__handle {
  width: 40px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: #d1d5db;
}

.tasful-market-order-history-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--tasful-market-border);
}

.tasful-market-order-history-sheet__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.tasful-market-order-history-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.tasful-market-order-history-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 8px;
  -webkit-overflow-scrolling: touch;
}

.tasful-market-order-history-sheet__foot {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--tasful-market-border);
  background: #fff;
}

.tasful-market-order-history-sheet__clear,
.tasful-market-order-history-sheet__apply {
  min-height: 44px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
}

.tasful-market-order-history-sheet__clear {
  border: 1px solid #aab7b8;
  background: #fff;
  color: #111827;
}

.tasful-market-order-history-sheet__apply {
  border: 1px solid #e77600;
  background: linear-gradient(180deg, #f7dfa5 0%, #f0c14b 100%);
  color: #111827;
}

.tasful-market-order-history-filter-group + .tasful-market-order-history-filter-group {
  margin-top: 16px;
}

.tasful-market-order-history-filter-group__title {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #374151;
}

.tasful-market-order-history-filter-group__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tasful-market-order-history-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.tasful-market-order-history-filter-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tasful-market-order-history-filter-chip.is-active {
  border-color: #e77600;
  background: #fff7ed;
  color: #9a3412;
  box-shadow: inset 0 0 0 1px rgba(231, 118, 0, 0.25);
}
