/*
 * Multimodal Ports animation (A5). Renders inside Webflow's Shadow DOM: colours and fonts come in
 * through custom properties set from props. Sizes are stage pixels (1208 x 906, 2x the Figma
 * frames), scaled to the component width. Frame 0 (the world map alone) is mirrored here and is
 * also the poster.
 */

.shpt-root {
  --shpt-text: var(--_default---primary--ocean, #1c213d);
  --shpt-accent: var(--_default---primary--sky, #00b2ff);
  --shpt-nav: var(--_default---primary--ocean, #1c213d);
  --shpt-nav-icons: var(--_default---swatch--neutral, #ffffff);
  --shpt-low: var(--_default---primary--sky, #00b2ff);
  --shpt-high: var(--_default---primary--tangerine, #ff863b);
  --shpt-panel: var(--_default---swatch--neutral, #ffffff);
  --shpt-success: #00bc70;
  --shpt-alert: #ff7373;
  --shpt-cursor: var(--_default---primary--sky, #00b2ff);
  --shpt-font: var(--_typography---font--primary-family, "Fg Futurist", Arial, sans-serif);
  --shpt-radius: 8px;
  --shpt-frame-width: 1px;
  --shpt-frame-color: var(--_default---primary--cloud-3, #e7e7e7);
  --shpt-white: var(--_default---swatch--neutral, #ffffff);
  --shpt-cloud: var(--_default---primary--cloud, #f8f8f8);
  --shpt-cloud-3: var(--_default---primary--cloud-3, #e7e7e7);
  --shpt-muted: color-mix(in srgb, var(--shpt-text) 60%, transparent);
  --shpt-faint: color-mix(in srgb, var(--shpt-text) 40%, transparent);
  --shpt-line: color-mix(in srgb, var(--shpt-text) 10%, transparent);
  --shpt-line-soft: color-mix(in srgb, var(--shpt-text) 6%, transparent);
  --shpt-accent-soft: color-mix(in srgb, var(--shpt-accent) 15%, transparent);
  --shpt-alert-soft: color-mix(in srgb, var(--shpt-alert) 15%, transparent);
  --shpt-alert-ink: color-mix(in srgb, var(--shpt-alert) 65%, var(--shpt-text));
  --hud: 1;

  position: relative;
  width: 100%;
  aspect-ratio: 1208 / 906;
  overflow: hidden;
  border-radius: var(--shpt-radius);
  background: var(--shpt-panel);
  font-family: var(--shpt-font);
  font-weight: 400;
  color: var(--shpt-text);
  line-height: 1.2;
  isolation: isolate;
  contain: layout paint;
  -webkit-font-smoothing: antialiased;
}

.shpt-root *,
.shpt-root *::before,
.shpt-root *::after {
  box-sizing: border-box;
}

.shpt-root svg {
  display: block;
  flex: none;
}

.shpt-root ol,
.shpt-root ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Frame border: drawn over everything (cursor included), in screen pixels, outside the stage fit */
.shpt-root::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  border-radius: inherit;
  box-shadow: inset 0 0 0 var(--shpt-frame-width) var(--shpt-frame-color);
  pointer-events: none;
}

:host > div:has(> .shpt-root) {
  display: block;
  width: 100%;
}

/* ---------- poster (frame 0: the world map, sized by CSS alone) and stage ---------- */

.shpt-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shpt-root[data-ready="true"] .shpt-poster {
  visibility: hidden;
}

.shpt-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1208px;
  height: 906px;
  overflow: hidden;
  transform-origin: 0 0;
  background: var(--shpt-panel);
}

.shpt-root:not([data-ready="true"]) .shpt-stage {
  opacity: 0;
}

/* Phone framing: as A4 (--zoom from the stage fit, --cam-x/-y/-k from the timeline) */
.shpt-camera {
  --z: calc(1 + (var(--zoom, 1) - 1) * var(--cam-k, 0));
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  transform: scale(var(--z))
    translate(
      clamp(calc(1208px / var(--z) - 1208px), calc(604px / var(--z) - var(--cam-x, 604) * 1px), 0px),
      clamp(calc(906px / var(--z) - 906px), calc(453px / var(--z) - var(--cam-y, 453) * 1px), 0px)
    );
}

.shpt-root[data-phone-zoom="false"] .shpt-camera {
  --zoom: 1;
}

/* ---------- map layers ---------- */

.shpt-world,
.shpt-port,
.shpt-dwell {
  position: absolute;
  overflow: visible;
}

.shpt-world {
  left: 0;
  top: 0;
  width: 1208px;
  height: 906px;
  transform-origin: 0 0;
}

.shpt-port,
.shpt-dwell {
  opacity: 0;
}

.shpt-port {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 96px, #000 calc(100% - 96px), transparent),
    linear-gradient(to bottom, transparent, #000 96px, #000 calc(100% - 96px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 96px, #000 calc(100% - 96px), transparent),
    linear-gradient(to bottom, transparent, #000 96px, #000 calc(100% - 96px), transparent);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.shpt-world > img,
.shpt-port > img,
.shpt-dwell > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
}

.shpt-world > .shpt-europe {
  inset: auto;
  opacity: 0;
}

.shpt-fence {
  position: absolute;
  border-radius: 50%;
  background: color-mix(in srgb, var(--shpt-accent) 22%, transparent);
  border: 2px solid color-mix(in srgb, var(--shpt-accent) 80%, transparent);
  transform: scale(0);
}

.shpt-fence-pulse {
  position: absolute;
  border-radius: 50%;
  border: 4px solid var(--shpt-accent);
  opacity: 0;
}

/* ---------- pin (origin = hexagon centre) ---------- */

.shpt-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  transform-origin: 0 0;
  transform: translate3d(281.7px, 159px, 0) scale(0);
}

.shpt-pin__hex {
  position: absolute;
  left: -42px;
  top: -47.5px;
  width: 84px;
  height: 95px;
  fill: var(--shpt-text);
}

.shpt-pin__anchor {
  position: absolute;
  left: -20px;
  top: -20px;
  width: 40px;
  height: 40px;
  color: var(--shpt-white);
}

.shpt-pin__shadow {
  position: absolute;
  left: -12px;
  top: 54px;
  width: 24px;
  height: 11px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--shpt-text) 70%, transparent);
  filter: blur(1px);
}

.shpt-pin__chip {
  position: absolute;
  left: 0;
  top: 78px;
  height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 8px;
  background: var(--shpt-text);
  color: var(--shpt-white);
  font-size: 24px;
  font-weight: 500;
  translate: -50% 0;
}

.shpt-pin__badge {
  position: absolute;
  left: 16px;
  top: -58px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--shpt-accent);
  background: var(--shpt-white);
  color: var(--shpt-text);
  font-size: 26px;
  font-weight: 500;
  transform: scale(0);
}

/* ---------- dwell dots, legend, tooltip ---------- */

.shpt-dwell-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shpt-dot {
  position: absolute;
  border-radius: 50%;
  border: 3px solid var(--shpt-white);
  background: var(--shpt-low);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--shpt-text) 25%, transparent);
  transform: translate(-50%, -50%) scale(0);
}

.shpt-dot.is-high {
  background: var(--shpt-high);
}

.shpt-dot__ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 4px solid var(--shpt-high);
  opacity: 0;
}

.shpt-legend {
  position: absolute;
  border-radius: 8px;
  background: var(--shpt-panel);
  box-shadow: 0 2px 16px color-mix(in srgb, var(--shpt-text) 20%, transparent);
  opacity: 0;
}

.shpt-legend__title {
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
}

.shpt-legend__scale {
  position: absolute;
  display: flex;
}

.shpt-legend__scale i {
  display: block;
}

.shpt-legend__min,
.shpt-legend__max {
  position: absolute;
  top: 80px;
  font-size: 24px;
  font-weight: 500;
}

.shpt-legend__min {
  right: calc(100% - 104px);
}

.shpt-legend__max {
  left: 448px;
}

.shpt-tip {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 22px;
  border-radius: 12px;
  background: var(--shpt-panel);
  border: 2px solid var(--shpt-cloud-3);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shpt-text) 14%, transparent);
  white-space: nowrap;
  opacity: 0;
}

.shpt-tip strong {
  font-size: 26px;
  font-weight: 500;
}

.shpt-tip span {
  font-size: 24px;
  color: var(--shpt-high);
  font-weight: 500;
}

/* ---------- app layer: rail, order panel, charts ---------- */

.shpt-app {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------- rail ---------- */

/* Rail sizes and positions come inline from RAIL in geometry.ts (re-exported from A8) */
.shpt-rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  background: var(--shpt-nav);
  color: var(--shpt-nav-icons);
  transform: translate3d(-120px, 0, 0);
}

.shpt-logo {
  position: absolute;
  left: 50%;
  display: block;
  width: 44px;
  height: 56px;
  margin-left: -22px;
  background: var(--shpt-nav-icons);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.shpt-logo--image {
  background: none;
  object-fit: contain;
}

.shpt-rail__icons {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shpt-rail__item {
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: color-mix(in srgb, var(--shpt-nav-icons) 60%, transparent);
}

.shpt-rail__item[data-active="true"] {
  background: color-mix(in srgb, var(--shpt-accent) 20%, transparent);
  color: var(--shpt-nav-icons);
}

.shpt-rail__item svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pill next to the active item; top is the item's centre */
.shpt-pill {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  height: calc(44px * var(--hud));
  margin-top: calc(-22px * var(--hud));
  padding: 0 calc(16px * var(--hud));
  border-radius: 10px;
  background: var(--shpt-nav);
  color: var(--shpt-nav-icons);
  font-size: calc(22px * var(--hud));
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-12px);
}

.shpt-pill::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  margin-top: -8px;
  border: 8px solid transparent;
  border-left: 0;
  border-right-color: var(--shpt-nav);
}

/* ---------- order panel ---------- */

.shpt-panel {
  position: absolute;
  top: 0;
  left: 706px;
  width: 502px;
  height: 906px;
  overflow: hidden;
  background: var(--shpt-panel);
  transform: translate3d(502px, 0, 0);
}

.shpt-panel__head {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  right: 0;
  height: 122px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 32px;
  background: var(--shpt-panel);
  border-bottom: 2px solid var(--shpt-line);
}

.shpt-panel__icon {
  width: 48px;
  height: 48px;
  color: var(--shpt-muted);
}

.shpt-panel__title {
  flex: 1;
  min-width: 0;
}

.shpt-panel__name {
  font-size: 26px;
  font-weight: 500;
  line-height: 32px;
  white-space: nowrap;
}

.shpt-panel__code {
  margin-top: 2px;
  font-size: 20px;
  line-height: 26px;
  color: var(--shpt-muted);
  white-space: pre;
}

.shpt-panel__list {
  position: absolute;
  top: 122px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  transform: translate3d(0, 0, 0);
}

.shpt-orders {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 16px;
  background: var(--shpt-cloud);
  border: 2px solid var(--shpt-line);
}

.shpt-orders svg {
  width: 32px;
  height: 32px;
}

.shpt-orders__label {
  font-size: 24px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shpt-orders__count {
  font-size: 28px;
  font-weight: 500;
}

/* ---------- order cards ---------- */

.shpt-card {
  position: relative;
  isolation: isolate;
  background: var(--shpt-panel);
  border: 2px solid var(--shpt-line);
  border-radius: 12px;
}

.shpt-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-bottom: 2px solid var(--shpt-line-soft);
}

.shpt-card__head > div {
  min-width: 0;
}

.shpt-card__id {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 500;
  line-height: 32px;
  color: var(--shpt-accent);
}

.shpt-card__id svg {
  width: 32px;
  height: 32px;
}

.shpt-card__carrier {
  font-size: 20px;
  line-height: 26px;
  color: var(--shpt-muted);
}

.shpt-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 48px;
  margin-top: 6px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 500;
  background: var(--shpt-alert-soft);
  color: var(--shpt-alert-ink);
}

.shpt-card__body {
  padding: 16px;
}

/* Stops: rows are 70 (no date), 106 (date), 130 (ETA) and 54 (last, no date) px, as in Figma */
.shpt-stop {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  column-gap: 16px;
}

.shpt-stop__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}

.shpt-stop__badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 500;
  background: var(--shpt-text);
  color: var(--shpt-white);
}

