/* Appily thirtyone — Frost Ticket Spool cart (unique a31-spool layout) */

.page-cart-spool {
  --spool-ice: #e8f4fc;
  --spool-frost: #d0e8f5;
  --spool-deep: #1a3a4a;
  --spool-mono: 'Consolas', 'Courier New', monospace;
  --spool-ticket: #fffef8;
  background:
    radial-gradient(circle at 20% 0%, rgba(208, 232, 245, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(26, 58, 74, 0.06) 0%, transparent 40%),
    #f4f8fb;
}

.a31-spool {
  padding: 0 0 3rem;
}

/* ── Header ── */
.a31-spool-head {
  background: linear-gradient(135deg, var(--spool-deep) 0%, #245066 55%, #2d6578 100%);
  color: #fff;
  padding: 2rem 0 1.85rem;
  border-bottom: 4px solid var(--a31-yellow);
  position: relative;
  overflow: hidden;
}

.a31-spool-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 35%),
    radial-gradient(circle at 85% 20%, rgba(255, 234, 0, 0.12) 0%, transparent 30%);
  pointer-events: none;
}

.a31-spool-head-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}

.a31-spool-kicker {
  margin: 0 0 0.45rem;
  font-family: var(--spool-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.a31-spool-head h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.65rem, 3.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.12;
}

.a31-spool-head h1 em {
  font-style: normal;
  color: var(--a31-yellow);
}

.a31-spool-lede {
  margin: 0;
  max-width: 46ch;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
}

.a31-spool-gauge {
  display: grid;
  gap: 0.35rem;
  text-align: center;
  min-width: 6.5rem;
}

.a31-spool-gauge-temp {
  padding: 0.55rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--spool-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.a31-spool-gauge-temp strong {
  display: block;
  font-size: 1.15rem;
  color: #7dd3fc;
  margin-bottom: 0.1rem;
}

.a31-spool-gauge-count {
  padding: 0.65rem 0.85rem;
  background: var(--a31-yellow);
  color: var(--spool-deep);
  font-family: var(--spool-mono);
  font-weight: 700;
}

.a31-spool-gauge-count strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.a31-spool-gauge-count span {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Stage ── */
.a31-spool-stage {
  margin-top: 1.75rem;
}

.a31-spool-layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 1.35rem;
  align-items: start;
}

/* Ticket roll */
.a31-spool-roll {
  background: var(--spool-frost);
  border: 2px solid #b8d4e3;
  padding: 1rem 0.85rem 1.25rem;
  position: relative;
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.5);
}

.a31-spool-roll::before {
  content: '';
  position: absolute;
  top: 0.65rem;
  bottom: 0.65rem;
  left: 1.35rem;
  width: 3px;
  background: repeating-linear-gradient(
    180deg,
    #94a3b8 0,
    #94a3b8 6px,
    transparent 6px,
    transparent 12px
  );
  border-radius: 2px;
  z-index: 0;
}

.a31-spool-roll-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0 0.35rem 0 2rem;
  position: relative;
  z-index: 1;
}

.a31-spool-roll-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--spool-deep);
}

.a31-spool-roll-head p {
  margin: 0;
  font-size: 0.78rem;
  color: #5a7280;
}

.a31-spool-roll-code {
  font-family: var(--spool-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: #5a7280;
  padding: 0.35rem 0.5rem;
  border: 1px dashed #94a3b8;
  background: rgba(255, 255, 255, 0.45);
}

.a31-spool-tickets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  position: relative;
  z-index: 1;
}

.a31-spool-ticket {
  display: grid;
  grid-template-columns: auto 72px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  background: var(--spool-ticket);
  border: 1px solid #cbd5e1;
  padding: 0.85rem 0.85rem 0.85rem 2rem;
  position: relative;
  box-shadow: 0 2px 8px rgba(26, 58, 74, 0.06);
}

.a31-spool-ticket::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--spool-frost);
  border: 2px solid #94a3b8;
  box-shadow: inset 0 0 0 1px #fff;
}

.a31-spool-ticket::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 4px,
    #cbd5e1 4px,
    #cbd5e1 8px
  );
  pointer-events: none;
}

.a31-spool-ticket-num {
  font-family: var(--spool-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--spool-deep);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.a31-spool-ticket-thumb {
  display: block;
  width: 72px;
  height: 72px;
  border: 1px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.a31-spool-ticket-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.a31-spool-ticket-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 1.25rem;
  color: #cbd5e1;
  background: #f8fafc;
}

.a31-spool-ticket-info h3 {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
}

.a31-spool-ticket-info h3 a {
  color: inherit;
  text-decoration: none !important;
}

.a31-spool-ticket-info h3 a:hover {
  color: var(--spool-deep);
  text-decoration: underline !important;
}

.a31-spool-ticket-meta {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}

.a31-spool-ticket-unit {
  font-family: var(--spool-mono);
  font-size: 0.68rem;
  color: #94a3b8;
}

.a31-spool-ticket-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  min-width: 7.5rem;
}

