/**
 * Acme breadcrumbs — shared trail for every page that renders
 * Magento_Theme::html/breadcrumbs.phtml (CMS/static pages, search, checkout success…).
 *
 * Values mirror the PDP trail in acme-pdp.css so the crumb reads the same
 * everywhere: 14px Montserrat, navy links, light-red current page.
 * PDP keeps its own `body.acme-pdp-page … !important` block and wins there;
 * category pages hide the trail entirely (acme-category.css).
 *
 * Width must match header / section / footer rail (--acme-header-pad-x +
 * --acme-header-inner), including MBA 2.8vw gutters — never 100% - 2rem.
 *
 * IMPORTANT: use !important so Tailwind / styles.css cannot force the <ol>
 * back to display:block (each crumb on its own row).
 */

/* Never hide PDP crumbs (stale acme-header once used display:none on mobile). */
html body.acme-pdp-page .top-container,
html body.acme-pdp-page .top-container .breadcrumbs,
html body.acme-pdp-page .breadcrumbs,
html body.acme-pdp-page .acme-breadcrumbs,
html body.acme-pdp-page .acme-pdp-breadcrumbs,
html body.catalog-product-view .breadcrumbs,
html body.catalog-product-view .acme-breadcrumbs {
    display: block !important;
    visibility: visible !important;
}

html body .acme-breadcrumbs,
html body.acme-pdp-page .acme-breadcrumbs,
html body.acme-pdp-page .acme-pdp-breadcrumbs,
html body.catalog-product-view .acme-breadcrumbs {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    max-width: var(--acme-header-inner, var(--acme-pdp-content-width, 93.3125rem)) !important;
    margin: 0 auto !important;
    padding-block: 1rem 0.75rem !important;
    padding-inline: var(--acme-header-pad-x, clamp(1.25rem, 10.8vw, 12.875rem)) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

html body .acme-breadcrumbs__list,
html body .acme-pdp-breadcrumbs__list,
html body.acme-pdp-page .acme-breadcrumbs__list,
html body.acme-pdp-page .acme-pdp-breadcrumbs__list,
html body.acme-pdp-page .breadcrumbs .items,
html body.catalog-product-view .acme-breadcrumbs__list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    background: transparent !important;
    -webkit-overflow-scrolling: touch !important;
}

html body .acme-breadcrumbs__list::-webkit-scrollbar,
html body.acme-pdp-page .acme-breadcrumbs__list::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
}