.shpt-stop[data-state="eta"] .shpt-stop__badge,
.shpt-stop[data-state="upcoming"] .shpt-stop__badge {
  background: var(--shpt-panel);
  border: 2px solid var(--shpt-faint);
  color: var(--shpt-faint);
}

.shpt-stop__line {
  flex: 1;
  width: 4px;
  margin: 4px 0 0;
  background: var(--shpt-text);
}

.shpt-stop[data-state="current"] .shpt-stop__line {
  background: linear-gradient(var(--shpt-text) 50%, var(--shpt-line) 50%);
}

.shpt-stop[data-state="eta"] .shpt-stop__line,
.shpt-stop[data-state="upcoming"] .shpt-stop__line {
  background: var(--shpt-line);
}

.shpt-stop:last-child .shpt-stop__line {
  display: none;
}

.shpt-stop__body {
  padding: 6px 0 32px;
}

.shpt-stop[data-state="eta"] .shpt-stop__body,
.shpt-stop:last-child .shpt-stop__body {
  padding-bottom: 16px;
}

.shpt-stop__port,
.shpt-stop__date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
}

.shpt-stop__port {
  gap: 4px;
}

.shpt-stop__port svg {
  width: 28px;
  height: 28px;
}

.shpt-stop__date {
  margin-top: 4px;
}