.a31-spool-qty {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--spool-deep);
  background: #fff;
}

.a31-spool-qty-btn {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: var(--spool-ice);
  color: var(--spool-deep);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}

.a31-spool-qty-btn:hover {
  background: var(--a31-yellow);
}

.a31-spool-qty input {
  width: 2.75rem;
  height: 2rem;
  border: 0;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  text-align: center;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  -moz-appearance: textfield;
}

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

.a31-spool-ticket-total {
  font-family: var(--spool-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--spool-deep);
}

.a31-spool-roll-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
  padding: 0 0.35rem 0 2rem;
  position: relative;
  z-index: 1;
}

.a31-spool-roll-foot .btn {
  border-radius: 0;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Summary tag */
.a31-spool-tag {
  position: sticky;
  top: 1rem;
  background: var(--spool-deep);
  color: #fff;
  border: 2px solid #0f2833;
  box-shadow: 0 12px 32px rgba(26, 58, 74, 0.2);
}

.a31-spool-tag-notch {
  height: 12px;
  background:
    radial-gradient(circle at 0 100%, transparent 10px, var(--spool-deep) 10px),
    radial-gradient(circle at 50% 100%, transparent 10px, var(--spool-deep) 10px),
    radial-gradient(circle at 100% 100%, transparent 10px, var(--spool-deep) 10px);
  background-size: 33.33% 100%;
  background-repeat: no-repeat;
  margin-bottom: -1px;
}

.a31-spool-tag-body {
  padding: 1.25rem 1.15rem 1.35rem;
}

.a31-spool-tag-kicker {
  margin: 0 0 0.35rem;
  font-family: var(--spool-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.a31-spool-tag-body h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.a31-spool-tag-rows {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.a31-spool-tag-rows div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}

.a31-spool-tag-rows dt {
  color: rgba(255, 255, 255, 0.62);
}

.a31-spool-tag-rows dd {
  margin: 0;
  font-weight: 700;
  font-family: var(--spool-mono);
}

.a31-spool-tag-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  margin-bottom: 0.85rem;
  border-top: 2px solid var(--a31-yellow);
  border-bottom: 2px solid var(--a31-yellow);
}

.a31-spool-tag-total span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.a31-spool-tag-total strong {
  font-family: var(--spool-mono);
  font-size: 1.35rem;
  color: var(--a31-yellow);
}

.a31-spool-ship-note {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

.a31-spool-ship-note em {
  color: #7dd3fc;
  font-style: normal;
  font-weight: 600;
}

.a31-spool-tag-actions {
  display: grid;
  gap: 0.5rem;
}

.a31-spool-tag-actions .btn {
  width: 100%;
  text-align: center;
  border-radius: 0;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.a31-spool-tag-actions .btn-primary {
  background: var(--a31-yellow);
  color: var(--spool-deep);
  border-color: var(--a31-yellow);
}

.a31-spool-tag-actions .btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.a31-spool-tag-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.a31-spool-tag-barcode {
  height: 28px;
  margin-top: 1rem;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.85) 0,
    rgba(255, 255, 255, 0.85) 2px,
    transparent 2px,
    transparent 5px
  );
  opacity: 0.35;
}

/* Empty state */
.a31-spool-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--spool-frost);
  border: 2px dashed #94a3b8;
}

.a31-spool-empty-roll {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff 0%, var(--spool-ice) 100%);
  border: 3px solid #94a3b8;
  position: relative;
  box-shadow: inset 0 0 20px rgba(26, 58, 74, 0.08);
}

.a31-spool-empty-roll::before {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 2px dashed #cbd5e1;
}

.a31-spool-empty h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--spool-deep);
}

.a31-spool-empty p {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  color: #5a7280;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.a31-spool-empty .btn {
  border-radius: 0;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

@media (max-width: 900px) {
  .a31-spool-head-grid {
    grid-template-columns: 1fr;
  }

  .a31-spool-layout {
    grid-template-columns: 1fr;
  }

  .a31-spool-tag {
    position: static;
  }

  .a31-spool-ticket {
    grid-template-columns: auto 64px 1fr;
    grid-template-rows: auto auto;
  }

  .a31-spool-ticket-num {
    writing-mode: horizontal-tb;
    transform: none;
    grid-column: 1 / -1;
    grid-row: 1;
    opacity: 0.45;
    font-size: 0.62rem;
  }

  .a31-spool-ticket-actions {
    grid-column: 2 / -1;
    grid-row: 2;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .a31-spool-ticket {
    grid-template-columns: 64px 1fr;
    padding-left: 1.5rem;
  }

  .a31-spool-ticket-num {
    display: none;
  }

  .a31-spool-roll::before {
    left: 0.85rem;
  }

  .a31-spool-roll-head,
  .a31-spool-roll-foot {
    padding-left: 1.25rem;
  }
}
