/* 鹽線 shop skins — themes via [data-theme], layouts via [data-layout] */

.shop-app {
  --shop-bg: #f7f1e8;
  --shop-ink: #1c1410;
  --shop-muted: #6b5b4f;
  --shop-card: #fffdf8;
  --shop-line: #e4d5c4;
  --shop-accent: #b85c38;
  --shop-accent-ink: #fff;
  --shop-ok: #2f6b4f;
  --shop-thumb-a: #d4b48c;
  --shop-thumb-b: #8f6a4a;
  background: var(--shop-bg);
  color: var(--shop-ink);
  min-height: calc(100vh - 44px);
}

.shop-app[data-theme="ink-night"] {
  --shop-bg: #0f1419;
  --shop-ink: #e8eef6;
  --shop-muted: #9aabbd;
  --shop-card: #18212c;
  --shop-line: #2a3544;
  --shop-accent: #5ee0a0;
  --shop-accent-ink: #0b0f14;
  --shop-ok: #5ee0a0;
  --shop-thumb-a: #243044;
  --shop-thumb-b: #3d5a80;
}

.shop-app[data-theme="coastal"] {
  --shop-bg: #e7f3f5;
  --shop-ink: #12323a;
  --shop-muted: #4d6b73;
  --shop-card: #f7fcfd;
  --shop-line: #b7d4da;
  --shop-accent: #0e7490;
  --shop-accent-ink: #fff;
  --shop-ok: #0f766e;
  --shop-thumb-a: #7dd3c7;
  --shop-thumb-b: #0e7490;
}

.shop-app[data-theme="paper-minimal"] {
  --shop-bg: #fafafa;
  --shop-ink: #111;
  --shop-muted: #666;
  --shop-card: #fff;
  --shop-line: #ddd;
  --shop-accent: #111;
  --shop-accent-ink: #fff;
  --shop-ok: #111;
  --shop-thumb-a: #eee;
  --shop-thumb-b: #bbb;
}

.shop-app a {
  color: var(--shop-accent);
}

.shop-wrap {
  width: min(100% - 1.5rem, 76rem);
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.shop-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.shop-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
}

.shop-hero p {
  margin: 0.4rem 0 0;
  color: var(--shop-muted);
  max-width: 36em;
  line-height: 1.7;
}

.shop-cart-btn {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--shop-line);
  background: var(--shop-accent);
  color: var(--shop-accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.shop-cart-btn:hover,
.shop-cart-btn:focus-visible {
  filter: brightness(1.05);
  outline: 2px solid var(--shop-ink);
  outline-offset: 2px;
}

.shop-studio {
  border: 1px solid var(--shop-line);
  background: var(--shop-card);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}

.shop-studio h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.shop-studio-note {
  margin: 0 0 0.85rem;
  color: var(--shop-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.shop-studio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.shop-studio-label {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 4.5rem;
  color: var(--shop-muted);
}

.shop-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.shop-seg-btn {
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--shop-line);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.shop-seg-btn.is-on,
.shop-seg-btn[aria-pressed="true"] {
  background: var(--shop-ink);
  color: var(--shop-bg);
  border-color: var(--shop-ink);
}

.shop-seg-btn[data-theme-swatch="salt-warm"].is-on {
  background: #b85c38;
  border-color: #b85c38;
  color: #fff;
}

.shop-seg-btn[data-theme-swatch="ink-night"].is-on {
  background: #5ee0a0;
  border-color: #5ee0a0;
  color: #0b0f14;
}

.shop-seg-btn[data-theme-swatch="coastal"].is-on {
  background: #0e7490;
  border-color: #0e7490;
  color: #fff;
}

.shop-seg-btn[data-theme-swatch="paper-minimal"].is-on {
  background: #111;
  border-color: #111;
  color: #fff;
}

.shop-shell {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 840px) {
  .shop-shell {
    grid-template-columns: 1fr;
  }
}

.shop-aside {
  border: 1px solid var(--shop-line);
  background: var(--shop-card);
  border-radius: 14px;
  padding: 0.9rem;
  position: sticky;
  top: 56px;
}

.shop-aside h2 {
  margin: 0.75rem 0 0.45rem;
  font-size: 0.95rem;
}

.shop-aside h2:first-child {
  margin-top: 0;
}

.shop-cat {
  display: flex;
  width: 100%;
  text-align: left;
  min-height: 40px;
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.25rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.shop-cat.is-on,
.shop-cat[aria-pressed="true"] {
  background: color-mix(in srgb, var(--shop-accent) 18%, transparent);
  font-weight: 600;
}

.shop-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  font-size: 0.95rem;
}

.shop-price-filter {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.shop-price-filter input {
  min-height: 40px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  background: var(--shop-bg);
  color: inherit;
  font: inherit;
}

.shop-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.shop-search {
  flex: 1 1 14rem;
  min-height: 44px;
  border: 1px solid var(--shop-line);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  background: var(--shop-card);
  color: inherit;
  font: inherit;
}

.shop-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--shop-muted);
  font-size: 0.92rem;
}

.shop-sort select {
  min-height: 44px;
  border: 1px solid var(--shop-line);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  background: var(--shop-card);
  color: inherit;
  font: inherit;
}

.shop-result-meta {
  margin: 0 0 0.85rem;
  color: var(--shop-muted);
  font-size: 0.92rem;
}

.shop-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
}

.shop-app[data-layout="list"] .shop-grid {
  grid-template-columns: 1fr;
}

.shop-app[data-layout="list"] .shop-card {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  align-items: stretch;
}

.shop-app[data-layout="list"] .shop-thumb {
  min-height: 100%;
  aspect-ratio: auto;
}

.shop-app[data-layout="compact"] .shop-grid {
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.55rem;
}

.shop-app[data-layout="compact"] .shop-card-body {
  padding: 0.55rem;
}

.shop-app[data-layout="compact"] .shop-card h2 {
  font-size: 0.95rem;
}

.shop-app[data-layout="compact"] .shop-tags,
.shop-app[data-layout="compact"] .shop-stock {
  display: none;
}

.shop-card {
  background: var(--shop-card);
  border: 1px solid var(--shop-line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shop-thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--shop-thumb-a), var(--shop-thumb-b));
}

