/* Section: order slip ("Tu pedido") + mobile order bar */

.slip {
  scroll-margin-top: var(--s4);
  padding: var(--frame-inset);
}

.slip__foot {
  position: relative;
  padding: var(--s4) calc(var(--s5) - var(--frame-inset)) calc(var(--s5) - var(--frame-inset));
  border-top: 2px dashed var(--rule);
}

/* Desktop: the slip rides beside the board; its body scrolls,
   the total and the send action stay pinned in view */
@media (min-width: 1024px) {
  .slip {
    position: sticky;
    top: var(--s4);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
  }
  .slip__head,
  .slip__foot {
    flex: none;
  }
  .slip__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior: contain;
  }
  .slip__foot {
    padding-top: var(--s3);
  }
  /* scroll cue: the body fades into the pinned total while more is below */
  .slip__foot::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 2px);
    height: 2.5rem;
    background: linear-gradient(rgb(27 21 19 / 0), var(--panel));
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--dur) var(--ease-out);
  }
  .slip.can-scroll .slip__foot::before {
    opacity: 1;
  }
}

.slip__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  padding: calc(var(--s5) - var(--frame-inset)) calc(var(--s5) - var(--frame-inset)) var(--s3);
}
.slip__title {
  font-size: var(--text-xl);
}
.slip__count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cream-2);
}

/* Segments read like a perforated slip */
.seg {
  padding: var(--s4) calc(var(--s5) - var(--frame-inset));
  border-top: 2px dashed var(--rule);
}
.seg__note {
  margin: calc(var(--s2) * -1) 0 var(--s3);
  font-size: var(--text-xs);
  color: var(--cream-3);
}
.seg__title {
  margin-bottom: var(--s3);
  font-family: var(--font-paint);
  font-weight: 900;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.slip__empty {
  padding: var(--s2) 0 var(--s3);
  color: var(--cream-2);
  font-size: var(--text-sm);
}
.slip__empty strong {
  color: var(--cream);
}

.slip__lines {
  display: grid;
}
.sline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--s1) var(--s3);
  margin-inline: calc(var(--s2) * -1);
  padding: var(--s3) var(--s2);
  border-radius: var(--radius);
  border-top: 1px dashed var(--rule);
  transition: background-color 1.4s var(--ease-out), box-shadow 1.4s var(--ease-out);
}
.sline:first-child {
  border-top: 0;
}
.sline.is-fresh {
  background-color: rgb(242 193 15 / 0.06);
  box-shadow: inset 0 0 0 1.5px rgb(242 193 15 / 0.55);
  transition-duration: 120ms;
}
.sline__name {
  font-weight: 600;
  line-height: 1.25;
}
.sline__detail {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--cream-2);
  margin-top: 0.15rem;
}
.sline__total {
  font-family: var(--font-paint);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  min-width: 4.6rem;
  text-align: right;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--rule-strong);
}
.stepper button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  position: relative;
}
.stepper button::before {
  content: '';
  position: absolute;
  inset: -0.2rem;
}
.stepper button:hover {
  background: var(--panel-2);
}
.stepper button svg {
  width: 1.05rem;
  height: 1.05rem;
}
.stepper output {
  min-width: 1.4rem;
  text-align: center;
  font-family: var(--font-paint);
  font-weight: 900;
  font-size: 1.15rem;
}

