/*
 * Catalog pages: product sections and the ribbon catalog.
 * Kept in public/ so the page works without re-running assets:precompile.
 */

/* Catalog page blocks: keep cards white but give them a slightly darker
 * border and a soft shadow so they read as distinct blocks on the white page. */
.consumables-search-card,
.ribbon-filter-card,
.catalog-filter-card,
.catalog-results,
.ribbon-results {
  background: #fff;
  border: 1px solid #d5ddeb;
  box-shadow: 0 1px 2px rgba(14, 33, 68, .06), 0 8px 24px rgba(14, 33, 68, .09);
}

.section-card {
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.section-card .card-body {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.section-card h3 {
  font-size: 1.12rem;
  margin: 0;
}

.section-card p {
  color: var(--muted);
  font-size: .93rem;
  margin: 0;
}

.ribbon-showcase-simple {
  position: relative;
  /* Matches the photos (1491 × 1222) so they fill the frame exactly. */
  aspect-ratio: 1491 / 1222;
  overflow: hidden;
}

.ribbon-showcase {
  position: relative;
  /* Matches the photos (1491 × 1222) so they fill the frame exactly. */
  aspect-ratio: 1491 / 1222;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--brand-050);
  box-shadow: var(--shadow-card);
}

.ribbon-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* The whole photo stays visible and touches the frame; nothing is cropped. */
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.ribbon-slide.is-active {
  opacity: 1;
}

.ribbon-facts {
  display: grid;
  gap: .5rem;
  padding: 0;
  list-style: none;
}

.ribbon-facts li {
  position: relative;
  padding-left: 1.6rem;
  color: #33415c;
  font-size: .95rem;
}

.ribbon-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45rem;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-100);
}

