/*
 * Component: breadcrumb sitewide.
 *
 * Il percorso resta sempre nel flusso del documento: una riga leggera,
 * senza pillole, sovrapposizioni o margini negativi sulle hero.
 */

.bpc-breadcrumb-shell {
  position: relative;
  z-index: var(--z-breadcrumb, 10);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--bspc-border-light) 72%, transparent);
  background: var(--bspc-bg-white);
}

.bpc-breadcrumb {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--bspc-content-width, 1200px);
  min-width: 0;
  min-height: 40px;
  margin: 0 auto;
  padding: 8px 24px;
  overflow-x: auto;
  color: var(--bspc-text-secondary);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.bpc-breadcrumb::-webkit-scrollbar,
.bpc-breadcrumb-list::-webkit-scrollbar {
  display: none;
}

.bpc-breadcrumb-list {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  box-sizing: border-box;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  list-style: none;
  scrollbar-width: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  -webkit-overflow-scrolling: touch;
}

.bpc-breadcrumb-item {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.bpc-breadcrumb a {
  color: var(--bspc-text-secondary);
  text-decoration: none;
  text-shadow: none;
  transition: color .15s ease;
}

.bpc-breadcrumb a:hover,
.bpc-breadcrumb a:focus-visible {
  color: var(--bspc-blue-primary);
}

.bpc-breadcrumb a:focus-visible {
  outline: 2px solid var(--bspc-blue-primary);
  outline-offset: 3px;
  border-radius: 3px;
}

.bpc-breadcrumb [aria-current="page"] {
  color: var(--bspc-text-primary);
  font-weight: 650;
  text-shadow: none;
}

.bpc-breadcrumb-item + .bpc-breadcrumb-item::before {
  content: "›";
  display: inline-block;
  margin: 0 7px;
  color: var(--bspc-text-light);
  font-size: .95em;
  font-weight: 400;
}

/* Mantiene esplicitamente lo stesso flusso sulle archive immersive. */
body:has(.bpc-category-hero-immersive) .bpc-breadcrumb-shell {
  position: relative;
  inset: auto;
  margin: 0;
  padding: 0;
  pointer-events: auto;
}

body:has(.bpc-category-hero-immersive) .bpc-breadcrumb-shell .bpc-breadcrumb {
  max-width: var(--bspc-content-width, 1200px);
  margin: 0 auto;
  padding: 8px 24px;
}

body:has(.bpc-category-hero-immersive) .bpc-breadcrumb-shell .bpc-breadcrumb-list {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* /servizi/ usa il breadcrumb globale; resta soltanto il comando locale. */
.bpc-service-single .bpc-s-breadcrumb-nav {
  display: none;
}

.bpc-service-single .bpc-s-breadcrumb-bar {
  justify-content: flex-start;
}

@media (max-width: 767.98px) {
  .bpc-breadcrumb {
    min-height: 43px;
    padding: 8px 16px;
    font-size: 11.5px;
  }

  body:has(.bpc-category-hero-immersive) .bpc-breadcrumb-shell .bpc-breadcrumb {
    padding: 8px 16px;
  }

  /* Nei prodotti lunghi preserva sempre padre e pagina corrente leggibili. */
  body.single-product .bpc-breadcrumb-list {
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  body.single-product .bpc-breadcrumb-item:not(:nth-last-child(-n + 2)) {
    display: none;
  }

  body.single-product .bpc-breadcrumb-item:nth-last-child(2)::before {
    display: none;
  }

  body.single-product .bpc-breadcrumb-item:last-child {
    flex: 1 1 auto;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bpc-breadcrumb a {
    transition: none;
  }
}