html body .acme-breadcrumbs__item,
html body .acme-pdp-breadcrumbs__item,
html body.acme-pdp-page .acme-breadcrumbs__item,
html body.acme-pdp-page .acme-pdp-breadcrumbs__item,
html body.acme-pdp-page .breadcrumbs .item,
html body.catalog-product-view .acme-breadcrumbs__item {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Last crumb (product name) may shrink with ellipsis so the trail stays one row. */
html body .acme-breadcrumbs__item:last-child,
html body .acme-pdp-breadcrumbs__item:last-child,
html body.acme-pdp-page .acme-breadcrumbs__item:last-child,
html body.acme-pdp-page .acme-pdp-breadcrumbs__item:last-child,
html body.acme-pdp-page .breadcrumbs .item:last-child,
html body.catalog-product-view .acme-breadcrumbs__item:last-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

html body .acme-breadcrumbs__sep,
html body .acme-pdp-breadcrumbs__sep,
html body.acme-pdp-page .acme-breadcrumbs__sep,
html body.acme-pdp-page .acme-pdp-breadcrumbs__sep {
    display: inline-block !important;
    flex-shrink: 0 !important;
    padding: 0 0.5rem !important;
    color: #6b7280 !important;
}

html body .acme-breadcrumbs__link,
html body .acme-breadcrumbs__text,
html body .acme-breadcrumbs__current,
html body .acme-pdp-breadcrumbs__link,
html body .acme-pdp-breadcrumbs__text,
html body.acme-pdp-page .acme-breadcrumbs__link,
html body.acme-pdp-page .acme-breadcrumbs__text,
html body.acme-pdp-page .acme-breadcrumbs__current {
    font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1.25rem !important;
    letter-spacing: 0 !important;
    color: var(--acme-ink, #0f2d52) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    min-height: 0 !important;
    height: auto !important;
}

html body .acme-breadcrumbs__item:last-child .acme-breadcrumbs__current,
html body .acme-breadcrumbs__item:last-child .acme-breadcrumbs__text,
html body .acme-breadcrumbs__item:last-child .acme-breadcrumbs__link,
html body.acme-pdp-page .acme-breadcrumbs__item:last-child .acme-breadcrumbs__current,
html body.acme-pdp-page .acme-breadcrumbs__item:last-child .acme-pdp-breadcrumbs__text {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

html body .acme-breadcrumbs__link:hover,
html body .acme-breadcrumbs__link:focus-visible {
    text-decoration: underline !important;
}

html body .acme-breadcrumbs__current,
html body .acme-breadcrumbs__item.is-current .acme-breadcrumbs__current,
html body.acme-pdp-page .acme-breadcrumbs__current,
html body.acme-pdp-page .acme-pdp-breadcrumbs__text {
    color: #e57373 !important;
    font-weight: 600 !important;
}

/*
 * Left-align trails: drop header pad-x so Home / Page starts on the same left
 * edge as the page H1 / hero / category title. `html body…` beats the base
 * `html body .acme-breadcrumbs` pad-inline rule (same sheet, higher specificity).
 *
 * Exclude centered form landings (sample-request / request-a-catalog): their H1
 * lives inside a narrow card, so pad-inline:0 glued crumbs to the viewport edge.
 */
html body.cms-page-view:not(.acme-gallery-page):not(.cms-sample-request):not(.cms-request-sample):not(.cms-request-a-catalog) .acme-breadcrumbs,
html body.cms-page-view:not(.acme-gallery-page):not(.cms-sample-request):not(.cms-request-sample):not(.cms-request-a-catalog) .breadcrumbs.acme-breadcrumbs,
html body.cms-page-view:not(.acme-gallery-page):not(.cms-sample-request):not(.cms-request-sample):not(.cms-request-a-catalog) .top-container .acme-breadcrumbs,
html body.acme-about-page .acme-breadcrumbs,
html body.acme-about-page .breadcrumbs.acme-breadcrumbs,
html body.acme-about-page .top-container .acme-breadcrumbs,
html body.acme-category-page .acme-breadcrumbs,
html body.acme-category-page .breadcrumbs.acme-breadcrumbs,
html body.acme-category-page .top-container .acme-breadcrumbs,
html body.catalog-category-view .acme-breadcrumbs,
html body.catalog-category-view .breadcrumbs.acme-breadcrumbs,
html body.catalog-category-view .top-container .acme-breadcrumbs,
html body.acme-fast-order-page .acme-breadcrumbs,
html body.acme-fast-order-page .breadcrumbs.acme-breadcrumbs,
html body.acme-fast-order-page .top-container .acme-breadcrumbs {
    display: block !important;
    visibility: visible !important;
    padding-inline: 0 !important;
    text-align: left !important;
    margin-inline: auto !important;
}

/* Form landings: keep header-rail pad (logo column), not viewport edge. */
html body.cms-sample-request .acme-breadcrumbs,
html body.cms-request-sample .acme-breadcrumbs,
html body.cms-request-a-catalog .acme-breadcrumbs,
html body.cms-sample-request .breadcrumbs.acme-breadcrumbs,
html body.cms-request-sample .breadcrumbs.acme-breadcrumbs,
html body.cms-request-a-catalog .breadcrumbs.acme-breadcrumbs,
html body.cms-sample-request .top-container .acme-breadcrumbs,
html body.cms-request-sample .top-container .acme-breadcrumbs,
html body.cms-request-a-catalog .top-container .acme-breadcrumbs {
    display: block !important;
    visibility: visible !important;
    padding-inline: var(--acme-header-pad-x, clamp(1.25rem, 10.8vw, 12.875rem)) !important;
    text-align: left !important;
    margin-inline: auto !important;
    max-width: none !important;
    width: 100% !important;
}

/* Parent/child category: equal air above + below the trail (beats base 1rem/0.75rem) */
html body.acme-category-page .acme-breadcrumbs,
html body.acme-category-page .breadcrumbs.acme-breadcrumbs,
html body.acme-category-page .top-container .acme-breadcrumbs,
html body.catalog-category-view .acme-breadcrumbs,
html body.catalog-category-view .breadcrumbs.acme-breadcrumbs,
html body.catalog-category-view .top-container .acme-breadcrumbs {
    padding-block: 1rem !important;
}

html body.cms-page-view:not(.acme-gallery-page) .acme-breadcrumbs__list,
html body.acme-about-page .acme-breadcrumbs__list,
html body.acme-category-page .acme-breadcrumbs__list,
html body.catalog-category-view .acme-breadcrumbs__list,
html body.acme-fast-order-page .acme-breadcrumbs__list {
    justify-content: flex-start !important;
    margin-inline: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
}

@media (max-width: 1023px) {
    html body .acme-breadcrumbs,
    html body.acme-pdp-page .acme-breadcrumbs,
    html body.acme-pdp-page .acme-pdp-breadcrumbs {
        display: block !important;
        padding-block: 0.75rem 0.5rem !important;
        padding-inline: var(--acme-header-pad-x, 1rem) !important;
        min-height: 0 !important;
    }

    /* Keep CMS / About / category / Fast Order trails left-aligned on small screens too */
    html body.cms-page-view:not(.acme-gallery-page):not(.cms-sample-request):not(.cms-request-sample):not(.cms-request-a-catalog) .acme-breadcrumbs,
    html body.acme-about-page .acme-breadcrumbs,
    html body.acme-category-page .acme-breadcrumbs,
    html body.catalog-category-view .acme-breadcrumbs,
    html body.acme-fast-order-page .acme-breadcrumbs {
        padding-inline: 1rem !important;
        text-align: left !important;
    }

    html body.cms-sample-request .acme-breadcrumbs,
    html body.cms-request-sample .acme-breadcrumbs,
    html body.cms-request-a-catalog .acme-breadcrumbs {
        padding-inline: var(--acme-header-pad-x, 1rem) !important;
        text-align: left !important;
    }

    html body.acme-category-page .acme-breadcrumbs,
    html body.catalog-category-view .acme-breadcrumbs {
        padding-block: 0.75rem !important;
    }

    html body .acme-breadcrumbs__link,
    html body .acme-breadcrumbs__text,
    html body .acme-breadcrumbs__current,
    html body.acme-pdp-page .acme-breadcrumbs__link,
    html body.acme-pdp-page .acme-breadcrumbs__current {
        font-size: 0.8125rem !important;
        line-height: 1.2 !important;
    }

    html body .acme-breadcrumbs__sep,
    html body.acme-pdp-page .acme-breadcrumbs__sep {
        padding: 0 0.35rem !important;
    }
}

/* Mobile / tablet / MBA: hard one-row lock (beats PDP white-space:normal leftovers). */
@media (max-width: 1799px) {
    html body .acme-breadcrumbs__list,
    html body.acme-pdp-page .acme-breadcrumbs__list,
    html body.acme-pdp-page .acme-pdp-breadcrumbs__list,
    html body.acme-pdp-page .breadcrumbs .items {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    html body .acme-breadcrumbs__item,
    html body.acme-pdp-page .acme-breadcrumbs__item,
    html body.acme-pdp-page .breadcrumbs .item {
        align-items: center !important;
        white-space: nowrap !important;
    }

    html body .acme-breadcrumbs__link,
    html body .acme-breadcrumbs__text,
    html body .acme-breadcrumbs__current,
    html body.acme-pdp-page .acme-breadcrumbs__link,
    html body.acme-pdp-page .acme-breadcrumbs__text,
    html body.acme-pdp-page .acme-breadcrumbs__current,
    html body.acme-pdp-page .breadcrumbs a,
    html body.acme-pdp-page .breadcrumbs .item > span {
        white-space: nowrap !important;
        min-height: 0 !important;
    }
}
