/* Shared panels below catalogue listings and article recommendations. */
main > .mc-content-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 18px auto;
  padding: clamp(16px, 2.1vw, 30px);
  color: #1d433a;
  background: #fff;
  border: 1px solid #c7d5cd;
  border-radius: 14px;
}

main > .mc-content-panel > :first-child {
  margin-top: 0;
}

main > .mc-content-panel > :last-child {
  margin-bottom: 0;
}

.mc-content-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(1.18rem, 1rem + .55vw, 1.45rem);
  line-height: 1.28;
}

.mc-content-panel h3 {
  margin: 16px 0 6px;
  line-height: 1.35;
}

.mc-content-panel p {
  max-width: 85ch;
  overflow-wrap: break-word;
}

.mc-content-panel .mc-panel-links,
.mc-content-panel .category-links {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.mc-panel-links > li {
  display: flex;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mc-content-panel .mc-panel-links a,
.mc-content-panel .category-links > a,
.mc-content-panel summary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 13px;
  gap: 8px;
  border: 1px solid #c9d5ca;
  border-radius: 8px;
  color: #21483d;
  background: #fafbf8;
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mc-content-panel .mc-panel-links a:hover,
.mc-content-panel .category-links > a:hover,
.mc-content-panel summary:hover,
.mc-content-panel details[open] > summary {
  background: #eaf1e9;
  border-color: #93ac9e;
}

.mc-content-panel :is(a, summary):focus-visible {
  outline: 2px solid #326853;
  outline-offset: 2px;
}

.mc-content-panel summary {
  cursor: pointer;
  list-style: none;
}

.mc-content-panel summary::-webkit-details-marker {
  display: none;
}

.mc-content-panel summary::after {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin-inline: 3px 2px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px);
}

.mc-content-panel details[open] > summary::after,
details.mc-content-panel[open] > summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.mc-content-panel details > :not(summary),
details.mc-content-panel > :not(summary) {
  margin-top: 10px;
}

main > .mc-panel-collections {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 9px;
}

.mc-panel-collections > :is(h2, .mc-panel-links, .category-links) {
  flex: 0 0 100%;
  margin: 0;
}

.mc-panel-collections > details {
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.mc-panel-collections > details[open] {
  flex-basis: 100%;
}

.mc-panel-collections > h2 {
  margin-bottom: 3px;
}

.mc-panel-collections .mc-panel-links:has(> :nth-child(3)) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mc-panel-collections .mc-panel-links > li > a {
  width: 100%;
}

.mc-panel-articles .mc-panel-tools {
  margin: 0 0 14px;
}

.mc-panel-tools a {
  background: #e6eee7;
}

.mc-content-panel .mc-panel-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.8vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mc-content-panel .mc-panel-tiles > li {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.mc-panel-tiles a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #d7dfd5;
  border-radius: 10px;
  overflow: hidden;
  color: inherit;
  background: #fff;
  text-decoration: none;
}

.mc-panel-tiles a:hover {
  border-color: #89a498;
}

.mc-panel-tiles img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: 0;
  background: #f3f3ef;
}

.mc-panel-tiles .mc-panel-tile-product {
  object-fit: contain;
}

.mc-panel-tiles span {
  padding: 11px 12px 13px;
  font-size: .97rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  main > .mc-content-panel {
    margin-block: 14px;
    border-radius: 12px;
  }

  .mc-content-panel .mc-panel-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mc-panel-collections .mc-panel-links:has(> :nth-child(2)) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Keep legacy catalogue utility classes from narrowing or indenting these panels. */
body main > .mc-content-panel:not(.mc-panel-articles) {
  --mc-panel-title-size: clamp(1.18rem, 1rem + .55vw, 1.45rem);
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  margin: 16px 0 0 !important;
  padding: clamp(16px, 2.1vw, 30px) !important;
  border: 1px solid #c7d5cd;
  border-color: #c7d5cd !important;
  border-radius: 14px !important;
  background: #fff;
  color: #1d433a;
}

body main > .mc-content-panel:not(.mc-panel-articles) > h2,
body main > details.mc-content-panel > summary {
  color: inherit;
  font-size: var(--mc-panel-title-size);
  font-weight: 700;
  line-height: 1.28;
}

/* A standalone accordion uses its full shared panel as the header. */
body main > details.mc-content-panel > summary {
  display: flex;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0;
  justify-content: space-between;
  column-gap: 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

body main > details.mc-content-panel > summary:hover {
  color: #326853;
}

body main > details.mc-content-panel > summary::after {
  margin-inline: 4px;
}

.mc-content-panel:not(.mc-panel-collections) > :is(.mc-panel-links, details) + details {
  margin-top: 8px;
}

@media (max-width: 760px) {
  body main > .mc-content-panel:not(.mc-panel-articles) {
    margin-top: 14px !important;
    border-radius: 12px !important;
  }
}
