/* Appily thirtythree — Harvest Weigh Station cart (unique market scale layout) */

.page-cart-scale {
  --sc-burlap: #e8dcc8;
  --sc-burlap-deep: #c9b896;
  --sc-wood: #6b4f3a;
  --sc-wood-dark: #3d2b1f;
  --sc-brass: #c9a227;
  --sc-brass-deep: #8b6914;
  --sc-paper: #fffef8;
  --sc-ink: #2a2218;
  --sc-muted: #6b5f52;
  --sc-line: rgba(107, 79, 58, 0.18);
  --sc-teal: var(--a33-teal);
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(201, 162, 39, 0.1), transparent 55%),
    linear-gradient(180deg, var(--sc-burlap) 0%, var(--a33-cream) 32%, var(--a33-cream) 100%);
}

.a33-scale {
  padding-bottom: 3.5rem;
}

/* ── Scale deck hero ── */
.a33-scale-deck {
  position: relative;
  padding: 2.35rem 0 3rem;
  background:
    linear-gradient(180deg, var(--sc-wood-dark) 0%, var(--sc-wood) 55%, #5a4030 100%);
  color: #fff;
  overflow: hidden;
}

.a33-scale-burlap {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0,
      transparent 3px,
      rgba(0, 0, 0, 0.04) 3px,
      rgba(0, 0, 0, 0.04) 6px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent 0,
      transparent 3px,
      rgba(255, 255, 255, 0.03) 3px,
      rgba(255, 255, 255, 0.03) 6px
    );
  pointer-events: none;
}

.a33-scale-deck-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}

.a33-scale-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--a33-lime);
}

.a33-scale-deck h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 800;
  line-height: 1.08;
}

.a33-scale-deck h1 em {
  font-style: normal;
  color: var(--a33-carrot);
}

.a33-scale-lede {
  margin: 0;
  max-width: 46ch;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.a33-scale-beam {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.a33-scale-beam-arm {
  position: relative;
  width: 168px;
  height: 72px;
}

.a33-scale-beam-fulcrum {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 22px solid var(--sc-brass-deep);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.a33-scale-beam-rod {
  position: absolute;
  top: 18px;
  left: 8%;
  right: 8%;
  height: 5px;
  background: linear-gradient(90deg, var(--sc-brass-deep), var(--sc-brass), var(--sc-brass-deep));
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: rotate(-3deg);
  transform-origin: center;
}

.a33-scale-beam-pan {
  position: absolute;
  top: 24px;
  width: 44px;
  height: 28px;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(180deg, #b8b8b8, #888);
  border: 2px solid #666;
  box-shadow: inset 0 4px 8px rgba(255, 255, 255, 0.25);
}

.a33-scale-beam-pan-left {
  left: 6%;
  transform: rotate(8deg);
}

.a33-scale-beam-pan-right {
  right: 6%;
  transform: rotate(-12deg);
}

.a33-scale-dial {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 0.75rem 1rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.2), transparent 50%),
    linear-gradient(145deg, #f0e6d0, var(--sc-burlap-deep));
  border: 4px solid var(--sc-brass);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
  color: var(--sc-wood-dark);
  text-align: center;
}

.a33-scale-dial-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px dashed rgba(107, 79, 58, 0.25);
  pointer-events: none;
}

.a33-scale-dial strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--sc-wood-dark);
}

.a33-scale-dial span {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 0.15rem;
}

.a33-scale-deck-edge {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 14px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--sc-burlap-deep) 0,
      var(--sc-burlap-deep) 18px,
      var(--sc-burlap) 18px,
      var(--sc-burlap) 36px
    );
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.12);
}

/* ── Stage ── */
.a33-scale-stage {
  margin-top: 1.75rem;
}

/* Empty state */
.a33-scale-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--sc-paper);
  border-radius: 20px;
  border: 2px dashed var(--sc-line);
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 12px 32px rgba(107, 79, 58, 0.08);
}

.a33-scale-empty-pan {
  position: relative;
  width: 120px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(180deg, #d0d0d0, #9a9a9a);
  border: 3px solid #777;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.15),
    inset 0 6px 12px rgba(255, 255, 255, 0.3);
}

.a33-scale-empty-pan::before {
  content: '';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 18px;
  background: var(--sc-brass);
  border-radius: 2px;
}

.a33-scale-empty-readout {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.55rem;
  background: var(--sc-wood-dark);
  color: var(--a33-lime);
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  white-space: nowrap;
}

.a33-scale-empty h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--sc-ink);
}

