/* AB#134830: bo padding DOC cua lop trong (.uiw-steps-guide-transition-instance) - widget theo
   TITLE cua bug (evidence lai tro vao icons-steps-guide, nen xu ca hai de phu moi cach hieu).
   Padding NGANG 24px (mobile 20px) giu nguyen. */
/* steps-guide-transition — desktop is CSS-only (radio-hack); mobile carousel loop/dot-sync is
   progressively enhanced by artifacts/widget.js (see template.liquid header comment) */
.uiw-steps-guide-transition { display: block; }
.uiw-steps-guide-transition-instance {
  background: #ffffff; padding: 0 24px; border-radius: 8px;
  box-shadow: 0px 0px 3.5px rgba(0,0,0,0.12);
}
.uiw-itg-radio { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* ================= DESKTOP (>= 641px) ================= */
.uiw-steps-guide-transition-desktop {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.uiw-steps-guide-transition-mobile { display: none; }

.uiw-steps-guide-transition-list {
  display: flex; flex-direction: column; gap: 32px; width: 582px; max-width: 100%;
}
.uiw-steps-guide-transition-item {
  display: flex; align-items: center; gap: 20px; padding: 16px; border-radius: 8px;
  cursor: pointer; background: transparent; transition: background-color .2s ease;
  /* a flex row keeps min-width:auto by default, so a long unbroken word pushes the row wider
     than the 582px list instead of wrapping inside it (AB#132459) */
  min-width: 0;
}
.uiw-itg-badge {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 17px; background: #666666;
  color: #ffffff; font-family: 'Unbeatable','Arial','Helvetica Neue','Helvetica',sans-serif; font-size: 18px;
  font-weight: 600; line-height: 24px;
}
.uiw-itg-description {
  color: #000000; font-family: 'Unbeatable','Arial','Helvetica Neue','Helvetica',sans-serif; font-size: 16px;
  font-weight: 500; line-height: 24px;
  /* wrap inside the step row whatever the content is — a 500-char unbroken string used to
     stretch this box to 4535px, run behind the image panel and off-screen (AB#132459) */
  min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}

.uiw-steps-guide-transition-panel {
  position: relative; flex-shrink: 0; width: 486px; height: 486px; border-radius: 8px; overflow: hidden;
}
.uiw-steps-guide-transition-panel .uiw-itg-image {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  border-radius: 8px; opacity: 0; transition: opacity .3s ease;
}

/* S1 default (step 1 highlighted + its image shown) comes from the radio's server-rendered
   `checked` attribute (template.liquid: {% if forloop.first %}checked{% endif %}) driving the
   :checked rules below — no separate hardcoded default here, or it never turns off once a
   different step is picked. */

/* click/select (radio :checked) drives highlight + image — persists after mouse leaves (S3) */
.uiw-itg-radio:nth-of-type(1):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-list label:nth-of-type(1) { background: #f2f8fc; }
.uiw-itg-radio:nth-of-type(1):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(1) { opacity: 1; }
.uiw-itg-radio:nth-of-type(2):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-list label:nth-of-type(2) { background: #f2f8fc; }
.uiw-itg-radio:nth-of-type(2):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(2) { opacity: 1; }
.uiw-itg-radio:nth-of-type(3):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-list label:nth-of-type(3) { background: #f2f8fc; }
.uiw-itg-radio:nth-of-type(3):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(3) { opacity: 1; }
.uiw-itg-radio:nth-of-type(4):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-list label:nth-of-type(4) { background: #f2f8fc; }
.uiw-itg-radio:nth-of-type(4):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(4) { opacity: 1; }
.uiw-itg-radio:nth-of-type(5):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-list label:nth-of-type(5) { background: #f2f8fc; }
.uiw-itg-radio:nth-of-type(5):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(5) { opacity: 1; }
.uiw-itg-radio:nth-of-type(6):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-list label:nth-of-type(6) { background: #f2f8fc; }
.uiw-itg-radio:nth-of-type(6):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(6) { opacity: 1; }
.uiw-itg-radio:nth-of-type(7):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-list label:nth-of-type(7) { background: #f2f8fc; }
.uiw-itg-radio:nth-of-type(7):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(7) { opacity: 1; }
.uiw-itg-radio:nth-of-type(8):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-list label:nth-of-type(8) { background: #f2f8fc; }
.uiw-itg-radio:nth-of-type(8):checked ~ .uiw-steps-guide-transition-desktop .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(8) { opacity: 1; }

/* hover previews the image while the pointer is over the list (S2) — reverts to :checked on mouse-leave (S3) */
.uiw-steps-guide-transition-list:hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image { opacity: 0; }
.uiw-steps-guide-transition-list label:nth-of-type(1):hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(1) { opacity: 1; }
.uiw-steps-guide-transition-list label:nth-of-type(2):hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(2) { opacity: 1; }
.uiw-steps-guide-transition-list label:nth-of-type(3):hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(3) { opacity: 1; }
.uiw-steps-guide-transition-list label:nth-of-type(4):hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(4) { opacity: 1; }
.uiw-steps-guide-transition-list label:nth-of-type(5):hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(5) { opacity: 1; }
.uiw-steps-guide-transition-list label:nth-of-type(6):hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(6) { opacity: 1; }
.uiw-steps-guide-transition-list label:nth-of-type(7):hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(7) { opacity: 1; }
.uiw-steps-guide-transition-list label:nth-of-type(8):hover ~ .uiw-steps-guide-transition-panel .uiw-itg-image:nth-of-type(8) { opacity: 1; }

/* ================= MOBILE (<= 640px): scroll-snap carousel + jump dots ================= */
@media (max-width: 640px) {
  .uiw-steps-guide-transition-instance { padding: 0 20px; }
  .uiw-steps-guide-transition-desktop { display: none; }
  .uiw-steps-guide-transition-mobile { display: block; }

  .uiw-steps-guide-transition-track {
    display: flex; align-items: stretch; gap: 27px; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px;
  }
  .uiw-steps-guide-transition-track::-webkit-scrollbar { display: none; }

  /* AB#132205 — the card had a HARD height:168px while the image inside was a hard 313x313, so the
     image overflowed and pushed the step text out of the (overflow-y:auto) track: the whole
     instruction text became unreachable on mobile. Figma mobile "Step Card" (node 3721-118500) has
     NO fixed card height — the card hugs its content: a square image (aspect 358/358) at full card
     width, then the text block. Height comes from content, and align-items:stretch on the track
     keeps every card as tall as the tallest one (Common rule #4, AB#132856). */
  .uiw-steps-guide-transition-card {
    scroll-snap-align: center; flex: 0 0 auto; width: 100%; max-width: 323px; height: auto;
    display: flex; flex-direction: column; align-items: stretch; gap: 16px;
  }
  .uiw-steps-guide-transition-card .uiw-itg-image {
    width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 8px;
  }
  /* Figma: badge on the LEFT, text to its right, inside a #f2f8fc block — not a centered column */
  .uiw-steps-guide-transition-card .uiw-steps-guide-transition-item {
    display: flex; flex-direction: row; align-items: center; text-align: left; gap: 20px;
    padding: 16px; background: #f2f8fc; border-radius: 8px;
  }
  /* no typography override here on purpose: the base .uiw-itg-description (500 / 16px / 24px,
     #000000) already IS the Figma mobile value. The old 400/22px override matched SRS Table 7,
     which Figma contradicts — see gap-132205 A2. */
  .uiw-steps-guide-transition-card .uiw-itg-description {
    text-align: left;
  }

  .uiw-steps-guide-transition-dots { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }
  .uiw-itg-dot { width: 18px; height: 8px; border-radius: 999px; background: #fee1bc; display: inline-block; cursor: pointer; }
  /* active dot is driven live by widget.js (scroll-position sync on swipe + click-to-jump) */
  .uiw-itg-dot--active { width: 24px; background: #ff7300; }
}
/* AB#152894/152895: step description is authored rich text (editorUrl) - PROD carries "Step N" bold line, links and a bullet list */
.uiw-itg-description p { margin: 0; }
.uiw-itg-description ul, .uiw-itg-description ol { margin: 0; padding-left: 24px; }
.uiw-itg-description ul { list-style: disc outside; }
.uiw-itg-description ol { list-style: decimal outside; }
.uiw-itg-description li { display: list-item; }
.uiw-itg-description b, .uiw-itg-description strong { font-weight: 700; }
.uiw-itg-description a { text-decoration: underline; }