/**
 * Shop-surface catalogue and hero corrections. Corporate pages do not enqueue this file.
 */

/* Woo appends "Warenkorb anzeigen" next to the 72×40 icon after added_to_cart (needed for
   fragments). The table already confirms in the live region above. */
.theme-order-table__cell--cart .added_to_cart,
.theme-order-table__cart .added_to_cart {
  display: none !important;
}

/* Safari :focus on ATC is 5px auto rgb(0, 103, 244). shop.scss only
   has :focus-visible; this file is what Safari actually loads. */
button.theme-order-table__cart-button:focus,
button.theme-order-table__cart-button:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
}

/* Safari :focus on shop crumbs is 5px auto rgb(0, 103, 244). Tab focus
   is :focus. Scope to the shop hero trail only — corporate crumbs stay
   on the global breadcrumb component. */
.theme-shop-hero .theme-breadcrumbs a.theme-breadcrumbs__link:focus,
.theme-shop-hero .theme-breadcrumbs a.theme-breadcrumbs__link:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
  box-shadow: none;
}

/* Safari :focus on shop search submit is 5px auto rgb(0, 103, 244).
   Tab focus is :focus. Scope to the catalogue field only —
   corporate header search (.header-search__submit) stays untouched. */
button.theme-shop-search__submit:focus,
button.theme-shop-search__submit:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
}

/* Safari :focus on the PDP group-compare link is 5px auto rgb(0, 103, 244).
   Tab focus is :focus. Scope to the order-table trail only. */
.theme-order-table__group-link a:focus,
.theme-order-table__group-link a:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
}

/* Safari :focus on the L3 sibling compare link is 5px auto rgb(0, 103, 244).
   Tab focus is :focus. Scope to the order-table trail only. */
.theme-order-table__siblings-link:focus,
.theme-order-table__siblings-link:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
}

/* Safari :focus on the L2 facet FILTER disclosure and reset is 5px auto
   rgb(0, 103, 244). Tab focus is :focus. shop.scss has no :focus on these
   bare buttons. Scope to the catalogue filter only. */
button.theme-shop-filter__toggle:focus,
button.theme-shop-filter__toggle:focus-visible,
button.theme-shop-filter__reset:focus,
button.theme-shop-filter__reset:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
}

/* Safari :focus on Hotline-Bestellung modal links is 5px auto
   rgb(0, 103, 244). Tab focus is :focus. shop.scss only has
   :focus-visible. Scope to the shop enquiry dialog only. */
.theme-shop-enquiry-modal a:focus,
.theme-shop-enquiry-modal a:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
}

/* Safari :focus on the price-enquiry Datenschutzerklärung link is
   5px auto rgb(0, 103, 244). Tab focus is :focus. Scope to the
   shop enquiry section only — corporate /datenschutz stays
   untouched. */
.theme-shop-enquiry a:focus,
.theme-shop-enquiry a:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
}

/* Fluent Forms :focus on Preisanfrage fields is leftover
   --fluentform-primary rgb(26, 126, 251). Tab focus is :focus.
   Theme _forms.scss already asks for the primary border and loses
   at (0,2,1) to .ff-default .ff-el-form-control:focus (0,3,0).
   Scope to the shop enquiry section only — corporate FF stays
   untouched. */
.theme-shop-enquiry .ff-default .ff-el-form-control:focus,
.theme-shop-enquiry .ff-default .ff-el-form-control:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
  border-color: var(--theme-secondary-color);
  box-shadow: none;
}

/* Fluent Forms :focus on Preisanfrage ANFRAGE SENDEN is
   outline: 0. Tab/JS focus is :focus, so there is no leftover-blue
   and no cyan ring. Scope to the shop enquiry submit only —
   corporate KONTAKT/Jobs/Katalog Fluent Forms stay untouched. */
.theme-shop-enquiry__form .frm-fluent-form .ff-btn-submit:focus,
.theme-shop-enquiry__form .frm-fluent-form .ff-btn-submit:focus-visible,
.theme-shop-enquiry button[type="submit"]:focus,
.theme-shop-enquiry button[type="submit"]:focus-visible {
  outline: 2px solid var(--theme-secondary-color);
  outline-offset: 2px;
}

/* Fluent invalid copy on Preisanfrage is leftover
   --fluentform-danger #f56c6c. Messages sit on the dark
   enquiry band; Figma error-on-dark is --theme-error-bright.
   Theme .text-danger loses at (0,1,0) to .fluentform .text-danger
   (0,2,0). Scope to the shop enquiry only — corporate FF stays
   untouched. */
