/* Salon Map — DUDU additions (the sm-*.css files are copies of POS and are not edited). */

.sm {
  --sm-brand: var(--main-color, var(--bs-dudu, #fb641b));
  --sm-brand-dark: color-mix(in srgb, var(--sm-brand) 85%, #000);
  --sm-brand-soft: color-mix(in srgb, var(--sm-brand) 9%, #fff);
}

.sm .sm-toggle.is-on {
  background: var(--sm-brand);
}

.sm .sm-sc-tickets.salon-center-page-body {
  display: block;
  height: auto;
  overflow: visible;
  background: transparent;
}
.sm .sm-sc-tickets .body-append-form.ticket {
  --w-tix: 228px;
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 2px;
}
/* Grid view. The queue panel is only 380px (>=1024px) / 420px (>=1280px) wide, or the phone sheet. Salon Center's 228px card width
   (minmax(min(100%, 228px), 1fr)) therefore always gave ONE column: each card stretched over the whole panel and Grid looked like
   the Line list. Two columns, like the POS .sm-tgrid (repeat(2, 1fr)), so the two views are clearly different. */
.sm .sm-sc-tickets .body-append-form.ticket:not(.line-view) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch; /* a card that grew by a wrapped time row makes its neighbour the same height */
}
.sm .sm-sc-tickets .body-append-form.ticket:not(.line-view) > .sc-ticket-card {
  width: 100%;
  min-width: 0;
}
/* A card is ~170px here, not 228px: the techs stay on one row and shrink with an ellipsis instead of wrapping out of the card
   (its height is fixed by the Salon Center card size preset). */
.sm .sm-sc-tickets .body-append-form.ticket:not(.line-view) .sc2-ticket__tech {
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}
.sm .sm-sc-tickets .body-append-form.ticket:not(.line-view) .sc2-ticket__tech-chip {
  min-width: 0;
  flex: 0 1 auto;
}
.sm .sm-sc-tickets .body-append-form.ticket:not(.line-view) .sc2-ticket__tech-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Time row (X: / Appt: / date). Salon Center gives it one fixed 15px line, which is right at 228px. Here the row is ~145px and the
   three parts need ~180px, so each part wrapped inside itself ("X: 12:34" / "AM") and ran over the service text under it.
   Keep every part on one line, let the row wrap to a second line, and let the card grow by that line instead of overlapping.
   Cards of one grid row stretch to the same height. */
.sm .sm-sc-tickets.salon-center-page-body.ticket-append .body-append-form.ticket.sc2-ticket-list:not(.line-view):not(.sc2-ticket-list--list) .sc2-ticket__time {
  flex: 0 0 auto;
  height: auto;
  min-height: 15px;
  flex-wrap: wrap;
  gap: 0 8px;
}
.sm .sm-sc-tickets.salon-center-page-body.ticket-append .body-append-form.ticket.sc2-ticket-list:not(.line-view):not(.sc2-ticket-list--list) .sc2-ticket__time > span {
  white-space: nowrap;
}
.sm .sm-sc-tickets .body-append-form.ticket:not(.line-view) > .sc-ticket-card {
  height: auto;
  min-height: var(--h-tix, 169px);
  align-self: stretch; /* Salon Center sets align-items: flex-end on the list, which beats the grid's own align-items */
}
.sm .sm-sc-tickets .body-append-form.ticket.line-view {
  display: flex;
  flex-direction: column;
}
/* Chair drop target. While a ticket is over a chair, "Drop here" / "Queue next" replaces the chair code or ticket text (display swap).
   With those spans as drag targets the swap made the span under the cursor disappear: dragleave removed is-over, the text swapped back,
   dragenter added it again... and the cursor flickered. The chair button is now the only target. */
.sm .sm-chair__btn * {
  pointer-events: none;
}

/* Drag image (seatMap.dudu.js wraps the cloned card in the same scope): one card, not the 2-column grid; the card in the queue dims. */
.sm .sm-drag-ghost .sm-sc-tickets .body-append-form.ticket:not(.line-view) {
  display: block;
  padding: 0;
}
.sm .sm-sc-tickets .sc2-ticket.is-dragging {
  opacity: 0.45;
}

/* Live drag card (seatMap.dudu.js): the copy follows the pointer by transform, tilts once lifted, shrinks over a chair that takes
   the drop, fades out on drop / cancel. Hold to lift on the queue card, as POS Salon Center v2 (.is-drag-ready). */
.sm .sm-drag-ghost.is-live {
  will-change: transform;
  transition: opacity 0.18s ease;
}
.sm .sm-drag-ghost.is-live .sm-drag-preview {
  transform-origin: 50% 100%;
  transition: scale 0.18s cubic-bezier(.2, .8, .2, 1), rotate 0.18s cubic-bezier(.2, .8, .2, 1), box-shadow 0.18s ease;
}
.sm .sm-drag-ghost.is-lifted .sm-drag-preview {
  scale: 1.02;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.26), 0 4px 10px rgba(15, 23, 42, 0.14);
}
.sm .sm-drag-ghost.is-lifted:is(.is-over-chair, .is-over-ticket) .sm-drag-preview {
  scale: 0.9;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sm-brand, #10b981) 45%, transparent), 0 10px 22px rgba(15, 23, 42, 0.22);
}
.sm .sm-drag-ghost.is-dropped,
.sm .sm-drag-ghost.is-cancelled {
  opacity: 0;
}
.sm .sm-drag-ghost.is-dropped .sm-drag-preview {
  scale: 0.6;
}
/* Wider queue column: two Salon Center size cards (~228px) per row instead of ~189px. */
@media (min-width: 1280px) {
  .sm .sm-queue--column {
    flex-basis: 500px;
    width: 500px;
  }
}

/* Group / combine stack (seatMap.dudu.js _listHtml): one grid cell, like Salon Center. */
.sm .sm-sc-tickets .cards-ticket-ui.group-parent {
  width: auto !important;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Ticket under the dragged one: dropping groups them. */
.sm .sm-sc-tickets .sc2-ticket.sm-group-target {
  position: relative;
  outline: 2px dashed var(--sc2-primary, var(--sm-brand, #10b981));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sc2-primary, #10b981) 14%, transparent) !important;
}
.sm .sm-drag-ghost.is-over-ticket::before {
  content: "Drop to group";
  position: absolute;
  top: -10px;
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sc2-primary, #10b981);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}
.sm .sm-sc-tickets .sc2-ticket[draggable="true"].is-drag-ready {
  outline: 2px dashed var(--sc2-primary, var(--sm-brand, #10b981));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sc2-primary, #10b981) 12%, transparent), 0 10px 24px rgba(15, 23, 42, 0.2) !important;
  translate: 0 -2px;
  transition: box-shadow 0.15s ease, translate 0.15s ease;
  cursor: grabbing;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  .sm .sm-drag-ghost.is-live,
  .sm .sm-drag-ghost.is-live .sm-drag-preview,
  .sm .sm-sc-tickets .sc2-ticket[draggable="true"].is-drag-ready {
    transition: none;
  }
}

.sm .sm-des,
.sm .sm-dialog {
  --sm-d-green-soft: var(--sm-brand-soft);
  --sm-d-green-line: color-mix(in srgb, var(--sm-brand) 20%, #fff);
  --sm-d-green-text: var(--sm-brand-dark);
}

.sm .sm-btn--soft:hover {
  background: color-mix(in srgb, var(--sm-brand) 16%, #fff);
}

.sm .sm-addchair {
  border-color: color-mix(in srgb, var(--sm-brand) 55%, #fff);
}

.sm .sm-filter .is-narrow {
  border-color: var(--sm-brand);
}

.sm .sm-dialog__head.is-tinted {
  background: var(--sm-brand-soft);
  border-bottom-color: color-mix(in srgb, var(--sm-brand) 20%, #fff);
}

.sm .sm-dialog__foot,
.sm .sm-set__foot {
  position: static;
  inset: auto;
  transform: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}

/* The demo banner shown while seatMap.store.isMock is on. */
.sm .sm-demo-banner,
.qs-pick .sm-demo-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff4e0;
  color: #9a6700;
  border-bottom: 1px solid #f3d9a8;
  font: 600 12px/1.3 Sora, "Segoe UI", system-ui, sans-serif;
}
.qs-pick .sm-demo-banner {
  border-radius: 8px;
  border: 1px solid #f3d9a8;
  margin: 0 0 8px;
}