.ribbon-filter-card .filter-group + .filter-group,
.catalog-filter-card .filter-group + .filter-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.filter-group-title {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 .55rem;
  text-transform: uppercase;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.filter-chips-scroll {
  max-height: 11rem;
  overflow-y: auto;
  padding-right: .35rem;
}

.filter-chip {
  display: inline-flex;
  margin: 0;
  cursor: pointer;
}

.filter-chip-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.filter-chip span {
  display: inline-flex;
  align-items: center;
  padding: .28rem .68rem;
  border: 1px solid var(--line);
  border-radius: 100rem;
  background: #fff;
  color: #33415c;
  font-size: .82rem;
  line-height: 1.4;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.filter-chip:hover span {
  border-color: rgba(53, 99, 171, .55);
  color: var(--brand-700);
}

.filter-chip-input:checked + span {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: #fff;
  box-shadow: 0 2px 8px rgba(29, 58, 107, .25);
}

.filter-chip-input:focus-visible + span {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
}

.ribbon-count,
.catalog-count {
  color: var(--muted);
  font-size: .92rem;
}

.ribbon-count b,
.catalog-count b {
  color: var(--brand-800);
}

/* Keep the catalog table in a viewport-sized scroll box so the horizontal
 * scrollbar stays next to the visible rows instead of sitting at the very
 * bottom of a long table. */
 .ribbon-results .table-responsive,
.catalog-results .table-responsive {
  max-height: 70vh;
  overflow: auto;
}

.ribbon-table,
.catalog-table {
  font-size: .92rem;
}

.ribbon-table thead th,
.catalog-table thead th {
  white-space: nowrap;
}

/* Sortable headers */
.ribbon-table thead th.sortable,
.catalog-table thead th.sortable {
  padding: 0;
}

.ribbon-table .sort-btn,
.catalog-table .sort-btn {
  align-items: center;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-weight: inherit;
  gap: .3rem;
  padding: .5rem;
  text-align: left;
  width: 100%;
}

.ribbon-table thead th.text-end .sort-btn,
.catalog-table thead th.text-end .sort-btn {
  justify-content: flex-end;
  text-align: right;
}

.ribbon-table .sort-btn:hover,
.catalog-table .sort-btn:hover {
  color: #cfdcf5;
}

.ribbon-table .sort-btn:focus-visible,
.catalog-table .sort-btn:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: -2px;
}

.ribbon-table .sort-btn::after,
.catalog-table .sort-btn::after {
  content: "\2195";
  font-size: .85em;
  opacity: .45;
}

.ribbon-table thead th[aria-sort="ascending"] .sort-btn::after,
.catalog-table thead th[aria-sort="ascending"] .sort-btn::after {
  content: "\2191";
  opacity: 1;
}

.ribbon-table thead th[aria-sort="descending"] .sort-btn::after,
.catalog-table thead th[aria-sort="descending"] .sort-btn::after {
  content: "\2193";
  opacity: 1;
}

.ribbon-name,
.catalog-name {
  min-width: 17rem;
}

.ribbon-articul,
.catalog-articul {
  color: var(--brand-800);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
}

.copy-btn {
  align-items: center;
  display: inline-flex;
  gap: .35rem;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .copy-btn .copy-label {
    display: none;
  }
}

/* --------------------------------------------------------------------------
 * Consumables catalog: search, cascading categories and the results table
 * -------------------------------------------------------------------------- */

.consumables-search-card .form-label {
  font-size: .9rem;
  margin-bottom: .45rem;
}

.consumables-search-note {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.consumables-search {
  position: relative;
}

.consumables-search .form-control {
  min-height: 46px;
}

.consumables-suggestions {
  position: absolute;
  z-index: 1050;
  top: calc(100% + .35rem);
  left: 0;
  right: 0;
  max-height: 24rem;
  overflow-y: auto;
  margin: 0;
  padding: .3rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(14, 33, 68, .16);
}

.consumables-suggestion {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  padding: .55rem .7rem;
  border-radius: .55rem;
  cursor: pointer;
}

.consumables-suggestion + .consumables-suggestion {
  border-top: 1px solid var(--line);
}

.consumables-suggestion:hover,
.consumables-suggestion.is-active {
  background: var(--brand-050);
}

.consumables-suggestion-name {
  color: var(--brand-800);
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.35;
}

.consumables-suggestion-meta {
  color: var(--brand-700);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .78rem;
}

.consumables-suggestion-category {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.consumables-suggestion-empty {
  color: var(--muted);
  cursor: default;
  font-size: .9rem;
}

.consumables-suggestion-empty:hover {
  background: none;
}

.consumables-category-field + .consumables-category-field {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}

.consumables-category-label {
  color: var(--muted);
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 .45rem;
  text-transform: uppercase;
}

.consumables-category-select {
  border-color: var(--line);
  font-size: .88rem;
}

.consumables-category-path {
  background: var(--brand-050);
  border-radius: .55rem;
  color: var(--brand-700);
  font-size: .82rem;
  line-height: 1.45;
  padding: .55rem .7rem;
  overflow-wrap: anywhere;
}

.consumables-number {
  color: #33415c;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .85rem;
  white-space: nowrap;
}

/* Long model lists such as "1010/1160/1320/P2015/P2035" rarely wrap on their
 * own, which would push the price column out of the scroll box. */
.consumables-table .catalog-name {
  overflow-wrap: anywhere;
}

.consumables-table tbody tr.is-highlighted td {
  background: var(--accent-100);
  transition: background-color .3s ease;
}

/* Category index on the base page and "see also" links on category pages. */
.consumables-categories,
.consumables-related {
  scroll-margin-top: 5rem;
}

.consumables-category-group {
  color: var(--brand-800);
  font-size: .92rem;
  margin: 1rem 0 .5rem;
}

.consumables-category-links,
.consumables-related-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.consumables-category-links {
  border-top: 1px solid var(--line);
}

.consumables-category-links li {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: .6rem;
  justify-content: space-between;
  line-height: 1.4;
  padding: .35rem 0;
}

.consumables-category-links a {
  color: var(--brand-700);
  font-size: .87rem;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.consumables-category-links a:hover {
  text-decoration: underline;
}

.consumables-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
}

.consumables-related-links li {
  align-items: baseline;
  display: flex;
  gap: .35rem;
}

.consumables-related-links a {
  font-size: .87rem;
}

.consumables-category-count {
  color: var(--muted);
  font-size: .75rem;
  margin-left: auto;
  white-space: nowrap;
}

.breadcrumb .breadcrumb-item {
  overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
  .consumables-search-note {
    display: none;
  }
}

