/* AB#134830 vong 1: bo padding DOC cua lop trong (.uiw-icons-steps-guide-item) - dung element ma QC
   inspect trong evidence (article.uiw-icons-steps-guide-item, padding 18px 24px).
   Padding NGANG 24px giu nguyen.
   AB#134830 vong 2 (26/08): bo luon `padding-top: 24px` o ROOT - xem khoi comment tai
   .uiw-icons-steps-guide ben duoi. QC re-test va inspect DUNG node nay
   (`div.uiw-icons-steps-guide`, Padding `24px 0px 0px`) => cau hoi A1 cua gap-134830 ("bug nay noi
   widget nao?") da co dap an tu chinh evidence: la Icon Steps Guide, khong phai Steps Guide
   Transition nhu title ADO. */
/* Icons Steps Guide — SRS Part15 §3.8 · tokens from Figma 3721-123461 (desktop) / 3721-123929 (mobile).
   Flat prefixed selectors only. Descendant selectors appear solely for raw rich-text tags (<p>/<b>),
   which have no class of their own. */

/* AB#134830 — the root carries NO vertical padding.
   It used to carry `padding-top: 24px`, added for AB#132704 / AB#132727 off Figma node 3721-123459
   (24px between the tab line / section header and the steps grid) because at the time nothing above
   the widget produced that gap. That premise no longer holds: the shell emits the instance heading as
   `h2.uiw-widget-title` OUTSIDE this root, and layout-shell.css:555-559 gives it
   `margin-bottom: 40px` for every dynamic widget (AB#131811, the common 40px rule). The 24px
   therefore stacked on top of the 40px and read as 64px, which is what QC re-opened AB#134830 for
   after round 1 ("Vẫn còn padding phía trên", DevTools on div.uiw-icons-steps-guide showing
   `24px 0px 0px`).
   And the UNTITLED branch closes the argument rather than weakening it: an instance with no title
   still gets 40px above it, from the shell's own margin — `.page-content--widgets > .uiw-dw-shell
   {margin-top:40px}` (layout-shell.css:529-532), which reaches this widget because
   DynamicWidgetAdapter.RequiresAbpCss => false makes the shell a direct child of
   .page-content--widgets. So 24px was surplus-on-top-of-40 in BOTH branches: there is no placement
   where removing it leaves content flush against whatever sits above.
   One case does move: in a TABBED placement the gap above the grid belongs to
   DynamicWidgetTabFrame's inline `.widget-cat-tabs{margin-bottom:20px}`, so tab-bar -> grid goes
   44px -> 20px, i.e. 4px UNDER the 24px of Figma 3721-123459 — not flush, but not the Figma number
   either. Recorded in gap-134830 §A-WAIVE vòng 2 so a tabbed page cannot become AB#132704 round three.
   Removing it REVERSES the AB#132704 / AB#132727 fix, so it is a deliberate decision, not a cleanup:
   Kiet Le Tuan (dev lead) chốt bỏ ngày 2026-08-26. It also puts this widget back in step with Slider,
   whose identical 24px was removed in AB#134811 earlier the same day. If BA later rules that 24px is
   the correct heading gap for this widget, the fix belongs in the SHELL
   (`.uiw-dw-shell.uiw-dw-dynamic-icons-steps-guide .uiw-widget-title{margin-bottom:24px}`) — do NOT
   put padding back on this root, or the two values stack again. See
   gap-134830-steps-guide-transition-wrong-widget.md. */
.uiw-icons-steps-guide {
  font-family: 'Unbeatable', 'Arial', 'Helvetica Neue', 'Helvetica', sans-serif;
}

.uiw-icons-steps-guide-block {
  display: block;
}

.uiw-icons-steps-guide-inner {
  position: relative;
  width: 100%;
  max-width: 1248px;          /* SRS Table 57 container width */
  margin: 0 auto;
}

.uiw-icons-steps-guide-list {
  display: grid;
  gap: 24px;                  /* Figma gap-x-[24px] gap-y-[24px] */
  /* align-items is left at the grid default (stretch) on purpose: cards in the SAME row must end at the
     same bottom edge (Figma row 1, and AMB-04's stated consequence of the fixed image frame). Grid sizes
     each row independently, so stretch does NOT stretch a short last row — nothing to stretch against. */
}