.theme-shop-enquiry .fluentform .text-danger,
.theme-shop-enquiry .fluentform .error,
.theme-shop-enquiry .fluentform .error-message,
.theme-shop-enquiry .fluentform .ff-el-is-error .text-danger,
.theme-shop-enquiry .fluentform .ff-el-is-error .error,
.theme-shop-enquiry .fluentform .ff-el-is-error .ff-el-form-check-label,
.theme-shop-enquiry .fluentform .ff-el-is-error .ff-el-form-check-label a {
  color: var(--theme-error-bright);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Fluent required asterisks on Preisanfrage are leftover
   --fluentform-danger #f56c6c. They sit on the dark enquiry
   band; Figma error-on-dark is --theme-error-bright.
   Scope to the shop enquiry only — corporate FF stays
   untouched. */
.theme-shop-enquiry .fluentform .ff-el-input--label.ff-el-is-required.asterisk-left label:before,
.theme-shop-enquiry .fluentform .ff-el-input--label.ff-el-is-required.asterisk-right label:after {
  color: var(--theme-error-bright);
}

/* Invalid pill border: theme forms already ask for
   --theme-error-color on [aria-invalid] and lose to
   .fluentform .ff-el-is-error .ff-el-form-control
   (Fluent danger) and the 2px light-grey shorthand. */
.theme-shop-enquiry .fluentform .ff-el-is-error .ff-el-form-control,
.theme-shop-enquiry .fluentform .ff-el-form-control[aria-invalid="true"],
.theme-shop-enquiry .fluentform .ff-el-form-control:invalid {
  /* shop.css restates the 2px light-grey pill shorthand after this file. */
  border: 2px solid var(--theme-error-color) !important;
}

/* Level-2 hero already holds the title and datasheet. shop.css still adds 53px
   under the hero plus 24–50px above the search. */
.theme-shop-hero:has(+ .theme-shop-groups) {
  padding-block-end: 1.25rem;
}

.theme-shop-hero + .theme-shop-groups {
  padding-block-start: 1.25rem !important;
}

.theme-shop-hero:has(+ .theme-order-table) {
  padding-block-end: 1.25rem;
}

.theme-shop-hero + .theme-order-table {
  padding-block-start: 1.25rem !important;
}

/* Title already sits in this section; shop.css adds a second 0–47px after it
   on top of the 32–56px stack gap (measured 92px to the search). */
.theme-shop-categories__title {
  margin-bottom: 0 !important;
}

/* Article numbers in the H1 must not wrap after the first hyphen. */
.theme-shop-hero__title .theme-shop-sku {
  white-space: nowrap;
}

/* A one-state stock legend was shrink-wrapping and centering in the table band. */
.theme-order-table__legend {
  align-self: flex-start;
  width: auto;
  margin-inline: 0 !important;
}

/* Do not restack `.theme-order-table` here. shop.scss turns it into labelled cards below
   xl (1199px) and a real table from 1200. A 1199.98px display:!important overlay without
   those card labels produced a hybrid at 992–1199 (no thead, no data-label, 72×40 cart). */

@media (max-width: 781px) {
  /* PDP trail is Start › Shop › family › group › article. nowrap + 0-shrink
     ancestors overflow the 390 viewport (measured 517px). Wrap on shop only. */
  .theme-shop-hero .theme-breadcrumbs {
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
    row-gap: 0.2rem;
  }

  /* ad22701 wrapped the trail and ellipsized __current. A long parent
     __link stays flex 0 0 auto, so its intrinsic width (measured 502)
     still sets body.scrollWidth to 517 and clips mid-label at 336. */
  .theme-shop-hero .theme-breadcrumbs__link {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  /* 1 1 8rem kept __current on the first line whenever ≥8rem remained,
     so at 768 the article crumb ellipsized mid-label (cw 155 / sw 335)
     instead of wrapping. Do not shrink: wrap the flex item.
     Global .theme-breadcrumbs__current is nowrap+ellipsis; flex wrap
     alone still mid-clips a long L3 title (measured cw 306 / sw 824).
     Same wrap as PDP .theme-single-product__breadcrumbs. */
  .theme-shop-hero .theme-breadcrumbs__current {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  .theme-shop-hero.theme-section {
    padding-block: 1.25rem 1.5rem !important;
  }

  .theme-shop-hero__inner {
    gap: 1rem !important;
    min-width: 0;
    max-width: 100%;
  }

  .theme-order-table.theme-section {
    padding-block: 1.5rem !important;
  }

  .theme-order-table__inner {
    gap: 1.25rem !important;
  }
}