.shpt-stop[data-state="eta"] .shpt-stop__date {
  color: var(--shpt-muted);
}

.shpt-stop__arrive {
  padding-top: 40px;
}

.shpt-stop__arrive span {
  display: block;
  font-size: 20px;
  line-height: 26px;
  color: var(--shpt-faint);
}

.shpt-stop__arrive strong {
  display: block;
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
}

.shpt-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 64px;
  font-size: 20px;
  font-weight: 500;
  background: var(--shpt-accent-soft);
  color: var(--shpt-text);
}

.shpt-chip.is-alert {
  background: var(--shpt-alert);
  color: var(--shpt-white);
}

.shpt-seta {
  display: inline-flex;
  align-items: center;
  height: 32px;
  border: 2px solid var(--shpt-muted);
  border-radius: 8px;
  overflow: hidden;
}

.shpt-seta svg {
  width: 28px;
  height: 28px;
  color: var(--shpt-text);
}

.shpt-seta span {
  padding: 0 8px;
  font-size: 24px;
  color: var(--shpt-muted);
}

.shpt-badge.is-success,
.shpt-chip.is-success {
  background: var(--shpt-success);
  color: var(--shpt-white);
}

.shpt-badge.is-alert {
  background: var(--shpt-alert-soft);
  color: var(--shpt-alert-ink);
}