.a33-scale-empty p {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--sc-muted);
  line-height: 1.55;
}

/* Layout */
.a33-scale-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 320px);
  gap: 1.5rem;
  align-items: start;
}

/* Ticket board */
.a33-scale-board {
  background: var(--sc-paper);
  border-radius: 18px;
  border: 2px solid var(--sc-line);
  box-shadow:
    0 16px 40px rgba(107, 79, 58, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.a33-scale-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.12), rgba(26, 83, 92, 0.08));
  border-bottom: 2px solid var(--sc-line);
}

.a33-scale-board-head h2 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--sc-ink);
}

.a33-scale-board-head p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--sc-muted);
}

.a33-scale-board-code {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--sc-teal);
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
}

.a33-scale-spike-rail {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 0.65rem 1rem 0;
  background: linear-gradient(180deg, #4a4a4a, #2a2a2a);
  border-bottom: 3px solid #1a1a1a;
}

.a33-scale-spike {
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, #aaa, #666);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.15);
}

.a33-scale-tickets {
  list-style: none;
  margin: 0;
  padding: 1.15rem 1.35rem 0.75rem;
  display: grid;
  gap: 0.85rem;
}

.a33-scale-ticket {
  position: relative;
  padding-top: 0.35rem;
}

.a33-scale-ticket-hole {
  position: absolute;
  top: 0;
  left: 1.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sc-paper);
  border: 2px solid var(--sc-line);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.a33-scale-ticket-body {
  position: relative;
  background: #fff;
  border: 1px solid var(--sc-line);
  border-left: 4px solid var(--sc-brass);
  border-radius: 4px 12px 12px 4px;
  box-shadow:
    0 4px 14px rgba(107, 79, 58, 0.08),
    2px 2px 0 rgba(107, 79, 58, 0.06);
  transform: rotate(var(--ticket-tilt, -0.6deg));
  transition: box-shadow 0.2s, transform 0.15s;
}

.a33-scale-ticket:nth-child(even) .a33-scale-ticket-body {
  --ticket-tilt: 0.5deg;
}

.a33-scale-ticket:nth-child(3n) .a33-scale-ticket-body {
  --ticket-tilt: -0.3deg;
}

.a33-scale-ticket-body:hover {
  box-shadow: 0 8px 22px rgba(107, 79, 58, 0.12);
  transform: rotate(0deg) translateY(-1px);
}

.a33-scale-ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  background: repeating-linear-gradient(
    180deg,
    rgba(201, 162, 39, 0.06) 0,
    rgba(201, 162, 39, 0.06) 1px,
    transparent 1px,
    transparent 4px
  );
  border-bottom: 1px dashed var(--sc-line);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sc-muted);
}

.a33-scale-ticket-num {
  font-family: 'Consolas', 'Courier New', monospace;
  color: var(--sc-teal);
}

.a33-scale-ticket-stamp {
  font-style: normal;
  opacity: 0.85;
}

.a33-scale-ticket-main {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem 0.95rem;
}

.a33-scale-ticket-thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: var(--sc-paper);
  border: 1px solid var(--sc-line);
  overflow: hidden;
  flex-shrink: 0;
}

.a33-scale-ticket-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.35rem;
}

.a33-scale-ticket-placeholder {
  font-size: 1.5rem;
  opacity: 0.45;
}

.a33-scale-ticket-info {
  min-width: 0;
}

.a33-scale-ticket-info h3 {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
}

.a33-scale-ticket-info h3 a {
  color: var(--sc-ink);
  text-decoration: none !important;
}

.a33-scale-ticket-info h3 a:hover {
  color: var(--sc-teal);
}

.a33-scale-ticket-meta {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  color: var(--sc-muted);
}

.a33-scale-ticket-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sc-teal);
}

.a33-scale-ticket-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.a33-scale-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--sc-paper);
}

.a33-scale-qty-btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: rgba(107, 79, 58, 0.08);
  color: var(--sc-wood);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}

.a33-scale-qty-btn:hover {
  background: rgba(107, 79, 58, 0.16);
}