/* SRS Table 57 — admin-selected column count. A short last row is left-aligned with empty slots,
   which is what a grid does naturally. */
.uiw-icons-steps-guide-list[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.uiw-icons-steps-guide-list[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.uiw-icons-steps-guide-list[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }

.uiw-icons-steps-guide-item {
  box-sizing: border-box;
  width: 100%;                /* = the grid track: 294px at 4 cols in a 1248px container */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;         /* AB#151824: Figma 3721-123461 (desktop) / 3721-123929 (mobile) card = px-[24px] py-[18px]
                                 (was 0 24px; the ticket text said 16/8 but the Figma nodes say 18/24). The icon-less
                                 variant (:not(:has(figure)) rule below) keeps its own PROD-based padding. */
  background-color: #ffffff;
  border-radius: 8px;         /* Figma var radius/radius-lg (base) */
  box-shadow: 0 0 7px rgba(0, 0, 0, 0.12);   /* Figma effect "dropdown 1" #0000001F, blur 7 */
}

.uiw-icons-steps-guide-title {
  display: block;
  width: 100%;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.18px;    /* Figma -1% of 18px */
  color: #ff7300;             /* Figma var primary/base */
  text-align: center;
  overflow-wrap: break-word;
}

/* SRS Table 59 — image is optional per step. The illustration is 138px wide (the Figma frame) and its height follows
   the image ratio (R3 BA 21/10: a fixed 138px-high box shrank portrait phone screenshots to ~100px wide; PROD shows them
   ~128px wide). Square icons keep the Figma 138x138; a tall screenshot grows taller instead of narrower. */
.uiw-icons-steps-guide-figure {
  display: flex;
  justify-content: center;
  width: 100%;
}

.uiw-icons-steps-guide-img {
  display: block;
  width: 138px;
  max-width: 100%;
  height: auto;
}

.uiw-icons-steps-guide-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.uiw-icons-steps-guide-content {
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: #000000;
  text-align: center;
  overflow-wrap: break-word;
}

/* rich-text body (SRS Table 60): paragraphs stack with the 4px body gap, inline runs stay inline */
.uiw-icons-steps-guide-content > :first-child { margin-top: 0; }
.uiw-icons-steps-guide-content > :last-child { margin-bottom: 0; }
.uiw-icons-steps-guide-content p { margin: 0 0 4px; }
.uiw-icons-steps-guide-content b,
.uiw-icons-steps-guide-content strong { font-weight: 700; }
.uiw-icons-steps-guide-content a { color: #ff7300; }
/* AB#145786: rich-text links underline on hover, as the AEM source did (.text a:hover). The step body is a
   RichText field, so PROD is the target; Figma 3721-123461 has no link state. Focus keeps PROD's outline. */
.uiw-icons-steps-guide-content a:hover { text-decoration: underline; }

/* Carousel arrows (SRS Table 57 mobile) — mobile + Horizontal Carousel only. Styling is INFERRED:
   the only reference is the annotated 32x32 orange circle in the SRS screenshot (gap A5). */
.uiw-icons-steps-guide-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: #ff7300;
  color: #ffffff;
  cursor: pointer;
  z-index: 2;
  align-items: center;
  justify-content: center;
}

/* 8px inside the CARD edge — the arrow belongs to the card (SRS screenshot), not to the page gutter.
   The carousel rule below narrows -inner to the card width so left/right resolve against the card. */
.uiw-icons-steps-guide-nav-prev { left: 8px; }
.uiw-icons-steps-guide-nav-next { right: 8px; }
.uiw-icons-steps-guide-chevron { display: block; }

/* ── Mobile ─────────────────────────────────────────────────────────────────
   Vertical Stack: single column, card 353px centred (Figma annotation 353x286),
   16px between cards (INFERRED — gap A6).
   Horizontal Carousel: scroll-snap track (swipe needs no JS) + arrow buttons (JS). */
@media (max-width: 767px) {
  .uiw-icons-steps-guide-list[data-columns] {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .uiw-icons-steps-guide-item {
    width: 100%;
    max-width: 353px;
    margin-left: auto;
    margin-right: auto;
  }

  /* AB#152892: Figma 3721-123929 draws the mobile card full width inside the 20px page gutter (393 frame: 20 + 353 + 20), so 353 is
     the 393 case, not a cap. Capping at 353 left 30/39px each side at 412/430 (PROD 16). Image cards now sit 20px from each edge at every
     phone width; icon-less cards (D31, PROD-based) keep the rule above. */
  .uiw-icons-steps-guide-item:has(.uiw-icons-steps-guide-figure) {
    max-width: min(100%, calc(100vw - 40px));
  }

  /* AB#152902: icon-less cards follow PROD (D31): PROD keeps them 16px from each edge at every phone width (375/412/430), so the
     353 cap (30/39px at 412/430) is dropped for them in Vertical Stack. Carousel keeps its 353 track. */
  .uiw-icons-steps-guide-block:not([data-mobile="carousel"]) .uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) {
    max-width: none;
  }

  /* Pin the track (and therefore the arrow buttons) to the card width, so an arrow sits ON the card
     instead of straddling the page gutter. */
  .uiw-icons-steps-guide-block[data-mobile="carousel"] .uiw-icons-steps-guide-inner {
    max-width: 353px;
  }

  .uiw-icons-steps-guide-block[data-mobile="carousel"] .uiw-icons-steps-guide-list[data-columns] {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .uiw-icons-steps-guide-block[data-mobile="carousel"] .uiw-icons-steps-guide-list[data-columns]::-webkit-scrollbar {
    display: none;
  }

  .uiw-icons-steps-guide-block[data-mobile="carousel"] .uiw-icons-steps-guide-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
  }

  .uiw-icons-steps-guide-block[data-mobile="carousel"] .uiw-icons-steps-guide-nav {
    display: flex;
  }

  /* SRS Table 57: hide the arrow when there is nothing further that way (widget.js sets [hidden]).
     Must out-specify the display:flex rule above, hence the same block[data-mobile] prefix. */
  .uiw-icons-steps-guide-block[data-mobile="carousel"] .uiw-icons-steps-guide-nav[hidden] {
    display: none;
  }
}


/* AB#150953: optional per-guide group heading (schema field `grouptitle`, rich text), for tabs that hold more
   than one guide — PROD business/support/wifi-calling: "Enable WiFi Calling" / "Make & Receive Calls with
   Wi-Fi Calling" above each group of steps, an h2 32/600/40 #2B2B2B centred (26/600 on mobile).
   The value is editor HTML (<p>, <b>, <br>, ...), so the raw <p> inside gets its margin reset here.
   Only titled blocks get any of this, so every untitled instance renders exactly as before.
   (Replaces the AB#141860 plain-text orange 16px heading: its schema field no longer exists, no item used it.) */
.uiw-icons-steps-guide-block--titled:not(:first-child) {
  margin-top: 40px;
}
.uiw-icons-steps-guide-heading {
  box-sizing: border-box;
  width: 100%;
  max-width: 1248px;
  margin: 0 auto 24px;
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  color: #2b2b2b;
  text-align: center;
  overflow-wrap: break-word;
}
.uiw-icons-steps-guide-heading p {
  margin: 0;
}
@media (max-width: 767px) {
  .uiw-icons-steps-guide-heading {
    font-size: 26px;
    line-height: 33px;
  }
}


/* Tab Line (08/10/2026): the tabbed (category) placement with a template whose tabStyle is underline / underline-left
   ("Icon Steps Guide - 1 Level Underline Left"; AEM text-with-line switch-tab, e.g. upgrade-your-plan). Figma "Tab Line"
   (FIG 2546-20305 left, 2546-39061 mobile; the component PlanContainer/FaqSection follow): tab padding 8/16/12, 16/24
   label, 24px apart, inactive 500 #4D4D4D, active 600 #FF7300 with a 2px #E86900 underline across the tab box, on a
   1px #E6E6E6 divider; a row wider than the column scrolls sideways without a scrollbar.
   DynamicWidgetTabFrame emits the bar as .widget-cat-underline-tabs(.widget-cat-underline-left) and its own <style>
   (gap 30, #666, 10px bottom padding) AFTER this sheet, so every rule here carries the two-class root prefix the frame
   provides for this purpose (.uiw-dw-root.uiw-dw-<key>) to win on specificity. Pill bars (.widget-cat-tabs) are not
   matched: every pill instance renders exactly as before. The left row starts at the widget column edge, like the
   cards (96 at 1440, 16 at 375/768); the divider spans the column. Underline gap to the grid = Figma 3721-123459 24px. */
.uiw-dw-root.uiw-dw-dynamic-icons-steps-guide > .widget-cat-underline-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 24px;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  background: linear-gradient(#e6e6e6, #e6e6e6) left bottom / 100% 1px no-repeat;
}
.uiw-dw-root.uiw-dw-dynamic-icons-steps-guide > .widget-cat-underline-tabs::-webkit-scrollbar {
  display: none;
}
.uiw-dw-root.uiw-dw-dynamic-icons-steps-guide > .widget-cat-underline-tabs.widget-cat-underline-left {
  width: 100%;
  justify-content: flex-start;
}
.uiw-dw-root.uiw-dw-dynamic-icons-steps-guide > .widget-cat-underline-tabs > button {
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0;
  padding: 8px 16px 12px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: #4d4d4d;
}
/* An inset shadow paints the underline over the divider without the -1px margin a border needs, which the scroll
   container (overflow-y clipped) would cut off. */
.uiw-dw-root.uiw-dw-dynamic-icons-steps-guide > .widget-cat-underline-tabs > button.active {
  color: #ff7300;
  font-weight: 600;
  border-bottom: 0;
  box-shadow: inset 0 -2px 0 #e86900;
}
/* Same clipping: draw the focus ring inside the tab box. */
.uiw-dw-root.uiw-dw-dynamic-icons-steps-guide > .widget-cat-underline-tabs > button:focus-visible {
  outline: 2px solid #e86900;
  outline-offset: -2px;
}
/* Forced colours drop box-shadow and the gradient divider: real borders there (the tab stays 44px). */
@media (forced-colors: active) {
  .uiw-dw-root.uiw-dw-dynamic-icons-steps-guide > .widget-cat-underline-tabs {
    border-bottom: 1px solid GrayText;
  }
  .uiw-dw-root.uiw-dw-dynamic-icons-steps-guide > .widget-cat-underline-tabs > button.active {
    border-bottom: 2px solid CanvasText;
    padding-bottom: 10px;
  }
}

/* AB#147337 / AB#147338 (15/10, user rule): a step card WITHOUT an image follows PROD, not Figma. Figma 3721-123461
   only draws the icon card (figure + centred text); the icon-less cards come from AEM text steps (business/support/volte
   "Experience Ultra Clear Voice Calling"), where PROD left-aligns them: "Step N" 16/400 #FF7B00, heading 22/700/28.6,
   body 16/400 #2B2B2B, 16px inset, radius 10, soft shadow (mobile: 13/400 · 18/700/24 · 13/400, 12px inset).
   Measured on www.u.com.my/en/business/support/volte at 1440/390. Icon cards keep every rule above unchanged. */
.uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) {
  align-items: stretch;
  gap: 4px;
  padding: 16px 16px 22px;
  border-radius: 10px;
  box-shadow: 0 3px 20px rgba(43, 43, 43, 0.2);
}
.uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-title {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3333;
  letter-spacing: 0;
  color: #ff7b00;
  text-align: left;
}
.uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-body {
  align-items: stretch;
}
.uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-content {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3333;
  color: #2b2b2b;
  text-align: left;
}
.uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-content p {
  margin: 0;
}
/* the step heading is the body's opening bold-only paragraph (the extractor writes it so) */
.uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-content > p:first-child:has(> b:only-child, > strong:only-child) {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 32px;
}
.uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-content a {
  color: #f48120;
  font-weight: 700;
  text-decoration: none;
}
.uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-content a:hover {
  text-decoration: underline;
}
@media (max-width: 767px) {
  .uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) {
    gap: 5px;
    padding: 16px 12px 22px;
  }
  .uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-title,
  .uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-content {
    font-size: 13px;
    line-height: 1.25;
  }
  .uiw-icons-steps-guide-item:not(:has(.uiw-icons-steps-guide-figure)) .uiw-icons-steps-guide-content > p:first-child:has(> b:only-child, > strong:only-child) {
    font-size: 18px;
    line-height: 24px;
    margin-bottom: 20px;
  }
}
