/* Desktop-only: make mega dropdown size to its content */
@media (min-width: 993px) {
  /* Stop forcing full-viewport width; anchor below the menu item */
  #mainmenu > li ul.mega {
    position: absolute;  /* relative to the <li> */
    top: 100%;           /* sit just under the menu item */
    left: 0;             /* align left edge with the parent <li> */
    width: auto;         /* <- key: shrink/grow to content */
    height: auto;        /* let it grow naturally when open */
    overflow: visible;
    z-index: 1000;       /* ensure it sits above header content */
  }

  /* Let the inner box also shrink to its content */
  #mainmenu > li ul.mega .sb-menu {
    width: auto;         /* <- key */
    display: inline-block;
  }
}
.d-list-small a {
  display: flex;
  align-items: center;  /* vertically center image + text */
  gap: 10px;            /* space between img and text */
}

.d-list-small img {
  display: block;       /* prevent inline spacing quirks */
  max-width: 40px;      /* control image size */
  height: auto;
}

.d-list-small h5 {
  margin: 0;            /* remove top/bottom margin */
}
/* === 1) Desktop-only: make the mega dropdown auto-width instead of full width === */
@media (min-width: 993px) {
  /* stop forcing full-viewport width; anchor below its parent <li> */
  header #mainmenu > li ul.mega {
    position: absolute !important;  /* was fixed */
    top: 100%;
    left: 0;                        /* use right:0; left:auto; to right-align if needed */
    width: auto !important;         /* key: shrink/grow to content */
    height: auto;
    overflow: visible;
    margin-top: 0;                  /* avoid unexpected offset */
    padding: 0;
    z-index: 1000;
  }

  /* the inner box should also shrink to its content */
  header #mainmenu > li ul.mega .sb-menu {
    width: auto !important;
    display: inline-block;          /* shrink-to-fit */
  }
}

/* === 2) Image + title on one line inside the submenu cards === */
header #mainmenu ul.mega .sb-menu .d-list-small > a {
  display: flex !important;         /* win against any theme block rules */
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

/* prevent global img rules from stretching the icon */
header #mainmenu ul.mega .sb-menu .d-list-small img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}

/* keep the heading inline on the same row and remove default margins */
header #mainmenu ul.mega .sb-menu .d-list-small h5 {
  margin: 0 !important;
  width: auto !important;
  display: inline-block;            /* safety net if flex gets overridden */
  white-space: normal;              /* use nowrap if you prefer a single line */
}
/*.hero-text-box {
  display: inline-block;                /* shrink to text width */
  background: rgba(0, 0, 0, 0.6);       /* black with 60% transparency */
  padding: 20px 30px;                   /* spacing around the text */
  border-radius: 8px;                   /* optional: rounded corners */
}*/

.de_count h3 {
      display: inline; /* keeps the numbers inline */
    }
    .de_count .decimal {
      font-size: inherit;   /* same size as the counter */
      color: inherit;       /* same color as the counter */
      font-weight: inherit; /* matches the weight */
    }