/* TroveMart Deals — front-end styles */
:root { --tmd-accent: #0b6e5c; }

.tmd-panel {
  margin: 22px 0;
  font-family: inherit;
}
.tmd-panel__head { margin-bottom: 12px; }
.tmd-panel__title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 3px;
  letter-spacing: -.01em;
}
.tmd-panel__sub {
  font-size: .85rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* ---- Tier cards ---- */
.tmd-tiers { display: flex; flex-direction: column; gap: 10px; }
.tmd-tier {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border: 1.5px solid #e3e6e8;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.tmd-tier:hover { border-color: #c7cdd1; }
.tmd-tier.is-active {
  border-color: var(--tmd-accent);
  box-shadow: 0 0 0 1px var(--tmd-accent), 0 6px 18px rgba(16,20,24,.06);
  background: color-mix(in srgb, var(--tmd-accent) 4%, #fff);
}
.tmd-tier input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.tmd-tier__radio {
  flex: none;
  width: 21px; height: 21px;
  border: 2px solid #cbd2d7;
  border-radius: 50%;
  position: relative;
  transition: border-color .16s;
}
.tmd-tier.is-active .tmd-tier__radio { border-color: var(--tmd-accent); }
.tmd-tier.is-active .tmd-tier__radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--tmd-accent);
}
.tmd-tier__main { flex: 1; min-width: 0; }
.tmd-tier__label {
  display: block;
  font-weight: 700;
  font-size: .97rem;
  line-height: 1.3;
  color: #111827;
}
.tmd-tier__qty {
  display: block;
  font-size: .82rem;
  color: #6b7280;
  margin-top: 2px;
}
.tmd-tier__off { color: var(--tmd-accent); font-weight: 700; }
.tmd-tier__prices { text-align: right; flex: none; }
.tmd-tier__total {
  display: block;
  font-weight: 800;
  font-size: 1.02rem;
  color: #111827;
  line-height: 1.25;
}
.tmd-tier__unit { display: block; font-size: .76rem; color: #6b7280; }
.tmd-tier__save {
  display: inline-block;
  margin-top: 4px;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  background: var(--tmd-accent);
  border-radius: 6px;
  padding: 3px 7px;
}
.tmd-tier__badge {
  position: absolute;
  top: -9px;
  right: 14px;
  background: #111827;
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.tmd-tier.is-active .tmd-tier__badge { background: var(--tmd-accent); }
.tmd-tier.has-badge { margin-top: 6px; }

/* Compact rows variant */
.tmd-panel--rows .tmd-tier { padding: 11px 14px; border-radius: 10px; }
.tmd-panel--rows .tmd-tier__unit { display: none; }
.tmd-panel--rows .tmd-tier__save { margin-top: 2px; }

/* ---- Shop loop badge ---- */
.tmd-loop-badge {
  display: inline-block;
  margin: 10px 16px 0;
  background: color-mix(in srgb, var(--tmd-accent) 10%, #fff);
  color: var(--tmd-accent);
  border: 1px solid color-mix(in srgb, var(--tmd-accent) 25%, #fff);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 4px 9px;
  border-radius: 999px;
}

/* ---- Cart / checkout / drawer upsell ---- */
.tmd-upsell { margin: 0 0 20px; }
.tmd-upsell--empty { display: none; }
.tmd-upsell--drawer { margin: 0; padding: 0 22px 12px; }

.tmd-saved {
  display: flex;
  align-items: center;
  gap: 9px;
  background: color-mix(in srgb, var(--tmd-accent) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--tmd-accent) 22%, #fff);
  color: var(--tmd-accent);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: .88rem;
  margin-bottom: 10px;
}
.tmd-saved svg { width: 17px; height: 17px; flex: none; }
.tmd-saved strong { font-weight: 800; }

.tmd-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--tmd-accent) 40%, #fff);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.tmd-nudge__text { min-width: 0; }
.tmd-nudge__text strong { display: block; font-size: .9rem; color: #111827; line-height: 1.35; }
.tmd-nudge__text span { display: block; font-size: .78rem; color: #6b7280; margin-top: 2px; }
.tmd-nudge__btn {
  flex: none;
  border: none;
  background: var(--tmd-accent);
  color: #fff;
  font-weight: 800;
  font-size: .82rem;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  transition: filter .15s;
}
.tmd-nudge__btn:hover { filter: brightness(.92); }
.tmd-nudge__btn[disabled] { opacity: .55; cursor: default; }

.tmd-switcher { display: flex; flex-direction: column; gap: 10px; }
.tmd-switcher__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 0;
  border-top: 1px solid #eceff1;
}
.tmd-switcher__name { font-size: .84rem; color: #6b7280; min-width: 0; flex: 1; }
.tmd-switcher__opts { display: flex; gap: 6px; }
.tmd-opt {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  border: 1.5px solid #e3e6e8;
  border-radius: 10px;
  background: #fff;
  padding: 7px 9px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.1;
  transition: border-color .15s, background .15s;
}
.tmd-opt b { font-size: .95rem; font-weight: 800; color: #111827; }
.tmd-opt i { font-style: normal; font-size: .66rem; font-weight: 700; color: var(--tmd-accent); margin-top: 2px; }
.tmd-opt:hover { border-color: #c7cdd1; }
.tmd-opt.is-active {
  border-color: var(--tmd-accent);
  background: color-mix(in srgb, var(--tmd-accent) 7%, #fff);
}
.tmd-busy { opacity: .5; pointer-events: none; }

@media (max-width: 560px) {
  .tmd-tier { padding: 13px 13px; gap: 10px; }
  .tmd-tier__label { font-size: .92rem; }
  .tmd-nudge { flex-direction: column; align-items: stretch; }
  .tmd-nudge__btn { width: 100%; }
  .tmd-switcher__row { flex-direction: column; align-items: flex-start; }
}
