/*
 * Design 7-straturi (piesa din 6-mvp, fără crestăturile rotunde ale biletelor, scoase pe 18.11.2026): Comandă (piesa din direcția 4): bonul de comandă care se tipărește (margine perforată, „Nr. 001", populare
 *   cu total calculat), ștampila „Deschis din …", poza prinsă cu bandă adezivă dedesubt, și plăcile-bilet (Wolt, Glovo,
 *   Bolt Food, Vino la noi) pe hârtie kraft.
 * Primește: markup-ul din index.html, umplut de order.js; clasa .is-in (reveal.js) pe .printer pornește tipărirea.
 * Dă: aspectul și mișcarea (doar transform și opacity): bonul iese din imprimantă în tranșe, ștampila cade după el,
 *   o singură dată. Mișcare redusă: bonul tipărit, ștampila căzută.
 * Nu e treaba lui: tokenii, .title-cond și .arrow (style.css).
 */

/* ---------- Bon, ștampilă, bandă adezivă ---------- */
.receipt-wrap { position: relative; }
/* umbra bonului: o copie zimțată, mutată cu 2-3 px, sub bon (filter: drop-shadow peste o mască lăsa rânduri nepictate în Chromium) */
.receipt-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: translate(2px, 3px);
  background: rgba(36, 55, 42, 0.22);
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
}
.receipt {
  position: relative;
  padding: 28px 22px 40px;
  background: var(--receipt);
  color: var(--ink);
  font: 400 0.8125rem/1.45 var(--font-mono);
  /* marginea de jos perforată: dinți triunghiulari, decupați cu mască */
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
}
.receipt__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px dashed var(--rule); }
.receipt__head img { height: 24px; width: auto; }
.receipt__no { font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.receipt__rows li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--rule); }
.receipt__item { display: flex; flex-direction: column; }
.receipt__name { font: 800 1.2rem/1.1 var(--font-cond); font-stretch: 74%; text-transform: uppercase; }
.receipt__grams { font-size: 0.75rem; color: var(--ink-soft); }
.receipt__amt { padding-top: 3px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt__total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; padding-top: 14px; border-top: 2px solid var(--ink); }
.receipt__total span { font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
/* singurul preț în roșu de ștampilă: totalul bonului */
.receipt__total strong { font: 900 2.1rem/1 var(--font-cond); font-stretch: 72%; color: var(--stamp); font-variant-numeric: tabular-nums; }
.receipt__bars {
  height: 34px;
  margin-top: 18px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 9px, var(--ink) 9px 12px, transparent 12px 14px);
}

.tape {
  position: absolute;
  z-index: 2;
  top: -14px;
  left: 9%;
  width: 100px;
  height: 30px;
  background: color-mix(in srgb, var(--kraft) 82%, transparent);
  transform: rotate(-5deg);
  clip-path: polygon(0 0, 100% 0, 97% 25%, 100% 50%, 97% 75%, 100% 100%, 0 100%, 3% 75%, 0 50%, 3% 25%);
}

