/**
 * Wiretag Rail — Appily-Ninetyfour cart ONLY
 * Isolated shell: no shared .page-cart / a94-cart.css / peer Furrow·Stencil·Slipstack CSS.
 * Nursery wire-tags on a galvanized rail · twine envelope · clip-board checkout.
 * Not sidebar-summary, card rows, Slipstack slip/sleeve/ribbon,
 * Stencil Dock plates, Furrow Rows soil beds, Pegboard hang-tags, tote/macro-cart.
 */

.page-a94-wiretag {
  /* Distinct Wiretag palette — not orchard-shared / Furrow / Stencil colors */
  --wt-rail: #2A3230;
  --wt-zinc: #5A6B66;
  --wt-kraft: #EFE9DC;
  --wt-blank: #FFFEF9;
  --wt-oxide: #B85C38;
  --wt-oxide-hot: #9A4A2C;
  --wt-sap: #3D6B4F;
  --wt-mute: #4A524C;
  --wt-ink: #1A1F1D;
  --wt-wire: rgba(42, 50, 48, 0.22);
  --wt-display: "Instrument Serif", Georgia, serif;
  --wt-ui: "Onest", system-ui, sans-serif;

  /* Own field — not global orchard wash / Furrow loam mist */
  background:
    radial-gradient(ellipse 55% 35% at 50% -5%, rgba(90, 107, 102, 0.18), transparent 60%),
    linear-gradient(180deg, #E8E4D8 0%, var(--wt-kraft) 42%, #E3DDD0 100%) !important;
  color: var(--wt-ink);
  font-family: var(--wt-ui);
  min-height: 100vh;
}

/* Kill leftover peer cart chrome if any legacy stylesheet sneaks in */
.page-a94-wiretag .a94-slate,
.page-a94-wiretag .a93-fu-furrow,
.page-a94-wiretag .sd-stack,
.page-a94-wiretag .ledger-slip {
  display: none !important;
}

.page-a94-wiretag .wt-main {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5.5rem 0 4rem;
}

/* —— Mast —— */
.wt-mast {
  margin-bottom: 2rem;
}
.wt-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wt-mute);
}
.wt-mast h1 {
  margin: 0;
  font-family: var(--wt-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--wt-rail);
}
.wt-mast h1 em {
  font-style: italic;
  color: var(--wt-oxide);
}
.wt-lede {
  margin: 0.75rem 0 0;
  max-width: 38rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--wt-mute);
}

/* —— Empty —— */
.wt-empty {
  position: relative;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  background: var(--wt-blank);
  border: 1px solid var(--wt-wire);
}
.wt-empty-rail {
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 6px;
  background: linear-gradient(90deg, #3a4441, #5a6662 40%, #3a4441);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.wt-empty-mark {
  margin: 1.5rem 0 0.25rem;
  font-family: var(--wt-display);
  font-size: 4rem;
  line-height: 1;
  color: #8A938C;
}
.wt-empty h2 {
  margin: 0;
  font-family: var(--wt-display);
  font-size: 1.75rem;
  font-weight: 400;
}
.wt-empty p {
  margin: 0.5rem auto 1.25rem;
  max-width: 28rem;
  color: var(--wt-mute);
}

/* —— Rail + tags —— */
.wt-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 1.35rem;
  margin-bottom: 1.25rem;
}
.wt-rail-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background:
    repeating-linear-gradient(
      90deg,
      #3a4441 0 6px,
      #4e5854 6px 10px,
      #3a4441 10px 16px
    ),
    linear-gradient(180deg, #555f5b, #2a3230);
  border-radius: 2px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
  z-index: 2;
}

.wt-tag {
  --wt-i: 0;
  position: relative;
  display: grid;
  grid-template-columns: auto 72px 1fr auto auto;
  grid-template-areas:
    "wire thumb meta wheel stamp"
    "wire thumb meta wheel untwist";
  gap: 0.35rem 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem 0.85rem 0.65rem;
  margin-top: 0.15rem;
  background:
    linear-gradient(135deg, rgba(184, 92, 56, 0.04), transparent 40%),
    var(--wt-blank);
  border: 1px solid var(--wt-wire);
  border-left: 3px solid var(--wt-sap);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transform-origin: 12px -8px;
  animation: wt-pendulum 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--wt-i) * 70ms);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.wt-tag.is-flash {
  box-shadow: inset 0 0 0 2px var(--wt-oxide);
  border-color: var(--wt-oxide);
}
.wt-tag.is-untwisting {
  animation: wt-untwist 0.38s ease forwards;
}