.shop-thumb-lg {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.shop-card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.shop-card-cat {
  font-size: 0.78rem;
  color: var(--shop-muted);
  letter-spacing: 0.04em;
}

.shop-card h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.shop-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.shop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.shop-tag {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--shop-line);
  color: var(--shop-muted);
}

.shop-sold {
  color: #a33;
  font-size: 0.9rem;
  font-weight: 600;
}

.shop-stock {
  color: var(--shop-muted);
  font-size: 0.85rem;
}

.shop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.45rem;
}

.shop-btn {
  min-height: 40px;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--shop-line);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.shop-btn:hover,
.shop-btn:focus-visible {
  border-color: var(--shop-ink);
}

.shop-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shop-btn-primary {
  background: var(--shop-accent);
  border-color: var(--shop-accent);
  color: var(--shop-accent-ink);
}

.shop-panel {
  border: 1px solid var(--shop-line);
  background: var(--shop-card);
  border-radius: 14px;
  padding: 1.1rem;
}

.shop-field {
  margin-bottom: 0.75rem;
}

.shop-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.shop-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font: inherit;
  background: var(--shop-bg);
  color: inherit;
}

.shop-field .err {
  color: #a33;
  font-size: 0.85rem;
}

.shop-drawer-backdrop {
  position: fixed;
  inset: 44px 0 0 0;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 39;
  cursor: pointer;
}

.shop-drawer {
  position: fixed;
  inset: 44px 0 0 auto;
  width: min(22rem, 100%);
  background: var(--shop-card);
  color: var(--shop-ink);
  border-left: 1px solid var(--shop-line);
  padding: 1rem;
  z-index: 40;
  overflow: auto;
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.12);
}

.shop-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--shop-line);
  align-items: center;
}

.shop-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  grid-column: 1 / -1;
}

.shop-qty .shop-btn {
  min-height: 36px;
  min-width: 36px;
  padding: 0;
}

.pay-skin {
  background: #0f1720;
  color: #e8eef6;
  min-height: calc(100vh - 44px);
  padding: 2rem 1rem;
}

.pay-box {
  width: min(100%, 26rem);
  margin: 0 auto;
  background: #18212c;
  border: 1px solid #2a3544;
  border-radius: 14px;
  padding: 1.25rem;
}

.pay-box h1 {
  margin-top: 0;
}

.pay-note {
  border: 1px solid rgba(240, 198, 116, 0.45);
  color: #f0c674;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.92rem;
}

.merchant {
  background: #111827;
  color: #e5e7eb;
  min-height: calc(100vh - 44px);
}

.merchant .shop-wrap h1,
.merchant .shop-panel {
  color: inherit;
}

.merchant .shop-panel {
  background: #1f2937;
  border-color: #374151;
}

.merchant .shop-muted,
.merchant .shop-hero p {
  color: #9ca3af;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  padding: 0.45rem 0 0.45rem 0.9rem;
  border-left: 2px solid #4b5563;
  margin-left: 0.35rem;
  color: #9ca3af;
  font-size: 0.92rem;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
  border: 1px solid currentColor;
}

.status-paid {
  color: #34d399;
}

.status-fail {
  color: #f87171;
}

.status-pending {
  color: #fbbf24;
}

@media (prefers-reduced-motion: reduce) {
  .shop-cart-btn,
  .shop-btn,
  .shop-seg-btn,
  .shop-cat {
    transition: none;
  }
}