.stamp {
  position: absolute;
  z-index: 4;
  right: -36px;
  bottom: -58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 116px;
  height: 116px;
  text-align: center;
  color: var(--stamp);
  border: 7px double var(--stamp);
  border-radius: 50%;
  opacity: 0.94;
  transform: rotate(-10deg);
  /* un voal de hârtie sub cerneală: ștampila rămâne lizibilă și peste poză */
  background: color-mix(in srgb, var(--receipt) 70%, transparent);
}
.stamp__small { font: 600 0.6875rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.stamp__big { font: 900 1.55rem/1 var(--font-cond); font-stretch: 68%; text-transform: uppercase; }

/* ---------- Secțiunea: hârtie kraft, cu dublă linie ca la capătul unui bon ---------- */
.order {
  --section-y: clamp(72px, 9vw, 132px);
  padding: var(--section-y) 0;
  background: var(--kraft);
  border-block: 4px double var(--ink);
}
.order__grid { display: grid; gap: 64px; margin-top: clamp(36px, 5vw, 56px); }

/* bonul din imprimantă și poza prinsă dedesubt */
.order__bon { position: relative; width: 100%; max-width: 500px; }
.printer { position: relative; z-index: 2; width: min(340px, 84%); margin-left: 4%; transform: rotate(-1.6deg); }
.printer__slot { position: relative; z-index: 3; height: 14px; margin: 0 -14px; border-radius: 7px; background: var(--ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.32); }
.printer__feed { position: relative; z-index: 1; margin-top: -7px; clip-path: inset(0 -40px -60px -40px); }
.photo {
  position: relative;
  z-index: 1;
  width: 90%;
  margin: -38px 0 0 auto;
  padding: 9px;
  transform: rotate(1.8deg);
  background: var(--receipt);
  box-shadow: 0 1px 0 rgba(36, 55, 42, 0.3), 0 7px 0 -3px rgba(36, 55, 42, 0.1);
}
.photo img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

@media (prefers-reduced-motion: no-preference) {
  /* până intră în ecran, bonul stă ascuns în imprimantă; apoi iese în tranșe, ca un bon adevărat */
  .js .printer:not(.is-in) .receipt-wrap { transform: translateY(-100%); }
  .js .printer:not(.is-in) .stamp { opacity: 0; }
  .printer.is-in .receipt-wrap { animation: print 2s ease-in-out 0.2s both; }
  .printer.is-in .stamp { animation: stamp 0.5s var(--ease) 2.3s both; }
}
@keyframes print {
  0% { transform: translateY(-100%); }
  16% { transform: translateY(-80%); }
  24% { transform: translateY(-80%); }
  44% { transform: translateY(-52%); }
  52% { transform: translateY(-52%); }
  74% { transform: translateY(-20%); }
  82% { transform: translateY(-20%); }
  100% { transform: none; }
}
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-10deg) scale(1.25); }
  55% { opacity: 1; transform: rotate(-10deg) scale(0.96); }
  100% { opacity: 0.94; transform: rotate(-10deg) scale(1); }
}

/* ---------- Plăcile: bilete cu linia perforației (crestăturile rotunde au fost scoase pe 18.11.2026, cu toate semicercurile) ---------- */
.tickets { display: grid; gap: 34px; }
.ticket {
  --stub: 72px;
  display: block;
  color: inherit;
  text-decoration: none;
  filter: drop-shadow(4px 4px 0 var(--ink));
  transition: transform 0.2s var(--ease);
}
.ticket__shape {
  display: flex;
  flex-direction: column;
  min-height: clamp(190px, 24vw, 250px);
  background: var(--ticket-bg);
  color: var(--ticket-ink);
}
.ticket--ink { --ticket-bg: var(--ink); --ticket-ink: var(--cream); }
.ticket--receipt { --ticket-bg: var(--receipt); --ticket-ink: var(--ink); }
.ticket--paper { --ticket-bg: var(--paper); --ticket-ink: var(--ink); }
.ticket--sage { --ticket-bg: var(--sage); --ticket-ink: var(--ink); }
.ticket__body { display: flex; flex: 1; align-items: flex-end; padding: 24px 24px 18px; }
.ticket__name { font-size: clamp(3rem, 5.4vw, 4.6rem); }
/* Siglele platformelor (shared/brand/delivery, o culoare Bagelo, decis de Robert pe 18.11.2026): aceeași înălțime
   vizuală ca titlurile biletelor; Bolt Food e mai lată și mai joasă, deci primește puțin mai puțin. */
.ticket__logo { display: block; width: auto; height: clamp(2.6rem, 4.6vw, 3.6rem); max-width: 100%; }
.ticket__logo--wide { height: clamp(2.2rem, 3.8vw, 3rem); }
.ticket__stub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: var(--stub);
  padding: 0 24px;
  border-top: 3px dashed color-mix(in srgb, currentColor 55%, transparent);
  font: 600 0.9375rem/1.2 var(--font-mono);
}
.ticket:not([href]) { cursor: default; }
@media (hover: hover) { .ticket[href]:hover { transform: translate(-3px, -3px) rotate(0deg); } }
@media (min-width: 640px) {
  .tickets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .ticket:nth-child(1) { transform: rotate(-1deg); }
  .ticket:nth-child(2) { transform: rotate(0.8deg) translateY(14px); }
  .ticket:nth-child(3) { transform: rotate(0.6deg); }
  .ticket:nth-child(4) { transform: rotate(-0.8deg) translateY(14px); }
}
@media (min-width: 1000px) {
  .order__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: center; }
}
@media (max-width: 999.98px) { .stamp { right: -10px; } }
@media (prefers-reduced-motion: reduce) { .ticket { transition: none; } }
@media (max-width: 639.98px) {
  .ticket__shape { min-height: 150px; }
  .ticket__body { padding: 18px 22px 14px; }
}