@keyframes wt-pendulum {
  from {
    opacity: 0;
    transform: rotate(-7deg) translateY(-18px);
  }
  60% {
    opacity: 1;
    transform: rotate(2deg) translateY(0);
  }
  to {
    opacity: 1;
    transform: rotate(0) translateY(0);
  }
}
@keyframes wt-untwist {
  to {
    opacity: 0;
    transform: rotate(18deg) translateY(28px) scale(0.92);
  }
}

.wt-wire {
  grid-area: wire;
  position: relative;
  width: 18px;
  height: 100%;
  min-height: 64px;
  align-self: stretch;
}
.wt-eye {
  position: absolute;
  top: -1.15rem;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border: 2px solid var(--wt-rail);
  border-radius: 50%;
  background: var(--wt-kraft);
  z-index: 3;
  box-shadow: 0 -6px 0 -3px var(--wt-rail);
}
.wt-twist {
  position: absolute;
  top: -0.35rem;
  left: 50%;
  width: 2px;
  height: calc(50% + 0.5rem);
  margin-left: -1px;
  background: repeating-linear-gradient(
    180deg,
    var(--wt-rail) 0 3px,
    transparent 3px 5px
  );
  transform-origin: top center;
}
.wt-tag.is-untwisting .wt-twist {
  animation: wt-spin-wire 0.38s ease forwards;
}
@keyframes wt-spin-wire {
  to {
    transform: rotate(540deg);
    opacity: 0.2;
  }
}

.wt-thumb {
  grid-area: thumb;
  display: block;
  width: 72px;
  height: 72px;
  overflow: hidden;
  background: #e8e4d8;
  border: 1px solid var(--wt-wire);
}
.wt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wt-thumb-ph {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #ddd8cc,
    #ddd8cc 4px,
    #e8e4d8 4px,
    #e8e4d8 8px
  );
}

.wt-meta {
  grid-area: meta;
  min-width: 0;
}
.wt-meta h2 {
  margin: 0;
  font-family: var(--wt-display);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.2;
}
.wt-meta h2 a {
  color: var(--wt-ink);
  text-decoration: none;
}
.wt-meta h2 a:hover {
  color: var(--wt-oxide);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wt-meta p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--wt-mute);
}

/* Thumbwheel qty */
.wt-wheel {
  grid-area: wheel;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 52px;
  padding: 2px;
  background: var(--wt-rail);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.wt-wheel-btn {
  width: 100%;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c5ccc8;
  font-size: 0.55rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}
.wt-wheel-btn:hover {
  color: #fff;
}
.wt-wheel-btn.is-tick {
  animation: wt-tick 0.2s ease;
  color: #fff;
}
@keyframes wt-tick {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
.wt-wheel input[type="number"] {
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-block: 1px solid rgba(255, 255, 255, 0.12);
  background: #1f2624;
  color: #fff;
  font-family: var(--wt-ui);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.wt-wheel input::-webkit-outer-spin-button,
.wt-wheel input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wt-stamp {
  grid-area: stamp;
  font-family: var(--wt-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--wt-sap);
  white-space: nowrap;
  align-self: end;
}
.wt-untwist {
  grid-area: untwist;
  justify-self: end;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--wt-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wt-oxide);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: start;
}
.wt-untwist:hover {
  color: var(--wt-rail);
}

/* —— Twine envelope —— */
.wt-twine {
  margin-bottom: 1.25rem;
  background: #e7dfcf;
  border: 1px dashed rgba(42, 50, 48, 0.35);
  overflow: hidden;
}
.wt-twine-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--wt-ui);
  color: var(--wt-ink);
}
.wt-twine-head strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}
.wt-twine-head span > span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--wt-mute);
}
.wt-knot {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--wt-oxide);
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.wt-twine.is-open .wt-knot {
  transform: rotate(135deg);
  color: var(--wt-sap);
}
.wt-twine-body {
  padding: 0 1.1rem 1.15rem 4.2rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--wt-mute);
  animation: wt-unseal 0.35s ease;
}
.wt-twine-body em {
  font-style: italic;
  color: var(--wt-sap);
  font-family: var(--wt-display);
}
@keyframes wt-unseal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.wt-promo {
  margin-top: 0.85rem;
}
.wt-promo label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wt-rail);
}
.wt-promo-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.wt-promo input {
  flex: 1 1 10rem;
  min-width: 0;
  height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid var(--wt-wire);
  background: var(--wt-blank);
  font-family: var(--wt-ui);
  font-size: 0.9rem;
  color: var(--wt-ink);
}
.wt-promo input:focus {
  outline: 2px solid var(--wt-oxide);
  outline-offset: 1px;
}
.wt-promo-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--wt-sap);
}

