/* Ember Terrarium — cart: perforated ticket stubs + sticky glass tally
   Archivo + Lora — distinct from home/shop/track */

body.tk-ticket *,
body.tk-ticket *::before,
body.tk-ticket *::after { box-sizing: border-box; }

body.tk-ticket {
  --void: #1C110D;
  --soil: #2A1A14;
  --glass: rgba(48, 28, 20, 0.58);
  --mist: #F6EDE4;
  --mute: #C4A992;
  --clay: #E07A5F;
  --moss: #7BAF7B;
  --honey: #F0C27A;
  --line: rgba(255, 214, 170, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  margin: 0;
  min-height: 100vh;
  color: var(--mist);
  font-family: 'Archivo', system-ui, sans-serif;
  background-color: var(--void);
  background-image:
    radial-gradient(ellipse 55% 42% at 90% 5%, rgba(240, 194, 122, 0.12), transparent 52%),
    radial-gradient(ellipse 48% 40% at 5% 75%, rgba(224, 122, 95, 0.14), transparent 50%),
    radial-gradient(ellipse 40% 28% at 50% 100%, rgba(123, 175, 123, 0.08), transparent 50%);
  -webkit-font-smoothing: antialiased;
}

.tk-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tk-root .page-main {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.tk-shell {
  flex: 1;
  width: min(100% - 2rem, 1120px);
  margin: 0 auto;
  padding: 1rem 0 2.2rem;
}

/* —— Mast —— */
.tk-mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tk-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--mist);
  text-decoration: none;
  min-width: 0;
}

.tk-brand em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  padding: 0.38rem 0.5rem;
  border: 1px dashed rgba(255, 214, 170, 0.3);
  background: var(--glass);
  backdrop-filter: blur(16px);
}

.tk-brand span {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.05rem, 2.2vw, 1.18rem);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-mast-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.22rem;
  padding: 0.28rem;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.tk-mast-links a {
  color: #EADFD4;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.48rem 0.78rem;
  transition: background 0.2s, color 0.2s;
}

.tk-mast-links a.is-on,
.tk-mast-links a:hover {
  background: var(--clay);
  color: var(--void);
}

.tk-bag {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0;
}

.tk-bag.has-items:not(.is-on) {
  background: rgba(224, 122, 95, 0.22);
}

.tk-bag em {
  font-style: normal;
  min-width: 1.15rem;
  text-align: center;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--void);
  color: var(--honey);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.tk-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--honey);
  font-weight: 700;
}

.tk-intro h1,
.tk-fallow h1 {
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.tk-intro h1 em,
.tk-fallow h1 em {
  font-style: italic;
  color: var(--clay);
}

.tk-dek,
.tk-fallow-dek {
  margin: 0.7rem 0 0;
  max-width: 40ch;
  color: var(--mute);
  line-height: 1.55;
  font-size: 1.02rem;
}

.tk-intro { margin-bottom: 1.4rem; }

/* Empty */
.tk-fallow {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 0 2.5rem;
}

.tk-fallow .tk-btn { margin-top: 1.35rem; align-self: flex-start; }

/* Spread */
.tk-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(290px, 30%);
  gap: 1.25rem;
  align-items: start;
}

.tk-yard {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Ticket stubs */
.tk-stub {
  --si: 0;
  position: relative;
  display: grid;
  grid-template-columns: 96px 16px minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 128px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  transform: rotate(calc((var(--si) % 2 - 0.5) * 0.55deg));
  box-shadow: 0 10px 28px rgba(12, 6, 4, 0.26);
  animation: tk-stub-in 0.45s var(--ease) both;
  animation-delay: calc(var(--si) * 0.05s);
  transition: border-color 0.2s, transform 0.2s;
}

.tk-stub:hover {
  border-color: rgba(224, 122, 95, 0.4);
  transform: rotate(0deg) translateY(-1px);
}

@keyframes tk-stub-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: rotate(calc((var(--si) % 2 - 0.5) * 0.55deg)); }
}

.tk-stub::before,
.tk-stub::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--void);
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 170, 0.12);
  z-index: 2;
}

.tk-stub::before { left: -9px; }
.tk-stub::after { right: -9px; }

.tk-stub-idx {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 3;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--honey);
  background: rgba(28, 17, 13, 0.75);
  padding: 0.15rem 0.35rem;
  font-weight: 700;
}

.tk-stub-media {
  display: block;
  overflow: hidden;
  background: var(--soil);
}

.tk-stub-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}

.tk-stub:hover .tk-stub-media img { transform: scale(1.04); }

.tk-stub-ph {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 128px;
  background:
    radial-gradient(circle at 40% 40%, rgba(224, 122, 95, 0.35), transparent 55%),
    var(--soil);
}

.tk-perf {
  background:
    linear-gradient(var(--void), var(--void)) center / 1px 100% no-repeat,
    radial-gradient(circle, var(--void) 2.8px, transparent 3.2px) center / 100% 13px;
}

