@layer components {

/* Breadcrumbs (previously from Metro .breadcrumbs) */
.breadcrumbs {
  margin: 0.2em;
  font-size: var(--font-size-sm);
}

.breadcrumbs.small {
  font-size: var(--font-size-xs);
}

.breadcrumbs ul {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.breadcrumbs ul li {
  margin: 0 0.15em 0 0.7em;
}

.breadcrumbs ul li:first-child {
  margin-left: 0;
}

.breadcrumbs ul a {
  background: #d9d9d9;
  padding: 0.2em 0.8em;
  display: inline-block;
  text-decoration: none;
  color: var(--primary-500);
  position: relative;
}

.breadcrumbs ul a:hover {
  background: var(--primary-500);
  color: #fff;
}

/* Arrow shape before */
.breadcrumbs ul a:before {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -1.1em;
  border-width: 1.1em 0 1.1em 0.7em;
  border-style: solid;
  border-color: #d9d9d9 #d9d9d9 #d9d9d9 transparent;
  left: -0.7em;
  margin-left: 1px;
}

/* Arrow shape after */
.breadcrumbs ul a:after {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -1.1em;
  border-top: 1.1em solid transparent;
  border-bottom: 1.1em solid transparent;
  border-left: 0.7em solid #d9d9d9;
  right: -0.7em;
  margin-right: 1px;
}

.breadcrumbs ul a:hover:before {
  border-color: var(--primary-500) var(--primary-500) var(--primary-500) transparent;
}

.breadcrumbs ul a:hover:after {
  border-left-color: var(--primary-500);
}

/* First item — no left arrow */
.breadcrumbs ul li:first-child a:before {
  content: normal;
}

/* Last/active item */
.breadcrumbs ul li:last-child a {
  color: #1d1d1d;
}

.breadcrumbs ul li:last-child a:after,
.breadcrumbs ul li:last-child a:before {
  content: normal;
}

.breadcrumbs ul .active,
.breadcrumbs ul .active:hover {
  background: transparent;
}

/* Mobile: truncate long breadcrumb text */
@media (max-width: 768px) {
  .breadcrumbs ul {
    flex-wrap: nowrap;
  }

  .breadcrumbs ul a {
    max-width: 12rem;
    overflow: clip;
    overflow-clip-margin: 1em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .breadcrumbs ul li:last-child a,
  .breadcrumbs ul .active {
    max-width: 10rem;
    overflow: clip;
    overflow-clip-margin: 1em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

}