/* —— Clip board checkout —— */
.wt-clip {
  position: relative;
  padding: 1.5rem 1.25rem 1.35rem;
  background: var(--wt-blank);
  border: 1px solid var(--wt-wire);
  box-shadow: 0 1px 0 rgba(42, 50, 48, 0.06);
}
.wt-clip-jaw {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 72px;
  height: 18px;
  margin-left: -36px;
  background: linear-gradient(180deg, #4a5551, var(--wt-rail));
  border-radius: 2px 2px 4px 4px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
.wt-clip-jaw::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #1a1f1d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.wt-score {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  padding-top: 0.35rem;
}
.wt-score p {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  padding-bottom: 0.45rem;
  border-bottom: 1px dotted var(--wt-wire);
  font-size: 0.92rem;
  color: var(--wt-mute);
}
.wt-score strong {
  font-family: var(--wt-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--wt-ink);
}
.wt-due {
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
  color: var(--wt-ink) !important;
  font-weight: 600;
}
.wt-due strong {
  font-size: 1.55rem;
  color: var(--wt-oxide);
}

.wt-clip-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.wt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
  font-family: var(--wt-ui);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
}
.wt-btn--ghost {
  background: transparent;
  border-color: var(--wt-wire);
  color: var(--wt-rail);
}
.wt-btn--ghost:hover {
  border-color: var(--wt-rail);
  background: rgba(42, 50, 48, 0.04);
}
.wt-btn--primary {
  background: var(--wt-oxide);
  color: #fffef9;
  border-color: var(--wt-oxide);
  letter-spacing: 0.02em;
}
.wt-btn--primary:hover {
  background: #a04e2f;
  border-color: #a04e2f;
}
.wt-cta {
  position: relative;
  overflow: hidden;
}
.wt-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.18);
  transform: scaleY(1);
  transform-origin: top;
  transition: transform 0.22s ease;
}
.wt-cta:hover::before {
  transform: scaleY(2.2);
}
.wt-cta:hover {
  transform: translateY(1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.wt-keep {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wt-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wt-keep:hover {
  color: var(--wt-rail);
}

.page-a94-wiretag.is-updated .wt-tag {
  animation: none;
  box-shadow: inset 0 0 0 1px rgba(61, 107, 79, 0.35);
}

/* —— Responsive —— */
@media (max-width: 720px) {
  .page-a94-wiretag .wt-main {
    width: min(100% - 1.25rem, 920px);
    padding-top: 1.25rem;
  }
  .wt-tag {
    grid-template-columns: auto 64px 1fr auto;
    grid-template-areas:
      "wire thumb meta stamp"
      "wire thumb meta wheel"
      "wire thumb untwist untwist";
    gap: 0.4rem 0.65rem;
    padding: 0.75rem 0.75rem 0.75rem 0.45rem;
  }
  .wt-thumb {
    width: 64px;
    height: 64px;
  }
  .wt-stamp {
    align-self: start;
    font-size: 1.05rem;
  }
  .wt-untwist {
    justify-self: start;
    margin-top: 0.15rem;
  }
  .wt-twine-body {
    padding-left: 1.1rem;
  }
  .wt-clip-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .wt-btn {
    width: 100%;
  }
  .wt-keep {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wt-tag,
  .wt-tag.is-untwisting,
  .wt-twine-body,
  .wt-wheel-btn.is-tick,
  .wt-knot {
    animation: none !important;
    transition: none !important;
  }
  .wt-tag.is-untwisting {
    opacity: 0.4;
  }
}