/* Choice tiles (fulfilment + payment) */
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: var(--s2);
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.opt {
  position: relative;
  display: grid;
  align-content: center;
  gap: 0.1rem;
  min-height: 3.6rem;
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1.5px var(--rule-strong);
  cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-out), box-shadow var(--dur) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.opt:hover {
  box-shadow: inset 0 0 0 1.5px var(--cream-3);
}
.opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.opt__label {
  font-weight: 600;
  line-height: 1.2;
}
.opt__note {
  font-size: var(--text-xs);
  color: var(--cream-3);
}
.opt:has(input:checked) {
  background: var(--red-ink);
  box-shadow: 0 3px 6px -1px rgb(0 0 0 / 0.5), 0 8px 18px -10px rgb(0 0 0 / 0.9);
}
.opt:has(input:checked) .opt__note {
  color: var(--cream);
}
.opt:has(input:focus-visible) {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.reveal {
  display: grid;
  gap: var(--s3);
  margin-top: var(--s4);
}
.reveal[hidden] {
  display: none;
}

/* Fields */
.fields {
  display: grid;
  gap: var(--s3);
}
.field {
  display: grid;
  gap: var(--s1);
}
.field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cream-2);
}
.field label small {
  font-weight: 500;
  color: var(--cream-3);
}
.field input,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--night);
  color: var(--cream);
  font-size: 1rem;
  transition: border-color var(--dur-quick) var(--ease-out);
}
.field textarea {
  min-height: 4.5rem;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--cream-3);
}
.field input:hover,
.field textarea:hover {
  border-color: var(--cream-3);
}
.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  outline: none;
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid rgb(242 193 15 / 0.35);
  outline-offset: 1px;
}
.field.is-error input {
  border-color: #ff6b5e;
}
.field__error {
  font-size: var(--text-xs);
  font-weight: 600;
  color: #ff8a7e;
}
.field__error[hidden] {
  display: none;
}

/* Totals + send */
.totals {
  display: grid;
  gap: var(--s1);
  margin-bottom: var(--s4);
}
.totals div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--cream-2);
  font-size: var(--text-sm);
}
.totals dd {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--cream);
}
.totals .totals__grand {
  margin-top: var(--s2);
  padding-top: var(--s3);
  border-top: 2px solid var(--rule-strong);
  color: var(--cream);
}
.totals__grand dt {
  font-family: var(--font-paint);
  font-weight: 900;
  font-size: 1.4rem;
  text-transform: uppercase;
}
.totals__grand dd {
  font-family: var(--font-paint);
  font-weight: 900;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--gold);
  text-shadow: var(--shade);
}

.send {
  width: 100%;
  min-height: 3.75rem;
  font-size: 1.35rem;
}
.send__error {
  margin-top: var(--s3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #ff8a7e;
}
.send__error[hidden] {
  display: none;
}
.send__help {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--cream-3);
  line-height: 1.45;
}

.preview {
  margin-top: var(--s4);
}
.preview summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cream-2);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.22em;
}
.preview summary:hover {
  color: var(--cream);
}
.preview pre {
  margin: var(--s2) 0 0;
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--night);
  box-shadow: inset 0 0 0 1px var(--rule);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--cream);
}

/* Mobile order bar */
.orderbar {
  position: fixed;
  left: var(--s3);
  right: var(--s3);
  bottom: calc(var(--s3) + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 3.75rem;
  padding: 0 var(--s4) 0 var(--s3);
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: 0 0 0 1.5px rgb(234 11 11 / 0.45), 0 18px 36px -12px rgb(0 0 0 / 0.95);
  text-decoration: none;
  transform: translateY(0);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.orderbar[hidden] {
  display: flex;
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
}
.orderbar__count {
  display: grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--red-ink);
  font-family: var(--font-paint);
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 0 0 1px rgb(255 120 100 / 0.35), 0 2px 14px rgb(234 11 11 / 0.7);
}
.orderbar__what {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cream-2);
}
.orderbar__total {
  font-family: var(--font-paint);
  font-weight: 900;
  font-size: 1.45rem;
  color: var(--gold);
}
.orderbar__go {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  font-weight: 700;
  font-size: var(--text-sm);
}
.orderbar__go svg {
  width: 1.1rem;
  height: 1.1rem;
}

@media (max-width: 380px) {
  .orderbar {
    gap: var(--s2);
  }
  .orderbar__what {
    display: none;
  }
}

@media (min-width: 1024px) {
  .orderbar {
    display: none !important;
  }
}
