/* mod_lmdb_marketplace Layout „cards“ – Produkte als Karten im Stil der Startseite
   Unterregeln hängen an .hwx-product-cards, damit sie die globale Regel „main :is(p,span)“ aus app.css schlagen. */

.hwx-product-cards {
  --product-ink: #0C3247;
  --product-text: #303030;
  --product-muted: #6C757D;
  --product-line: #DBE3E8;
  --product-surface: #F5F8FA;
  --product-accent: #164F9E;
  --product-red: #D11F34;
  --product-button: #013F58;

  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.hwx-product-cards .hwx-product-cards__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hwx-product-cards .hwx-product-cards__title {
  display: inline-block;
  max-width: calc(100% - 1rem);
  margin: 0 0 0 .5rem;
  padding: .6rem 1.75rem;
  transform: skew(-15deg);
  background: var(--product-accent);
  color: #fff;
  font-family: var(--hwx-text_font-family, WorkSans-Regular), system-ui, sans-serif;
  font-size: clamp(1.25rem, 2.35vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.hwx-product-cards .hwx-product-cards__empty {
  margin: 0;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--product-line);
  border-radius: .875rem;
  color: var(--product-text);
}

.hwx-product-cards .hwx-product-cards__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
}

.hwx-product-cards .hwx-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: .875rem;
  box-shadow: 0 .45rem 1.2rem rgba(12, 50, 71, .08);
  transition: box-shadow .2s ease, transform .2s ease;
}

.hwx-product-cards .hwx-product-card:hover {
  box-shadow: 0 1rem 2.75rem rgba(12, 50, 71, .15);
  transform: translateY(-2px);
}

/* Produktbilder vollständig zeigen (oft freigestellt auf Weiß), nicht beschneiden */
.hwx-product-cards .hwx-product-card__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--product-line);
}

.hwx-product-cards .hwx-product-card__media img {
  position: absolute;
  inset: .75rem;
  width: calc(100% - 1.5rem);
  height: calc(100% - 1.5rem);
  max-width: none;
  object-fit: contain;
  transition: transform .3s ease;
}

.hwx-product-cards .hwx-product-card:hover .hwx-product-card__media img {
  transform: scale(1.03);
}

.hwx-product-cards .hwx-product-card__media.is-empty {
  background: var(--product-surface);
  color: var(--product-muted);
  font-size: 2rem;
}

.hwx-product-cards .hwx-product-card__price {
  position: absolute;
  left: .75rem;
  bottom: .75rem;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: .375rem;
  margin: 0;
  padding: .3rem .75rem;
  border-radius: 9999px;
  background: var(--product-ink);
  color: #fff;
  font-size: .9375rem;
  line-height: 1.3;
  box-shadow: 0 .25rem .75rem rgba(12, 50, 71, .2);
}

.hwx-product-cards .hwx-product-card__price strong {
  color: #fff;
  font-weight: 700;
}

.hwx-product-cards .hwx-product-card__price.is-reduced {
  background: var(--product-red);
}

.hwx-product-cards .hwx-product-card__price del {
  color: rgba(255, 255, 255, .8);
  font-size: .8125rem;
}

.hwx-product-cards .hwx-product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .5rem;
  padding: 1.125rem 1.25rem 1.25rem;
}

.hwx-product-cards .hwx-product-card__category {
  color: var(--product-accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hwx-product-cards .hwx-product-card__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #000;
  font-family: var(--hwx-text_font-family, WorkSans-Regular), system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hwx-product-cards .hwx-product-card__teaser {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--product-text);
  font-size: .875rem;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hwx-product-cards .hwx-product-card__provider {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--product-line);
  color: var(--product-muted);
  font-size: .8125rem;
}

.hwx-product-cards .hwx-product-card__provider img {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: .125rem;
  border: 1px solid var(--product-line);
  border-radius: .375rem;
  background: #fff;
  object-fit: contain;
}

.hwx-product-cards .hwx-product-card__provider span {
  overflow: hidden;
  color: var(--product-muted);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hwx-product-cards .hwx-product-card__link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.hwx-product-cards .hwx-product-card__link:focus-visible {
  outline: 3px solid var(--product-accent);
  outline-offset: 2px;
}

.hwx-product-cards .hwx-product-cards__all {
  display: flex;
  justify-content: center;
  padding-top: .5rem;
}

.hwx-product-cards .hwx-product-cards__button {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  height: 58px;
  padding: 0 1.75rem;
  border: 2px solid var(--product-button);
  border-radius: 9999px;
  color: var(--product-button);
  font-size: 19px;
  font-weight: 500;
  text-decoration: none;
  transition: background .4s, color .4s;
}

.hwx-product-cards .hwx-product-cards__button span {
  color: inherit;
}

.hwx-product-cards .hwx-product-cards__button:hover,
.hwx-product-cards .hwx-product-cards__button:focus-visible {
  background: var(--product-button);
  color: #fff;
}

/* Mobil: Seitenrand (Position „bottom“ hat keinen) und Karten als wischbare Reihe statt langer Liste */
@media (max-width: 767.98px) {
  .hwx-product-cards {
    padding-inline: 1rem;
  }
}

@media (max-width: 575.98px) {
  .hwx-product-cards .hwx-product-cards__grid {
    grid-auto-columns: 80%;
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 1rem;
    margin-inline: -1rem;
    padding: .25rem 1rem 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .hwx-product-cards .hwx-product-cards__grid::-webkit-scrollbar {
    display: none;
  }

  .hwx-product-cards .hwx-product-card {
    scroll-snap-align: start;
  }

  .hwx-product-cards .hwx-product-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hwx-product-cards .hwx-product-card,
  .hwx-product-cards .hwx-product-card__media img,
  .hwx-product-cards .hwx-product-cards__button {
    transition: none;
  }

  .hwx-product-cards .hwx-product-card:hover,
  .hwx-product-cards .hwx-product-card:hover .hwx-product-card__media img {
    transform: none;
  }
}