.tk-stub-body {
  padding: 0.85rem 0.65rem 0.85rem 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.tk-sku {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 700;
}

.tk-stub-body h2 {
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.22;
}

.tk-stub-body h2 a {
  color: var(--mist);
  text-decoration: none;
}

.tk-stub-body h2 a:hover { color: var(--honey); }

.tk-variant { margin: 0; font-size: 0.82rem; color: var(--mute); }

.tk-unit {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
  color: var(--moss);
  font-weight: 700;
}
.tk-unit span { color: var(--mute); font-weight: 500; }

.tk-qty {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  border: 1px dashed rgba(255, 214, 170, 0.28);
  background: rgba(28, 17, 13, 0.42);
  width: max-content;
}

.tk-qty button {
  width: 2.05rem;
  height: 2.05rem;
  border: 0;
  background: transparent;
  color: var(--mist);
  font-size: 1.05rem;
  cursor: pointer;
  transition: color 0.15s;
}

.tk-qty button:hover { color: var(--honey); }

.tk-qty input {
  width: 2.5rem;
  height: 2.05rem;
  border: 0;
  border-left: 1px dashed rgba(255, 214, 170, 0.2);
  border-right: 1px dashed rgba(255, 214, 170, 0.2);
  background: transparent;
  color: var(--mist);
  text-align: center;
  font: inherit;
  font-weight: 700;
  -moz-appearance: textfield;
}

.tk-qty input::-webkit-outer-spin-button,
.tk-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

.tk-stub-line {
  align-self: center;
  padding: 0 1.05rem 0 0.45rem;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.2rem;
  color: var(--honey);
  white-space: nowrap;
  font-weight: 600;
}

/* Foil + actions */
.tk-foil {
  margin-top: 0.25rem;
  padding: 0.75rem 1rem;
  background: rgba(48, 28, 20, 0.42);
  border: 1px dashed rgba(255, 214, 170, 0.22);
}

.tk-foil summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  list-style: none;
}

.tk-foil summary::-webkit-details-marker { display: none; }

.tk-foil summary em {
  font-style: normal;
  color: var(--mute);
  font-weight: 500;
  margin-left: 0.4rem;
  text-transform: none;
  letter-spacing: 0;
}

.tk-foil-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.tk-foil-body input {
  flex: 1 1 160px;
  min-height: 2.5rem;
  border: 1px solid var(--line);
  background: rgba(28, 17, 13, 0.48);
  color: var(--mist);
  padding: 0.45rem 0.8rem;
  font: inherit;
  border-radius: 0;
}

.tk-foil-body input:focus {
  outline: none;
  border-color: var(--honey);
}

.tk-foil-note {
  margin: 0;
  width: 100%;
  font-size: 0.8rem;
  color: var(--mute);
}
.tk-foil-note.is-held { color: var(--moss); }

.tk-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

/* Sticky tally */
.tk-tally {
  position: sticky;
  top: 1rem;
}

.tk-tally-glass {
  padding: 1.2rem 1.2rem 1.3rem;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 14px));
  box-shadow: 0 16px 40px rgba(10, 5, 3, 0.32);
}

.tk-tally-glass h2 {
  margin: 0 0 0.95rem;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
}

.tk-tally-row,
.tk-tally-grand {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.42rem 0;
  font-size: 0.9rem;
  color: var(--mute);
}

.tk-tally-row strong { color: var(--mist); font-weight: 700; }

.tk-tally-grand {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(255, 214, 170, 0.24);
  align-items: baseline;
}

.tk-tally-grand span {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
}

.tk-tally-grand strong {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.55rem;
  color: var(--honey);
  font-weight: 600;
}

.tk-tally-note {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--mute);
  line-height: 1.45;
}
.tk-tally-note em { font-style: italic; color: var(--moss); }

.tk-tally-go {
  width: 100%;
  margin-top: 1.05rem;
  justify-content: center;
}

.tk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, filter 0.2s;
}

.tk-btn-fill {
  background: linear-gradient(135deg, var(--clay), #c46248);
  color: var(--void);
}
.tk-btn-fill:hover {
  filter: brightness(1.06);
  color: var(--void);
}

.tk-btn-ghost {
  background: transparent;
  color: var(--mist);
  border-color: rgba(255, 214, 170, 0.24);
}
.tk-btn-ghost:hover {
  border-color: var(--honey);
  color: var(--honey);
}

.tk-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
  width: min(100% - 2rem, 1120px);
  margin: 0 auto 1.3rem;
  padding: 0.95rem 1.15rem;
  color: var(--mute);
  font-size: 0.86rem;
  background: var(--glass);
  border: 1px solid var(--line);
}

.tk-foot a {
  color: var(--honey);
  text-decoration: none;
  font-weight: 700;
}
.tk-foot a:hover { color: var(--clay); }

@media (max-width: 900px) {
  .tk-spread { grid-template-columns: 1fr; }
  .tk-tally { position: static; }

  .tk-stub {
    grid-template-columns: 80px 14px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .tk-stub-line {
    grid-column: 1 / -1;
    justify-self: end;
    padding: 0 1rem 0.85rem;
  }
}

@media (max-width: 640px) {
  .tk-shell { width: min(100% - 1.4rem, 1120px); padding-top: 0.75rem; }

  .tk-mast {
    flex-direction: column;
    align-items: stretch;
  }

  .tk-mast-links { justify-content: flex-start; }

  .tk-stub {
    grid-template-columns: 68px 12px minmax(0, 1fr);
    transform: none;
  }

  .tk-stub:hover { transform: none; }

  .tk-form-actions { flex-direction: column; }
  .tk-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tk-stub {
    animation: none !important;
    transform: none !important;
  }
  .tk-stub-media img,
  .tk-btn {
    transition: none !important;
  }
}