.shpt-stop__status {
  margin-top: 8px;
}

/* ---------- charts ---------- */

.shpt-charts {
  position: absolute;
  inset: 0;
  transform: translate3d(1088px, 0, 0);
}

/* Without the sidebar the charts page is the whole stage wide */
.shpt-root[data-sidebar="false"] .shpt-charts {
  transform: translate3d(1208px, 0, 0);
}

.shpt-charts__page {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--shpt-panel);
}

.shpt-charts__title {
  position: absolute;
  font-size: 30px;
  font-weight: 500;
}

.shpt-charts__card {
  position: absolute;
  border-radius: 24px;
  border: 2px solid var(--shpt-cloud-3);
  background: var(--shpt-panel);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--shpt-text) 8%, transparent);
}

.shpt-charts__name {
  position: absolute;
  width: 380px;
  translate: -50% 0;
  text-align: center;
  font-size: 28px;
  font-weight: 500;
  line-height: 36px;
}

.shpt-charts__svg {
  position: absolute;
  inset: 0;
  width: 1208px;
  height: 906px;
  overflow: visible;
}

.shpt-grid {
  stroke: var(--shpt-line);
  stroke-width: 2;
}

.shpt-band {
  fill: color-mix(in srgb, var(--shpt-accent) 15%, transparent);
  stroke: color-mix(in srgb, var(--shpt-accent) 35%, transparent);
  stroke-width: 2;
}

.shpt-line {
  fill: none;
  stroke: var(--shpt-accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shpt-read {
  opacity: 0;
}

.shpt-read circle {
  fill: var(--shpt-accent);
  stroke: var(--shpt-white);
  stroke-width: 4;
}

.shpt-tick {
  position: absolute;
  translate: -100% -50%;
  font-size: 22px;
  color: var(--shpt-muted);
}

.shpt-date {
  position: absolute;
  transform-origin: 0 0;
  transform: rotate(-90deg) translate(-100%, -50%);
  white-space: nowrap;
  font-size: 18px;
  color: var(--shpt-faint);
}

.shpt-readout {
  position: absolute;
  translate: -100% -100%;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--shpt-text);
  color: var(--shpt-white);
  font-size: 22px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
}

/* ---------- feedback: ripple and swipe trail ---------- */

.shpt-ripple {
  position: absolute;
  z-index: 1;
  top: -48px;
  left: -48px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--shpt-cursor);
  background: color-mix(in srgb, var(--shpt-cursor) 15%, transparent);
  opacity: 0;
  pointer-events: none;
}

.shpt-trail {
  position: absolute;
  inset: 0;
  width: 1208px;
  height: 906px;
  overflow: visible;
  pointer-events: none;
}

.shpt-trail line {
  stroke: var(--shpt-cursor);
  stroke-width: 8;
  stroke-linecap: round;
  opacity: 0;
}

/* ---------- cursor (hotspot at the element origin) ---------- */

.shpt-cursor {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(1290px, 760px, 0);
}

.shpt-cursor__press {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.shpt-cursor__arrow {
  position: absolute;
  left: -21px;
  top: -7px;
  width: 112px;
  height: 123px;
  filter: drop-shadow(0 11px 4px rgb(4 22 39 / 0.3));
}

.shpt-cursor__hand {
  position: absolute;
  left: -34px;
  top: -6px;
  width: 92px;
  height: 100px;
  opacity: 0;
  filter: drop-shadow(0 4px 4px rgb(18 19 26 / 0.25));
}

.shpt-cursor__fill {
  fill: var(--shpt-white);
}

.shpt-cursor__outline {
  fill: none;
  stroke: var(--shpt-cursor);
}

.shpt-cursor__line {
  fill: var(--shpt-cursor);
}

/* Reduced motion holds a still (POSTER_TIME): no cursor */
@media (prefers-reduced-motion: reduce) {
  .shpt-root[data-still="true"] .shpt-camera {
    --zoom: 1;
  }

  .shpt-root[data-still="true"] .shpt-cursor {
    visibility: hidden;
  }
}