.a33-scale-qty input {
  width: 2.5rem;
  border: 0;
  text-align: center;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  background: transparent;
  -moz-appearance: textfield;
}

.a33-scale-qty input::-webkit-outer-spin-button,
.a33-scale-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.a33-scale-ticket-total {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--a33-carrot);
  white-space: nowrap;
}

.a33-scale-board-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 1rem 1.35rem 1.25rem;
  border-top: 2px dashed var(--sc-line);
  background: rgba(232, 220, 200, 0.35);
}

/* Receipt printer summary */
.a33-scale-receipt {
  position: sticky;
  top: 100px;
}

.a33-scale-receipt-printer {
  position: relative;
  height: 36px;
  background: linear-gradient(180deg, #3a3a3a, #222);
  border-radius: 14px 14px 0 0;
  border: 2px solid #1a1a1a;
  border-bottom: 0;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08);
}

.a33-scale-receipt-slot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72%;
  height: 6px;
  background: #111;
  border-radius: 3px 3px 0 0;
}

.a33-scale-receipt-led {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.a33-scale-receipt-paper {
  position: relative;
  background: var(--sc-paper);
  border: 1px solid var(--sc-line);
  border-top: 0;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 12px 32px rgba(107, 79, 58, 0.12);
  font-family: var(--font-body);
}

.a33-scale-receipt-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--sc-ink);
}

.a33-scale-receipt-kicker {
  margin: 0.15rem 0 0.5rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--sc-muted);
}

.a33-scale-receipt-paper h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed var(--sc-line);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  color: var(--sc-ink);
}

.a33-scale-receipt-rows {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.45rem;
}

.a33-scale-receipt-rows div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dotted var(--sc-line);
}

.a33-scale-receipt-rows dt {
  color: var(--sc-muted);
  font-weight: 500;
}

.a33-scale-receipt-rows dd {
  margin: 0;
  font-weight: 700;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--sc-ink);
}

.a33-scale-receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 0;
  margin-bottom: 0.75rem;
  border-top: 2px double var(--sc-wood);
  border-bottom: 2px double var(--sc-wood);
}

.a33-scale-receipt-total span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sc-muted);
}

.a33-scale-receipt-total strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--a33-carrot);
}

.a33-scale-ship-note {
  margin: 0 0 1rem;
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--sc-muted);
  text-align: center;
}

.a33-scale-ship-note em {
  font-style: normal;
  font-weight: 700;
  color: var(--sc-teal);
}

.a33-scale-receipt-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.a33-scale-receipt-actions {
  display: grid;
  gap: 0.65rem;
}

.a33-scale-auth-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--a33-muted, #5a6b62);
  line-height: 1.45;
}

.a33-scale-receipt-actions .btn {
  width: 100%;
  text-align: center;
}

.a33-scale-receipt-foot {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--sc-line);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--sc-muted);
}

.a33-scale-receipt-tear {
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 8px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'%3E%3Cpath fill='%23fffef8' d='M0 0 L6 8 L12 0 L18 8 L24 0 L30 8 L36 0 L42 8 L48 0 L54 8 L60 0 L66 8 L72 0 L78 8 L84 0 L90 8 L96 0 L102 8 L108 0 L114 8 L120 0 Z'/%3E%3C/svg%3E")
    center bottom / 100% 100% no-repeat;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .a33-scale-deck-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .a33-scale-beam {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1.25rem;
  }

  .a33-scale-layout {
    grid-template-columns: 1fr;
  }

  .a33-scale-receipt {
    position: static;
  }
}

@media (max-width: 640px) {
  .a33-scale-ticket-main {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding-top: 0.75rem;
  }

  .a33-scale-ticket-thumb {
    width: 64px;
    height: 64px;
  }

  .a33-scale-ticket-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .a33-scale-board-foot {
    flex-direction: column;
  }

  .a33-scale-board-foot .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .a33-scale-ticket-main {
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto;
  }

  .a33-scale-ticket-thumb {
    grid-row: span 2;
  }

  .a33-scale-ticket-actions {
    grid-column: 1 / -1;
  }

  .a33-scale-beam-arm {
    width: 140px;
    height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a33-scale-ticket-body {
    transition: none;
  }
}
