.bartom-process {
  --bartom-panel: #002a4e;
  --bartom-text: #fff;
  --bartom-accent: #6d96cd;
  --bartom-card-width: 32%;
  position: relative;
  width: 100%;
  font-family: "Courier New", Courier, monospace;
}

/* Elementor 4.2 può lasciare i widget custom invisibili dopo l'animazione di ingresso. */
.elementor-widget-bartom-interactive-process.elementor-invisible {
  visibility: visible !important;
  opacity: 1 !important;
}

.bartom-process *,
.bartom-process *::before,
.bartom-process *::after { box-sizing: border-box; }

.bartom-process__canvas {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.bartom-process__canvas > svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.bartom-stage,
.bartom-stage-icon,
.bartom-stage-base {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .65s cubic-bezier(.2,.8,.2,1), filter .45s ease, opacity .35s ease;
}

.bartom-stage { cursor: pointer; }
.bartom-stage.is-active .bartom-stage-base { filter: drop-shadow(0 14px 12px rgba(0,0,0,.2)); }
.bartom-process[data-animation="lift-rotate"] .bartom-stage.is-active .bartom-stage-icon { transform: translateY(-22px) rotate(-6deg) scale(1.06); }
.bartom-process[data-animation="lift"] .bartom-stage.is-active .bartom-stage-icon { transform: translateY(-22px) scale(1.06); }
.bartom-process[data-animation="rotate"] .bartom-stage.is-active .bartom-stage-icon { transform: rotate(-8deg) scale(1.06); }

.bartom-process__hotspots { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.bartom-process__hotspot {
  appearance: none;
  position: absolute;
  top: 49%;
  width: 19.5%;
  height: 37%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.bartom-process__hotspot:nth-child(1) { left: 6.5%; }
.bartom-process__hotspot:nth-child(2) { left: 29.1%; }
.bartom-process__hotspot:nth-child(3) { left: 51.7%; }
.bartom-process__hotspot:nth-child(4) { left: 74.3%; }
.bartom-process__hotspot:focus-visible { outline: 3px solid #fff; outline-offset: -3px; border-radius: 20%; }

.bartom-process__card {
  position: absolute;
  z-index: 5;
  top: 2%;
  left: var(--card-left);
  width: var(--bartom-card-width);
  min-height: 96%;
  padding: clamp(28px, 3.2vw, 58px) clamp(24px, 3vw, 54px) clamp(28px, 3vw, 50px);
  color: var(--bartom-text);
  background: var(--bartom-panel);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(.97);
  transition: opacity .35s ease, transform .5s cubic-bezier(.2,.8,.2,1), visibility 0s linear .5s;
  box-shadow: 0 18px 45px rgba(0,0,0,.15);
}
.bartom-process__card--1 { --card-left: 0%; }
.bartom-process__card--2 { --card-left: 22.65%; }
.bartom-process__card--3 { --card-left: 45.3%; }
.bartom-process__card--4 { --card-left: calc(100% - var(--bartom-card-width)); }
.bartom-process__card.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.bartom-process__close {
  position: absolute;
  z-index: 2;
  top: clamp(16px, 2vw, 30px);
  right: clamp(16px, 2vw, 30px);
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  color: var(--bartom-text);
  background: linear-gradient(var(--bartom-text),var(--bartom-text)) left top/12px 2px no-repeat,
              linear-gradient(var(--bartom-text),var(--bartom-text)) left top/2px 12px no-repeat,
              linear-gradient(var(--bartom-text),var(--bartom-text)) right top/12px 2px no-repeat,
              linear-gradient(var(--bartom-text),var(--bartom-text)) right top/2px 12px no-repeat,
              linear-gradient(var(--bartom-text),var(--bartom-text)) left bottom/12px 2px no-repeat,
              linear-gradient(var(--bartom-text),var(--bartom-text)) left bottom/2px 12px no-repeat,
              linear-gradient(var(--bartom-text),var(--bartom-text)) right bottom/12px 2px no-repeat,
              linear-gradient(var(--bartom-text),var(--bartom-text)) right bottom/2px 12px no-repeat;
  cursor: pointer;
}
.bartom-process__close::before,
.bartom-process__close::after { content: ""; position: absolute; left: 10px; top: 20px; width: 22px; height: 2px; background: currentColor; }
.bartom-process__close::before { transform: rotate(45deg); }
.bartom-process__close::after { transform: rotate(-45deg); }
.bartom-process__close:hover { background: #002A4E !important; }

.bartom-process__brand { min-height: clamp(58px, 7vw, 100px); padding: 0 48px 0 0; display: flex; align-items: flex-start; justify-content: center; }
.bartom-process__brand-logos { width: 100%; display: flex; align-items: center; justify-content: center; }
.bartom-process__brand-logos--double { flex-direction: column; gap: clamp(8px, 1vw, 16px); }
.bartom-process__brand img { display: block; max-height: 78px; width: var(--bartom-logo-1-width, 82%); height: auto; object-fit: contain; }
.bartom-process__brand-logo--2 { width: var(--bartom-logo-2-width, 82%) !important; }
.bartom-process__brand span { font-family: Arial, sans-serif; font-size: clamp(18px, 2.2vw, 36px); font-weight: 700; line-height: 1.05; text-align: center; }

.bartom-process__brackets { position: relative; display: grid; place-items: center; min-height: clamp(210px, 23vw, 350px); margin-top: clamp(12px, 2vw, 30px); padding: 24px clamp(18px, 3vw, 44px); }
.bartom-process__brackets::before,
.bartom-process__brackets::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(28px, 3.5vw, 55px);
  border-top: clamp(7px, .75vw, 12px) solid var(--bartom-accent);
  border-bottom: clamp(7px, .75vw, 12px) solid var(--bartom-accent);
}
.bartom-process__brackets::before { left: 0; border-left: clamp(7px, .75vw, 12px) solid var(--bartom-accent); }
.bartom-process__brackets::after { right: 0; border-right: clamp(7px, .75vw, 12px) solid var(--bartom-accent); }
.bartom-process__copy { text-align: center; }
.bartom-process__copy h3 { margin: 0; color: inherit; font: inherit; font-size: clamp(28px, 3vw, 50px); line-height: 1.05; }
.bartom-process__copy p { margin: clamp(12px, 1.5vw, 22px) 0 0; color: inherit; font-size: clamp(15px, 1.45vw, 25px); line-height: 1.3; }
.bartom-process__copy .bartom-process__subtitle { margin-top: 0; }
.bartom-process__mobile-list { display: none; }

@media (min-width: 768px) and (max-width: 1024px) {
  .bartom-process { --bartom-card-width: 44%; }
  .bartom-process__card--1 { --card-left: 0%; }
  .bartom-process__card--2 { --card-left: 18.65%; }
  .bartom-process__card--3 { --card-left: 37.3%; }
  .bartom-process__card--4 { --card-left: calc(100% - var(--bartom-card-width)); }
  .bartom-process__card { padding: 30px 28px; }
  .bartom-process__copy h3 { font-size: clamp(28px, 4vw, 42px); }
  .bartom-process__copy p { font-size: clamp(15px, 2vw, 21px); }
}

@media (max-width: 767px) {
  html.bartom-process-modal-open { overflow: hidden; }

  .bartom-process {
    width: 100%;
    max-width: 100vw;
  }

  .bartom-process__canvas {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }

  .bartom-process__mobile-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    overflow: visible;
  }

  .bartom-process__mobile-stage,
  .bartom-process__hotspot.bartom-process__mobile-stage {
    appearance: none;
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    color: #fff;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .bartom-process__mobile-stage svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 360 / 215;
  }

  .bartom-process__mobile-stage > span {
    position: absolute;
    left: 50%;
    bottom: 8%;
    z-index: 2;
    padding: 4px 10px;
    color: #fff;
    background: rgba(0,42,78,.86);
    font-family: "Courier New", Courier, monospace;
    font-size: clamp(14px, 4.2vw, 18px);
    line-height: 1;
    transform: translateX(-50%);
  }

  .bartom-process__mobile-stage:not(:last-child)::after {
    content: "↓";
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: -17px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: #002a4e;
    font: 23px/1 Arial, sans-serif;
    transform: translateX(-50%);
  }

  .bartom-process__card,
  .bartom-process__card--1,
  .bartom-process__card--2,
  .bartom-process__card--3,
  .bartom-process__card--4 {
    position: fixed;
    z-index: 999999;
    inset: 50% auto auto 50%;
    width: calc(100vw - 28px);
    max-width: 520px;
    min-height: 0;
    max-height: calc(100dvh - 28px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 28px 22px 24px;
    transform: translate(-50%, calc(-50% + 22px)) scale(.97);
    box-shadow: 0 20px 50px rgba(0,0,0,.32), 0 0 0 100vmax rgba(0,24,46,.62);
  }

  .bartom-process__card.is-open {
    transform: translate(-50%,-50%) scale(1);
  }

  .bartom-process__brand { min-height: 56px; padding-right: 42px; }
  .bartom-process__brand-logos--double { gap: 8px; }
  .bartom-process__brand img { max-height: 52px; }
  .bartom-process__brand-logos--double img { max-height: 40px; }
  .bartom-process__brackets { min-height: 230px; margin-top: 14px; padding: 26px 34px; }
  .bartom-process__copy h3 { font-size: 31px; }
  .bartom-process__copy p { font-size: 16px; }
}

@media (max-width: 380px) {
  .bartom-process__card,
  .bartom-process__card--1,
  .bartom-process__card--2,
  .bartom-process__card--3,
  .bartom-process__card--4 { width: calc(100vw - 18px); padding: 24px 16px 18px; }
  .bartom-process__brackets { min-height: 215px; padding-inline: 27px; }
  .bartom-process__copy h3 { font-size: 27px; }
  .bartom-process__copy p { font-size: 14px; }
}

@media (max-width: 767px) and (orientation: landscape) {
  .bartom-process__card,
  .bartom-process__card--1,
  .bartom-process__card--2,
  .bartom-process__card--3,
  .bartom-process__card--4 { max-width: 680px; padding-block: 20px; }
  .bartom-process__brand { min-height: 42px; }
  .bartom-process__brand img { max-height: 38px; }
  .bartom-process__brackets { min-height: 170px; margin-top: 8px; }
  .bartom-process__copy h3 { font-size: 26px; }
  .bartom-process__copy p { margin-top: 8px; font-size: 14px; }
  .bartom-process__mobile-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bartom-process__mobile-stage:not(:last-child)::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bartom-process *, .bartom-process *::before, .bartom-process *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
